Datashader Charts

line chart

datashader.line(y, data_points=100, add_interaction=True, pixel_shade_type='linear', color=None, step_size=None, step_size_type=<class 'int'>, width=800, height=400, title='', timeout=100, unselected_alpha=0.2, **library_specific_params)
Parameters:
x: str

x-axis column name from the gpu dataframe

y: str

y-axis column name from the gpu dataframe

x_range: tuple, default(gpu_dataframe[x].min(), gpu_dataframe[x].max())

(min, max) x-dimensions of the geo-scatter plot to be displayed

y_range: tuple, default(gpu_dataframe[y].min(), gpu_dataframe[y].max())

(min, max) x-dimensions of the geo-scatter plot to be displayed

add_interaction: {True, False}, default True
pixel_shade_type: str, default ‘linear’

The “how” parameter in datashader.transfer_functions.shade() function. Available options: eq_hist, linear, log, cbrt

color: str, default #8735fb
step_size: int, default None

for the range_slider below the chart

step_size_type: type, default int

for the range_slider below the chart

width: int, default 800
height: int, default 400
title: str,

chart title

timeout: int (milliseconds), default 100

Determines the timeout after which the callback will process new events without the previous one having reported completion. Increase for very long running callbacks and if zooming feels laggy.

unselected_alpha: float [0, 1], default 0.2

if True, displays unselected data in the same color_palette but transparent(alpha=0.2)

**library_specific_params:

additional library specific keyword arguments to be passed to the function

Returns:
A cudashader scatter plot of type:

cuxfilter.charts.datashader.custom_extensions.InteractiveDatashaderLine

Example

from cuxfilter import DataFrame
from cuxfilter.charts.datashader import line
import numpy as np
import cudf
import random
import cuxfilter

n = 100000                           # Number of points
start = 1456297053                   # Start time
end = start + 60 * 60 * 24

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'x': np.linspace(start, end, n), 'y':np.random.normal(0, 0.3, size=n).cumsum() + 50}))
line_chart_1 = line(x='x', y='y', unselected_alpha=0.2)

d = cux_df.dashboard([line_chart_1])
line_chart_1.view()