Skip to content

Feature request: sort values  #162

@oskbor

Description

@oskbor

Hi!
Currently regl-scatterplot renders the items in the order they appear in the arrays. This means that outliers (high or low values) can be obscured by other dots on the plot. My request is to have an option to draw the largest (or smallest) value on top.

Our current workaround for this is to sort the arrays before passing them to regl-scatterplot. This works but its clunky and we also need to "unsort" the values in the selection/hover events as the index is the source of truth.

My hope/idea with this request is that maybe regl-scatterplot can achieve the desired behaviour w/o sorting?

Idea 1 would be in line with most other settings

sortBy?: "valueA" | "valueB"
sortDirection?: "ascending" | "descending"

Idea 2 is to pass an array with the wanted index ordering

sortBy?: number[]

best regards Oskar

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementFeature improvement or enhancementwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions