Closed dnwick closed 8 years ago
It seems I cannot give topojson as a inline source other than url. On my app I have given not the url but as values. To test it I have given the same on Vega editor and it did not draw the map. As you can see I mistakenly given it as data above but it did not threw any error.
{
"name": "countries",
"values": [{jsonValues}],//not specified since its large data set
"format": {"type": "topojson","feature": "countries"},
"transform": [
{
"type": "geopath",
"value": "data",
"scale": 80,
"center": [-180,125],
"translate": [0,0],
"projection": "equirectangular"
},
{
"type": "lookup",
"keys": ["id"],
"on": "highlights",
"onKey": "id",
"as": ["zipped"],
"default": {"v": null, "country":"No data"}
}
]
}
I found the issue of not showing the colors in vega editor. It seems the csv data is not loaded properly. But the url is working fine. I'm not sure why it is not picking it up. I have given one data set inline and it worked. But I still having issues of getting this work on my app. And even though I give the topojson inline or using an URL it always says TopoJSON library not loaded
. I think the issue here is the data set and topojson is not picking up properly. Also I would like to know how should I create different topojson to draw different areas as mentioned above.
Hi,
My requirement is to show a world map with a color scale so that each country will be shown with different colors according to attribute value. I found this tutorial [1] which is some what I need and trying to understand how it was done. [1] https://www.mediawiki.org/wiki/Extension:Graph/Interactive_Graph_Tutorial_2 First I tried it to replicate it in Vega live editor and I was able to get the map showing but even though I added all the code correctly It does not show color scales as shown in the sample and throws
Please find below the vega specification I tried. To make this work it need two data sources which are the data set and the topojson data which were correctly uploaded.
Also I like to clarify some points regarding the topojson. I have read the documentation but as it contains data with counties ISO codes , how can I map the real country name to that? Do I have to keep a separate json for that ? Also If I want to draw only the countries in Europe or states in USA how can obtain the corresponding topojson file ?
Regarding the Issue I mentioned as the subject of this issue, Since above specification gives said error I have removed some of the configuration and got the map which now highlights when hovers (But colors not showing). I have add the same configuration to the app I'm building but it does not show the map.
Please let me know if I missing any configuration. Below is my map initializing and draw functions.
For above specification I only call draw method which passes the div which the map need to be plotted. But it only shows following with no errors on the console.
Also I have tried the map example in vega editor but when I add the specification to above function it says Uncaught TypeError: d3.geo[p] is not a function. I really appreciate if you could provide any help on above.