-
Notifications
You must be signed in to change notification settings - Fork 681
d3.js
agershun edited this page Jan 11, 2015
·
7 revisions
#d3.js with Alasql
This is an example, how d3.js can read data from XLSX file and put it on the map:
alasql('SELECT * FROM xlsx("https://cdn.rawgit.com/agershun/alasql-org/gh-pages/demo/014map/cities.xlsx",\
{headers:true})',[], function(data) {
g.selectAll("text")
.data(data)
.enter()
.append('text')
.text(function(d){return d.city})
.attr("x", function(d) {
return projection([d.lon, d.lat])[0];
})
.attr("y", function(d) {
return projection([d.lon, d.lat])[1];
})
});
See the full code of this example in jsFiddle.
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo