Display an accessible organisation chart.
The package exposes one javascript function that can be used on any website, or in any framework.
Keep in mind that the function always attaches itself to window
.
npm install @digdir/organisation-chart
After the package is installed, we need to import the css, either globally or only on the page you are using the chart.
import '@digdir/organisation-chart/dist/index.css';
then import the function, and use it
import { generateOrgChart } from '@digdir/organisation-chart';
generateOrgChart(data, 'chart');
The first argument is your JSON data, read more about setting up your data below. The second argument is the id of the container where you want the chart to show.
Please read the documentation on orgchart.digdir.no for more information about behaviour and data structure.