Plotting with GD

Here it is.

I have been thinking about this for a long time, and havent really been able to establish the right way to do it yet. I haven't implemented anything yet, as I'm still designing a thing.

The idea is that I crawl the site for internal links, I got it, it’s easy, but after crawling I get an array with a lot of links and how many times this particular link appears on the site that I crawled (and how they are connected).

With this huge array, I want to somehow draw a graph. Assuming I can process the data correctly, the real question is how can I do this in the image using the GD library.

I realized that if there are less than 12 elements, I can align them in a unit circle, dividing them in a circle, and then connect them accordingly, so nothing, up to 12 elements, should be a problem, but if theres more than 12, it could would be amazing if they were lined up like that http://nayena.com/stackoverflow/graph.png Or, well, it's just a rough drawing, but I think its just to prove the point.

So, here I am looking for guidance or tips to get the math, to get the material built in a good way.

I used to make diagrams, so I have little experience in math with GD. If possible, id prefers not to use some plotter library - after all, it gives me a better understanding of how things should be.

+3

Source: https://habr.com/ru/post/1791834/


All Articles