Draggable Nodes

Drag a node up or down; links follow and the position survives updates. nodeMove reports the offset.

Chart type
Sankey sankey
Tier
Premium
Collection
Sankey
Render
Live, site theme
View .md Agent setup
LIVE/sankey/draggable-nodes13 of 23 in Sankey

Configuration

Raw Standalone
const options = {
  chart: {
    height: 420,
    toolbar: {
      show: false
    },
    type: "sankey",
    events: {
      nodeMove: (e, ctx, o) => log(`nodeMove ${o.node.name}: ${Math.round(o.offset)} px`)
    }
  },
  series: [
    {
      data: [
        ["Coal", "Electricity", 22],
        ["Gas", "Electricity", 30],
        ["Gas", "Heat", 26],
        ["Wind", "Electricity", 28],
        ["Solar", "Electricity", 14],
        ["Electricity", "Industry", 40],
        ["Electricity", "Homes", 34],
        ["Electricity", "Losses", 20],
        ["Heat", "Homes", 18],
        ["Heat", "Industry", 8]
      ]
    }
  ],
  plotOptions: {
    sankey: {
      draggable: true
    }
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()

This example uses Premium modules. Compare licences · Embedding in a distributed product?