Widgets#

Range slider#

panel_widgets.range_slider(data_points=None, step_size=None, step_size_type=<class 'int'>, **params)#

Widget in the navbar of the cuxfilter dashboard.

Type: Range Slider

Parameters:
x: str

column name from gpu dataframe, dtype should be int or float

data_points: int, default None

when None, it means no custom number of bins are provided and data_points will default to df[self.x].nunique()

step_size: int, default 1
step_size_type: {int, float}, default int
**params:

additional arguments to be passed to the function. See panel widgets documentation for more info, https://panel.holoviz.org/reference/widgets/RangeSlider.html#parameters

Example#

import cudf
from cuxfilter import charts, DataFrame
import cuxfilter

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'key': [0, 1, 2, 3, 4], 'val':[float(i + 10) for i in range(5)]}))
range_slider = charts.range_slider('key')

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

Date Range slider#

panel_widgets.date_range_slider(data_points=None, **params)#

Widget in the navbar of the cuxfilter dashboard.

Type: Range Slider

Parameters:
x: str

column name from gpu dataframe, dtype should be datetime

data_points: int, default None

when None, it means no custom number of bins are provided and data_points will default to df[self.x].nunique()

step_size: np.timedelta64, default np.timedelta64(days=1)
**params:

additional arguments to be passed to the function. See panel widgets documentation for more info, https://panel.holoviz.org/reference/widgets/DateRangeSlider.html#parameters

Example#

import cudf
from cuxfilter import charts, DataFrame

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'time':['2020-01-01', '2020-01-10', '2020-02-20']}))
cux_df.data['time'] = cudf.to_datetime(cux_df.data['time'])

date_range_slider = charts.date_range_slider('time')

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

Float slider#

panel_widgets.float_slider(data_points=None, step_size=None, **params)#

Widget in the navbar of the cuxfilter dashboard.

Type: Float Slider

Parameters:
x: str

column name from gpu dataframe, dtype should be float

data_points: int, default None

when None, it means no custom number of bins are provided and data_points will default to df[self.x].nunique()

step_size: float, default float((max - min)/datapoints)
**params:

additional arguments to be passed to the function. See panel widgets documentation for more info, https://panel.holoviz.org/reference/widgets/FloatSlider.html#parameters

Example#

import cudf
from cuxfilter import charts, DataFrame

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'key': [0, 0.5, 1, 1.5, 2], 'val':[float(i + 10) for i in range(5)]}))
float_slider = charts.float_slider('key', step_size=0.5)

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

Int slider#

panel_widgets.int_slider(data_points=None, step_size=1, **params)#

Widget in the navbar of the cuxfilter dashboard.

Type: Int Slider

Parameters:
x: str

column name from gpu dataframe, dtype should be int

data_points: int, default None

when None, it means no custom number of bins are provided and data_points will default to df[self.x].nunique()

step_size: int, default 1
**params:

additional arguments to be passed to the function. See panel widgets documentation for more info, https://panel.holoviz.org/reference/widgets/IntSlider.html#parameters

Example#

import cudf
from cuxfilter import charts, DataFrame

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'key': [0, 1, 2, 3, 4], 'val':[float(i + 10) for i in range(5)]}))
int_slider = charts.int_slider('val')

d = cux_df.dashboard([int_slider])
#view the individual int_slider chart part of the dashboard d
int_slider.view()

Multiselect#

panel_widgets.multi_select(**params)#

Widget in the navbar of the cuxfilter dashboard.

Type: multi_choice

Parameters:
x: str

column name from gpu dataframe, dtype [str, int, float]

data_points: int, default number of unique values
**params:

additional arguments to be passed to the function. See panel widgets documentation for more info, https://panel.holoviz.org/reference/widgets/MultiChoice.html#parameters

Example#

import cudf
from cuxfilter import charts, DataFrame

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'val': ['A', 'B', 'C', 'D', 'E']}))
multi_select = charts.multi_select('val')

d = cux_df.dashboard([multi_select])
# View the individual multi_select chart part of the dashboard d
multi_select.view(height=200)

Number Chart#

panel_widgets.number(aggregate_fn='mean', title='', format='{value}', default_color='black', colors=[], font_size='18pt', **library_specific_params)#

Number chart which can be located in either the main dashboard or side navbar.

Type: number_chart or number_chart_widget

Parameters:
expression:

string containing computable expression containing column names e.g: “(x+y)/2” will result in number value = (df.x + df.y)/2

aggregate_fn: {‘count’, ‘mean’, ‘min’, ‘max’,’sum’, ‘std’}, default ‘count’
title: str,

chart title

format: str, default=’{value}’

A formatter string which accepts a {value}.

default_color: str, default ‘black’

A color string to use as the default color if no thresholds are passed via the colors argument.

colors: list

Color thresholds for the Number indicator, specified as a tuple of the absolute thresholds and the color to switch to. e,g: colors=[(33, ‘green’), (66, ‘gold’), (100, ‘red’)]

font_size: str, default ‘18pt’
title_size: str, default ‘14pt’
**params:

additional arguments to be passed to the function. See panel widgets documentation for more info, https://panel.holoviz.org/reference/indicators/Number.html#parameters

Example 1#

import cudf
from cuxfilter import charts, DataFrame

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'key': [0, 1, 2, 3, 4], 'val':[float(i + 10) for i in range(5)]}))
number_chart = charts.number(expression='val', aggregate_fn="mean", format="{value}%")

d = cux_df.dashboard([number_chart])
# view the individual number_chart chart part of the dashboard d
number_chart.view()

Example 2#

import cudf
from cuxfilter import charts, DataFrame

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'key': [0, 1, 2, 3, 4], 'val':[float(i + 10) for i in range(5)]}))
number_chart = charts.number(
                expression='(key*val)*1000', aggregate_fn="mean",
                title="custom eval expr",
                format="{value:,}", font_size="20pt"
            )

d = cux_df.dashboard([number_chart])
# view the individual number chart part of the dashboard d
number_chart.view()

Card Chart#

panel_widgets.card(**library_specific_params)#

Card chart contating markdown content and can be located in either the main dashboard or side navbar.

Type: number_chart

Parameters:
content: {str, markdown static content}, default “”
**params:

additional arguments to be passed to the function. See panel widgets documentation for more info, https://panel.holoviz.org/reference/layouts/Card.html#parameters

Example#

import cudf
from cuxfilter import charts, DataFrame
import panel as pn

cux_df = DataFrame.from_dataframe(cudf.DataFrame({'key': [0, 1, 2, 3, 4]}))
card_chart = charts.card(pn.pane.Markdown("""
            # H1
            ## H2
            ### H3
            #### H4
            ##### H5
            ###### H6

            ### Emphasis

            Emphasis, aka italics, with *asterisks* or _underscores_.
            """))

d = cux_df.dashboard([card_chart])
# view the individual card_chart chart part of the dashboard d
card_chart.view()