@fusion.dev/helix 0.40.0 → 0.41.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/custom-elements.json +320 -31
- package/dist/area-chart/root/area-chart-root.d.ts +27 -2
- package/dist/bar-chart/root/bar-chart-root.css.js +0 -1
- package/dist/bar-chart/root/bar-chart-root.d.ts +17 -5
- package/dist/bar-chart/root/bar-chart-root.js +2 -6
- package/dist/donut-chart/root/donut-chart-root.css.js +1 -1
- package/dist/donut-chart/root/donut-chart-root.d.ts +1 -1
- package/dist/legend/root/legend-root.js +2 -6
- package/dist/line-chart/root/line-chart-root.d.ts +15 -6
- package/dist/scatter-chart/root/scatter-chart-root.css.js +1 -1
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +25 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +761 -137
- package/types/vue.d.ts +101 -44
|
@@ -13,11 +13,35 @@ import '../../tooltip/index.js';
|
|
|
13
13
|
* the bands overlap where they are drawn and a translucent one would show the
|
|
14
14
|
* others through it.
|
|
15
15
|
*
|
|
16
|
+
* **No visual axis applies here, and that is the answer rather than a gap.**
|
|
17
|
+
* Both refusals are geometric and both were argued in the stylesheet before
|
|
18
|
+
* they were argued anywhere a reader looks.
|
|
19
|
+
*
|
|
20
|
+
* `emphasis` is which of a family's two marks carries the reading, and here
|
|
21
|
+
* neither can give way. The fill is the value, a band's thickness being its
|
|
22
|
+
* amount, and the edge is the boundary, which is why it is drawn at full color
|
|
23
|
+
* over a pale fill rather than left to two pale fills meeting. Every point on
|
|
24
|
+
* the axis moves one at the other's expense: `outlined` thins the fill until
|
|
25
|
+
* the chart is a set of cumulative lines, which is `LineChart` and is the form
|
|
26
|
+
* this one exists because a reader cannot read shares off; `solid` takes the
|
|
27
|
+
* fill to the series' own color, which is the edge's color, so the boundary
|
|
28
|
+
* disappears into the band it bounds. `LineChart` can take the axis because its
|
|
29
|
+
* wash is optional there, `area` deciding whether one is drawn at all.
|
|
30
|
+
*
|
|
31
|
+
* `material` is what reads through a mark, and a band cannot let anything
|
|
32
|
+
* through. Each is drawn as everything under its top edge with the next one
|
|
33
|
+
* down covering the rest, so a translucent band shows the bands behind it and
|
|
34
|
+
* reads as a third color that is in no palette. That is `LineChart`'s recorded
|
|
35
|
+
* reason for refusing `wash`, met here from the other side. The strength of a
|
|
36
|
+
* fill is still adjustable and is `--area-chart-fill-strength`, which is a
|
|
37
|
+
* continuum rather than an axis and is a theme's business rather than a
|
|
38
|
+
* reader's.
|
|
39
|
+
*
|
|
16
40
|
* @since 0.1.0
|
|
17
|
-
* @status
|
|
41
|
+
* @status stable
|
|
18
42
|
* @category charts
|
|
19
43
|
* @groups charts
|
|
20
|
-
* @aliases Stacked Area Chart, Composition Chart,
|
|
44
|
+
* @aliases Stacked Area Chart, Composition Chart, Banded Chart
|
|
21
45
|
* @documentation https://fusion.dev/helix/components/area-chart
|
|
22
46
|
*
|
|
23
47
|
* @cssproperty --area-chart-block-size - Height of the drawing.
|
|
@@ -25,6 +49,7 @@ import '../../tooltip/index.js';
|
|
|
25
49
|
* @cssproperty --area-chart-gap - Space between the drawing and its labels.
|
|
26
50
|
* @cssproperty --area-chart-gridline-color - One rule across the plot, under `gridlines`.
|
|
27
51
|
* @cssproperty --area-chart-width - Thickness of a band's top edge, over `--chart-stroke`.
|
|
52
|
+
* @cssproperty --chart-stroke - Thickness of a band's top edge, one name across this family, Line Chart and Bar Chart's `lines`, since the three read one shared rule. `--area-chart-width` overrides it here.
|
|
28
53
|
*/
|
|
29
54
|
export declare class HelixAreaChart extends HelixHeadlessAreaChart {
|
|
30
55
|
/** The styled tier, so the tooltip this renders is the styled one. */
|
|
@@ -267,7 +267,6 @@ var(--helix-color-background)
|
|
|
267
267
|
--_bar-chart-through: calc(0.62 * var(--helix-material-opacity));
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
[part="bar"][data-material="frosted"],
|
|
271
270
|
:host([material="frosted"]) [part="bar"]:not([data-material]) {
|
|
272
271
|
--_bar-chart-through: calc(0.88 * var(--helix-material-opacity));
|
|
273
272
|
}
|
|
@@ -11,7 +11,7 @@ import '../../tooltip/index.js';
|
|
|
11
11
|
* it is measured against.
|
|
12
12
|
*
|
|
13
13
|
* @since 0.1.0
|
|
14
|
-
* @status
|
|
14
|
+
* @status stable
|
|
15
15
|
* @category charts
|
|
16
16
|
* @groups charts
|
|
17
17
|
* @aliases Column Chart, Categorical Chart
|
|
@@ -26,6 +26,7 @@ import '../../tooltip/index.js';
|
|
|
26
26
|
* @cssproperty --bar-chart-gridline-color - One rule across the plot, under `gridlines`.
|
|
27
27
|
* @cssproperty --bar-chart-line-color - A `lines` series, overriding its series color.
|
|
28
28
|
* @cssproperty --bar-chart-line-width - Thickness of a `lines` series, over `--chart-stroke`.
|
|
29
|
+
* @cssproperty --chart-stroke - Thickness of a `lines` series, one name across this family, Line Chart and Area Chart's top edge, since the three read one shared rule. `--bar-chart-line-width` overrides it here.
|
|
29
30
|
*/
|
|
30
31
|
export declare class HelixBarChart extends HelixHeadlessBarChart {
|
|
31
32
|
/**
|
|
@@ -47,6 +48,12 @@ export declare class HelixBarChart extends HelixHeadlessBarChart {
|
|
|
47
48
|
* of the series color with that edge on it, and absent is the filled column,
|
|
48
49
|
* per the rule that a reflected property takes no default.
|
|
49
50
|
*
|
|
51
|
+
* `solid` is that filled column written out. It matches no rule in the sheet
|
|
52
|
+
* and lands on the base one, which is what the resting value of every axis in
|
|
53
|
+
* the registry does, and it is worth having so a consumer switching a chart
|
|
54
|
+
* between treatments has a word for the one it started at rather than having
|
|
55
|
+
* to remove the attribute.
|
|
56
|
+
*
|
|
50
57
|
* **It composes with `material` rather than competing with it.** Emphasis
|
|
51
58
|
* decides what is drawn and material decides how much of it comes through, so
|
|
52
59
|
* `glass` thins whatever emphasis put there: the fill on a solid column, the
|
|
@@ -109,10 +116,15 @@ export declare class HelixBarChart extends HelixHeadlessBarChart {
|
|
|
109
116
|
/**
|
|
110
117
|
* Which series are drawn as an outline rather than a fill, by name.
|
|
111
118
|
*
|
|
112
|
-
*
|
|
113
|
-
* the way `lines` and `secondary` are, so a chart says
|
|
114
|
-
* rather than counting columns. Names because they are
|
|
115
|
-
* carries and what the legend already shows.
|
|
119
|
+
* Separated by whitespace or commas and matched against the column headings
|
|
120
|
+
* the table gives, the way `lines` and `secondary` are, so a chart says
|
|
121
|
+
* `outlined="Forecast"` rather than counting columns. Names because they are
|
|
122
|
+
* what the table already carries and what the legend already shows.
|
|
123
|
+
*
|
|
124
|
+
* All five read one splitter, `seriesNames` in `core`, because the sentence
|
|
125
|
+
* above was true of the matching and false of the splitting: these three took
|
|
126
|
+
* a comma and those two did not, so `lines="Gateway, Billing"` drew no line
|
|
127
|
+
* and said nothing.
|
|
116
128
|
*
|
|
117
129
|
* **The case this exists for is a series that is not a measurement.** A
|
|
118
130
|
* forecast, a target, a budget: something drawn on the same axis as the
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, seriesIndex } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, seriesIndex, seriesNames } from '@fusion.dev/helix-core';
|
|
8
8
|
import { HelixHeadlessBarChart } from '@fusion.dev/helix-headless/bar-chart';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { styles as seriesStyles } from '../../shared/chart/series.css.js';
|
|
@@ -15,11 +15,7 @@ let HelixBarChart = class HelixBarChart extends HelixHeadlessBarChart {
|
|
|
15
15
|
static { this.tier = 'helix-'; }
|
|
16
16
|
updated(changed) {
|
|
17
17
|
super.updated(changed);
|
|
18
|
-
const slots = (list) => new Set((list
|
|
19
|
-
.split(/[\s,]+/)
|
|
20
|
-
.filter(Boolean)
|
|
21
|
-
.map((name) => name.toLowerCase())
|
|
22
|
-
.flatMap((name) => {
|
|
18
|
+
const slots = (list) => new Set(seriesNames(list).flatMap((name) => {
|
|
23
19
|
const at = this.series.findIndex((one) => one.name.trim().toLowerCase() === name);
|
|
24
20
|
return at < 0 ? [] : [seriesIndex(at)];
|
|
25
21
|
}));
|
|
@@ -60,7 +60,7 @@ box-sizing: border-box;
|
|
|
60
60
|
|
|
61
61
|
container-type: inline-size;
|
|
62
62
|
display: grid;
|
|
63
|
-
inline-size: calc(100% * (var(--_donut-chart-ring) - var(--donut-chart-stroke, 16)) / 100);
|
|
63
|
+
inline-size: calc(100% * (var(--_donut-chart-ring) - 2 * var(--donut-chart-stroke, 16)) / 100);
|
|
64
64
|
place-items: center;
|
|
65
65
|
text-align: center;
|
|
66
66
|
}
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, seriesNames } from '@fusion.dev/helix-core';
|
|
8
8
|
import { HelixHeadlessLegend } from '@fusion.dev/helix-headless/legend';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { styles as seriesStyles } from '../../shared/chart/series.css.js';
|
|
@@ -14,11 +14,7 @@ let HelixLegend = class HelixLegend extends HelixHeadlessLegend {
|
|
|
14
14
|
updated(changed) {
|
|
15
15
|
super.updated(changed);
|
|
16
16
|
const showing = this.names().map((name) => name.trim().toLowerCase());
|
|
17
|
-
const slots = (value) => new Set((value
|
|
18
|
-
.split(/[\s,]+/)
|
|
19
|
-
.filter(Boolean)
|
|
20
|
-
.map((name) => name.toLowerCase())
|
|
21
|
-
.flatMap((name) => {
|
|
17
|
+
const slots = (value) => new Set(seriesNames(value).flatMap((name) => {
|
|
22
18
|
const at = showing.indexOf(name);
|
|
23
19
|
return at < 0 ? [] : [at];
|
|
24
20
|
}));
|
|
@@ -13,19 +13,28 @@ import '../../tooltip/index.js';
|
|
|
13
13
|
* lets one drawing fill a narrow card and a wide panel, and without
|
|
14
14
|
* `vector-effect: non-scaling-stroke` the same line comes out hairline in the
|
|
15
15
|
* first and heavy in the second. It rescues strokes and not geometry, which is
|
|
16
|
-
* why
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* why nothing inside the drawing marks a reading: a circle in a stretched
|
|
17
|
+
* coordinate space is an ellipse, and there is no vector-effect that answers
|
|
18
|
+
* for a shape.
|
|
19
|
+
*
|
|
20
|
+
* **The last reading of each series is marked, and that is the same rule rather
|
|
21
|
+
* than an exception to it.** `terminus` draws an HTML element placed over the
|
|
22
|
+
* plot by percentage instead of a shape inside it, so it keeps its shape at any
|
|
23
|
+
* width. It is on by default, as a dot, because the column of marks at the far
|
|
24
|
+
* edge is where a reader looks for "and what is it now".
|
|
19
25
|
*
|
|
20
26
|
* @since 0.1.0
|
|
21
|
-
* @status
|
|
27
|
+
* @status stable
|
|
22
28
|
* @category charts
|
|
23
29
|
* @groups charts
|
|
24
30
|
* @aliases Time Series, Trend Chart, Multi-line Chart
|
|
25
31
|
* @documentation https://fusion.dev/helix/components/line-chart
|
|
26
32
|
*
|
|
27
|
-
* @cssproperty --chart-stroke - Thickness of a series drawn as a line,
|
|
28
|
-
* Chart's top edge and Bar Chart's `lines
|
|
33
|
+
* @cssproperty --chart-stroke - Thickness of a series drawn as a line, one name across this
|
|
34
|
+
* family, Area Chart's top edge and Bar Chart's `lines`, since the three read one shared
|
|
35
|
+
* rule. Each family's own width hook overrides it.
|
|
36
|
+
* @cssproperty --chart-terminus-hole - A fill for the middle of a `ring` terminus, which is otherwise open. One name across this family and Sparkline, the two reading one shared sheet.
|
|
37
|
+
* @cssproperty --chart-terminus-size - Size of the mark on each series' last reading. One name across this family and Sparkline, the two reading one shared sheet.
|
|
29
38
|
* @cssproperty --line-chart-area-opacity - How much of a line's color its wash takes.
|
|
30
39
|
* @cssproperty --line-chart-band-color - The slot the pointer is resting in.
|
|
31
40
|
* @cssproperty --line-chart-block-size - Height of the drawing.
|
|
@@ -12,8 +12,32 @@ import '../../tooltip/index.js';
|
|
|
12
12
|
* dense cluster reads as dense rather than as one blot, and two points that
|
|
13
13
|
* overlap each keep their edge.
|
|
14
14
|
*
|
|
15
|
+
* **No visual axis applies here, and that is the answer rather than a gap.**
|
|
16
|
+
* Both refusals come out of that sentence, and both were argued in the
|
|
17
|
+
* stylesheet before they were argued anywhere a reader looks.
|
|
18
|
+
*
|
|
19
|
+
* `emphasis` is how much ink a mark claims, and on a scatter that channel is
|
|
20
|
+
* already carrying data. The points rest at 0.8 so that where they pile up they
|
|
21
|
+
* compound: how dark a region is *is* how many rows are in it, which is most of
|
|
22
|
+
* what a reader is looking at a scatter to see and is the one thing a table of
|
|
23
|
+
* the same numbers hides. `solid` flattens a dense cluster and a sparse one into
|
|
24
|
+
* the same picture; `outlined` replaces the pile with overlapping rings, which
|
|
25
|
+
* reads as texture rather than as count. An axis whose two ends each cost the
|
|
26
|
+
* drawing its density is not a treatment, it is a second meaning for a property
|
|
27
|
+
* the chart already spends.
|
|
28
|
+
*
|
|
29
|
+
* `material` is the same refusal said once more. Translucency is the density
|
|
30
|
+
* channel here, so `glass` and `frosted` are two more named stops on a scale
|
|
31
|
+
* the data is using, and a point admitting the page through is a point that
|
|
32
|
+
* counts for less than one.
|
|
33
|
+
*
|
|
34
|
+
* What stays adjustable is `--scatter-chart-point-opacity`, and it is a
|
|
35
|
+
* continuum rather than an axis: a chart drawn over a busier ground wants a
|
|
36
|
+
* different resting density, and that is a fact about the ground rather than a
|
|
37
|
+
* claim about the points.
|
|
38
|
+
*
|
|
15
39
|
* @since 0.1.0
|
|
16
|
-
* @status
|
|
40
|
+
* @status stable
|
|
17
41
|
* @category charts
|
|
18
42
|
* @groups charts
|
|
19
43
|
* @aliases Scatter Plot, XY Chart, Correlation Chart, Dot Plot
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix",
|
|
3
3
|
"description": "Styled component tier. Extends the headless tier with token-driven presentation.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.41.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
},
|
|
48
48
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@fusion.dev/helix-core": "0.
|
|
51
|
-
"@fusion.dev/helix-headless": "0.
|
|
52
|
-
"@fusion.dev/helix-styles": "0.
|
|
50
|
+
"@fusion.dev/helix-core": "0.41.0",
|
|
51
|
+
"@fusion.dev/helix-headless": "0.41.0",
|
|
52
|
+
"@fusion.dev/helix-styles": "0.41.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
56
|
-
"@fusion.dev/helix-cem": "0.
|
|
57
|
-
"@fusion.dev/helix-testing": "0.
|
|
56
|
+
"@fusion.dev/helix-cem": "0.41.0",
|
|
57
|
+
"@fusion.dev/helix-testing": "0.41.0",
|
|
58
58
|
"@fusion.dev/scripts": "0.0.0-dev",
|
|
59
59
|
"@happy-dom/global-registrator": "^20.0.0",
|
|
60
60
|
"@lit-labs/ssr": "^4.1.0",
|