Skip to content

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 directly

Type 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 ​

ParameterType
dataDataInput | null | undefined
options?O

Returns ​

ExpressFigure

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

Call 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 ​

ParameterType
elHTMLElement
dataDataInput | 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

Released under the MIT License.