Skip to content

Instantly share code, notes, and snippets.

@dogrunjp
Created March 25, 2014 21:01
Show Gist options
  • Save dogrunjp/9771228 to your computer and use it in GitHub Desktop.
Save dogrunjp/9771228 to your computer and use it in GitHub Desktop.
D3.jsのアップデート時に、data().enter().append()したSVGのg要素を削除するとき。
#下記要素にSVGの要素を描画する
<div><svg class="chart1"></svg></div>
#D3.jsでSVG要素を描画後、要素をアップデートする前に下記のようにg要素を削除する
d3.selectAll("chart1 > g").remove()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment