sankey = (sankeyData, title, nodeColor,orientation,height ) => {
const trace = {
type: "sankey",
orientation: orientation,
valueformat: ".0f",
node: {
pad: 5,
thickness: 15,
line: {
color: nodeColor,
width: 0.5
},
color: nodeColor,
label: sankeyData['nodes'],
},
link: {
source: sankeyData['edges'].map(d => d.source),
target: sankeyData['edges'].map(d => d.target),
value: sankeyData['edges'].map(d => d.value)
}
};
const data=[trace];
const div = DOM.element('div');
const layout = {
title: title,
font: {
size: 10
},
height:h,
width:width
};
Plotly.react(div, data, layout);
return div;
}