big data and Inkscape. Automation?

Post questions on how to use or achieve an effect in Inkscape.
Amadeus12
Posts: 66
Joined: Sat Sep 11, 2010 4:20 pm

big data and Inkscape. Automation?

Postby Amadeus12 » Fri May 01, 2015 5:45 pm

I have an Excel spreadsheet with the amount of ppl. living in each state of the USA, and I want to graph that in a SVG-map with colors.

Something like this: https://commons.wikimedia.org/wiki/File:USA_states_population_density_map.PNG

It is of course possible to manually assign colors to the states according to population size, but is it possible to automate this process in some way?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: big data and Inkscape. Automation?

Postby brynn » Sat May 02, 2015 6:44 am

I would guess that probably a script could be written to do that. But I don't know how to write scripts. I don't know of any automatic way to do it with inkscape. But it seems there are extensions around, which aren't widely known. People make for themselves and don't bother to let the wider community know about it. So maybe there might be an extension somewhere that could do it. You could only search, I guess.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: big data and Inkscape. Automation?

Postby tylerdurden » Sat May 02, 2015 10:33 am

For fifty states, it is probably not worth the effort to automate, unless the image needs to be frequently updated.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Uktrunie
Posts: 154
Joined: Sun Jul 18, 2010 4:48 am

Re: big data and Inkscape. Automation?

Postby Uktrunie » Sat May 02, 2015 3:25 pm

Well, in this particular case you could do it with a VBA script in Excel I guess... You would set the name of the state as the ID for each object in your SVG and then the VBA script would read the file, parse the XML, and modify the color attribute for the object whose ID you get from each of the cells you want...

But like tylerdurden said, for just a small amount of data it's just not worth it, unless you have to do a lot more maps with the same map but with different values for each state.

Amadeus12
Posts: 66
Joined: Sat Sep 11, 2010 4:20 pm

Re: big data and Inkscape. Automation?

Postby Amadeus12 » Sat May 02, 2015 5:29 pm

It is not just this problem of course. It is worthwhile for the future to find out more about this. In more complex drawings this could really helpful.

Thank you for your anwers.

Uktrunie
Posts: 154
Joined: Sun Jul 18, 2010 4:48 am

Re: big data and Inkscape. Automation?

Postby Uktrunie » Sat May 02, 2015 5:35 pm

Yes, some sort of generation by code would be lovely. But the truth is that such I thing should be done by 3rd party libraries in programing languages. Many of them would probably have an SVG library, it will not generate Inkscape SVGs but plain ones.


Return to “Help with using Inkscape”