observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.16k stars 171 forks source link

Copy initial value from svg to figure #2046

Closed Fil closed 3 months ago

Fil commented 3 months ago

closes #2045

Fil commented 3 months ago

The pointer transform initializes svg.value: https://github.com/observablehq/plot/blob/00610bbc1b32f6689fa71559f3db1f572688acfb/src/interactions/pointer.js#L182

it dispatches here before we actually have a figure: https://github.com/observablehq/plot/blob/00610bbc1b32f6689fa71559f3db1f572688acfb/src/interactions/pointer.js#L129

Once the figure has replaced the svg, the value is dispatched correctly.