@blueprint-chart/docs 1.8.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -5
- package/src/charts/area-stacked.md +49 -1
- package/src/charts/area.md +48 -2
- package/src/charts/bar-grouped.md +45 -1
- package/src/charts/bar-horizontal.md +46 -0
- package/src/charts/bar-multi.md +44 -1
- package/src/charts/bar-split.md +43 -0
- package/src/charts/bar-stacked.md +47 -2
- package/src/charts/bar-vertical.md +46 -0
- package/src/charts/column-stacked.md +47 -3
- package/src/charts/donut.md +27 -1
- package/src/charts/line-multi.md +52 -1
- package/src/charts/line.md +47 -1
- package/src/charts/pie.md +27 -1
- package/src/guide/data-transforms.md +13 -12
- package/src/guide/dsl-editor.md +0 -1
- package/src/handbook/axes.md +8 -0
- package/src/handbook/frame-elements.md +2 -2
- package/src/handbook/tooltips.md +2 -1
- package/src/reference/api/index.md +3 -3
- package/src/reference/dsl/annotations.md +3 -2
- package/src/reference/dsl/index.md +2 -2
- package/src/reference/dsl/properties.md +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprint-chart/docs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Public documentation for Blueprint Chart — handbook, guide, BPC DSL spec, and lib API reference.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"provenance": true
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
+
"@blueprint-chart/lib": "2.0.0",
|
|
37
|
+
"@blueprint-chart/ui": "2.0.0",
|
|
36
38
|
"@fontsource-variable/geist": "^5.3.0",
|
|
37
39
|
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
38
40
|
"@fontsource/dm-serif-display": "^5.3.0",
|
|
@@ -50,18 +52,17 @@
|
|
|
50
52
|
"unplugin-icons": "^23.0.1",
|
|
51
53
|
"vitepress": "^1.6.4",
|
|
52
54
|
"vitest": "^4.1.10",
|
|
53
|
-
"vue": "^3.5.41"
|
|
54
|
-
"@blueprint-chart/lib": "1.8.2",
|
|
55
|
-
"@blueprint-chart/ui": "1.8.2"
|
|
55
|
+
"vue": "^3.5.41"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"dev": "vitepress dev src --host 0.0.0.0 --port 4445",
|
|
59
59
|
"build:vitepress": "vitepress build src",
|
|
60
|
+
"build:options": "tsx scripts/build-options.ts",
|
|
60
61
|
"build:manifest": "tsx scripts/build-manifest.ts",
|
|
61
62
|
"build:llms-full": "tsx scripts/build-llms-full.ts",
|
|
62
63
|
"build:api": "tsc --project tsconfig.api.json",
|
|
63
64
|
"build:package": "pnpm run build:manifest && pnpm run build:api",
|
|
64
|
-
"build": "pnpm run build:llms-full && pnpm run build:vitepress && pnpm run build:package",
|
|
65
|
+
"build": "pnpm run build:options && pnpm run build:llms-full && pnpm run build:vitepress && pnpm run build:package",
|
|
65
66
|
"preview": "vitepress preview src --host 0.0.0.0 --port 4445",
|
|
66
67
|
"test": "vitest run"
|
|
67
68
|
}
|
|
@@ -6,7 +6,7 @@ title: Stacked area chart
|
|
|
6
6
|
|
|
7
7
|
> Multi-series stacked area chart for composition over time; supports percent stacking.
|
|
8
8
|
|
|
9
|
-
`area-stacked` layers multiple series on top of each other so readers can see both the individual trends and the cumulative total. Set `stackPercent = true` to switch to a 100 % normalised view.
|
|
9
|
+
`area-stacked` layers multiple series on top of each other so readers can see both the individual trends and the cumulative total. Set `stackPercent = true` to switch to a 100 % normalised view. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -46,6 +46,54 @@ chart area-stacked {
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
<!-- options:start -->
|
|
50
|
+
|
|
51
|
+
## Properties
|
|
52
|
+
|
|
53
|
+
Every property `area-stacked` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
54
|
+
|
|
55
|
+
| Property | Type | Default |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `colors` | colors | (unset) |
|
|
58
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
59
|
+
| `autoContrast` | boolean | `false` |
|
|
60
|
+
| `allowDarkMode` | boolean | `true` |
|
|
61
|
+
| `areaFillOpacity` | text | `0.85` |
|
|
62
|
+
| `interpolation` | select: `linear`, `monotoneX`, `step`, `stepBefore`, `stepAfter`, `basis`, `cardinal`, `catmullRom` | `monotoneX` |
|
|
63
|
+
| `edgePadding` | boolean | `false` |
|
|
64
|
+
| `areaSortMode` | select: `none`, `ascending`, `descending` | `none` |
|
|
65
|
+
| `stacked` | boolean | `true` |
|
|
66
|
+
| `stackPercent` | boolean | `false` |
|
|
67
|
+
| `areaLines` | boolean | `true` |
|
|
68
|
+
| `legend` | boolean | `true` |
|
|
69
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
70
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
71
|
+
| `directLabelling` | select: `""`, `auto`, `outside`, `inside` | `""` |
|
|
72
|
+
| `showVerticalAxis` | boolean | `false` |
|
|
73
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
74
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
75
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
76
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `dashed` |
|
|
77
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
78
|
+
| `verticalScaleType` | select: `linear`, `log` | `linear` |
|
|
79
|
+
| `verticalRangeMin` | text | (unset) |
|
|
80
|
+
| `verticalRangeMax` | text | (unset) |
|
|
81
|
+
| `showHorizontalAxis` | boolean | `true` |
|
|
82
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
83
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
84
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
85
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
86
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
87
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
88
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
89
|
+
| `tooltips` | boolean | `false` |
|
|
90
|
+
| `crosshair` | boolean | `true` |
|
|
91
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `vertical` |
|
|
92
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
93
|
+
| `crosshairColor` | text | `#999` |
|
|
94
|
+
|
|
95
|
+
<!-- options:end -->
|
|
96
|
+
|
|
49
97
|
## Common pitfalls
|
|
50
98
|
|
|
51
99
|
- Series above the baseline are hard to compare — put the most important one at the bottom
|
package/src/charts/area.md
CHANGED
|
@@ -6,7 +6,7 @@ title: Area chart
|
|
|
6
6
|
|
|
7
7
|
> Single-series area chart for magnitude over time; pairs with `areaFill`.
|
|
8
8
|
|
|
9
|
-
`area` is a line chart with the region below the line filled in, emphasising the magnitude of a single series rather than just its direction.
|
|
9
|
+
`area` is a line chart with the region below the line filled in, emphasising the magnitude of a single series rather than just its direction. See [Properties](#properties) for every key it accepts. The `area-fill` block that shades a band between two series is rendered by [`line-multi`](./line-multi), not here.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -47,10 +47,56 @@ chart area {
|
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
<!-- options:start -->
|
|
51
|
+
|
|
52
|
+
## Properties
|
|
53
|
+
|
|
54
|
+
Every property `area` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
55
|
+
|
|
56
|
+
| Property | Type | Default |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `colors` | colors | (unset) |
|
|
59
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
60
|
+
| `autoContrast` | boolean | `false` |
|
|
61
|
+
| `allowDarkMode` | boolean | `true` |
|
|
62
|
+
| `interpolation` | select: `linear`, `monotoneX`, `step`, `stepBefore`, `stepAfter`, `basis`, `cardinal`, `catmullRom` | `monotoneX` |
|
|
63
|
+
| `edgePadding` | boolean | `false` |
|
|
64
|
+
| `showVerticalAxis` | boolean | `false` |
|
|
65
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
66
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
67
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
68
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `dashed` |
|
|
69
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
70
|
+
| `verticalScaleType` | select: `linear`, `log` | `linear` |
|
|
71
|
+
| `verticalRangeMin` | text | (unset) |
|
|
72
|
+
| `verticalRangeMax` | text | (unset) |
|
|
73
|
+
| `showHorizontalAxis` | boolean | `true` |
|
|
74
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
75
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
76
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
77
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
78
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
79
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
80
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
81
|
+
| `valueLabels` | boolean | `false` |
|
|
82
|
+
| `tooltips` | boolean | `false` |
|
|
83
|
+
| `crosshair` | boolean | `true` |
|
|
84
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `vertical` |
|
|
85
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
86
|
+
| `crosshairColor` | text | `#999` |
|
|
87
|
+
| `lineSymbols` | boolean | `false` |
|
|
88
|
+
| `lineSymbolShape` | select: `circle`, `square`, `diamond`, `triangle`, `triangleDown`, `cross`, `star` | `circle` |
|
|
89
|
+
| `lineSymbolShowOn` | select: `firstLast`, `first`, `last`, `all` | `firstLast` |
|
|
90
|
+
| `lineSymbolStyle` | select: `filled`, `hollow` | `filled` |
|
|
91
|
+
| `lineSymbolSize` | text | `3.5` |
|
|
92
|
+
| `lineSymbolOpacity` | text | `1` |
|
|
93
|
+
|
|
94
|
+
<!-- options:end -->
|
|
95
|
+
|
|
50
96
|
## Common pitfalls
|
|
51
97
|
|
|
52
98
|
- The y-axis must start at zero — the filled area encodes magnitude
|
|
53
|
-
-
|
|
99
|
+
- The fill sits at 0.25 opacity so the line stays readable, and `area` exposes no key to change it; [`area-stacked`](./area-stacked) does, via `areaFillOpacity`
|
|
54
100
|
- Don't stack two area charts by overlapping them; reach for [`area-stacked`](./area-stacked)
|
|
55
101
|
|
|
56
102
|
## Related types
|
|
@@ -6,7 +6,7 @@ title: Grouped bar chart
|
|
|
6
6
|
|
|
7
7
|
> Multi-series grouped vertical bar chart for grouped categorical comparison across a second dimension.
|
|
8
8
|
|
|
9
|
-
`bar-grouped` clusters bars from several series under each category, exposing a second dimension of comparison.
|
|
9
|
+
`bar-grouped` clusters bars from several series under each category, exposing a second dimension of comparison. Reorder categories with `sortMode`; the top-level `sort` property is read only by `bar-vertical`, `bar-horizontal`, and `donut`. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -42,6 +42,50 @@ chart bar-grouped {
|
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
|
|
45
|
+
<!-- options:start -->
|
|
46
|
+
|
|
47
|
+
## Properties
|
|
48
|
+
|
|
49
|
+
Every property `bar-grouped` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
50
|
+
|
|
51
|
+
| Property | Type | Default |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `colors` | colors | (unset) |
|
|
54
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
55
|
+
| `autoContrast` | boolean | `false` |
|
|
56
|
+
| `allowDarkMode` | boolean | `true` |
|
|
57
|
+
| `sortMode` | select: `none`, `total`, `within-groups` | `total` |
|
|
58
|
+
| `legend` | boolean | `true` |
|
|
59
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
60
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
61
|
+
| `barBackground` | boolean | `false` |
|
|
62
|
+
| `barSeparators` | boolean | `false` |
|
|
63
|
+
| `categoryLabelLine` | boolean | `false` |
|
|
64
|
+
| `showVerticalAxis` | boolean | `true` |
|
|
65
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
66
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
67
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
68
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
69
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
70
|
+
| `showHorizontalAxis` | boolean | `false` |
|
|
71
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
72
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `off` |
|
|
73
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
74
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
75
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
76
|
+
| `horizontalScaleType` | select: `linear`, `log` | `linear` |
|
|
77
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
78
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
79
|
+
| `valueLabels` | boolean | `true` |
|
|
80
|
+
| `valueLabelPosition` | select: `auto`, `outside`, `inside` | `auto` |
|
|
81
|
+
| `tooltips` | boolean | `false` |
|
|
82
|
+
| `crosshair` | boolean | `false` |
|
|
83
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `both` |
|
|
84
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
85
|
+
| `crosshairColor` | text | `#999` |
|
|
86
|
+
|
|
87
|
+
<!-- options:end -->
|
|
88
|
+
|
|
45
89
|
## Common pitfalls
|
|
46
90
|
|
|
47
91
|
- Too many bars per group overwhelms the reader — keep series to three or fewer
|
|
@@ -53,6 +53,52 @@ chart bar-horizontal {
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
<!-- options:start -->
|
|
57
|
+
|
|
58
|
+
## Properties
|
|
59
|
+
|
|
60
|
+
Every property `bar-horizontal` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
61
|
+
|
|
62
|
+
| Property | Type | Default |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `colors` | colors | (unset) |
|
|
65
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
66
|
+
| `autoContrast` | boolean | `false` |
|
|
67
|
+
| `allowDarkMode` | boolean | `true` |
|
|
68
|
+
| `swapLabelValue` | boolean | `false` |
|
|
69
|
+
| `barBackground` | boolean | `false` |
|
|
70
|
+
| `barSeparators` | boolean | `false` |
|
|
71
|
+
| `barGap` | text | `60` |
|
|
72
|
+
| `connectedColumns` | boolean | `false` |
|
|
73
|
+
| `connectionsOpacity` | text | `0.15` |
|
|
74
|
+
| `waterfall` | boolean | `false` |
|
|
75
|
+
| `waterfallTotal` | boolean | `false` |
|
|
76
|
+
| `categoryLabelLine` | boolean | `false` |
|
|
77
|
+
| `showVerticalAxis` | boolean | `true` |
|
|
78
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
79
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
80
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
81
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
82
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
83
|
+
| `showHorizontalAxis` | boolean | `false` |
|
|
84
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
85
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `off` |
|
|
86
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
87
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
88
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
89
|
+
| `horizontalScaleType` | select: `linear`, `log` | `linear` |
|
|
90
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
91
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
92
|
+
| `valueLabels` | boolean | `true` |
|
|
93
|
+
| `valueLabelPosition` | select: `auto`, `outside`, `inside` | `auto` |
|
|
94
|
+
| `tooltips` | boolean | `false` |
|
|
95
|
+
| `crosshair` | boolean | `false` |
|
|
96
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `both` |
|
|
97
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
98
|
+
| `crosshairColor` | text | `#999` |
|
|
99
|
+
|
|
100
|
+
<!-- options:end -->
|
|
101
|
+
|
|
56
102
|
## Common pitfalls
|
|
57
103
|
|
|
58
104
|
- Forgetting to sort — an unranked horizontal bar chart loses most of its power
|
package/src/charts/bar-multi.md
CHANGED
|
@@ -6,7 +6,7 @@ title: Multi-series bar chart
|
|
|
6
6
|
|
|
7
7
|
> Multi-series vertical bar chart for side-by-side comparison of a small group of series.
|
|
8
8
|
|
|
9
|
-
`bar-multi` places several series next to each other within each category, so readers can compare them at a glance.
|
|
9
|
+
`bar-multi` places several series next to each other within each category, so readers can compare them at a glance. Reorder categories with `sortMode`; the top-level `sort` property is read only by `bar-vertical`, `bar-horizontal`, and `donut`. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -46,6 +46,49 @@ chart bar-multi {
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
<!-- options:start -->
|
|
50
|
+
|
|
51
|
+
## Properties
|
|
52
|
+
|
|
53
|
+
Every property `bar-multi` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
54
|
+
|
|
55
|
+
| Property | Type | Default |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `colors` | colors | (unset) |
|
|
58
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
59
|
+
| `autoContrast` | boolean | `false` |
|
|
60
|
+
| `allowDarkMode` | boolean | `true` |
|
|
61
|
+
| `sortMode` | select: `none`, `total`, `within-groups` | `total` |
|
|
62
|
+
| `legend` | boolean | `false` |
|
|
63
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
64
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
65
|
+
| `directLabelling` | select: `""`, `auto`, `outside`, `inside` | `auto` |
|
|
66
|
+
| `directLabelAnchor` | select: `start`, `middle`, `end` | `middle` |
|
|
67
|
+
| `showVerticalAxis` | boolean | `false` |
|
|
68
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
69
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
70
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `off` |
|
|
71
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
72
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
73
|
+
| `verticalScaleType` | select: `linear`, `log` | `linear` |
|
|
74
|
+
| `verticalRangeMin` | text | (unset) |
|
|
75
|
+
| `verticalRangeMax` | text | (unset) |
|
|
76
|
+
| `showHorizontalAxis` | boolean | `true` |
|
|
77
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
78
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
79
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
80
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
81
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
82
|
+
| `valueLabels` | boolean | `true` |
|
|
83
|
+
| `valueLabelPosition` | select: `auto`, `outside`, `inside` | `auto` |
|
|
84
|
+
| `tooltips` | boolean | `false` |
|
|
85
|
+
| `crosshair` | boolean | `false` |
|
|
86
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `both` |
|
|
87
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
88
|
+
| `crosshairColor` | text | `#999` |
|
|
89
|
+
|
|
90
|
+
<!-- options:end -->
|
|
91
|
+
|
|
49
92
|
## Common pitfalls
|
|
50
93
|
|
|
51
94
|
- Too many bars per group overwhelms the reader; cap at 3–4 series
|
package/src/charts/bar-split.md
CHANGED
|
@@ -43,6 +43,49 @@ chart bar-split {
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
<!-- options:start -->
|
|
47
|
+
|
|
48
|
+
## Properties
|
|
49
|
+
|
|
50
|
+
Every property `bar-split` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
51
|
+
|
|
52
|
+
| Property | Type | Default |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `colors` | colors | (unset) |
|
|
55
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
56
|
+
| `autoContrast` | boolean | `false` |
|
|
57
|
+
| `allowDarkMode` | boolean | `true` |
|
|
58
|
+
| `sharedScale` | boolean | `false` |
|
|
59
|
+
| `sortMode` | select: `none`, `total`, `within-groups` | `none` |
|
|
60
|
+
| `legend` | boolean | `true` |
|
|
61
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
62
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
63
|
+
| `categoryLabelLine` | boolean | `false` |
|
|
64
|
+
| `showVerticalAxis` | boolean | `true` |
|
|
65
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
66
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
67
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
68
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
69
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
70
|
+
| `showHorizontalAxis` | boolean | `false` |
|
|
71
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
72
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `off` |
|
|
73
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
74
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
75
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
76
|
+
| `horizontalScaleType` | select: `linear`, `log` | `linear` |
|
|
77
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
78
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
79
|
+
| `valueLabels` | boolean | `true` |
|
|
80
|
+
| `valueLabelPosition` | select: `auto`, `outside`, `inside` | `auto` |
|
|
81
|
+
| `tooltips` | boolean | `false` |
|
|
82
|
+
| `crosshair` | boolean | `false` |
|
|
83
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `both` |
|
|
84
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
85
|
+
| `crosshairColor` | text | `#999` |
|
|
86
|
+
|
|
87
|
+
<!-- options:end -->
|
|
88
|
+
|
|
46
89
|
## Common pitfalls
|
|
47
90
|
|
|
48
91
|
- Forgetting that the chart is encoding sign; readers should be able to tell what zero means without reading the axis label
|
|
@@ -6,13 +6,13 @@ title: Stacked bar chart
|
|
|
6
6
|
|
|
7
7
|
> Stacked horizontal bar chart for composition within a category, emphasising the total.
|
|
8
8
|
|
|
9
|
-
`bar-stacked` segments horizontal bars into subcategories, showing both the individual parts and the total.
|
|
9
|
+
`bar-stacked` segments horizontal bars into subcategories, showing both the individual parts and the total. Set `stackMode = "percent"` to flip to a 100 % view for pure composition. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
13
13
|
- Showing how a total breaks down into parts
|
|
14
14
|
- Comparing totals across categories while keeping the composition visible
|
|
15
|
-
- 100 % stacked view (`
|
|
15
|
+
- 100 % stacked view (`stackMode = "percent"`) when relative proportions matter more than absolute values
|
|
16
16
|
- Categories with long labels that suit the horizontal orientation
|
|
17
17
|
|
|
18
18
|
## When NOT to use
|
|
@@ -44,6 +44,51 @@ chart bar-stacked {
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
|
|
47
|
+
<!-- options:start -->
|
|
48
|
+
|
|
49
|
+
## Properties
|
|
50
|
+
|
|
51
|
+
Every property `bar-stacked` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
52
|
+
|
|
53
|
+
| Property | Type | Default |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| `colors` | colors | (unset) |
|
|
56
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
57
|
+
| `autoContrast` | boolean | `false` |
|
|
58
|
+
| `allowDarkMode` | boolean | `true` |
|
|
59
|
+
| `stackMode` | select: `normal`, `percent` | `normal` |
|
|
60
|
+
| `sortMode` | select: `none`, `total`, `within-groups` | `none` |
|
|
61
|
+
| `legend` | boolean | `true` |
|
|
62
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
63
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
64
|
+
| `directLabelling` | select: `""`, `auto`, `outside`, `inside` | `""` |
|
|
65
|
+
| `directLabelAnchor` | select: `start`, `middle`, `end` | `middle` |
|
|
66
|
+
| `categoryLabelLine` | boolean | `false` |
|
|
67
|
+
| `showVerticalAxis` | boolean | `true` |
|
|
68
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
69
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
70
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
71
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
72
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
73
|
+
| `showHorizontalAxis` | boolean | `false` |
|
|
74
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
75
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `off` |
|
|
76
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
77
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
78
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
79
|
+
| `horizontalScaleType` | select: `linear`, `log` | `linear` |
|
|
80
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
81
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
82
|
+
| `valueLabels` | boolean | `true` |
|
|
83
|
+
| `valueLabelPosition` | select: `auto`, `outside`, `inside` | `auto` |
|
|
84
|
+
| `tooltips` | boolean | `false` |
|
|
85
|
+
| `crosshair` | boolean | `false` |
|
|
86
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `both` |
|
|
87
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
88
|
+
| `crosshairColor` | text | `#999` |
|
|
89
|
+
|
|
90
|
+
<!-- options:end -->
|
|
91
|
+
|
|
47
92
|
## Common pitfalls
|
|
48
93
|
|
|
49
94
|
- Segments not on the baseline are nearly impossible to compare accurately — put the most important segment first
|
|
@@ -53,6 +53,52 @@ chart bar-vertical {
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
<!-- options:start -->
|
|
57
|
+
|
|
58
|
+
## Properties
|
|
59
|
+
|
|
60
|
+
Every property `bar-vertical` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
61
|
+
|
|
62
|
+
| Property | Type | Default |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `colors` | colors | (unset) |
|
|
65
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
66
|
+
| `autoContrast` | boolean | `false` |
|
|
67
|
+
| `allowDarkMode` | boolean | `true` |
|
|
68
|
+
| `swapLabelValue` | boolean | `false` |
|
|
69
|
+
| `barBackground` | boolean | `false` |
|
|
70
|
+
| `barSeparators` | boolean | `false` |
|
|
71
|
+
| `barGap` | text | `60` |
|
|
72
|
+
| `connectedColumns` | boolean | `false` |
|
|
73
|
+
| `connectionsOpacity` | text | `0.15` |
|
|
74
|
+
| `waterfall` | boolean | `false` |
|
|
75
|
+
| `waterfallTotal` | boolean | `false` |
|
|
76
|
+
| `categoryLabelLine` | boolean | `false` |
|
|
77
|
+
| `showVerticalAxis` | boolean | `false` |
|
|
78
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
79
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
80
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `off` |
|
|
81
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
82
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
83
|
+
| `verticalScaleType` | select: `linear`, `log` | `linear` |
|
|
84
|
+
| `verticalRangeMin` | text | (unset) |
|
|
85
|
+
| `verticalRangeMax` | text | (unset) |
|
|
86
|
+
| `showHorizontalAxis` | boolean | `true` |
|
|
87
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
88
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
89
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
90
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
91
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
92
|
+
| `valueLabels` | boolean | `true` |
|
|
93
|
+
| `valueLabelPosition` | select: `auto`, `outside`, `inside` | `auto` |
|
|
94
|
+
| `tooltips` | boolean | `false` |
|
|
95
|
+
| `crosshair` | boolean | `false` |
|
|
96
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `both` |
|
|
97
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
98
|
+
| `crosshairColor` | text | `#999` |
|
|
99
|
+
|
|
100
|
+
<!-- options:end -->
|
|
101
|
+
|
|
56
102
|
## Common pitfalls
|
|
57
103
|
|
|
58
104
|
- Truncating the y-axis exaggerates differences and misleads readers — always start at zero
|
|
@@ -6,13 +6,13 @@ title: Stacked column chart
|
|
|
6
6
|
|
|
7
7
|
> Stacked vertical column chart for composition over discrete columns; supports percent stacking.
|
|
8
8
|
|
|
9
|
-
`column-stacked` is the vertical sibling of [`bar-stacked`](./bar-stacked) — each column breaks down into segments. It's the right choice when the x-axis represents a small number of ordered steps (quarters, fiscal years, study cohorts).
|
|
9
|
+
`column-stacked` is the vertical sibling of [`bar-stacked`](./bar-stacked) — each column breaks down into segments. It's the right choice when the x-axis represents a small number of ordered steps (quarters, fiscal years, study cohorts). Set `stackMode = "percent"` for a 100 % composition view. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
13
13
|
- Composition over a small number of discrete columns (5–10 quarters, years, or stages)
|
|
14
14
|
- When both the total and the breakdown matter for each column
|
|
15
|
-
- 100 % stacked view (`
|
|
15
|
+
- 100 % stacked view (`stackMode = "percent"`) when readers should focus on relative share
|
|
16
16
|
|
|
17
17
|
## When NOT to use
|
|
18
18
|
|
|
@@ -39,10 +39,54 @@ chart column-stacked {
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
|
|
42
|
+
<!-- options:start -->
|
|
43
|
+
|
|
44
|
+
## Properties
|
|
45
|
+
|
|
46
|
+
Every property `column-stacked` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
47
|
+
|
|
48
|
+
| Property | Type | Default |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| `colors` | colors | (unset) |
|
|
51
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
52
|
+
| `autoContrast` | boolean | `false` |
|
|
53
|
+
| `allowDarkMode` | boolean | `true` |
|
|
54
|
+
| `stackMode` | select: `normal`, `percent` | `normal` |
|
|
55
|
+
| `sortMode` | select: `none`, `total`, `within-groups` | `none` |
|
|
56
|
+
| `legend` | boolean | `true` |
|
|
57
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
58
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
59
|
+
| `directLabelling` | select: `""`, `auto`, `outside`, `inside` | `""` |
|
|
60
|
+
| `directLabelAnchor` | select: `start`, `middle`, `end` | `middle` |
|
|
61
|
+
| `showVerticalAxis` | boolean | `false` |
|
|
62
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
63
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
64
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `off` |
|
|
65
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
66
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
67
|
+
| `verticalScaleType` | select: `linear`, `log` | `linear` |
|
|
68
|
+
| `verticalRangeMin` | text | (unset) |
|
|
69
|
+
| `verticalRangeMax` | text | (unset) |
|
|
70
|
+
| `showHorizontalAxis` | boolean | `true` |
|
|
71
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
72
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
73
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
74
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
75
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
76
|
+
| `valueLabels` | boolean | `true` |
|
|
77
|
+
| `valueLabelPosition` | select: `auto`, `outside`, `inside` | `auto` |
|
|
78
|
+
| `tooltips` | boolean | `false` |
|
|
79
|
+
| `crosshair` | boolean | `false` |
|
|
80
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `both` |
|
|
81
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
82
|
+
| `crosshairColor` | text | `#999` |
|
|
83
|
+
|
|
84
|
+
<!-- options:end -->
|
|
85
|
+
|
|
42
86
|
## Common pitfalls
|
|
43
87
|
|
|
44
88
|
- Stacking too many series — the top layers float and lose their baseline
|
|
45
|
-
- Switching to `
|
|
89
|
+
- Switching to `stackMode = "percent"` without telling the reader hides the change in absolute total
|
|
46
90
|
- Inconsistent segment ordering between columns destroys the visual flow
|
|
47
91
|
|
|
48
92
|
## Related types
|
package/src/charts/donut.md
CHANGED
|
@@ -6,7 +6,7 @@ title: Donut chart
|
|
|
6
6
|
|
|
7
7
|
> Circular part-to-whole chart with a central label slot.
|
|
8
8
|
|
|
9
|
-
`donut` is a pie chart with the centre removed, opening a slot for a total, key metric, or icon.
|
|
9
|
+
`donut` is a pie chart with the centre removed, opening a slot for a total, key metric, or icon. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -48,6 +48,32 @@ chart donut {
|
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
|
|
51
|
+
<!-- options:start -->
|
|
52
|
+
|
|
53
|
+
## Properties
|
|
54
|
+
|
|
55
|
+
Every property `donut` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
56
|
+
|
|
57
|
+
| Property | Type | Default |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| `colors` | colors | (unset) |
|
|
60
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
61
|
+
| `autoContrast` | boolean | `false` |
|
|
62
|
+
| `allowDarkMode` | boolean | `true` |
|
|
63
|
+
| `legend` | boolean | `false` |
|
|
64
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
65
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
66
|
+
| `directLabelling` | select: `""`, `auto`, `outside`, `inside` | `auto` |
|
|
67
|
+
| `tooltips` | boolean | `false` |
|
|
68
|
+
| `displayAsPercentage` | boolean | `false` |
|
|
69
|
+
| `showTotal` | boolean | `true` |
|
|
70
|
+
| `showLabels` | boolean | `true` |
|
|
71
|
+
| `showValues` | boolean | `true` |
|
|
72
|
+
| `sliceMax` | text | `6` |
|
|
73
|
+
| `sliceGroupLabel` | text | `Others` |
|
|
74
|
+
|
|
75
|
+
<!-- options:end -->
|
|
76
|
+
|
|
51
77
|
## Common pitfalls
|
|
52
78
|
|
|
53
79
|
- Filling the centre slot with decoration instead of a meaningful metric wastes the chart's main affordance
|
package/src/charts/line-multi.md
CHANGED
|
@@ -6,7 +6,7 @@ title: Multi-line chart
|
|
|
6
6
|
|
|
7
7
|
> Multi-series line chart for comparing several time series or trends.
|
|
8
8
|
|
|
9
|
-
`line-multi` plots two or more series on shared axes so readers can see divergence, convergence, and ranking shifts over an ordered domain.
|
|
9
|
+
`line-multi` plots two or more series on shared axes so readers can see divergence, convergence, and ranking shifts over an ordered domain. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -46,6 +46,57 @@ chart line-multi {
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
<!-- options:start -->
|
|
50
|
+
|
|
51
|
+
## Properties
|
|
52
|
+
|
|
53
|
+
Every property `line-multi` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
54
|
+
|
|
55
|
+
| Property | Type | Default |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `colors` | colors | (unset) |
|
|
58
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
59
|
+
| `autoContrast` | boolean | `false` |
|
|
60
|
+
| `allowDarkMode` | boolean | `true` |
|
|
61
|
+
| `interpolation` | select: `linear`, `monotoneX`, `step`, `stepBefore`, `stepAfter`, `basis`, `cardinal`, `catmullRom` | `monotoneX` |
|
|
62
|
+
| `edgePadding` | boolean | `false` |
|
|
63
|
+
| `sortMode` | select: `none`, `total`, `within-groups` | `none` |
|
|
64
|
+
| `legend` | boolean | `false` |
|
|
65
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
66
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
67
|
+
| `directLabelling` | select: `""`, `auto`, `outside`, `inside` | `auto` |
|
|
68
|
+
| `showVerticalAxis` | boolean | `false` |
|
|
69
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
70
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
71
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
72
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `dashed` |
|
|
73
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
74
|
+
| `verticalScaleType` | select: `linear`, `log` | `linear` |
|
|
75
|
+
| `verticalRangeMin` | text | (unset) |
|
|
76
|
+
| `verticalRangeMax` | text | (unset) |
|
|
77
|
+
| `showHorizontalAxis` | boolean | `true` |
|
|
78
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
79
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
80
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
81
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
82
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
83
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
84
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
85
|
+
| `valueLabels` | boolean | `false` |
|
|
86
|
+
| `tooltips` | boolean | `false` |
|
|
87
|
+
| `crosshair` | boolean | `true` |
|
|
88
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `vertical` |
|
|
89
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
90
|
+
| `crosshairColor` | text | `#999` |
|
|
91
|
+
| `lineSymbols` | boolean | `true` |
|
|
92
|
+
| `lineSymbolShape` | select: `circle`, `square`, `diamond`, `triangle`, `triangleDown`, `cross`, `star` | `circle` |
|
|
93
|
+
| `lineSymbolShowOn` | select: `firstLast`, `first`, `last`, `all` | `firstLast` |
|
|
94
|
+
| `lineSymbolStyle` | select: `filled`, `hollow` | `filled` |
|
|
95
|
+
| `lineSymbolSize` | text | `3.5` |
|
|
96
|
+
| `lineSymbolOpacity` | text | `1` |
|
|
97
|
+
|
|
98
|
+
<!-- options:end -->
|
|
99
|
+
|
|
49
100
|
## Common pitfalls
|
|
50
101
|
|
|
51
102
|
- Five or more lines crossing each other defeats the chart — either highlight one and grey the rest, or split into small multiples
|
package/src/charts/line.md
CHANGED
|
@@ -6,7 +6,7 @@ title: Line chart
|
|
|
6
6
|
|
|
7
7
|
> Single-series line chart for continuous trend over an ordered domain.
|
|
8
8
|
|
|
9
|
-
`line` connects data points to show how a single measure changes across an ordered axis — typically time.
|
|
9
|
+
`line` connects data points to show how a single measure changes across an ordered axis — typically time. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -47,6 +47,52 @@ chart line {
|
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
<!-- options:start -->
|
|
51
|
+
|
|
52
|
+
## Properties
|
|
53
|
+
|
|
54
|
+
Every property `line` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
55
|
+
|
|
56
|
+
| Property | Type | Default |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `colors` | colors | (unset) |
|
|
59
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
60
|
+
| `autoContrast` | boolean | `false` |
|
|
61
|
+
| `allowDarkMode` | boolean | `true` |
|
|
62
|
+
| `interpolation` | select: `linear`, `monotoneX`, `step`, `stepBefore`, `stepAfter`, `basis`, `cardinal`, `catmullRom` | `monotoneX` |
|
|
63
|
+
| `edgePadding` | boolean | `false` |
|
|
64
|
+
| `showVerticalAxis` | boolean | `false` |
|
|
65
|
+
| `verticalAxisDirection` | select: `left`, `right` | `left` |
|
|
66
|
+
| `showVerticalTicks` | boolean | `false` |
|
|
67
|
+
| `verticalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
68
|
+
| `verticalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `dashed` |
|
|
69
|
+
| `verticalNumberFormat` | numberFormat | (unset) |
|
|
70
|
+
| `verticalScaleType` | select: `linear`, `log` | `linear` |
|
|
71
|
+
| `verticalRangeMin` | text | (unset) |
|
|
72
|
+
| `verticalRangeMax` | text | (unset) |
|
|
73
|
+
| `showHorizontalAxis` | boolean | `true` |
|
|
74
|
+
| `showHorizontalTicks` | boolean | `false` |
|
|
75
|
+
| `horizontalLabelPosition` | select: `auto`, `inside`, `outside`, `off` | `auto` |
|
|
76
|
+
| `horizontalLabelRotation` | select: `auto`, `horizontal`, `vertical` | `horizontal` |
|
|
77
|
+
| `horizontalGridStyle` | select: `solid`, `dashed`, `dotted`, `none` | `none` |
|
|
78
|
+
| `horizontalNumberFormat` | numberFormat | (unset) |
|
|
79
|
+
| `horizontalRangeMin` | text | (unset) |
|
|
80
|
+
| `horizontalRangeMax` | text | (unset) |
|
|
81
|
+
| `valueLabels` | boolean | `false` |
|
|
82
|
+
| `tooltips` | boolean | `false` |
|
|
83
|
+
| `crosshair` | boolean | `true` |
|
|
84
|
+
| `crosshairDirection` | select: `both`, `vertical`, `horizontal` | `vertical` |
|
|
85
|
+
| `crosshairStyle` | select: `solid`, `dashed`, `dotted` | `dashed` |
|
|
86
|
+
| `crosshairColor` | text | `#999` |
|
|
87
|
+
| `lineSymbols` | boolean | `false` |
|
|
88
|
+
| `lineSymbolShape` | select: `circle`, `square`, `diamond`, `triangle`, `triangleDown`, `cross`, `star` | `circle` |
|
|
89
|
+
| `lineSymbolShowOn` | select: `firstLast`, `first`, `last`, `all` | `firstLast` |
|
|
90
|
+
| `lineSymbolStyle` | select: `filled`, `hollow` | `filled` |
|
|
91
|
+
| `lineSymbolSize` | text | `3.5` |
|
|
92
|
+
| `lineSymbolOpacity` | text | `1` |
|
|
93
|
+
|
|
94
|
+
<!-- options:end -->
|
|
95
|
+
|
|
50
96
|
## Common pitfalls
|
|
51
97
|
|
|
52
98
|
- Aggressively truncating the y-axis exaggerates small movements
|
package/src/charts/pie.md
CHANGED
|
@@ -6,7 +6,7 @@ title: Pie chart
|
|
|
6
6
|
|
|
7
7
|
> Circular part-to-whole chart for very small N.
|
|
8
8
|
|
|
9
|
-
`pie` divides a circle into proportional slices, each representing a category's share of the whole.
|
|
9
|
+
`pie` divides a circle into proportional slices, each representing a category's share of the whole. See [Properties](#properties) for every key it accepts.
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
@@ -45,6 +45,32 @@ chart pie {
|
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
<!-- options:start -->
|
|
49
|
+
|
|
50
|
+
## Properties
|
|
51
|
+
|
|
52
|
+
Every property `pie` accepts, beside the [frame and layout keys](/reference/dsl/properties) every chart shares. Anything absent from this table is rejected by `validateChart` and ignored by the renderer.
|
|
53
|
+
|
|
54
|
+
| Property | Type | Default |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| `colors` | colors | (unset) |
|
|
57
|
+
| `colorPalette` | select, see [Palettes](/guide/palettes) | `Blueprint` |
|
|
58
|
+
| `autoContrast` | boolean | `false` |
|
|
59
|
+
| `allowDarkMode` | boolean | `true` |
|
|
60
|
+
| `legend` | boolean | `false` |
|
|
61
|
+
| `legendAnchor` | select: `start`, `middle`, `end` | `start` |
|
|
62
|
+
| `legendPosition` | select: `top`, `bottom`, `left`, `right` | `top` |
|
|
63
|
+
| `directLabelling` | select: `""`, `auto`, `outside`, `inside` | `auto` |
|
|
64
|
+
| `tooltips` | boolean | `false` |
|
|
65
|
+
| `displayAsPercentage` | boolean | `true` |
|
|
66
|
+
| `showTotal` | boolean | `false` |
|
|
67
|
+
| `showLabels` | boolean | `true` |
|
|
68
|
+
| `showValues` | boolean | `true` |
|
|
69
|
+
| `sliceMax` | text | `5` |
|
|
70
|
+
| `sliceGroupLabel` | text | `Others` |
|
|
71
|
+
|
|
72
|
+
<!-- options:end -->
|
|
73
|
+
|
|
48
74
|
## Common pitfalls
|
|
49
75
|
|
|
50
76
|
- Too many slices destroy readability — cap at five and use `sliceMax` to merge the tail
|
|
@@ -116,7 +116,7 @@ transform filter {
|
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
::: warning No sample uses `transform filter` today
|
|
119
|
-
The block above is synthesized from `packages/
|
|
119
|
+
The block above is synthesized from `packages/lib/src/transforms/applyFilter.ts` rather than copied from a `.bpc` file — none of the 38 shipped samples filter their data on render. Treat the syntax as canonical (it round-trips through the editor) but expect to author it by hand for now.
|
|
120
120
|
:::
|
|
121
121
|
|
|
122
122
|
If the target value is empty for any condition other than `equals` / `not-equals`, the filter is a no-op (the row is kept).
|
|
@@ -133,7 +133,7 @@ transform group-by {
|
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
::: warning No sample uses `transform group-by` today
|
|
136
|
-
Synthesized from `packages/
|
|
136
|
+
Synthesized from `packages/lib/src/transforms/applyGroupBy.ts` and `packages/lib/src/enums.ts` (`TransformType.GroupBy = 'group-by'`). Build the step in the editor's Data panel and copy the serialised output if you want a verified starting point.
|
|
137
137
|
:::
|
|
138
138
|
|
|
139
139
|
### Use the pipeline outside the editor
|
|
@@ -163,26 +163,27 @@ const { columns, rows, columnTypes } = applyTransforms(
|
|
|
163
163
|
|
|
164
164
|
## API surface
|
|
165
165
|
|
|
166
|
-
The
|
|
166
|
+
The pipeline lives in `@blueprint-chart/lib`, so a headless render of a `.bpc` applies the same steps as the editor:
|
|
167
167
|
|
|
168
168
|
| Symbol (from `@blueprint-chart/lib`) | One-liner |
|
|
169
169
|
| --- | --- |
|
|
170
170
|
| `TransformNode` (type) | AST node for a `transform <name> { … }` block. |
|
|
171
171
|
| `DslNodeType.Transform` (enum value) | Discriminator on the AST union. |
|
|
172
|
-
|
|
173
|
-
The `editor` half (used internally by the editor app):
|
|
174
|
-
|
|
175
|
-
| Symbol (from the editor) | One-liner |
|
|
176
|
-
| --- | --- |
|
|
177
|
-
| `useDataTransforms()` / `useDataTransformsStore()` | Pipeline composable + raw store. |
|
|
178
|
-
| `TransformStep` (type) | `{ id, type, config }` — one row in the pipeline. |
|
|
179
172
|
| `TransformType` (enum) | `Sort \| Filter \| HideColumns \| Transpose \| Parse \| Rename \| GroupBy \| Computed`. |
|
|
173
|
+
| `TRANSFORM_TYPES` | The set of executed types, and what the validator accepts. |
|
|
180
174
|
| `TransformResult` (type) | `{ columns, rows, columnTypes }` — the value flowing through the chain. |
|
|
175
|
+
| `TransformStep` (type) | `{ type, config }` — one step of the pipeline. |
|
|
176
|
+
| `applyTransformSteps(steps, columns, rows, columnTypes)` | Fold a step list over a table. |
|
|
177
|
+
| `applyTransformNodes(dataStr, nodes)` | Run `transform` AST nodes over a `data { … }` body. |
|
|
181
178
|
| `ParseOperation` / `parseOperations` | Catalogue of `Parse` operations and their accepted input types. |
|
|
182
179
|
| `NULL_VALUE` | Sentinel returned by `Parse` when a cell can't be coerced. |
|
|
183
180
|
|
|
184
|
-
|
|
185
|
-
|
|
181
|
+
The editor half is the interactive wrapper around it:
|
|
182
|
+
|
|
183
|
+
| Symbol (from the editor) | One-liner |
|
|
184
|
+
| --- | --- |
|
|
185
|
+
| `useDataTransforms()` / `useDataTransformsStore()` | Pipeline composable + raw store. |
|
|
186
|
+
| `TransformStep` (type) | The library step plus the `id` the pipeline UI keys rows by. |
|
|
186
187
|
|
|
187
188
|
## See also
|
|
188
189
|
|
package/src/guide/dsl-editor.md
CHANGED
package/src/handbook/axes.md
CHANGED
|
@@ -45,7 +45,7 @@ A **description** (or subtitle) sits near the top and tells the reader what they
|
|
|
45
45
|
|
|
46
46
|
## How Blueprint Chart applies the frame
|
|
47
47
|
|
|
48
|
-
Blueprint Chart's `FrameOptions` matches this hierarchy almost one-to-one: title, description, note, source, and credit are all first-class frame fields. The frame layer is independent of the chart layer, so the same frame can wrap any chart type without changing the type's internals. See the [API reference](/reference/api/) for `createFrame` and the frame options.
|
|
48
|
+
Blueprint Chart's `FrameOptions` matches this hierarchy almost one-to-one: title, description, note, source, and byline (the credit slot) are all first-class frame fields. The frame layer is independent of the chart layer, so the same frame can wrap any chart type without changing the type's internals. See the [API reference](/reference/api/) for `createFrame` and the frame options.
|
|
49
49
|
|
|
50
50
|
A minimal BPC source illustrates the structure:
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ chart bar-vertical {
|
|
|
55
55
|
description = "Quarterly revenue, USD millions"
|
|
56
56
|
note = "Q3 figures preliminary; EMEA excludes Russia"
|
|
57
57
|
source = "Company filings"
|
|
58
|
-
|
|
58
|
+
byline = "Chart: Blueprint Chart"
|
|
59
59
|
|
|
60
60
|
data {
|
|
61
61
|
"AMER" = 142
|
package/src/handbook/tooltips.md
CHANGED
|
@@ -69,6 +69,7 @@ chart line-multi {
|
|
|
69
69
|
legend = false
|
|
70
70
|
tooltips = true
|
|
71
71
|
crosshair = true
|
|
72
|
+
crosshairDirection = "vertical"
|
|
72
73
|
crosshairStyle = "dashed"
|
|
73
74
|
|
|
74
75
|
annotation "2009" {
|
|
@@ -87,7 +88,7 @@ chart line-multi {
|
|
|
87
88
|
```
|
|
88
89
|
|
|
89
90
|
::: info Progressive disclosure without hiding the story
|
|
90
|
-
The annotation carries the headline (`"Great Recession peak"`) so the chart stands on its own. `tooltips = true` plus `crosshair = true` then layer progressive disclosure on top: hover anywhere
|
|
91
|
+
The annotation carries the headline (`"Great Recession peak"`) so the chart stands on its own. `tooltips = true` plus `crosshair = true` then layer progressive disclosure on top: hover anywhere in the plot and a dashed vertical line aligns the cursor across all four series, while the tooltip names the nearest point only (`New York – 2009: 9.5`). The tooltip is nearest-point, not a shared readout of every series at that x. The essential story is never trapped behind a hover.
|
|
91
92
|
:::
|
|
92
93
|
|
|
93
94
|
## See also
|
|
@@ -71,7 +71,7 @@ PNG export and headless SVG in Node require optional native deps (`jsdom`, `@nap
|
|
|
71
71
|
|
|
72
72
|
Authoritative list of enum exports (from `./enums`):
|
|
73
73
|
|
|
74
|
-
`ChartType` · `AxisDirection` · `ScaleType` · `GridStyle` · `LabelPosition` · `LabelRotation` · `TickPosition` · `FrameSizing` · `CompassDirection` · `AnnotationLineStyle` · `StrokeStyle` · `AnnotationKind` · `
|
|
74
|
+
`ChartType` · `AxisDirection` · `ScaleType` · `GridStyle` · `LabelPosition` · `LabelRotation` · `TickPosition` · `FrameSizing` · `CompassDirection` · `AnnotationLineStyle` · `StrokeStyle` · `AnnotationKind` · `RangeAnchor` · `Orientation` · `SymbolShape` · `SymbolShowOn` · `SymbolStyle` · `SortDirection` · `SortMode` · `LegendPosition` · `Anchor` · `ValueLabelPosition` · `CrosshairDirection` · `CrosshairStyle` · `StackMode` · `LineStyle` · `ChartOptionType` · `DirectLabelMode` · `Interpolation` · `DslNodeType`
|
|
75
75
|
|
|
76
76
|
## Types
|
|
77
77
|
|
|
@@ -101,8 +101,8 @@ import {
|
|
|
101
101
|
|
|
102
102
|
| Symbol | Purpose |
|
|
103
103
|
| --- | --- |
|
|
104
|
-
| `createFrame(options)` | Set up the chart's outer frame (title, description, source, axis labels, note). Returns `FrameElements`. |
|
|
105
|
-
| `createCanvas(
|
|
104
|
+
| `createFrame(container, options?)` | Set up the chart's outer frame (title, description, source, axis labels, note) inside `container`. Pass `null` for frameless. Returns `FrameElements`. |
|
|
105
|
+
| `createCanvas(body, margin?)` | Set up the inner drawing surface inside `body` (the frame body element). Returns `CanvasElements`. |
|
|
106
106
|
| `renderVerticalAxis(...)` / `renderHorizontalAxis(...)` | Draw axes with grid lines, ticks, and labels. |
|
|
107
107
|
| `renderLegend(...)` | Draw a chart legend (position + interactivity). |
|
|
108
108
|
|
|
@@ -68,10 +68,12 @@ Three scenes share the same data and successively highlight one country each —
|
|
|
68
68
|
```bpc
|
|
69
69
|
area-fill "Lower bound" "Upper bound" {
|
|
70
70
|
color = "#94a3b8"
|
|
71
|
-
opacity =
|
|
71
|
+
opacity = 20
|
|
72
72
|
}
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
`opacity` is a percentage from 0 to 100 and defaults to `30`, the same scale as `bgOpacity` on a `range` annotation. `opacity = 0.2` is not a 20 % fill, it is a 0.2 % one, and the band is invisible.
|
|
76
|
+
|
|
75
77
|
::: tip
|
|
76
78
|
No bundled sample currently uses `area-fill`. The grammar is documented and parser-tested; the example above is illustrative.
|
|
77
79
|
:::
|
|
@@ -98,7 +100,6 @@ A richer point annotation with a connector line and curved leader:
|
|
|
98
100
|
|
|
99
101
|
```bpc
|
|
100
102
|
annotation "2015" {
|
|
101
|
-
id = "2o3cx"
|
|
102
103
|
text = "2015 Paris Agreement to limit global warming to 1.5°C "
|
|
103
104
|
maxWidth = 224
|
|
104
105
|
showLine = true
|
|
@@ -5,7 +5,7 @@ The Blueprint Chart format (`.bpc`) is a declarative text DSL for describing a c
|
|
|
5
5
|
The canonical grammar lives in [`packages/lib/src/dsl/grammar.peggy`](https://github.com/blueprint-chart/blueprint-chart/blob/main/packages/lib/src/dsl/grammar.peggy). This page is the human-readable specification.
|
|
6
6
|
|
|
7
7
|
::: tip Stability
|
|
8
|
-
The DSL is **AST round-trip safe**: `parse(source)` → `serialize(ast)` → `parse(...)` produces an equivalent AST. The round trip is over the AST, not the source text. Comments are
|
|
8
|
+
The DSL is **AST round-trip safe**: `parse(source)` → `serialize(ast)` → `parse(...)` produces an equivalent AST. The round trip is over the AST, not the source text. Comments are attached to the AST node they document and survive `serialize`: the ones written above a member, the one ending a member's line, and the ones after a block's last member. A multi-line comment ending a member's line is re-emitted as a `/* */` block so it still parses.
|
|
9
9
|
:::
|
|
10
10
|
|
|
11
11
|
## A minimal example
|
|
@@ -94,7 +94,7 @@ Numbers accept an optional leading minus, a fractional part (including a leading
|
|
|
94
94
|
|
|
95
95
|
### Comments
|
|
96
96
|
|
|
97
|
-
Two comment forms exist. Line comments start with `//` and run to end-of-line. Block comments are delimited by `/*` and `*/` and may span multiple lines.
|
|
97
|
+
Two comment forms exist. Line comments start with `//` and run to end-of-line. Block comments are delimited by `/*` and `*/` and may span multiple lines. Neither carries meaning for rendering, but both are attached to the AST node they sit above, on the same line as, or at the end of the enclosing block, as `leadingComments`, `trailingComment` and `trailingComments`, so they survive a `parse` then `serialize` round trip.
|
|
98
98
|
|
|
99
99
|
## Working with the AST
|
|
100
100
|
|
|
@@ -8,8 +8,8 @@ Properties are simple key/value pairs:
|
|
|
8
8
|
|
|
9
9
|
```bpc
|
|
10
10
|
title = "Chrome dominates the desktop browser market"
|
|
11
|
-
displayAsPercentage = true
|
|
12
11
|
tooltips = true
|
|
12
|
+
lineSymbolSize = 4
|
|
13
13
|
lineSymbolShape = "diamond"
|
|
14
14
|
```
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ lineSymbolShape = "diamond"
|
|
|
22
22
|
|
|
23
23
|
Property keys may be identifiers (`title`) or strings (`"data-attribute"`).
|
|
24
24
|
|
|
25
|
-
The full set of recognized property keys per chart type is defined by
|
|
25
|
+
The full set of recognized property keys per chart type is defined by the option defs in `@blueprint-chart/lib` and tabulated on each [chart type page](/charts/), generated from `getChartOptions()` at build time.
|
|
26
26
|
|
|
27
27
|
## Data block
|
|
28
28
|
|
|
@@ -80,7 +80,7 @@ data {
|
|
|
80
80
|
```bpc
|
|
81
81
|
series "Renewables" {
|
|
82
82
|
color = "#2ca02c"
|
|
83
|
-
interpolation = "
|
|
83
|
+
interpolation = "monotoneX"
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|