You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we index only the x/y point of the label/text mark. However, it would be much better to index the bounding box instead. Since we are not relying on native event listener on each element but rather a spatial index, this is the only way to set event listeners on labels.
Currently, we index only the x/y point of the label/text mark. However, it would be much better to index the bounding box instead. Since we are not relying on native event listener on each element but rather a spatial index, this is the only way to set event listeners on labels.
This isn't trivial since we don't know the height/width of the text until we actually draw it with the correct font/size etc. I did some quick sleuthing and it turns out that there is a performant way using
canvas.measureText()
(https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/measureText). A reference implementation can be found at: https://github.com/FormidableLabs/measure-text.The text was updated successfully, but these errors were encountered: