Map your data on a 3D World in Lumira
This blog will introduce you a brand new extension I’ve just created for SAP Lumira.
Indeed, it does speak to everyone, even in a glance. While we were used to play with terrestrial globes when we were young (and some of us still does 😛 ), now we’re just likely daily using app like Google Maps when we need to go somewhere.
Well, I then started to think what – from my point of view – was “missing” in Lumira. From the exploration of the stories I’ve already created and the visualizations I’ve already made, something came to my mind. Indeed, I think most of the time what I produced was missing a “playful side“. Sure, you have interactive charts, filters, etc. Everything is displayed in a modern UI, this is cool I don’t deny it, but it misses some kind of “fun“, something really appealing for the end users. d3.js is the best tool to create clearly whatever visualization you want. So why not “3D“? If it’s well-executed, it can achieve high expectations 🙂 .
Thus said, I decided to create a 3D world, where you could map your geodata and displays measures on them. There, the idea was on the way to become reality. I’ve to admit it was pretty exciting even before I’ve started, and I hope you feel the same while reading this words. After searching for good examples on how to achieve what I had in mind, I started coding all night long 😎 .
Let’s take a quick tour
When switching to the extension, what you see first is a 3D World. No data on it, just all the countries like if you were watching a real terrestrial globe. If you click on it and then drag your mouse on left or on the right, you’ll see it rotating.
Well, this is nice, but the point of Lumira is to create visualizations from your data, to get insights on it.
Let’s add some points on the 3D World.
In order to do so, you have to have two dimensions in your dataset, one containing Longitude values and the other one containing Latitude values.
You just place them in the dimension input and you see points displaying over the globe.
Right now, you already have a useful insight in front of your eyes. For example, this could be use in a story with a title like “Our customers all over the world”. That would bring “ludic” to the story, and this was exactly my point while creating this extension : make something useful and ludic at the same time.
You can also add measures to the points you just set. The first indicator – placed in the Measures/Size input – will impact the size of the points on the map according to their respective measure value.
The second indicator – placed in the Measures/Color input – will impact point colors on the map according to each point respective measure value. By default, the colors will go to yellow to red the higher the values are.
And of course, you can fill both measures inputs at the same time with two different measures, one for the size and another one for the color.
That’s pretty much it. I wanted the extension to be really simple to use. No curlicue.
And to finish, this is what you can get when you use the visualization you’ve just created in Lumira stories.
And there is a good news! This extension is open-sourced 🙂 .
Meaning that if you want to change the ocean color, or the defaut ramp colors, go ahead and fork the repository from GitHub.
I also plan to support it for quite a while, and maybe improve it a bit when I’ve some more free time.
As an appendix to this blog, if you are interested in further geomapping solutions for Lumira in order to visualize more complex data or use cases, check out the extension we’ve developped where I work : Galigeo for Lumira.
I also want to thank my current company Galigeo where I learnt (and keep learning!) a lot about geomapping, as well as Ganaël Jatteau who made some of the functions I use in the extension (to calculate points size according to a measure for example).
That’s it guys, I hope you’ll enjoy it.
As usually, if you have any feedback or idea for this custom extension, leave a comment there or open a ticket on the GitHub page of the project.
Terrific work and thank you for open sourcing!
Thank you for a great extension and sharing with us.
Awesome extension, Vincent!
I get an error opening the LUMS or trying to pick up the zip extension. I says I use the wrong version of Lumira. I use 1.28.5. Is this one written already in a 1.29 pre-release ?
Looks very nice on the pics by the way ... impressive !
Indeed I did not pay attention as where I work we already own a Lumira 1.29 beta, and I've created the demo on it.
Same for the extension archive, it was referencing a common.core version too high to be read by 1.28.
Let me know if you find further issues.
Great extension! Would it be possible to also display shape files onto this 3D World?
With kind regards,
Martijn van Foeken | Just-BI
Yes this is something that could be possible.
One thing that could be achieved quickly in my opinion would be to - instead of mapping points - map directly the indicator on the countries, as they already exist.
However, it's not planned on my side to do this, but the extension is open-sourced, so if you (or someone you know) feels like doing it you can just fork the GitHub repository.
Really enjoying this extension - I am experiencing one issue however. Each time I refresh my document or switch between tabs in Lumira, the globe is reset to its default view with Africa at the center. This is making it impossible for me to use to represent data in the Americas or APJ and severely limiting the use cases for this extension.
What can be done to get this fixed?
Indeed the rotation is resetted to default at each refresh. That's a limitation for the moment. One could easily go around this by storing the rotation value on the client side and retrieves it through closure, however it has several drawbacks, the major being that this would also be resetted each time you would close and reopen Lumira.
Storing it on Chromium local storage could work a bit better but you would have the same issue when sending your .lums to a colleague.
The best would be to store it in a custom Lumira property. Unfortunately this is only (officially) available on the Compose room, not the Visualize one. Still, I've found a way to "hack" it but it's unofficial and relies on unexposed SAP properties which might change in the future. It's still worth a try tho.
I might do some "fixes" like this in the next days. Or if you want you can fork the repository on GitHub and tries some improvements by yourself. The code is not really hard to understand 🙂 .
Hey by the way, I had few time to make a quick win that could help you a lot.
The globe is now centered above USA/Canada by default.
Go there, and download the 3DWorld-master-CenteredAboveUSA.zip. I made this "blindly", but this should work. Let me know.
The recentered extension works great for my particular use case - thanks 😆 I will take a look at the workarounds you mentioned and be in touch if we make any progress.
Thanks for your quick response,
Wow, impressive Vincent Dechandon!