Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
source: string | number, // ref to node id
target: string | number, // ref to node id
value: number
}}>
}
\`\`\`
`,
type: '{ nodes: object[], links: object[] }',
required: true,
},
{
key: 'layout',
help: `Control sankey layout direction.`,
type: 'string',
required: false,
defaultValue: defaults.layout,
controlType: 'radio',
group: 'Base',
controlOptions: {
choices: [
{ label: 'horizontal', value: 'horizontal' },
{ label: 'vertical', value: 'vertical' },
],
},
},
{
key: 'align',
group: 'Base',
help: 'Node alignment method.',
description: `
Defines node alignment method.
Please have a look at the
],
},
},
{
key: 'align',
group: 'Base',
help: 'Node alignment method.',
description: `
Defines node alignment method.
Please have a look at the
[official d3 documentation](https://github.com/d3/d3-sankey#sankey_nodeAlign)
for further information.
`,
type: 'string',
required: false,
defaultValue: defaults.align,
controlType: 'choices',
controlOptions: {
choices: sankeyAlignmentPropKeys.map(key => ({
label: key,
value: key,
})),
},
},
{
key: 'sort',
description: `
Defines node sorting method. Must be one of:
- **'auto'** order of nodes within each
column is determined automatically by the layout.
- **'input'** order is fixed by the input.
defaultValue: defaults.sort,
controlType: 'choices',
group: 'Base',
controlOptions: {
choices: ['auto', 'input', 'ascending', 'descending'].map(key => ({
label: key,
value: key,
})),
},
},
{
key: 'colors',
help: 'Defines how to compute nodes color.',
type: 'string | Function | string[]',
required: false,
defaultValue: defaults.colors,
controlType: 'ordinalColors',
group: 'Base',
},
{
key: 'width',
enableControlForFlavors: ['api'],
description: `
not required if using
\`\`.
`,
help: 'Chart width.',
type: 'number',
required: true,
controlType: 'range',
group: 'Base',
controlOptions: {
},
{
key: 'enableLinkGradient',
help: 'Enable/disable gradient from source/target nodes instead of plain color.',
type: 'boolean',
required: false,
defaultValue: defaults.enableLinkGradient,
controlType: 'switch',
group: 'Links',
},
{
key: 'enableLabels',
help: 'Enable/disable labels.',
type: 'boolean',
required: false,
defaultValue: defaults.enableLabels,
controlType: 'switch',
group: 'Labels',
},
{
key: 'labelPosition',
help: 'Label position.',
type: 'string',
required: false,
defaultValue: defaults.labelPosition,
controlType: 'radio',
group: 'Labels',
controlOptions: {
choices: ['inside', 'outside'].map(key => ({
label: key,
value: key,
})),
description: `
Defines CSS \`mix-blend-mode\` property for links, see
[MDN documentation](https://developer.mozilla.org/fr/docs/Web/CSS/mix-blend-mode).
`,
type: 'string',
required: false,
defaultValue: defaults.linkBlendMode,
controlType: 'blendMode',
group: 'Links',
},
{
key: 'enableLinkGradient',
help: 'Enable/disable gradient from source/target nodes instead of plain color.',
type: 'boolean',
required: false,
defaultValue: defaults.enableLinkGradient,
controlType: 'switch',
group: 'Links',
},
{
key: 'enableLabels',
help: 'Enable/disable labels.',
type: 'boolean',
required: false,
defaultValue: defaults.enableLabels,
controlType: 'switch',
group: 'Labels',
},
{
key: 'labelPosition',
help: 'Label position.',
type: 'string',
controlType: 'radio',
group: 'Labels',
controlOptions: {
choices: ['horizontal', 'vertical'].map(key => ({
label: key,
value: key,
})),
},
},
{
key: 'isInteractive',
flavors: ['svg'],
help: 'Enable/disable interactivity.',
type: 'boolean',
required: false,
defaultValue: defaults.isInteractive,
controlType: 'switch',
group: 'Interactivity',
},
...motionProperties(['svg'], defaults),
]
export const groups = groupProperties(props)
description: `
how to compute label text color,
[see dedicated documentation](self:/guides/colors).
`,
type: 'string | object | Function',
required: false,
defaultValue: defaults.labelTextColor,
controlType: 'inheritedColor',
group: 'Labels',
},
{
key: 'labelOrientation',
help: 'Label orientation.',
type: 'string',
required: false,
defaultValue: defaults.labelOrientation,
controlType: 'radio',
group: 'Labels',
controlOptions: {
choices: ['horizontal', 'vertical'].map(key => ({
label: key,
value: key,
})),
},
},
{
key: 'isInteractive',
flavors: ['svg'],
help: 'Enable/disable interactivity.',
type: 'boolean',
required: false,
defaultValue: defaults.isInteractive,
required: false,
defaultValue: defaults.labelPosition,
controlType: 'radio',
group: 'Labels',
controlOptions: {
choices: ['inside', 'outside'].map(key => ({
label: key,
value: key,
})),
},
},
{
key: 'labelPadding',
help: 'Label padding from node.',
required: false,
defaultValue: defaults.labelPadding,
type: 'number',
controlType: 'range',
group: 'Labels',
controlOptions: {
unit: 'px',
min: 0,
max: 60,
},
},
{
key: 'labelTextColor',
help: 'Method to compute label text color.',
description: `
how to compute label text color,
[see dedicated documentation](self:/guides/colors).
`,
},
{
key: 'enableLabels',
help: 'Enable/disable labels.',
type: 'boolean',
required: false,
defaultValue: defaults.enableLabels,
controlType: 'switch',
group: 'Labels',
},
{
key: 'labelPosition',
help: 'Label position.',
type: 'string',
required: false,
defaultValue: defaults.labelPosition,
controlType: 'radio',
group: 'Labels',
controlOptions: {
choices: ['inside', 'outside'].map(key => ({
label: key,
value: key,
})),
},
},
{
key: 'labelPadding',
help: 'Label padding from node.',
required: false,
defaultValue: defaults.labelPadding,
type: 'number',
controlType: 'range',
controlOptions: {
unit: 'px',
min: 0,
max: 60,
},
},
{
key: 'labelTextColor',
help: 'Method to compute label text color.',
description: `
how to compute label text color,
[see dedicated documentation](self:/guides/colors).
`,
type: 'string | object | Function',
required: false,
defaultValue: defaults.labelTextColor,
controlType: 'inheritedColor',
group: 'Labels',
},
{
key: 'labelOrientation',
help: 'Label orientation.',
type: 'string',
required: false,
defaultValue: defaults.labelOrientation,
controlType: 'radio',
group: 'Labels',
controlOptions: {
choices: ['horizontal', 'vertical'].map(key => ({
label: key,
value: key,
})),