Skip to content

Integration

import { Chart, LinearScale } from 'chart.js'
import { Flow, SankeyController } from 'chartjs-chart-sankey'
Chart.register(LinearScale, SankeyController, Flow)

The CommonJS entry registers the sankey controller and flow element as side effects.

const { Chart, LinearScale } = require('chart.js')
require('chartjs-chart-sankey')
Chart.register(LinearScale)

The built ESM bundle exports the controller and element.

import { Flow, SankeyController } from 'chartjs-chart-sankey/dist/chartjs-chart-sankey.esm.js'
Chart.register(SankeyController, Flow)