it:ad:d3.js:howto:transitions

IT:AD:D3.JS:HowTo:Transitions

Recap:

  • when you selectAll you are getting an Array of DOM elements (actually an array of arrays, but lets gloss over that for now)
  • when you apply data() to a selection the data is embedded in the dom element (yeah…I was a bit surprised the first time I learnt that).
    • it's the equivalent of calling d3.select('div').datum(whatever) on the dom element.

So here's an example of:

  • binding some data to some elements
  • getting a single element
  • updating its datum
  • applying another transition.

An alternative way of selecting a single element – or any subset of an element is as follows:

But in most cases I'll bet you'll be updating, or reimporting fresh data - in which case you'll want to update the whole set again:

  • /home/skysigal/public_html/data/pages/it/ad/d3.js/howto/transitions.txt
  • Last modified: 2023/11/04 03:39
  • by 127.0.0.1