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
- pan: for pan/zoom operations on canvas
- box: box selection of data points
- lasso: lasso selection
plot.setInteraction("lasso");
For more documentation, visit GitHub repository