@motionscript/charts 0.1.1-alpha.1 → 0.1.1-alpha.3
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/CHANGELOG.md +23 -0
- package/README.md +21 -12
- package/dist/bar-chart/bar-chart.d.ts +113 -81
- package/dist/bar-chart/bar-chart.d.ts.map +1 -1
- package/dist/bar-chart/bar-chart.js +9 -5
- package/dist/bar-chart/bar-chart.js.map +1 -1
- package/dist/bar-chart/chart-bars.d.ts +29 -5
- package/dist/bar-chart/chart-bars.d.ts.map +1 -1
- package/dist/bar-chart/chart-bars.js +33 -8
- package/dist/bar-chart/chart-bars.js.map +1 -1
- package/dist/bar-chart/shared.d.ts +10 -4
- package/dist/bar-chart/shared.d.ts.map +1 -1
- package/dist/bar-chart/shared.js +12 -5
- package/dist/bar-chart/shared.js.map +1 -1
- package/dist/browser/chunks/chunk-FJHNBNPQ.js +2 -0
- package/dist/browser/chunks/chunk-FJHNBNPQ.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/kit/cartesian.d.ts +6 -4
- package/dist/kit/cartesian.d.ts.map +1 -1
- package/dist/kit/cartesian.js +5 -3
- package/dist/kit/cartesian.js.map +1 -1
- package/dist/kit/style.d.ts +344 -76
- package/dist/kit/style.d.ts.map +1 -1
- package/dist/kit/style.js +198 -101
- package/dist/kit/style.js.map +1 -1
- package/dist/line-chart/line-chart.d.ts +97 -73
- package/dist/line-chart/line-chart.d.ts.map +1 -1
- package/dist/line-chart/line-chart.js +9 -7
- package/dist/line-chart/line-chart.js.map +1 -1
- package/dist/line-chart/shared.d.ts +2 -1
- package/dist/line-chart/shared.d.ts.map +1 -1
- package/dist/line-chart/shared.js +2 -0
- package/dist/line-chart/shared.js.map +1 -1
- package/dist/pie-chart/pie-chart.d.ts +43 -49
- package/dist/pie-chart/pie-chart.d.ts.map +1 -1
- package/dist/pie-chart/pie-chart.js +2 -1
- package/dist/pie-chart/pie-chart.js.map +1 -1
- package/dist/pie-chart/shared.d.ts +15 -10
- package/dist/pie-chart/shared.d.ts.map +1 -1
- package/dist/pie-chart/shared.js +18 -20
- package/dist/pie-chart/shared.js.map +1 -1
- package/dist/radar-chart/radar-chart.d.ts +37 -49
- package/dist/radar-chart/radar-chart.d.ts.map +1 -1
- package/dist/radar-chart/radar-chart.js +10 -11
- package/dist/radar-chart/radar-chart.js.map +1 -1
- package/dist/radar-chart/radar-grid.d.ts +7 -1
- package/dist/radar-chart/radar-grid.d.ts.map +1 -1
- package/dist/radar-chart/radar-grid.js +17 -15
- package/dist/radar-chart/radar-grid.js.map +1 -1
- package/dist/radar-chart/shared.d.ts +4 -2
- package/dist/radar-chart/shared.d.ts.map +1 -1
- package/dist/radar-chart/shared.js +3 -0
- package/dist/radar-chart/shared.js.map +1 -1
- package/dist/radial-chart/radial-chart.d.ts +37 -49
- package/dist/radial-chart/radial-chart.d.ts.map +1 -1
- package/dist/radial-chart/radial-chart.js +2 -1
- package/dist/radial-chart/radial-chart.js.map +1 -1
- package/dist/radial-chart/shared.d.ts +13 -11
- package/dist/radial-chart/shared.d.ts.map +1 -1
- package/dist/radial-chart/shared.js +12 -16
- package/dist/radial-chart/shared.js.map +1 -1
- package/package.json +4 -4
- package/src/bar-chart/bar-chart.ts +17 -6
- package/src/bar-chart/chart-bars.ts +48 -9
- package/src/bar-chart/shared.ts +23 -5
- package/src/kit/cartesian.ts +10 -7
- package/src/kit/style.ts +216 -118
- package/src/line-chart/line-chart.ts +14 -8
- package/src/line-chart/shared.ts +3 -1
- package/src/pie-chart/pie-chart.ts +3 -1
- package/src/pie-chart/shared.ts +26 -22
- package/src/radar-chart/radar-chart.ts +14 -13
- package/src/radar-chart/radar-grid.ts +18 -13
- package/src/radar-chart/shared.ts +5 -2
- package/src/radial-chart/radial-chart.ts +3 -1
- package/src/radial-chart/shared.ts +26 -18
- package/dist/browser/chunks/chunk-R3Q5EE6E.js +0 -2
- package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @motionscript/charts
|
|
2
2
|
|
|
3
|
+
## 0.1.1-alpha.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2291209: **Breaking:** a chart's text fields sit in the style group of the part they label, so a host draws each beside it rather than in one text section: axis text in a new `axes` group with `axisStroke`, `showXAxis` and `showYAxis` (which leave `grid`), `valueText` (and a pie's or radial's other labels) in `labels`, `legendText` in `legend`, a radar's `spokeText` in `grid`. The kit exports `CARTESIAN_AXES` and `VALUE_TEXT` in place of `CARTESIAN_TEXT` and `LEGEND_TEXT` (`CHART_LEGEND` now holds `legendText`), and the radar's `RADAR_TEXT` is folded into `RADAR_GRID`.
|
|
8
|
+
|
|
9
|
+
Migration: no stored document is affected; field names and values are unchanged. Code that spread `CARTESIAN_TEXT`, `LEGEND_TEXT` or `RADAR_TEXT` into a style spreads `CARTESIAN_AXES`, `VALUE_TEXT`, `CHART_LEGEND` or `RADAR_GRID` instead.
|
|
10
|
+
|
|
11
|
+
## 0.1.1-alpha.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 3050906: **Breaking:** every run of text a chart draws gets its own text style, the palette becomes `seriesFills`, and a chart has a background for the whole chart beside one for its grid.
|
|
16
|
+
|
|
17
|
+
- **`Types.typography(textStyle)`** (core, sdk): one text style as an entry (face, size, weight, style, spacing, paint). A partial is laid over the default or the value it replaces, so `{ fill }` recolours and keeps the rest; it tweens key by key. `describe()` reports `kind: "typography"` with its default.
|
|
18
|
+
- **Chart text** (charts): `foreground`, `muted`, `fontFamily`, `fontSize` and `fontWeight` are gone. Line and bar charts have `xLabelText`, `xTitleText`, `yLabelText`, `yTitleText`, `valueText` and `legendText`; a pie `labelText`, `valueText`, `centerText` and `legendText`; a radar `spokeText`; a radial `labelText` and `centerText`. Spacing that followed the one size now follows the text it sits beside.
|
|
19
|
+
- **Series fills**: `palette` is `seriesFills` (group `series`), each entry a fill that may stack paints.
|
|
20
|
+
- **Backgrounds**: `background` (group `background`) paints behind the whole chart on every chart; line, bar and radar charts add `gridBackground` for the plot (inside the web on a radar). A line or bar chart's old `background`, which painted the plot, is now `gridBackground`.
|
|
21
|
+
- **Bar corners**: `barRadius` is `barCornerRadius`, a `Types.cornerRadius` read as for a bar standing up (top pair at the far end, bottom pair at the base), with `barCornerStyle` (rounded or angled) beside it. `barWidth` reports itself as a percentage.
|
|
22
|
+
- Each chart's `migrate` hook (`migrateChartStyle`) carries a stored style across: the palette, the two inks and the shared type become the new fields as each chart derived them, a plot background becomes `gridBackground`, and a `barRadius` keeps rounding only the far end.
|
|
23
|
+
|
|
24
|
+
Migration: a stored document needs nothing done to it. Each chart's `migrate` hook converts its stored `style` (and a `to` command's) as the document opens: `palette` to `seriesFills`, `foreground`, `muted` and the font fields to the text fields as the chart derived them (titles 1.1× and a weight heavier, values as before), a line, bar or radar chart's `background` to `gridBackground`, and a number `barRadius` to `barCornerRadius` with only the top pair rounded. Code that sets these fields by hand, or a host that reads a chart's stored `style`, uses the new names; `migrateChartStyle(layout)` converts a style object the same way.
|
|
25
|
+
|
|
3
26
|
## 0.1.1-alpha.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -39,8 +39,10 @@ shelved and the box it is seeded at are the host's to keep. `lineChartDomains` a
|
|
|
39
39
|
is out.
|
|
40
40
|
|
|
41
41
|
The style kit exports `CHART_STYLE_FAMILY` (`"chart"`), `CHART_STYLE_PRESETS`,
|
|
42
|
-
`CHART_PALETTE_DEFAULT
|
|
43
|
-
`
|
|
42
|
+
`CHART_PALETTE_DEFAULT`, the shared field groups (`CHART_SERIES`,
|
|
43
|
+
`CHART_BACKGROUND`, `GRID_BACKGROUND`, `CARTESIAN_AXES`, `VALUE_TEXT`,
|
|
44
|
+
`CARTESIAN_GRID`, `CHART_LEGEND`) and `migrateChartStyle`, each chart's
|
|
45
|
+
`migrate` hook for styles written before 0.1.1-alpha.2.
|
|
44
46
|
|
|
45
47
|
## Nodes
|
|
46
48
|
|
|
@@ -65,36 +67,43 @@ is above 0.
|
|
|
65
67
|
|
|
66
68
|
Each chart has one look entry, `style`, and nothing else about colour or type:
|
|
67
69
|
no `theme`, no `showLegend`. Its fields come in groups, written grouped and read
|
|
68
|
-
flat (`state.style.
|
|
70
|
+
flat (`state.style.xLabelText`):
|
|
69
71
|
|
|
70
72
|
| Group | Fields | On |
|
|
71
73
|
|---|---|---|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
| grid | `horizontalGrid` (a 2px `white/15` stroke), `verticalGrid` (none)
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
74
|
+
| series | `seriesFills`: a fill per series (per row on a pie or radial), cycled; each may stack paints | every chart |
|
|
75
|
+
| background | `background` (the whole chart), `gridBackground` (the plot, under the grid) | every chart; `gridBackground` on line, bar, radar |
|
|
76
|
+
| grid | `horizontalGrid` (a 2px `white/15` stroke), `verticalGrid` (none) | line, bar |
|
|
77
|
+
| axes | `axisStroke` (none), `showXAxis`, `xLabelText`, `xTitleText`, `showYAxis`, `yLabelText`, `yTitleText` | line, bar |
|
|
78
|
+
| grid | `gridShape`, `gridLevels`, `gridStroke` (rings), `spokeStroke` (spokes), `spokeLabels`, `spokeText` | radar |
|
|
79
|
+
| marks | the chart's own: `strokeWidth`, `curve`, `dots`, `area`, `barCornerRadius`, `barCornerStyle`, `innerRadius`, `sweep`, ... | every chart |
|
|
80
|
+
| labels | `values` and `valueText` (line, bar); `labelPlacement`, `labelText`, `valueText`, `centerText` (pie); `ringLabels`, `labelText`, `centerText` (radial) | |
|
|
81
|
+
|
|
82
|
+
Every run of text is a `Types.typography` field in the group of the part it labels (face, size, weight, style,
|
|
83
|
+
spacing, paint), so each is set like a text node; a partial (`{ fill }`) keeps the
|
|
84
|
+
rest of the field's default. The chart places and aligns the text itself.
|
|
85
|
+
`barCornerRadius` and `barCornerStyle` read as for a bar standing up: the top
|
|
86
|
+
pair round its far end, the bottom pair its base, turned with the bar.
|
|
78
87
|
|
|
79
88
|
A line is a stroke and an area is a fill: `horizontalGrid`, `verticalGrid`, `axisStroke`, `gridStroke`
|
|
80
89
|
and `spokeStroke` are `Types.stroke` entries (weight, colour, dash and caps; empty draws
|
|
81
90
|
nothing), and a radial's `track` is a `Types.fill` (empty draws no track). A series' `label`
|
|
82
91
|
is optional; the legend shows `label || field`.
|
|
83
|
-
| legend | `legend` (`bottom`, `top`, `right`, `none`), `swatch` (`square`, `circle`, `line`) | every chart |
|
|
92
|
+
| legend | `legend` (`bottom`, `top`, `right`, `none`), `swatch` (`square`, `circle`, `line`), `legendText` | every chart |
|
|
84
93
|
|
|
85
94
|
A chart takes only the fields it draws. A style is a partial laid over the chart's
|
|
86
95
|
previous style, and a key the chart does not have is dropped, so one style dresses
|
|
87
96
|
every chart in the family.
|
|
88
97
|
|
|
89
98
|
`CHART_STYLE_PRESETS` (`midnight`, `paper`, `ember`, `neon`, `ocean`, `sunset`,
|
|
90
|
-
`pastel`, `mono`) are colour-only partials. Spread one into a style and add to it:
|
|
99
|
+
`pastel`, `mono`) are colour-only partials (each text field's `fill`, the rules, the backgrounds). Spread one into a style and add to it:
|
|
91
100
|
|
|
92
101
|
```ts
|
|
93
102
|
import { CHART_STYLE_PRESETS } from '@motionscript/charts';
|
|
94
103
|
|
|
95
104
|
const props = {
|
|
96
105
|
// ...data, series
|
|
97
|
-
style: { ...CHART_STYLE_PRESETS.paper, fontSize: 32, area: 'gradient' },
|
|
106
|
+
style: { ...CHART_STYLE_PRESETS.paper, legendText: { fontSize: 32 }, area: 'gradient' },
|
|
98
107
|
};
|
|
99
108
|
```
|
|
100
109
|
|
|
@@ -1,53 +1,61 @@
|
|
|
1
|
-
import { type DataRecord, type NodeOf, type OutOf, type Node2D, type Node2DProps as _Node2DProps, type Fill as _Fill, type FillResolved as _FillResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved, type StyleInput as _StyleInput, type StyleValues as _StyleValues } from "@motionscript/sdk";
|
|
1
|
+
import { type DataRecord, type NodeOf, type OutOf, type Node2D, type Node2DProps as _Node2DProps, type TextStyle as _TextStyle, type CornerRadiusResolved as _CornerRadiusResolved, type CornerStyleResolved as _CornerStyleResolved, type RectCornerRadius as _RectCornerRadius, type RectCornerStyle as _RectCornerStyle, type Fill as _Fill, type FillResolved as _FillResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved, type StyleInput as _StyleInput, type StyleValues as _StyleValues } from "@motionscript/sdk";
|
|
2
2
|
import { type AxisDomainConfig, type ResolvedAxisDomain } from "../kit/shared.js";
|
|
3
3
|
import { type BarSeries, type BarStack } from "./shared.js";
|
|
4
4
|
declare const BAR_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
|
|
5
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
6
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
7
|
+
} & {
|
|
5
8
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
6
9
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
10
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
7
11
|
} & {
|
|
8
12
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
9
13
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
14
|
+
} & {
|
|
15
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
16
|
+
} & {
|
|
10
17
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
11
18
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
19
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
20
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
12
21
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
22
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
23
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
13
24
|
} & {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
17
|
-
} & {
|
|
18
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
19
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
20
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
21
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
22
|
-
} & {
|
|
23
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
25
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
26
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
24
27
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
25
28
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
26
29
|
} & {
|
|
30
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
27
31
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
28
32
|
}>, _StyleValues<{
|
|
33
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
34
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
35
|
+
} & {
|
|
29
36
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
30
37
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
38
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
31
39
|
} & {
|
|
32
40
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
33
41
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
42
|
+
} & {
|
|
43
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
44
|
+
} & {
|
|
34
45
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
35
46
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
47
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
48
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
36
49
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
50
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
51
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
37
52
|
} & {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
41
|
-
} & {
|
|
42
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
43
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
44
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
45
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
46
|
-
} & {
|
|
47
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
53
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
54
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
48
55
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
49
56
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
50
57
|
} & {
|
|
58
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
51
59
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
52
60
|
}>, false>;
|
|
53
61
|
/** A bar chart's resolved style. */
|
|
@@ -85,52 +93,60 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
|
|
|
85
93
|
readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
86
94
|
readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
87
95
|
readonly style: import("@motionscript/sdk").Type<_StyleInput<{
|
|
96
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
97
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
98
|
+
} & {
|
|
88
99
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
89
100
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
101
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
90
102
|
} & {
|
|
91
103
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
92
104
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
105
|
+
} & {
|
|
106
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
107
|
+
} & {
|
|
93
108
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
94
109
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
110
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
111
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
95
112
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
113
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
114
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
96
115
|
} & {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
100
|
-
} & {
|
|
101
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
102
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
103
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
104
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
105
|
-
} & {
|
|
106
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
116
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
117
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
107
118
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
108
119
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
109
120
|
} & {
|
|
121
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
110
122
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
111
123
|
}>, _StyleValues<{
|
|
124
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
125
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
126
|
+
} & {
|
|
112
127
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
113
128
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
129
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
114
130
|
} & {
|
|
115
131
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
116
132
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
133
|
+
} & {
|
|
134
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
135
|
+
} & {
|
|
117
136
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
118
137
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
138
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
139
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
119
140
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
141
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
142
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
120
143
|
} & {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
124
|
-
} & {
|
|
125
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
126
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
127
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
128
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
129
|
-
} & {
|
|
130
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
144
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
145
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
131
146
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
132
147
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
133
148
|
} & {
|
|
149
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
134
150
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
135
151
|
}>, false>;
|
|
136
152
|
/** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
|
|
@@ -168,52 +184,60 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
|
|
|
168
184
|
readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
169
185
|
readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
170
186
|
readonly style: import("@motionscript/sdk").Type<_StyleInput<{
|
|
187
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
188
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
189
|
+
} & {
|
|
171
190
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
172
191
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
192
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
173
193
|
} & {
|
|
174
194
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
175
195
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
196
|
+
} & {
|
|
197
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
198
|
+
} & {
|
|
176
199
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
177
200
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
201
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
202
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
178
203
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
204
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
205
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
179
206
|
} & {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
183
|
-
} & {
|
|
184
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
185
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
186
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
187
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
188
|
-
} & {
|
|
189
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
207
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
208
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
190
209
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
191
210
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
192
211
|
} & {
|
|
212
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
193
213
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
194
214
|
}>, _StyleValues<{
|
|
215
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
216
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
217
|
+
} & {
|
|
195
218
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
196
219
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
220
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
197
221
|
} & {
|
|
198
222
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
199
223
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
224
|
+
} & {
|
|
225
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
226
|
+
} & {
|
|
200
227
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
201
228
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
229
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
230
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
202
231
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
232
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
233
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
203
234
|
} & {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
207
|
-
} & {
|
|
208
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
209
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
210
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
211
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
212
|
-
} & {
|
|
213
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
235
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
236
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
214
237
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
215
238
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
216
239
|
} & {
|
|
240
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
217
241
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
218
242
|
}>, false>;
|
|
219
243
|
/** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
|
|
@@ -236,52 +260,60 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
|
|
|
236
260
|
readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
237
261
|
readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
238
262
|
readonly style: import("@motionscript/sdk").Type<_StyleInput<{
|
|
263
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
264
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
265
|
+
} & {
|
|
239
266
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
240
267
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
268
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
241
269
|
} & {
|
|
242
270
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
243
271
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
272
|
+
} & {
|
|
273
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
274
|
+
} & {
|
|
244
275
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
245
276
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
277
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
278
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
246
279
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
280
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
281
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
247
282
|
} & {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
251
|
-
} & {
|
|
252
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
253
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
254
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
255
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
256
|
-
} & {
|
|
257
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
283
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
284
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
258
285
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
259
286
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
260
287
|
} & {
|
|
288
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
261
289
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
262
290
|
}>, _StyleValues<{
|
|
291
|
+
gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
292
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
293
|
+
} & {
|
|
263
294
|
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
264
295
|
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
296
|
+
legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
265
297
|
} & {
|
|
266
298
|
horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
267
299
|
verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
300
|
+
} & {
|
|
301
|
+
seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
302
|
+
} & {
|
|
268
303
|
axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
|
|
269
304
|
showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
305
|
+
xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
306
|
+
xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
270
307
|
showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
308
|
+
yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
309
|
+
yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
271
310
|
} & {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
275
|
-
} & {
|
|
276
|
-
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
277
|
-
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
278
|
-
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
279
|
-
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
280
|
-
} & {
|
|
281
|
-
barRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
311
|
+
barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
|
|
312
|
+
barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
|
|
282
313
|
barWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
283
314
|
barGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
284
315
|
} & {
|
|
316
|
+
valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
|
|
285
317
|
values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
|
|
286
318
|
}>, false>;
|
|
287
319
|
/** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,KAAK,EAEV,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EAEtC,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,WAAW,IAAI,YAAY,EACjC,MAAM,mBAAmB,CAAA;AAS1B,OAAO,EAWL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,KAAK,EAEV,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,SAAS,IAAI,UAAU,EAC5B,KAAK,oBAAoB,IAAI,qBAAqB,EAClD,KAAK,mBAAmB,IAAI,oBAAoB,EAChD,KAAK,gBAAgB,IAAI,iBAAiB,EAC1C,KAAK,eAAe,IAAI,gBAAgB,EACxC,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EAEtC,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,WAAW,IAAI,YAAY,EACjC,MAAM,mBAAmB,CAAA;AAS1B,OAAO,EAWL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAA;AAkBtB,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,UAAU,CAAA;AAEjB,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAId,CAAA;AAED,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEnD,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;CACrC;AAED,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAA;AAsB/C,gHAAgH;AAChH,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,cAAc,CAOhE;AA8HD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ;;;;IAOjB,8GAA8G;;IAE9G,mHAAmH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnH,gFAAgF;;IAEhF,wFAAwF;;;IAGxF,6HAA6H;;IAE7H,4GAA4G;;;;;;;;;;;;;;;;;;;;;IAd5G,8GAA8G;;IAE9G,mHAAmH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnH,gFAAgF;;IAEhF,wFAAwF;;;IAGxF,6HAA6H;;IAE7H,4GAA4G;;;;;;IAd5G,8GAA8G;;IAE9G,mHAAmH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnH,gFAAgF;;IAEhF,wFAAwF;;;IAGxF,6HAA6H;;IAE7H,4GAA4G;;;;;;;;;;;;;;;;;0BAkO9G,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
|
@@ -7,12 +7,12 @@ import { SERIES_ARG, asParts, fresh } from "../kit/entries.js";
|
|
|
7
7
|
import { HorizontalAxis } from "../kit/horizontal-axis.js";
|
|
8
8
|
import { DEFAULT_MARKERS, ENTER_SHARE, beats, legendAway } from "../kit/motion.js";
|
|
9
9
|
import { SPOTLIGHT_DIM, formatMarker, lerpAxisDomain, lerpAxisEntry, markerStep, markerValues, niceTicks, num, resolveAxisDomain, settleAxisDomain, } from "../kit/shared.js";
|
|
10
|
-
import { CARTESIAN_GRID,
|
|
10
|
+
import { CARTESIAN_GRID, CARTESIAN_AXES, CHART_LEGEND, CHART_SERIES, CHART_STYLE_FAMILY, CHART_STYLE_PRESETS, GRID_BACKGROUND, axisConfigOf, migrateChartStyle, legendConfigOf, seriesFill, valueText, } from "../kit/style.js";
|
|
11
11
|
import { VerticalAxis, axisPads } from "../kit/vertical-axis.js";
|
|
12
12
|
import { CategoryAxis, slotCentre } from "./category-axis.js";
|
|
13
13
|
import { ChartBars } from "./chart-bars.js";
|
|
14
14
|
import { BAR_LABELS, BAR_MARKS, barCategories, barSpans, resolveBarScale, } from "./shared.js";
|
|
15
|
-
const BAR_STYLE = Types.style(CHART_STYLE_FAMILY, {
|
|
15
|
+
const BAR_STYLE = Types.style(CHART_STYLE_FAMILY, { series: CHART_SERIES, background: GRID_BACKGROUND, grid: CARTESIAN_GRID, axes: CARTESIAN_AXES, marks: BAR_MARKS, labels: BAR_LABELS, legend: CHART_LEGEND }, { presets: CHART_STYLE_PRESETS });
|
|
16
16
|
function drawnValue(s, domain) {
|
|
17
17
|
const divisions = (domain.ticks?.length ?? DEFAULT_MARKERS) - 1;
|
|
18
18
|
const range = resolveBarScale(s.data, s.series, s.stack, domain.range, divisions);
|
|
@@ -108,6 +108,7 @@ function seriesBars(s, index, plot) {
|
|
|
108
108
|
from: valueToPx(domain, along, span.from),
|
|
109
109
|
to: valueToPx(domain, along, span.to),
|
|
110
110
|
round: span.outer,
|
|
111
|
+
grounded: !stacked || span.from === 0,
|
|
111
112
|
caption,
|
|
112
113
|
};
|
|
113
114
|
});
|
|
@@ -193,6 +194,7 @@ export const BarChart = component2d({
|
|
|
193
194
|
weights: (state) => state.series.map((s) => ((s.enabled ?? true) ? 1 : 0)),
|
|
194
195
|
showing: (state) => state.series.map((s) => s.enabled ?? true),
|
|
195
196
|
},
|
|
197
|
+
migrate: { style: migrateChartStyle("cartesian") },
|
|
196
198
|
allowedChildren: [],
|
|
197
199
|
children: (state) => {
|
|
198
200
|
const style = () => state.style;
|
|
@@ -262,12 +264,13 @@ export const BarChart = component2d({
|
|
|
262
264
|
baseline: () => valueToPx(domain(), runs(state, plotSize()).along, baselineValue(domain())),
|
|
263
265
|
horizontal,
|
|
264
266
|
fill: () => seriesFill(style(), s, i),
|
|
265
|
-
cornerRadius: () => style().
|
|
267
|
+
cornerRadius: () => style().barCornerRadius,
|
|
268
|
+
cornerStyle: () => style().barCornerStyle,
|
|
266
269
|
growth: () => state.growth,
|
|
267
270
|
dims: () => categoryDims(state),
|
|
268
271
|
// A figure past a stack's end prints the stack's total; a percent stack has none worth printing, so prints its shares inside.
|
|
269
272
|
values: () => (built.values === "end" && state.stack === "percent" ? "inside" : built.values),
|
|
270
|
-
valueStyle: () =>
|
|
273
|
+
valueStyle: () => valueText(style()),
|
|
271
274
|
enabled: () => state.showing[i] ?? (s.enabled ?? true),
|
|
272
275
|
}));
|
|
273
276
|
const legendAt = built.legend;
|
|
@@ -286,7 +289,7 @@ export const BarChart = component2d({
|
|
|
286
289
|
plot = new Rect({
|
|
287
290
|
children: [
|
|
288
291
|
new ChartCanvas({
|
|
289
|
-
fill: () => style().
|
|
292
|
+
fill: () => style().gridBackground,
|
|
290
293
|
xGridStroke: () => style().verticalGrid,
|
|
291
294
|
yGridStroke: () => style().horizontalGrid,
|
|
292
295
|
xMarkers: horizontal ? () => domain().ticks : boundaries,
|
|
@@ -302,6 +305,7 @@ export const BarChart = component2d({
|
|
|
302
305
|
});
|
|
303
306
|
return asParts([
|
|
304
307
|
cartesianFrame({
|
|
308
|
+
background: () => style().background,
|
|
305
309
|
left,
|
|
306
310
|
ghost,
|
|
307
311
|
plot,
|