it:ad:d3.js:howto:operators

IT:AD:DS.JS:HowTo:Operators

After you have a Selection), you apply one of (basically) two types of Operators.

Much like IT:AD:JQuery, once you have a Selection, you can modify the properties of the elements in the Selection:

  • classed is a bit of a surprise in that it's second arg (value) is boolean function/arg indicating whether to add/remove the class.
  • For all of them, a null value will remove anything there.

Alternatively, you can operate on the set itself – mutating it.

The following is a naive attempt to find the 3 p's, and add a new one, with some text in the new one…

It did exactly what you requested (it Selected All, then Added a P to each one, then changed the html of each element), but is probably not what was expected:

<callout icon="true" type="id="ex01">
  <p>Uno<p>woohoo<p></p>
  <p>Dos<p>woohoo<p></p>
  <p>Tres<p>woohoo<p></p">
</callout>

Instead, you probably wanted something more like:

  • /home/skysigal/public_html/data/pages/it/ad/d3.js/howto/operators.txt
  • Last modified: 2023/11/04 22:55
  • by 127.0.0.1