Suppose I import an interesting visualization:
import {chart} from "@d3/histogram"
Now I want to add additional stuff to the chart. Like, for example, I want
to mess up the beautiful histogram with a big circle. I can do the following:
d3.select(chart).selectAll('circle').data([({x:100,y:100,r:100})]).enter().append('circle').attr('cx',d=>d.x).attr('cy',d=>d.y).attr('r',d=>d.r).attr('fill','blue')
and this will stick a big blue circle on the histogram. However, if I edit the cell and change the color âblueâ to âgreenâ, the circle on the histogram doesnât change color.
I understand that this has to do with the computational flow â the displayed graph doesnât know that it depends on the cell that sets the circleâs color â but I canât figure out what the right way to do this is!
Thanks for any tips.