Skip to content

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 pixels

Chart Types

Plot Engine (default)

TypeDescription
barVertical or horizontal bar chart
lineLine chart
areaArea chart
scatterScatter plot
piePie chart
donutDonut chart

D3 Engine (requires engine: d3)

Hierarchical:

TypeDescription
treemapNested rectangles
sunburstRadial hierarchy
circle-packingNested circles
dendrogramTree diagram
tidy-treeClean tree layout
icicleRectangular partition

Network:

TypeDescription
sankeyFlow diagram
force-directedNetwork graph
chordChord diagram
directed-chordDirected chord
arc-diagramLinear arc layout
edge-bundlingBundled edges
parallel-setsCategory flows

Statistical:

TypeDescription
boxplotBox and whisker
violinViolin plot
histogramFrequency distribution
ridgelineOverlapping densities
contour2D density
beeswarmDot swarm

Financial:

TypeDescription
candlestickOHLC chart
bollingerBollinger bands
horizonHorizon chart

Radial:

TypeDescription
radial-barCircular bars
radial-areaWind rose

Comparison:

TypeDescription
slopeBefore/after
parallel-coordsMulti-dimensional

Animated:

TypeDescription
bar-raceAnimated ranking
streamgraphFlowing areas

Interactive:

TypeDescription
brushable-scatterSelectable 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 query

Position Channels

PropertyTypeDescription
xstringX axis field name
ystring/arrayY axis field (array for slope charts)
colorstringField for color encoding
rstring/numberRadius field or constant (scatter/bubble)
symbolstringSymbol shape field

Dimensions

PropertyTypeDefaultDescription
widthnumber640Chart width (50-5000)
heightnumber400Chart height (50-5000)
minWidthnumber-Minimum responsive width
maxWidthnumber/string-Maximum width (number or "N%")

Labels

PropertyTypeDescription
titlestringChart title
subtitlestringChart subtitle
xLabelstringX axis label
yLabelstringY axis label

Layout

yaml
layout: standard           # Preset name (simple)

# Or with options:
layout:
  preset: standard         # standard, compact, dashboard, presentation
  minWidth: 400
  maxWidth: 900

Presets:

PresetDescription
standardDefault layout with title and legend
compactMinimal layout, smaller margins
dashboardSilent mode, external legend
presentationLarge centered title

Metadata

yaml
metadata:
  points: auto            # Show data point count ('auto' or number)
  source: "USGS Data"     # Data source attribution

Hierarchy 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 field

Faceting

Split chart into multiple panels:

yaml
facet:
  x: category             # Facet by column
  y: year                 # Facet by row
  wrap: 3                 # Columns before wrapping

Marks

Define multiple visual layers:

yaml
marks:
  - type: line
  - type: dot
    r: 4
  - type: text
    text: label

See 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: 10

See Transformations for all types.


Style Options

PropertyTypeDefaultDescription
gridbooleantrueShow grid lines
stackbooleanfalseStack areas/bars
horizontalbooleanfalseHorizontal orientation (bar)
curvestring"linear"Line interpolation
opacitynumber1Fill opacity (0-1)
innerRadiusnumber0.5Donut hole size (0-1)
centerLabelstring-Donut center text

Curve Options

For line and area charts:

ValueDescription
linearStraight lines (default)
naturalSmooth natural spline
stepStep function
step-beforeStep before point
step-afterStep after point
basisB-spline
cardinalCardinal spline
catmull-romCatmull-Rom spline
monotone-xMonotonic 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

Released under the MIT License.