I'm using vincent a data visualization package. One of the inputs it takes is path to data.
(from the documentation)
`geo_data` needs to be passed as a list of dicts with the following
| format:
| {
| name: data name
| url: path_to_data,
| feature: TopoJSON object set (ex: 'countries')
| }
|
I have a topo.json file on my computer, but when I run that in, ipython says loading failed.
map=r'C:\Users\chungkim271\Desktop\DC housing\dc.json'
geo_data = [{'name': 'DC',
'url': map,
'feature': "collection"}]
vis = vincent.Map(geo_data=geo_data, scale=1000)
vis
Do you know if vincent only takes url addresses, and if so, what is the quickest way i can get an url address for this file?
Thanks in advance
It seems that you're using it in Jupyter Notebook. If no, my reply is irrelevant for your case.
AFAIK, vincent needs this topojson file to be available through web server (so javascript from your browser will be able to download it to build the map). If the topojson file is somewhere in the Jupyter root dir then it's available (and you can provide relative path to it), otherwise it's not.
To determine relative path you can use something like this: