YAML Schema Reference
Complete reference for all DataGlass chart configuration options.
Basic Structure
yaml
type: bar # Chart type (required for simple charts)
engine: plot # Rendering engine (plot or d3)
data: # Data source (required)
file: data.csv
x: category # X axis field
y: value # Y axis field
color: group # Color by field
title: "My Chart" # Chart title
width: 640 # Width in pixels
height: 400 # Height in pixelsChart Types
Plot Engine (default)
| Type | Description |
|---|---|
bar | Vertical or horizontal bar chart |
line | Line chart |
area | Area chart |
scatter | Scatter plot |
pie | Pie chart |
donut | Donut chart |
D3 Engine (requires engine: d3)
Hierarchical:
| Type | Description |
|---|---|
treemap | Nested rectangles |
sunburst | Radial hierarchy |
circle-packing | Nested circles |
dendrogram | Tree diagram |
tidy-tree | Clean tree layout |
icicle | Rectangular partition |
Network:
| Type | Description |
|---|---|
sankey | Flow diagram |
force-directed | Network graph |
chord | Chord diagram |
directed-chord | Directed chord |
arc-diagram | Linear arc layout |
edge-bundling | Bundled edges |
parallel-sets | Category flows |
Statistical:
| Type | Description |
|---|---|
boxplot | Box and whisker |
violin | Violin plot |
histogram | Frequency distribution |
ridgeline | Overlapping densities |
contour | 2D density |
beeswarm | Dot swarm |
Financial:
| Type | Description |
|---|---|
candlestick | OHLC chart |
bollinger | Bollinger bands |
horizon | Horizon chart |
Radial:
| Type | Description |
|---|---|
radial-bar | Circular bars |
radial-area | Wind rose |
Comparison:
| Type | Description |
|---|---|
slope | Before/after |
parallel-coords | Multi-dimensional |
Animated:
| Type | Description |
|---|---|
bar-race | Animated ranking |
streamgraph | Flowing areas |
Interactive:
| Type | Description |
|---|---|
brushable-scatter | Selectable scatter |
Data Configuration
yaml
data:
# Choose ONE source type:
source: '[{"x": 1, "y": 2}]' # Inline JSON
file: data/sales.csv # Local file
file: "#Heading Name" # Heading table reference
url: "https://api.example.com" # External URL
query: "from:Projects" # Vault queryPosition Channels
| Property | Type | Description |
|---|---|---|
x | string | X axis field name |
y | string/array | Y axis field (array for slope charts) |
color | string | Field for color encoding |
r | string/number | Radius field or constant (scatter/bubble) |
symbol | string | Symbol shape field |
Dimensions
| Property | Type | Default | Description |
|---|---|---|---|
width | number | 640 | Chart width (50-5000) |
height | number | 400 | Chart height (50-5000) |
minWidth | number | - | Minimum responsive width |
maxWidth | number/string | - | Maximum width (number or "N%") |
Labels
| Property | Type | Description |
|---|---|---|
title | string | Chart title |
subtitle | string | Chart subtitle |
xLabel | string | X axis label |
yLabel | string | Y axis label |
Layout
yaml
layout: standard # Preset name (simple)
# Or with options:
layout:
preset: standard # standard, compact, dashboard, presentation
minWidth: 400
maxWidth: 900Presets:
| Preset | Description |
|---|---|
standard | Default layout with title and legend |
compact | Minimal layout, smaller margins |
dashboard | Silent mode, external legend |
presentation | Large centered title |
Metadata
yaml
metadata:
points: auto # Show data point count ('auto' or number)
source: "USGS Data" # Data source attributionHierarchy Configuration
For hierarchical charts (treemap, sunburst, etc.):
yaml
hierarchy:
id: name # Node identifier field
parent: parent # Parent reference field
value: size # Node size field (optional for tree charts)Network Configuration
For network charts (sankey, force-directed, chord):
yaml
network:
source: from # Source node field
target: to # Target node field
value: weight # Edge weight fieldFaceting
Split chart into multiple panels:
yaml
facet:
x: category # Facet by column
y: year # Facet by row
wrap: 3 # Columns before wrappingMarks
Define multiple visual layers:
yaml
marks:
- type: line
- type: dot
r: 4
- type: text
text: labelSee Marks Reference for all mark types.
Scales
Configure axis and color scales:
yaml
scales:
x:
type: time
nice: true
y:
domain: [0, 100]
color:
scheme: "tableau10"See Scales Reference for all options.
Transformations
Process data before rendering:
yaml
transformations:
- type: filter
configuration:
where: { status: { eq: "active" } }
- type: aggregate
configuration:
groupBy: ["category"]
sum: ["value"]
- type: sort
configuration:
by: [{ column: "value", direction: "desc" }]
- type: limit
configuration:
count: 10See Transformations for all types.
Style Options
| Property | Type | Default | Description |
|---|---|---|---|
grid | boolean | true | Show grid lines |
stack | boolean | false | Stack areas/bars |
horizontal | boolean | false | Horizontal orientation (bar) |
curve | string | "linear" | Line interpolation |
opacity | number | 1 | Fill opacity (0-1) |
innerRadius | number | 0.5 | Donut hole size (0-1) |
centerLabel | string | - | Donut center text |
Curve Options
For line and area charts:
| Value | Description |
|---|---|
linear | Straight lines (default) |
natural | Smooth natural spline |
step | Step function |
step-before | Step before point |
step-after | Step after point |
basis | B-spline |
cardinal | Cardinal spline |
catmull-rom | Catmull-Rom spline |
monotone-x | Monotonic in x |
Complete Example
yaml
type: bar
engine: plot
data:
file: data/sales.csv
transformations:
- type: aggregate
configuration:
groupBy: ["region"]
sum: ["revenue"]
- type: sort
configuration:
by: [{ column: "revenue_sum", direction: "desc" }]
- type: limit
configuration:
count: 10
x: region
y: revenue_sum
color: region
title: "Top 10 Regions by Revenue"
subtitle: "Q4 2024 Sales Data"
width: 800
height: 500
scales:
y:
nice: true
color:
scheme: "tableau10"
layout:
preset: standard
metadata:
points: auto
source: "Sales Database"See Also
- Marks Reference - All mark types
- Scales Reference - Scale configuration
- Transformations - Data processing
- Cheat Sheet - Quick reference