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

Live update of arcs (and bubbles) #26

Closed jaegr closed 8 years ago

jaegr commented 11 years ago

Hi,

I can't get the live update of arcs to work. I want to change the color of the arcs based on some external data, but the arcs don't update when a call .arc (same with bubbles). I got it to work if I first call .arc with the new options, and then call map.arc([]) to clear all arcs, then the arcs show up with the new colors. Am I missing something?

chewxy commented 10 years ago

To clear it, you need to do this:map.svg.selectAll('path.datamaps-arc').remove() if you are using the arc plugin that comes bundled with datamaps. Then call map.arc( data, optionsWithNewColours).