UI
fastplotlib
Render high-performance scatter plots with GPU acceleration.
The fastplotlib
function renders high-performance scatter plots using GPU acceleration via Fastplotlib. It is ideal for visualizing large datasets directly from the backend with minimal frontend overhead.
Parameters
label
(str): A title or alt-text label describing the chart.data
(dict): A dictionary containing the following keys:x
(list or np.ndarray): X-axis values.y
(list or np.ndarray): Y-axis values.color
(optional list): Labels used to assign different colors. The component cycles through a fixed palette.
size
(float): (Optional) The width of the component in a row. Defaults to1.0
(full row). See the Layout Guide for details.
Returns
str
: A unique component ID referencing the rendered image.
Usage Example
This will render a GPU-accelerated scatter plot, cycling colors by species. It is exported server-side and displayed as an image in the frontend.
Notes
- Rendering happens offscreen via Fastplotlib’s WGPU backend, so this is ideal for large or compute-heavy charts.
- Colors are currently cycled from a fixed palette. For more control over color schemes, we recommend extending the component in the future with support for RGBA arrays or named colors.