Skip to content

Dynamically changing points #19

Open

Description

@1ec5

Currently, if a point is added, removed, or moved, you have to recluster all the points, which can be expensive. For mapbox/mapbox-gl-native#5814, it should be possible to update the clustering to account for dynamically changing points.

/cc @mourner

Activity

  1. fungiboletus commented on Sep 27, 2016

    @fungiboletus

    I am considering to develop a hybrid clustering layer, combining supercluster for static markers and prunecluster for dynamic markers. But if supercluster supports dynamic markers out of the box with good performances, I probably shouldn't do it.

    How likely do you think supercluster will support this feature in the next two years ?

  2. mourner commented on Sep 27, 2016

    @mourner
    Member

    It's likely, although will probably come with performance costs. Supercluster used to be rbush-based and was 2.3 times slower: #5

  3. fungiboletus commented on Sep 27, 2016

    @fungiboletus

    Will you update kdbush to support dynamic points with a performance cost, or have some kind of hybrid approach as well ?

  4. mourner commented on Sep 27, 2016

    @mourner
    Member

    KDBush algorithm is static by design. I'd have to roll back to RBush.

  5. mourner commented on Jan 19, 2017

    @mourner
    Member

    I guess this is not as critical as it may seem, because you rarely need to dynamically change an already huge dataset on the client. Typically you either have a large static dataset, or a small dynamic one. Since Supercluster is extremely fast, it's usually fast enough to regenerate the whole clustering in the dynamic case.

  6. 1ec5 commented on Jan 19, 2017

    @1ec5
    Author

    For mapbox/mapbox-gl-native#5814, the highly dynamic point annotation layer could be small or it could be large – we’ve seen plenty of examples of either in the iOS SDK. But I agree that we should try to make point annotation clustering work in the first place before worrying about this optimization. Do you think the optimization proposed in mapbox/mapbox-gl-native#5814 (comment) would suffice in the meantime?

  7. viktorstaikov commented on Aug 23, 2018

    @viktorstaikov

    Hi,

    I'm considering Supercluster for my backend and I need to be able to add new points to the clusters.
    Is there a way to add points efficiently to the clusters without rebuilding it?

    I'm expecting to have more than 500k points in my DB and I can't imagine loading them everytime a new one is added. Can you suggest an approach?

    Thanks

  8. XiiiRuth commented on Jan 18, 2019

    @XiiiRuth

    For mapbox/mapbox-gl-native#5814, the highly dynamic point annotation layer could be small or it could be large – we’ve seen plenty of examples of either in the iOS SDK. But I agree that we should try to make point annotation clustering work in the first place before worrying about this optimization. Do you think the optimization proposed in mapbox/mapbox-gl-native#5814 (comment) would suffice in the meantime?

    i hope it will be realize,did you guys try to do it?or meet some problems?

  9. XiiiRuth commented on Jan 18, 2019

    @XiiiRuth

    I guess this is not as critical as it may seem, because you rarely need to dynamically change an already huge dataset on the client. Typically you either have a large static dataset, or a small dynamic one. Since Supercluster is extremely fast, it's usually fast enough to regenerate the whole clustering in the dynam

    I guess this is not as critical as it may seem, because you rarely need to dynamically change an already huge dataset on the client. Typically you either have a large static dataset, or a small dynamic one. Since Supercluster is extremely fast, it's usually fast enough to regenerate the whole clustering in the dynamic case.

    well,when have a large static dataset,it will be waiting for many seconds,a dynamicallu feature may be useful

  10. RWOverdijk commented on Mar 6, 2019

    @RWOverdijk

    Are there any updates on this? I've been trying to use this through react-native-super-cluster but every change made causes quite a big delay. Anything that can be done?

  11. mourner commented on Mar 6, 2019

    @mourner
    Member

    Not at the moment unfortunately.

  12. RWOverdijk commented on Mar 6, 2019

    @RWOverdijk

    Ahw... Ah well. Thanks :)

  13. StuRuby commented on Apr 1, 2019

    @StuRuby

    Supercluster uses kd bush to generate index, so it do not support dynamic indexing data

  14. alamothe commented on Apr 29, 2026

    @alamothe

    Can you at least support chunking the work? Currently, it's one synchronous call which can take e.g. 10 seconds, and it blocks the thread. Ideally we should be able to chunk it and allow the JS thread to do UI stuff in between.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions