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
i'm currently reading back bounding box coords to render a hover rect over the matched index, it looks something like below bound to mousemove. this works well enough for my-sized datasets. i assume there isn't anything more efficient than let offs = index._indices.indexOf(idx) * 4; besides wasting mem/cpu to store some kind of additional mapping between returned index and coords externally?
Yeah, there's no fast way to get original coords from the index. indexOf is gross — as a workaround, I'd rather generate a Uint16/32Array that maps an id to its position in _indices/_boxes array. Linear to generate (just a loop over ids once after indexing), doesn't take much space, and allows for constant time lookups.
hey @mourner
i'm currently reading back bounding box coords to render a hover rect over the matched index, it looks something like below bound to
mousemove
. this works well enough for my-sized datasets. i assume there isn't anything more efficient thanlet offs = index._indices.indexOf(idx) * 4;
besides wasting mem/cpu to store some kind of additional mapping between returned index and coords externally?The text was updated successfully, but these errors were encountered: