Skip to main content

Render helpers

isSelection()​

A d3 selection, recognised by its methods rather than with instanceof: on a CDN page the page's own d3 is a different copy from the bundle's, and its selections are not instances of the bundle's class.

Kind: global function

renderChart(chart, target, [data]) ⇒ TChart​

Draws a chart into a target, as select(target).datum(data).call(chart) does, so a page needs no d3 code of its own. The charts' render accessor calls this.

Kind: global function
Returns: TChart - {Function} The chart, to chain calls

ParamTypeDescription
chartfunctionThe chart module to draw
targetString | Element | D3SelectionWhere to draw it
[data]ObjectThe data to draw; left out, the chart redraws with the data already bound to the target