Interface: ExpressFunction()<O>
An Express function: builds a figure from data, or renders it when given an element first.
Example
ts
const figure = hx.scatter(rows, { x: 'gdp', y: 'life' }); // a figure to adjust
figure.layout.title = { text: 'Income and life expectancy' };
createChart(el, figure);
const chart = await hx.scatter(el, rows, { x: 'gdp', y: 'life' }); // or render directlyType Parameters
| Type Parameter |
|---|
O |
Call Signature
ts
ExpressFunction(data, options?): ExpressFigure;An Express function: builds a figure from data, or renders it when given an element first.
Parameters
| Parameter | Type |
|---|---|
data | DataInput | null | undefined |
options? | O |
Returns
Example
ts
const figure = hx.scatter(rows, { x: 'gdp', y: 'life' }); // a figure to adjust
figure.layout.title = { text: 'Income and life expectancy' };
createChart(el, figure);
const chart = await hx.scatter(el, rows, { x: 'gdp', y: 'life' }); // or render directlyCall Signature
ts
ExpressFunction(
el,
data,
options?
): Promise<Chart>;An Express function: builds a figure from data, or renders it when given an element first.
Parameters
| Parameter | Type |
|---|---|
el | HTMLElement |
data | DataInput | null | undefined |
options? | O |
Returns
Promise<Chart>
Example
ts
const figure = hx.scatter(rows, { x: 'gdp', y: 'life' }); // a figure to adjust
figure.layout.title = { text: 'Income and life expectancy' };
createChart(el, figure);
const chart = await hx.scatter(el, rows, { x: 'gdp', y: 'life' }); // or render directly