const section = generateSankeySection({
lang: 'en',
nodes: [
{ id: 'gov', label: 'Government', color: 'cyan' },
{ id: 'opp', label: 'Opposition', color: 'magenta' },
{ id: 'prop', label: 'Propositions', color: 'orange' },
{ id: 'mot', label: 'Motions', color: 'purple' },
{ id: 'passed', label: 'Passed', color: 'green' },
{ id: 'rejected', label: 'Rejected/Shelved', color: 'red' },
],
flows: [
{ source: 'gov', target: 'prop', value: 12, label: '2024 props' },
{ source: 'opp', target: 'mot', value: 35, label: '2024 mots' },
{ source: 'prop', target: 'passed', value: 10 },
{ source: 'prop', target: 'rejected', value: 2 },
{ source: 'mot', target: 'passed', value: 5 },
{ source: 'mot', target: 'rejected', value: 30 },
],
});
articleData.sections = [...(articleData.sections ?? []), section];
Generate a color-coded Sankey flow chart as inline SVG.
Returns a
TemplateSectionwith an embedded responsive SVG. No client-side JavaScript is required. An accessible<table>withsr-onlyclass is included as a fallback for screen readers and search engines.