highcharts / highcharts

Highcharts JS, the JavaScript charting framework
https://www.highcharts.com
Other
11.99k stars 3.6k forks source link

Sankey: placement of nodes without ancestors #21860

Open 2x2xplz opened 1 day ago

2x2xplz commented 1 day ago

[I was asked to create this issue after submitting a support request 2024-09-16]

Description of the feature

Highcharts Sankey - when a new input node (i.e. a node that has no ancestor) is added to the sankey diagram in any column other than column 0, the new node is vertically positioned above all other nodes. The request is to allow placement at the bottom, under other nodes.

Library related to the feature

Highcharts Sankey

Proof of Concept/Live example for the feature

trying to position "NewNode" below D, E, F instead of above them

image
// the intended goal is to position "NewNode" under D, E, F - not above them
Highcharts.chart('container', {
    chart: {
        type: 'sankey'
    },
    title: {
        text: 'Sankey Diagram Example'
    },
    series: [{
        keys: ['from', 'to', 'weight'],
        data: [
            ['A', 'B', 5],
            ['A', 'C', 3],
            ['B', 'D', 2],
            ['C', 'D', 4],
            ['B', 'E', 1],
            ['C', 'F', 2],
            ['D', 'G', 3],
            ['E', 'G', 1],
            ['F', 'G', 1],
            ['NewNode', 'G', 3] // I added this link
        ],
        nodes: [
            { id: 'A' },
            { id: 'B', column: 1 },
            { id: 'C', column: 1 },
            { id: 'D', column: 2 },
            { id: 'E', column: 2 },
            { id: 'F', column: 2 },
            { id: 'G', column: 3 },
            { id: 'NewNode', column: 2 } // New node placed below in the same column
        ]
    }]
});

You can vote for this feature by adding a thumbs-up reaction to this post.

hubertkozik commented 1 day ago

Hi @2x2xplz! Thank you for reporting the Feature Request.