Select to view content in your preferred language

Anybody use D3 with their map?

1978
1
12-23-2013 05:39 AM
TyroneLigon
Deactivated User
Apologizing up front for the lack of code snippets; our app is on an intranet. We have a page with 3 tabs: chart, table, and map. The chart is a parallel coordinate chart and we use D3's rectangle drag to allow the user to select data points. Those points are used to populate the chart and put graphics in a graphics layer on the map. The problem is that the graphics don't draw on the graphics layer; in fact, the zoom rectangle on the map doesn't draw either. No Firebug errors, and the graphics are being added to the graphics layer. Has anybody used D3 successfully with a map?
0 Kudos
1 Reply
TyroneLigon
Deactivated User
Solved our problem; the chart code was written a couple of months before the map tab was added. We had a statement to remove all svg elements from the page in order to refresh the chart:

d3.selectAll("svg").remove();


That statement was affecting all the map's graphics layers. When we made the selection tag more specific, we were able to refresh the chart without trashing the graphics layers:

d3.selectAll("#chart-area svg").remove();


Just documenting the resolution so that someone else doesn't waste an entire day figuring out what's wrong with their code.
0 Kudos