VegaEmbedded Interface

class epyk.interfaces.graphs.CompChartsVega.VegaEmbedded(ui)
plot(record=None, y=None, x=None, kind='line', profile=None, width=(100, '%'), height=(330, 'px'), options=None, html_code=None)
Tags:

Categories:

Usage:

c = page.ui.charts.vega.plot(y=["Value"], x="Year", kind="point", height=(500, "px"))
text = page.ui.input("Italy")
slider = page.ui.sliders.range(minimum=1990, maximum=2020)
page.ui.button("Click").click([
page.js.d3.csv(data_urls.DEMO_COUNTRY).filterCol("Country Name", text.dom.content).cast(["Year", "Value"]).
   filterCol("Year", slider.dom.min_select, ">").filterCol("Year", slider.dom.max_select, "<").get(
     [#"data = data.slice(1)",
    c.build(pk.events.data)])
])
Parameters:
  • record – List. Optional. The list of dictionaries with the input data.

  • y – List | String. Optional. The columns corresponding to keys in the dictionaries in the record.

  • x – String. Optional. The column corresponding to a key in the dictionaries in the record.

  • kind – String. Optional. The chart type.

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

  • width – Tuple. Optional. The width of the component in the page, default (100, ‘%’).

  • height – Tuple. Optional. The height of the component in the page, default (330, “px”).

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

  • html_code – String. Optional. An identifier for this component (on both Python and Javascript side).