Graflume · Alpha
Hierarchy · Basic implementation · Common features
Compare categorical proportions through the area of space-filling tiles. Start with only the required data and family encoding. Expand the code to run the same example. Use the tabs to compare header, tooltip, theme, legend, highlight, callout, selection, view controls, and accessibility one feature at a time.
Chart family · Default families
Hierarchy
Compare categorical proportions through the area of space-filling tiles.
- Quick API
treemap()- Browser snapshot
graflume- mark
treemap- Presets
- 7
Basic implementation
The smallest runnable chart
Start with only the required data and family encoding. Expand the code to run the same example.
Basic example
Compare categorical proportions through the area of space-filling tiles.
StatusLoading
minimal-implementation
Loading
Basic example · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Common features
Features shared by every chart
Use the tabs to compare header, tooltip, theme, legend, highlight, callout, selection, view controls, and accessibility one feature at a time. Hover over a data mark. On supported charts, move the pointer along the axis to see the nearest value. All exact values are available in the table below.
Header
Add a chart title and supporting description inside the visualization.
StatusLoading
header
Loading
Header · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"title": {
"subtitle": "Tree map uses runnable data and options to demonstrate nested icicle.",
"text": "Hierarchy"
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"title": {
"subtitle": "Tree map uses runnable data and options to demonstrate nested icicle.",
"text": "Hierarchy"
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Tooltip
Reveal exact values from a mark or axis position. Authors can choose locale-aware date/time styles and a time zone with declarative options.
StatusLoading
tooltip
Loading
Tooltip · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"hover": true,
"tooltip": {
"fields": [
{
"field": "id",
"format": "auto",
"label": "Id"
},
{
"field": "value",
"format": "number",
"label": "Value"
},
{
"field": "parent",
"format": "auto",
"label": "Parent"
}
],
"title": "Hierarchy · Tooltip",
"trigger": "mark"
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"hover": true,
"tooltip": {
"fields": [
{
"field": "id",
"format": "auto",
"label": "Id"
},
{
"field": "value",
"format": "number",
"label": "Value"
},
{
"field": "parent",
"format": "auto",
"label": "Parent"
}
],
"title": "Hierarchy · Tooltip",
"trigger": "mark"
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Theme
Apply the current built-in theme from the selector and update every active example together.
StatusLoading
theme
Loading
Theme · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"theme": "graflume-light",
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"theme": "graflume-light",
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Legend
Explain the visual meaning of layers, categories, or continuous values.
StatusLoading
legend
- Legend:
legend · explicit · 1 channels
Loading
Legend · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"legend": {
"interactive": false,
"items": [
{
"id": "semantic-0",
"label": "Value"
}
],
"labels": {
"hide": "Hide",
"show": "Show"
},
"maxItems": 8,
"mode": "layers",
"orientation": "horizontal",
"position": "bottom",
"title": "Hierarchy · Legend",
"visible": true
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"legend": {
"interactive": false,
"items": [
{
"id": "semantic-0",
"label": "Value"
}
],
"labels": {
"hide": "Hide",
"show": "Show"
},
"maxItems": 8,
"mode": "layers",
"orientation": "horizontal",
"position": "bottom",
"title": "Hierarchy · Legend",
"visible": true
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Highlight
Emphasize a representative datum or spatial position to guide inspection.
StatusLoading
highlight
- Point and range highlights:
highlights[] · datum · id
Loading
Highlight · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"highlights": [
{
"id": "manual-focus",
"padding": 7,
"target": {
"field": "id",
"type": "datum",
"value": "Spatial charts"
}
}
],
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"highlights": [
{
"id": "manual-focus",
"padding": 7,
"target": {
"field": "id",
"type": "datum",
"value": "Spatial charts"
}
}
],
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Callout
Show an explanatory callout with automatic collision avoidance and multilingual wrapping.
StatusLoading
callout
- Custom callouts:
annotations[] · datum · id · callout · placement:auto
Loading
Callout · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"annotations": [
{
"connector": {
"visible": true
},
"detail": "Attach user-authored safe text to a datum, axis range, or normalized plot position.",
"id": "manual-callout",
"placement": "auto",
"style": {
"maxWidth": 220,
"padding": 8
},
"target": {
"field": "id",
"type": "datum",
"value": "Spatial charts"
},
"text": "Point and range highlights · Spatial charts"
}
],
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"controls": {
"annotations": true,
"labels": {
"controls": "Chart controls",
"enterFullscreen": "Enter fullscreen",
"exitFullscreen": "Exit fullscreen",
"exportPng": "Download PNG",
"hideAnnotations": "Hide callouts",
"loop": "Loop playback",
"nextFrame": "Next frame",
"pause": "Pause",
"play": "Play",
"previousFrame": "Previous frame",
"reset": "Reset view",
"seek": "Playback position",
"showAnnotations": "Show callouts",
"speed": "Playback speed",
"zoomIn": "Zoom in",
"zoomOut": "Zoom out"
}
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"annotations": [
{
"connector": {
"visible": true
},
"detail": "Attach user-authored safe text to a datum, axis range, or normalized plot position.",
"id": "manual-callout",
"placement": "auto",
"style": {
"maxWidth": 220,
"padding": 8
},
"target": {
"field": "id",
"type": "datum",
"value": "Spatial charts"
},
"text": "Point and range highlights · Spatial charts"
}
],
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"controls": {
"annotations": true,
"labels": {
"controls": "Chart controls",
"enterFullscreen": "Enter fullscreen",
"exitFullscreen": "Exit fullscreen",
"exportPng": "Download PNG",
"hideAnnotations": "Hide callouts",
"loop": "Loop playback",
"nextFrame": "Next frame",
"pause": "Pause",
"play": "Play",
"previousFrame": "Previous frame",
"reset": "Reset view",
"seek": "Playback position",
"showAnnotations": "Show callouts",
"speed": "Playback speed",
"zoomIn": "Zoom in",
"zoomOut": "Zoom out"
}
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Selection
Select and toggle data, then clear it from the background or Escape key.
StatusLoading
selection
- Interactive selection:
selection · multiple · toggle
Loading
Selection · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"selection": {
"ariaLabel": "Interactive selection",
"clearOnBackground": true,
"clearOnEscape": true,
"highlight": {
"padding": 5
},
"key": "id",
"mode": "multiple",
"toggle": true
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"selection": {
"ariaLabel": "Interactive selection",
"clearOnBackground": true,
"clearOnEscape": true,
"highlight": {
"padding": 5
},
"key": "id",
"mode": "multiple",
"toggle": true
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}View controls
Show or hide zoom, pan, reset, projection, fullscreen, and PNG export one menu at a time. Set controls: false to remove the entire toolbar.
StatusLoading
controls
Loading
View controls · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"controls": {
"annotations": false,
"export": true,
"fullscreen": true,
"labels": {
"controls": "Chart controls",
"enterFullscreen": "Enter fullscreen",
"exitFullscreen": "Exit fullscreen",
"exportPng": "Download PNG",
"hideAnnotations": "Hide callouts",
"loop": "Loop playback",
"nextFrame": "Next frame",
"pause": "Pause",
"play": "Play",
"previousFrame": "Previous frame",
"reset": "Reset view",
"seek": "Playback position",
"showAnnotations": "Show callouts",
"speed": "Playback speed",
"zoomIn": "Zoom in",
"zoomOut": "Zoom out"
},
"playback": false,
"reset": true,
"zoom": true
},
"navigation": {
"drag": true,
"keyboard": true,
"maxZoom": 6,
"minZoom": 1,
"pinch": true,
"wheel": "modifier"
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"padding": {
"top": 52
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"axes": {
"x": false,
"y": false
},
"height": 620,
"interaction": {
"controls": {
"annotations": false,
"export": true,
"fullscreen": true,
"labels": {
"controls": "Chart controls",
"enterFullscreen": "Enter fullscreen",
"exitFullscreen": "Exit fullscreen",
"exportPng": "Download PNG",
"hideAnnotations": "Hide callouts",
"loop": "Loop playback",
"nextFrame": "Next frame",
"pause": "Pause",
"play": "Play",
"previousFrame": "Previous frame",
"reset": "Reset view",
"seek": "Playback position",
"showAnnotations": "Show callouts",
"speed": "Playback speed",
"zoomIn": "Zoom in",
"zoomOut": "Zoom out"
},
"playback": false,
"reset": true,
"zoom": true
},
"navigation": {
"drag": true,
"keyboard": true,
"maxZoom": 6,
"minZoom": 1,
"pinch": true,
"wheel": "modifier"
}
},
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"padding": {
"top": 52
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}Accessibility
Pair ARIA descriptions and keyboard guidance with a semantic data table.
StatusLoading
accessibility
Loading
Accessibility · Row data
Row data and zero-copy TypedArray columns share one data contract.
idordinal | valuequantitative | parentordinal |
|---|---|---|
| Statground | 100 | — |
| Visualization | 46 | Statground |
| Data products | 34 | Statground |
| Documentation | 20 | Statground |
| Canvas charts | 28 | Visualization |
| Spatial charts | 18 | Visualization |
| Catalog | 14 | Data products |
| Workbench | 12 | Data products |
| Pipelines | 8 | Data products |
| Guides | 12 | Documentation |
| Examples | 8 | Documentation |
Browser API · Portable schema
Browser API
Graflume.treemap()
const data = [
{
"id": "Statground",
"parent": "",
"value": 100
},
{
"id": "Visualization",
"parent": "Statground",
"value": 46
},
{
"id": "Data products",
"parent": "Statground",
"value": 34
},
{
"id": "Documentation",
"parent": "Statground",
"value": 20
},
{
"id": "Canvas charts",
"parent": "Visualization",
"value": 28
},
{
"id": "Spatial charts",
"parent": "Visualization",
"value": 18
},
{
"id": "Catalog",
"parent": "Data products",
"value": 14
},
{
"id": "Workbench",
"parent": "Data products",
"value": 12
},
{
"id": "Pipelines",
"parent": "Data products",
"value": 8
},
{
"id": "Guides",
"parent": "Documentation",
"value": 12
},
{
"id": "Examples",
"parent": "Documentation",
"value": 8
}
];
const options = {
"accessibility": {
"description": "Zoom and pan inspect the rendered surface without changing data axes or values. When playback controls are available, they move through real steps in the order each unique value first appears in the source data.",
"label": "Hierarchy · Accessibility example"
},
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
};
Graflume.treemap('#chart', data, options);Portable schema
ChartSpec 0.1 · options
{
"accessibility": {
"description": "Zoom and pan inspect the rendered surface without changing data axes or values. When playback controls are available, they move through real steps in the order each unique value first appears in the source data.",
"label": "Hierarchy · Accessibility example"
},
"axes": {
"x": false,
"y": false
},
"height": 620,
"locale": "en",
"mark": {
"fields": {
"parent": "parent"
}
},
"width": "container",
"x": {
"field": "id",
"title": "Portfolio node",
"type": "ordinal"
},
"y": {
"field": "value",
"title": "Relative investment",
"type": "quantitative"
}
}