GraphBillboard Module

class epyk.core.html.graph.GraphBillboard.Chart(page: PageModel, width, height, html_code, options, profile)
build(data: Union[str, JsDataModel, float, dict, list, bool] = None, options: Optional[Union[bool, dict]] = None, profile: Optional[Union[bool, dict]] = None, component_id: str = None, stop_state: bool = True, dataflows: List[dict] = None) str

Build / Update the chart.

Parameters:
  • data – Optional. Dataset

  • options – Optional. Specific Python options available for this component

  • profile – Optional. A flag to set the component performance storage

  • component_id – Optional. The component reference (the htmlCode)

  • stop_state – Remove the top panel for the component state (error, loading…)

  • dataflows – Chain of data transformations

property chartId: str

Return the Javascript variable of the chart.

click(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)

Add a click event on a chart.

Parameters:
  • js_funcs – A Javascript Python function

  • profile – Set to true to get the profile for the function on the Javascript console.

  • source_event – Optional. The source target for the event.

  • on_ready – Optional. Specify if the event needs to be trigger when the page is loaded.

colors(hex_values: List[str])

Set the colors of the chart.

hex_values can be a list of string with the colors or a list of tuple to also set the bg colors. If the background colors are not specified they will be deduced from the colors list changing the opacity.

Parameters:

hex_values – An array of hexadecimal color codes.

property d3: D3Select

Property shortcut the D3 underlying base classes.

define(options: Optional[Union[str, JsDataModel, float, dict, list, bool]] = None, dataflows: Optional[List[dict]] = None) str
Parameters:
  • options

  • dataflows – Chain of config transformations:

property dom: C3

Return all the Javascript functions defined for an HTML Component. Those functions will use plain javascript by default.

Returns:

A Javascript Dom object.

property js: Billboard

C3 reference API.

Related Pages:

Returns:

A Javascript object

property options: C3

Property to the component options. Options can either impact the Python side or the Javascript builder.

Python can pass some options to the JavaScript layer.

property shared: OptionsChartSharedC3

All the common properties shared between all the charts. This will ensure a compatibility with the plot method.

Usage:

line = page.ui.charts.bb.bar()
line.shared.x_label("x axis")
class epyk.core.html.graph.GraphBillboard.ChartArea(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphBillboard.ChartBar(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphBillboard.ChartBubble(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphBillboard.ChartDonut(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphBillboard.ChartGauge(page: PageModel, width, height, html_code, options, profile)
add_dataset(value: list, name: str, kind: Optional[str] = None)
Parameters:
  • value – The series of numbers to be added to the chart

  • name – The series name

  • kind – Optional. The chart type

build(data: Optional[Union[str, JsDataModel, float, dict, list, bool]] = None, options: Optional[Union[bool, dict]] = None, profile: Optional[Union[bool, dict]] = None, component_id: Optional[str] = None) str
Parameters:
  • data – Optional. The dataset to be added to the chart

  • options – Optional. Specific Python options available for this component

  • profile – Optional. A flag to set the component performance storage

  • component_id – Optional. The component reference (the htmlCode)

class epyk.core.html.graph.GraphBillboard.ChartLine(page: PageModel, width, height, html_code, options, profile)
add_dataset(data: list, name: str, kind: Optional[str] = None) OptionsData

Add a dataset to the chart.

Parameters:
  • data – The dataset to be added to the chart

  • name – The name (alias) of the dataset

  • kind – Optional. The type of chart

labels(labels: list, series_id: str = 'x')

Set the series labels.

Parameters:
  • labels – List of labels

  • series_id – The series key

class epyk.core.html.graph.GraphBillboard.ChartPie(page: PageModel, width, height, html_code, options, profile)
add_dataset(values: list, name: str, kind: Optional[str] = None)

Add a dataset to a pie chart. If multiple datasets are added the value will be summed up in the resulting pue chart.

Parameters:
  • values – The series of numbers to be added to the chart

  • name – The series name

  • kind – Optional. The chart type

labels(labels: list, series_id: str = 'x')
Parameters:
  • labels

  • series_id – Optional.

class epyk.core.html.graph.GraphBillboard.ChartRadar(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphBillboard.ChartScatter(page: PageModel, width, height, html_code, options, profile)
labels(labels: list, series_id: str = 'x')
Parameters:
  • labels

  • series_id – Optional. The series ID.

class epyk.core.html.graph.GraphBillboard.ChartSpline(page: PageModel, width, height, html_code, options, profile)
class epyk.core.data.DataClass.DataClass(component: Optional[HtmlModel] = None, attrs: Optional[dict] = None, options: Optional[dict] = None, page: Optional[PageModel] = None)
add(name: str, value: Any)

Add the key and value to the final result object.

Parameters:
  • name – The key in the final data dictionary.

  • value – The value in the final data dictionary.

attr(name: str, value: Any)

Add an attribute to the Javascript underlying dictionary.

Parameters:
  • name – The attribute name

  • value – The attribute value

Returns:

“Self” to allow the chains on the Python side

attrs()
config_attrs(options: Optional[dict] = None) str

Get the attributes in a string.

Parameters:

options – Dictionary with specific attributes to be set

custom(name: str, value: Any)

Custom function to add a bespoke attribute to a class.

This entry point will not be able to display any documentation but it is a shortcut to test new features. If the value is a Javascript object, the PyJs object must be used.

Parameters:
  • name – The key to be added to the attributes

  • value – The value of the defined attributes

Returns:

The DataAttrs to allow the chains

get(dfl: Optional[Union[str, bool, int, dict, list, float]] = None, name: Optional[str] = None)

Get the attribute to the underlying attributes dictionary.

Parameters:
  • dfl – Optional. The default value of this attribute

  • name – Optional. The attribute name. default the name of the function

has_attribute(cls_obj)

Add an extra sub layer to the data structure.

The key in the object representation will be the function name.

Parameters:

cls_obj – Class. The sub data class used in the structure definition

set(value: Any, name: Optional[str] = None)

Add an attribute to the Javascript underlying dictionary.

Parameters:
  • value – The attribute value

  • name – Optional. The attribute name. default the name of the functin.

Returns:

“Self” to allow the chains on the Python side

sub_data(name: str, cls_obj)

Add an extra sub layer to the data structure. The key in the object representation will be the function name.

Should use has_attribute is the name can be deduced from the parent function.

Parameters:
  • name – The key to be added to the internal data dictionary

  • cls_obj – Class. Object. The object which will be added to the nested data structure

sub_data_enum(name: str, cls_obj)

Add key to a sub dictionary. This will create an attribute object with a nested structure.

Parameters:
  • name – The key to be added to the internal data dictionary

  • cls_obj – Class. Object. The object which will be added to the nested data structure

update(vals: dict)

Update the object internal attributes.

Parameters:

vals – All the attributes to be added to the component