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 was wondering if it is possible to resize the index before calling finish()? looking at the code, i think it's possible.
my situation is that i have 100k "objects" (stored as flat arrays of facets, e.g.: prices: [12,19,25,...], gdps: [1000,500,2300,...] ) that i need to render on an x/y chart. i don't know the coords up front as they are calculated from the facet values during rendering. most of these objects may be omitted or clustered if they are too small to render, so i don't need them in the spatial index for hit testing. i may only end up rendering 10k, but i don't know in advance without wasting mem or cpu which ones may end up in this subset. so what i'd like to do is specify a 100k maximum number of items when instantiating Flatbush, but then trim() it to the final size during calling finish().
does this sound like something that can be supported?
thanks!
The text was updated successfully, but these errors were encountered:
leeoniya
changed the title
resize before finish() ?
resize (shrink) during finish()?
Aug 30, 2022
Thanks for the suggestion! This sounds useful and potentially possible, although a little tricky with the current data layout. Feel free to experiment and submit a PR for a trim() method if it looks good in code. I think it's better for it to be explicit so that users would call it intentionally before finish(), and get an error otherwise.
hi @mourner,
i was wondering if it is possible to resize the index before calling finish()? looking at the code, i think it's possible.
my situation is that i have 100k "objects" (stored as flat arrays of facets, e.g.:
prices: [12,19,25,...], gdps: [1000,500,2300,...]
) that i need to render on an x/y chart. i don't know the coords up front as they are calculated from the facet values during rendering. most of these objects may be omitted or clustered if they are too small to render, so i don't need them in the spatial index for hit testing. i may only end up rendering 10k, but i don't know in advance without wasting mem or cpu which ones may end up in this subset. so what i'd like to do is specify a 100k maximum number of items when instantiating Flatbush, but then trim() it to the final size during calling finish().does this sound like something that can be supported?
thanks!
The text was updated successfully, but these errors were encountered: