Sankey
Properties
nameKeyStringoptional
The key of each sector's name.
DEFAULT:
"name"dataKeyString | Number | Functionoptional
The key of a group of data which should be unique in a SankeyChart.
DEFAULT:
"value"widthPercentage | Number
The percentage value of the chart's width or a fixed width.
heightPercentage | Number
The percentage value of the chart's width or a fixed height.
dataObject
The source data, including the array of nodes, and the relationships, represented by links.
FORMAT:
nodes: [ { name: 'Visit' }, { name: 'Direct-Favourite' }, { name: 'Page-Click' }, { name: 'Detail-Favourite' }, { name: 'Lost' }, ], links: [ { source: 0, target: 1, value: 3728.3 }, { source: 0, target: 2, value: 354170 }, { source: 2, target: 3, value: 62429 }, { source: 2, target: 4, value: 291741 }, ],sortBooleanoptional
Whether to sort the nodes on th y axis, or to display them as user-defined.
DEFAULT:
truenodePaddingNumberoptional
The padding between the nodes
DEFAULT:
10nodeWidthNumber
The width of node
DEFAULT:
10linkCurvatureNumber
The curvature of width
DEFAULT:
0.5iterationsNumber
The number of the iterations between the links
DEFAULT:
32nodeObject | ReactElementoptional
If set a object, the option is the configuration of nodes. If set a React element, the option is the custom react element of drawing the nodes.
FORMAT:
<Sankey node={<MyCustomComponent />} /> <Sankey node={{stroke: #77c878, strokeWidth: 2}} />linkObject | ReactElementoptional
If set a object, the option is the configuration of links. If set a React element, the option is the custom react element of drawing the links.
FORMAT:
<Sankey link={<MyCustomComponent />} /> <Sankey link={{fill: #77c878 }} />marginObject
The sizes of whitespace around the container.
DEFAULT:
"{\"top\":5,\"right\":5,\"bottom\":5,\"left\":5}"FORMAT:
{ top: 5, right: 5, bottom: 5, left: 5 }onClickFunctionoptional
The customized event handler of click on the area in this group
onMouseEnterFunctionoptional
The customized event handler of mouseenter on the area in this group
onMouseLeaveFunctionoptional
The customized event handler of mouseleave on the area in this group
align'left' | 'justify'optional
If set to 'justify', the start nodes will be aligned to the left edge of the chart and the end nodes will be aligned to the right edge of the chart. If set to 'left', the start nodes will be aligned to the left edge of the chart.
DEFAULT:
"justify"verticalAlign'justify' | 'top'optional
Controls the vertical spacing of nodes within a depth. 'justify' distributes nodes evenly and balances link paths, while 'top' positions the group starting from the top edge of the chart.
DEFAULT:
"justify"