🏠 back to Observable

Help with update function (mutable var)

Hello, newbie here.

I was visiting the d3.bisect function and I am a hard time trying to replicate the line chart here: https://observablehq.com/@ricardopss/d3-bisect.

I don’t know why but the chart’s legend and markers are not updating, though the bars and the mutable lookup cell value are updating with mouse move.

At first, I thought it was due to different data formats, but apparently no. I am almost certain that the problem is somewhere inside the update function, but again, I couldn’t figure it out.

Anyone could give me a hint?

I have just figured it out: d3.bisect works only with sorted data!

:sunglasses:

1 Like