#HierarchySankey
#Regional Sales Hierarchy Sankey
A hierarchy sankey chart showing sales flowing from region to country to city.
import { VSeedRender } from '@components'
export default () => {
const vseedConfig = {
"chartType": "hierarchySankey",
"dataset": [
{
"region": "Asia",
"country": "China",
"city": "Beijing",
"sales": 30
},
{
"region": "Asia",
"country": "China",
"city": "Shanghai",
"sales": 20
},
{
"region": "Asia",
"country": "Japan",
"city": "Tokyo",
"sales": 10
},
{
"region": "Europe",
"country": "Germany",
"city": "Berlin",
"sales": 18
},
{
"region": "Europe",
"country": "Germany",
"city": "Munich",
"sales": 12
},
{
"region": "Europe",
"country": "France",
"city": "Paris",
"sales": 16
}
],
"dimensions": [
{
"id": "region",
"alias": "Region"
},
{
"id": "country",
"alias": "Country"
},
{
"id": "city",
"alias": "City"
}
],
"measures": [
{
"id": "sales",
"alias": "Sales"
}
],
"legend": {
"enable": true,
"position": "top"
},
"label": {
"enable": true,
"showDimension": true,
"showValue": true
},
"tooltip": {
"enable": true
}
}
return <VSeedRender vseed={vseedConfig} />
}#Multiple Hierarchy Dimensions + One Measure
This example shows a hierarchical flow from region to country and then to channel, with a single measure controlling the flow size.
import { VSeedRender } from '@components'
export default () => {
const vseedConfig = {
"chartType": "hierarchySankey",
"dataset": [
{
"region": "North China",
"country": "China",
"channel": "Direct",
"revenue": 42
},
{
"region": "North China",
"country": "China",
"channel": "Partner",
"revenue": 18
},
{
"region": "East China",
"country": "China",
"channel": "Direct",
"revenue": 36
},
{
"region": "East China",
"country": "China",
"channel": "E-commerce",
"revenue": 22
},
{
"region": "Southeast Asia",
"country": "Singapore",
"channel": "Direct",
"revenue": 15
},
{
"region": "Southeast Asia",
"country": "Malaysia",
"channel": "Partner",
"revenue": 12
}
],
"dimensions": [
{
"id": "region",
"alias": "Region"
},
{
"id": "country",
"alias": "Country"
},
{
"id": "channel",
"alias": "Channel"
}
],
"measures": [
{
"id": "revenue",
"alias": "Revenue"
}
],
"legend": {
"enable": true,
"position": "top"
},
"label": {
"enable": true,
"showDimension": true,
"showValue": true
},
"tooltip": {
"enable": true
}
}
return <VSeedRender vseed={vseedConfig} />
}#Pivot Hierarchy Sankey
A pivoted hierarchy sankey grouped by region and year. Region is mapped to rows, year is mapped to columns, and each pivot cell renders an independent hierarchy flow tree.
import { VSeedRender } from '@components'
export default () => {
const vseedConfig = {
"chartType": "hierarchySankey",
"dataset": [
{
"region": "East",
"year": "2023",
"country": "China",
"city": "Shanghai",
"channel": "Direct",
"sales": 35
},
{
"region": "East",
"year": "2023",
"country": "China",
"city": "Hangzhou",
"channel": "Partner",
"sales": 20
},
{
"region": "East",
"year": "2023",
"country": "Japan",
"city": "Tokyo",
"channel": "Direct",
"sales": 18
},
{
"region": "East",
"year": "2024",
"country": "China",
"city": "Shanghai",
"channel": "Direct",
"sales": 42
},
{
"region": "East",
"year": "2024",
"country": "China",
"city": "Nanjing",
"channel": "E-commerce",
"sales": 16
},
{
"region": "East",
"year": "2024",
"country": "Japan",
"city": "Osaka",
"channel": "Partner",
"sales": 14
},
{
"region": "West",
"year": "2023",
"country": "Germany",
"city": "Berlin",
"channel": "Direct",
"sales": 22
},
{
"region": "West",
"year": "2023",
"country": "France",
"city": "Paris",
"channel": "Partner",
"sales": 19
},
{
"region": "West",
"year": "2023",
"country": "France",
"city": "Lyon",
"channel": "Direct",
"sales": 11
},
{
"region": "West",
"year": "2024",
"country": "Germany",
"city": "Munich",
"channel": "Direct",
"sales": 26
},
{
"region": "West",
"year": "2024",
"country": "France",
"city": "Paris",
"channel": "E-commerce",
"sales": 17
},
{
"region": "West",
"year": "2024",
"country": "Spain",
"city": "Madrid",
"channel": "Partner",
"sales": 13
}
],
"dimensions": [
{
"id": "country",
"alias": "Country",
"encoding": "hierarchy"
},
{
"id": "city",
"alias": "City",
"encoding": "hierarchy"
},
{
"id": "channel",
"alias": "Channel",
"encoding": "hierarchy"
},
{
"id": "region",
"alias": "Region",
"encoding": "row"
},
{
"id": "year",
"alias": "Year",
"encoding": "column"
}
],
"measures": [
{
"id": "sales",
"alias": "Sales"
}
],
"color": {
"colorScheme": [
"#0B6CFF",
"#3B8BFF",
"#00A6A6",
"#4DC3B2",
"#FF8A00",
"#FFB347",
"#7B61FF",
"#B39DFF"
]
},
"legend": {
"enable": true,
"position": "top"
},
"label": {
"enable": true,
"showDimension": true,
"showValue": true
},
"tooltip": {
"enable": true
}
}
return <VSeedRender vseed={vseedConfig} />
}#Measure Name As A Hierarchy Dimension + One Measure
This example places the measure name itself on the hierarchy path, so each region flows into different business metrics while a single numeric measure controls the magnitude.
import { VSeedRender } from '@components'
export default () => {
const vseedConfig = {
"chartType": "hierarchySankey",
"dataset": [
{
"region": "North China",
"metricName": "Revenue",
"value": 42
},
{
"region": "North China",
"metricName": "Profit",
"value": 12
},
{
"region": "East China",
"metricName": "Revenue",
"value": 36
},
{
"region": "East China",
"metricName": "Profit",
"value": 10
},
{
"region": "South China",
"metricName": "Revenue",
"value": 28
},
{
"region": "South China",
"metricName": "Profit",
"value": 8
}
],
"dimensions": [
{
"id": "region",
"alias": "Region"
},
{
"id": "metricName",
"alias": "Metric Name"
}
],
"measures": [
{
"id": "value",
"alias": "Metric Value"
}
],
"legend": {
"enable": true,
"position": "top"
},
"label": {
"enable": true,
"showDimension": true,
"showValue": true
},
"tooltip": {
"enable": true
}
}
return <VSeedRender vseed={vseedConfig} />
}