hey guys having trouble with vincent, im not sure exactly how to use it
So ive parsed some data from the UK house of commons petition site, and now have a list of countries and their corresponding number of votes into a certain petition and ive got the data from JSON to ('Austria', 40)
format
Im using vincent to plot them onto a map with colour scaled to represent number of votes but dont really know how to use vincent
for example to render a basic map of the world the code is
world_topo = r'world-countries.topo.json'
geo_data = [{'name': 'countries',
'url': world_topo,
'feature': 'world-countries'}]
vis = Map(geo_data=geo_data, scale=200)
vis.to_json('vega.json')
but that just outputs a JSON, not a picture of a map, even though that is what two tutorial examples are saying should happen (for example here: http://wrobstory.github.io/2013/10/mapping-data-python.html and another place I forgot to save the link)
could someone help me out? thanks in advance guys
If you want to see a picture of a map you will have to create a html file that will read the json file and map it.
Then open your command line and type in:
Python -m SimpleHTTPServer 8000 # Python 2
Next open your browser athttp://localhost:8000/path/to/json/file
.You should now see a map on the page. Note this will be a basic map depending on what data you passed from the json file.
I hope this helps and good luck!