Skip to main content

Hierarchical and Relational Data Charts with Vizly

Not all data fits in a flat table. Hierarchies, trees, flows, and networks need specialized visualizations. Vizly provides sunburst, treemap, tree, graph, and sankey charts - all with the same DataFrame or dict interface. v1.0.1 accepts pd.DataFrame, list[dict], or dict[list] directly. Use chart.render('file.html') to write to a file or chart.to_html() for a string.

Sunburst for hierarchical proportions

Show nested categories as concentric rings. The center is the root, each ring outward is a deeper level.

import pandas as pd
import vizly as vz

vz.set_theme("corporate")

df = pd.DataFrame({
'name': ['Product', 'Platform', 'Analytics', 'Charts', 'Maps',
'Integrations', 'Streamlit', 'FastAPI', 'Docs'],
'parent': [None, 'Product', 'Product', 'Platform', 'Platform',
'Product', 'Integrations', 'Integrations', 'Product'],
'value': [100, 40, 28, 22, 18, 24, 12, 12, 16],
})
chart = vz.sunburst(df, names='name', values='value', parent='parent',
title='Product tree', theme='corporate')
chart.to_html()

Treemap for nested proportions with area encoding

Treemaps show hierarchical data as nested rectangles. Area encodes value, making large contributions immediately visible.

import pandas as pd
import vizly as vz

df = pd.DataFrame({
'name': ['Enterprise', 'Mid-market', 'SMB', 'Startup', 'Partner'],
'value': [34, 26, 18, 12, 10],
})
chart = vz.treemap(df, title='Segment mix by revenue', theme='corporate')

Tree diagram for org structures

A traditional node-link tree for organizational charts, decision trees, or taxonomy.

import pandas as pd
import vizly as vz

df = pd.DataFrame({
'name': ['CEO', 'Engineering', 'Product', 'Sales', 'Marketing',
'Frontend', 'Backend', 'Infra', 'Analytics', 'Core'],
'parent': [None, 'CEO', 'CEO', 'CEO', 'CEO',
'Engineering', 'Engineering', 'Engineering', 'Product', 'Product'],
'value': [100, 40, 25, 20, 15, 15, 12, 13, 13, 12],
})
chart = vz.tree(df, names='name', parent='parent',
title='Organization tree', theme='corporate')

Sankey diagram for flow analysis

Show volume movement between stages or categories. Width of each flow encodes magnitude.

import pandas as pd
import vizly as vz

df = pd.DataFrame({
'source': ['Traffic', 'Traffic', 'Traffic', 'Organic', 'Paid',
'Referral', 'Signup', 'Signup', 'Trial'],
'target': ['Organic', 'Paid', 'Referral', 'Signup', 'Signup',
'Signup', 'Trial', 'Churn', 'Paid plan'],
'value': [48, 32, 20, 36, 24, 14, 42, 12, 30],
})
chart = vz.sankey(df, title='User acquisition flow', theme='corporate')

Graph / network diagram

Visualize nodes and edges in a force-directed layout. Great for network analysis, dependency graphs, and relationship mapping.

import pandas as pd
import vizly as vz

# Same format as sankey: source, target, value
df = pd.DataFrame({
'source': ['Traffic', 'Traffic', 'Traffic', 'Organic', 'Paid',
'Referral', 'Signup', 'Signup', 'Trial'],
'target': ['Organic', 'Paid', 'Referral', 'Signup', 'Signup',
'Signup', 'Trial', 'Churn', 'Paid plan'],
'value': [48, 32, 20, 36, 24, 14, 42, 12, 30],
})
chart = vz.graph(df, title='Acquisition graph', theme='corporate')

Full hierarchical dashboard

Combine all hierarchical views to explore data from every angle.

import pandas as pd
import vizly as vz

vz.set_theme("corporate")

df_hier = pd.DataFrame({
'name': ['Product', 'Platform', 'Analytics', 'Charts', 'Maps',
'Integrations', 'Streamlit', 'FastAPI', 'Docs'],
'parent': [None, 'Product', 'Product', 'Platform', 'Platform',
'Product', 'Integrations', 'Integrations', 'Product'],
'value': [100, 40, 28, 22, 18, 24, 12, 12, 16],
})
df_flow = pd.DataFrame({
'source': ['Traffic', 'Traffic', 'Traffic', 'Organic', 'Paid',
'Referral', 'Signup', 'Signup', 'Trial'],
'target': ['Organic', 'Paid', 'Referral', 'Signup', 'Signup',
'Signup', 'Trial', 'Churn', 'Paid plan'],
'value': [48, 32, 20, 36, 24, 14, 42, 12, 30],
})

chart = vz.page(charts=[
vz.sunburst(df_hier, names='name', values='value', parent='parent',
title='Product hierarchy'),
vz.sankey(df_flow, title='User flow'),
vz.graph(df_flow, title='Network view'),
], title="Hierarchical Data Dashboard")
chart.to_html()

Chart type guide

ChartBest forData shape
sunburstNested proportions, category hierarchyname, parent, value
treemapArea-encoded hierarchy, budget allocationname, value (or name, parent, value)
treeOrg charts, decision trees, taxonomyname, parent
sankeyFlow volume between stagessource, target, value
graphForce-directed networks, relationshipssource, target, value