markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Allow dataUrl to point to a javascript object containing the json #120

Closed ramnathv closed 10 years ago

ramnathv commented 10 years ago

My use case is that I sometimes want to create standalone html files with no external dependencies. This works for US and World maps, because I can embed a base64 encoded version of datamaps.all.min.js. However, for external topojson files, I cannot do that.

If dataUrl could be flexible in accepting a javascript object, then I can read the contents of the json file and assign it to a javascript variable, and inline it so that datamaps will be able to pick it up.

Let me know if this is possible. If you can give me some pointers on how to do it, I can take a crack at it myself and send a pull request.

Thanks again for an awesome mapping library!

markmarkoh commented 10 years ago

Addressed in PR #121