Closed chrisconlan closed 3 years ago
The default example works (see https://observablehq.com/@d3/zoom@38) , so the question is what is different in the two codes. Unfortunately it's difficult to guess from snippets.
Agreed. I was hoping someone that is familiar with the code might understand the circumstances under which x
and y
could be NaN
for d3.event.transform
. Is it fair to say that this state shouldn't be possible?
Try maybe
- .translateExtent([0, 0], [width, height])
+ .translateExtent([[0, 0], [width, height]])
That worked! Thank you.
Hopefully this explanation is sufficient ...
When the
x
andy
areNaN
basically none of the other zooming functionality works. I don't know how or why thex
andy
could beNaN
. The chart is a time series that usesscaleTime
andscaleLinear
.If I monkey-patch the
x
andy
to both be1
, thek
-scaling works as expected.