epiviz.scatter.gl

this dataset contains 150k points (comes from genome-spy, not the fanciest demo page but it works :)

Simple Usage:

            import ScatterGL from "epiviz.scatter.gl";
            
            # you can either pass in a dom selector or HTMLElement
            let plot = new ScatterGL(".canvas");

            # provide input data to the element, 
            # data must contain x and y coordinates
            plot.setInput({
              x: [...],
              y: [...],
            });

            # render the plot
            plot.render();
        

Capture events:

The library provides click, hover (mouseover) and selection events for interactivity with the plot. The default behavior logs the events to the console

            plot.hoverCallback = function(point) {
                # do something when a point is hovered
                console.log(point);
            }
        

Interactions:

currently supports

            plot.setInteraction("lasso");
      

For more documentation, visit GitHub repository

(closest point wrt to mouse)