Question: I have been looking for some javascript code that I can use to create something similar to [this](http://politilines.periscopic.com/).

I need something that can show the links between boxes when clicked on/hovered over. As of this point I have not yet been able to determine what the name of this particular type visualisation is.

I have already looked at: 

* Google Charts
* d3.js
* graphdracula
* processing.js
* Raphael
* Protovis
* MooWheel
* PlotKit

Answer: 
Using the C++11 `<random>` solution could look something like this:

```
#include <random>
#include <iostream>

int main()
{
    const int length = 60;
    std::random_device rd;
    std::mt19937_64 mt(rd());
    std::uniform_real_distribution<double> distribution(0, M_PI/12);
    for(int i = 0; i < length; i++)
    {
        double d = distribution(mt);
    std::cout << "d = " << d << std::endl;
    }
}

```
What you want to do is something like this:

```
double RealRand (double up_to)
{
    return double(rand()) / RAND_MAX * up_to;
}

```

Effectively, what this does is first generate a random number between 0 and 1 (left-inclusive,) and then scale the number to [0..`up_to`]. (Note: just in case you didn't know, `rand()` function generates random integers between 0 and `RAND_MAX`.)

However, there are (at least) two reasons you don't want to do this. First, `rand()` is usually a bad random number generator. And second, on some platforms (e.g. Visual C++) `RAND_MAX` is a very small number (32767 or something,) which leads to very poor resolution for the generated real values.

Using the facilities in `<random>` header (newer C++) is highly recommended.