Pages

Friday, December 4, 2020

Worldmap connections...

Aloha,

Everytime I'm sitting on an airplane I'm taking out the magazine where it shows the flight connections of the airline on a worldmap. Somehow I really like that kind of visualization.

For those that don't know what I'm talking about, it's something like this:


When I've created the last update of my charts library I stumbled upon my worldmap and thought by myself...why not creating such a visualization by using the worldmap I already have.

You can choose this kind of visualization for different kind of data, e.g. simple connections, weighted connections to visualize a flow, incoming/outgoing connections and more.

Long story short...I've added the ability to cover some use cases I came up with. The first one is just a visualization of simple connections without showing any direction.



This really only shows the connections between points on the map. Nice but what if we would like to use colors and also show the direction? No problem, in this case it could look as follows...

Not bad but what if we would like to indicate the points with the highest volume of outgoing connections? No problem, here you go...


Hmm...so far so good but what if we would like to visualize a data flow from one point to another? Therefor the connection itself need to have a value which defines the thickness of the connection. Well...here it is...

Ok that's nice...so what about gradients...would it not be nice to have the connections change their color on their way from their startpoint to their endpoint? Yes it would be...so...


Allright...with this I covered all things I've implemented so far and as always I have no idea if someone has a use for that because I simply created it for the fun of it.

But if you can use it and you need more features...just let me know and I will try to make it happen.

If you are interested in how the above charts have been done you can find the code for it in the WorldmapConnectionsTest.java file in the test package.

In principle you can add MapPoint objects with a name, a color and latitude/longitude coordinates to show the points. The connections are of type MapConnection which takes 2 MapPoints, a value, a color or gradient and a tooltip text.

Attention: The connections are not clickable yet...so there is no tooltip and no user interaction implemented right now but it might follow.

The code can be found over at github at: https://github.com/HanSolo/charts

You will find the changes in the dev branch.

That's it for today, so enjoy your upcoming weekend...and keep coding...


1 comment:

  1. Gerrit,
    As always, great job! I love maps because they're so spatial ;-)
    Carl

    ReplyDelete