@mcp-b/viz-components 0.2.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/LICENSE +21 -0
- package/dist/chart-B-xXO_Qw.js +293 -0
- package/dist/components/chart/chart.d.ts +32 -0
- package/dist/components/chart/chart.js +2 -0
- package/dist/components/chart-card/chart-card.d.ts +22 -0
- package/dist/components/chart-card/chart-card.js +49 -0
- package/dist/components/distribution/distribution.d.ts +18 -0
- package/dist/components/distribution/distribution.js +31 -0
- package/dist/components/legend/legend.d.ts +22 -0
- package/dist/components/legend/legend.js +54 -0
- package/dist/components/metric-card/metric-card.d.ts +19 -0
- package/dist/components/metric-card/metric-card.js +48 -0
- package/dist/decorate-DcF3lt7P.js +9 -0
- package/dist/docs/custom-elements.json +444 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MCP-B contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
|
+
import { bin, extent } from "d3-array";
|
|
3
|
+
import { scaleBand, scaleLinear } from "d3-scale";
|
|
4
|
+
import { arc, area, line, pie } from "d3-shape";
|
|
5
|
+
import { css, html, nothing, svg } from "lit";
|
|
6
|
+
import { property } from "lit/decorators.js";
|
|
7
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
8
|
+
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
9
|
+
//#region src/components/chart/chart.styles.ts
|
|
10
|
+
var chart_styles_default = css`
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
min-inline-size: 0;
|
|
14
|
+
color: var(--sigvelo-color-text);
|
|
15
|
+
}
|
|
16
|
+
svg {
|
|
17
|
+
display: block;
|
|
18
|
+
inline-size: 100%;
|
|
19
|
+
block-size: auto;
|
|
20
|
+
min-block-size: 13rem;
|
|
21
|
+
overflow: visible;
|
|
22
|
+
}
|
|
23
|
+
.axis {
|
|
24
|
+
stroke: var(--sigvelo-color-neutral-border);
|
|
25
|
+
stroke-width: 1;
|
|
26
|
+
}
|
|
27
|
+
.grid {
|
|
28
|
+
stroke: var(--sigvelo-color-neutral-border-muted);
|
|
29
|
+
stroke-width: 1;
|
|
30
|
+
}
|
|
31
|
+
.tick-label,
|
|
32
|
+
.muted {
|
|
33
|
+
fill: var(--sigvelo-color-text-muted);
|
|
34
|
+
font: var(--sigvelo-text-xs) / var(--sigvelo-text-xs-leading) var(--sigvelo-font-sans);
|
|
35
|
+
}
|
|
36
|
+
.mark,
|
|
37
|
+
.line,
|
|
38
|
+
.area {
|
|
39
|
+
--sigvelo-viz-mark-color: var(--sigvelo-color-viz-series-1);
|
|
40
|
+
}
|
|
41
|
+
.mark {
|
|
42
|
+
fill: var(--sigvelo-viz-mark-color);
|
|
43
|
+
stroke: var(--sigvelo-color-surface);
|
|
44
|
+
stroke-width: 2;
|
|
45
|
+
}
|
|
46
|
+
.series-2 {
|
|
47
|
+
--sigvelo-viz-mark-color: var(--sigvelo-color-viz-series-2);
|
|
48
|
+
}
|
|
49
|
+
.series-3 {
|
|
50
|
+
--sigvelo-viz-mark-color: var(--sigvelo-color-viz-series-3);
|
|
51
|
+
}
|
|
52
|
+
.series-4 {
|
|
53
|
+
--sigvelo-viz-mark-color: var(--sigvelo-color-viz-series-4);
|
|
54
|
+
}
|
|
55
|
+
.series-5 {
|
|
56
|
+
--sigvelo-viz-mark-color: var(--sigvelo-color-viz-series-5);
|
|
57
|
+
}
|
|
58
|
+
.series-6 {
|
|
59
|
+
--sigvelo-viz-mark-color: var(--sigvelo-color-viz-series-6);
|
|
60
|
+
}
|
|
61
|
+
.line {
|
|
62
|
+
fill: none;
|
|
63
|
+
stroke: var(--sigvelo-viz-mark-color);
|
|
64
|
+
stroke-width: 3;
|
|
65
|
+
stroke-linecap: round;
|
|
66
|
+
stroke-linejoin: round;
|
|
67
|
+
}
|
|
68
|
+
.area {
|
|
69
|
+
fill: color-mix(in srgb, var(--sigvelo-viz-mark-color) 20%, transparent);
|
|
70
|
+
stroke: var(--sigvelo-viz-mark-color);
|
|
71
|
+
stroke-width: 2;
|
|
72
|
+
}
|
|
73
|
+
.empty {
|
|
74
|
+
color: var(--sigvelo-color-text-muted);
|
|
75
|
+
padding: var(--sigvelo-spacing-4);
|
|
76
|
+
}
|
|
77
|
+
@media (forced-colors: active) {
|
|
78
|
+
.axis,
|
|
79
|
+
.grid,
|
|
80
|
+
.mark,
|
|
81
|
+
.line,
|
|
82
|
+
.area {
|
|
83
|
+
stroke: CanvasText;
|
|
84
|
+
}
|
|
85
|
+
.mark,
|
|
86
|
+
.area {
|
|
87
|
+
fill: Canvas;
|
|
88
|
+
}
|
|
89
|
+
.tick-label,
|
|
90
|
+
.muted {
|
|
91
|
+
fill: CanvasText;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/chart/chart.ts
|
|
97
|
+
const WIDTH = 640;
|
|
98
|
+
const HEIGHT = 300;
|
|
99
|
+
const PADDING = {
|
|
100
|
+
top: 20,
|
|
101
|
+
right: 24,
|
|
102
|
+
bottom: 44,
|
|
103
|
+
left: 48
|
|
104
|
+
};
|
|
105
|
+
function numberAt(row, key) {
|
|
106
|
+
const value = row[key];
|
|
107
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
108
|
+
if (typeof value !== "string" || value.trim() === "") return void 0;
|
|
109
|
+
const parsed = Number(value);
|
|
110
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
111
|
+
}
|
|
112
|
+
function labelAt(row, key, index) {
|
|
113
|
+
const value = row[key];
|
|
114
|
+
return value === null || value === void 0 ? String(index + 1) : String(value);
|
|
115
|
+
}
|
|
116
|
+
function paddedExtent(values, includeZero) {
|
|
117
|
+
const [low = 0, high = 1] = extent(values);
|
|
118
|
+
const span = high - low;
|
|
119
|
+
const padding = span === 0 ? Math.max(1, Math.abs(low) * .1) : span * .1;
|
|
120
|
+
const lower = low - padding;
|
|
121
|
+
const upper = high + padding;
|
|
122
|
+
return includeZero ? [Math.min(0, lower), Math.max(0, upper)] : [lower, upper];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* <sigvelo-chart>
|
|
126
|
+
*
|
|
127
|
+
* @summary Renders a bounded set of data-driven SVG chart types using D3 scales and shapes.
|
|
128
|
+
* @tag sigvelo-chart
|
|
129
|
+
* @status stable
|
|
130
|
+
* @since 1.0
|
|
131
|
+
*/
|
|
132
|
+
var SigveloChart = class extends SigveloElement {
|
|
133
|
+
constructor(..._args) {
|
|
134
|
+
super(..._args);
|
|
135
|
+
this.type = "bar";
|
|
136
|
+
this.data = [];
|
|
137
|
+
this.xField = "label";
|
|
138
|
+
this.yField = "value";
|
|
139
|
+
this.labelField = "label";
|
|
140
|
+
this.label = "Chart";
|
|
141
|
+
}
|
|
142
|
+
static {
|
|
143
|
+
this.styles = [hostStyles, chart_styles_default];
|
|
144
|
+
}
|
|
145
|
+
#plot() {
|
|
146
|
+
const innerWidth = WIDTH - PADDING.left - PADDING.right;
|
|
147
|
+
const innerHeight = HEIGHT - PADDING.top - PADDING.bottom;
|
|
148
|
+
const numeric = this.data.map((row, index) => ({
|
|
149
|
+
row,
|
|
150
|
+
index,
|
|
151
|
+
value: numberAt(row, this.yField)
|
|
152
|
+
})).filter((entry) => entry.value !== void 0);
|
|
153
|
+
if (numeric.length === 0) return nothing;
|
|
154
|
+
const includeZero = this.type === "bar";
|
|
155
|
+
const y = scaleLinear().domain(paddedExtent(numeric.map((entry) => entry.value), includeZero)).nice().range([innerHeight, 0]);
|
|
156
|
+
const labels = numeric.map((entry) => labelAt(entry.row, this.xField, entry.index));
|
|
157
|
+
const xBand = scaleBand().domain(numeric.map((_, index) => index)).range([0, innerWidth]).padding(.2);
|
|
158
|
+
const baseline = includeZero ? y(0) : innerHeight;
|
|
159
|
+
const yTicks = y.ticks(4);
|
|
160
|
+
const labelStride = Math.max(1, Math.ceil(labels.length / 8));
|
|
161
|
+
const axes = svg`
|
|
162
|
+
${yTicks.map((tick) => {
|
|
163
|
+
const tickY = PADDING.top + y(tick);
|
|
164
|
+
return svg`<line
|
|
165
|
+
class="grid"
|
|
166
|
+
x1=${PADDING.left}
|
|
167
|
+
y1=${tickY}
|
|
168
|
+
x2=${PADDING.left + innerWidth}
|
|
169
|
+
y2=${tickY}
|
|
170
|
+
></line>
|
|
171
|
+
<text class="tick-label" x=${PADDING.left - 8} y=${tickY + 4} text-anchor="end"
|
|
172
|
+
>${tick}</text
|
|
173
|
+
>`;
|
|
174
|
+
})}
|
|
175
|
+
<line
|
|
176
|
+
class="axis"
|
|
177
|
+
x1=${PADDING.left}
|
|
178
|
+
y1=${PADDING.top + innerHeight}
|
|
179
|
+
x2=${PADDING.left + innerWidth}
|
|
180
|
+
y2=${PADDING.top + innerHeight}
|
|
181
|
+
></line>
|
|
182
|
+
<line
|
|
183
|
+
class="axis"
|
|
184
|
+
x1=${PADDING.left}
|
|
185
|
+
y1=${PADDING.top}
|
|
186
|
+
x2=${PADDING.left}
|
|
187
|
+
y2=${PADDING.top + innerHeight}
|
|
188
|
+
></line>
|
|
189
|
+
`;
|
|
190
|
+
const categoryTicks = svg`${labels.map((label, index) => {
|
|
191
|
+
if (index % labelStride !== 0 && index !== labels.length - 1) return nothing;
|
|
192
|
+
return svg`<text
|
|
193
|
+
class="tick-label"
|
|
194
|
+
x=${PADDING.left + (xBand(index) ?? 0) + xBand.bandwidth() / 2}
|
|
195
|
+
y=${PADDING.top + innerHeight + 22}
|
|
196
|
+
text-anchor="middle"
|
|
197
|
+
>${label}</text
|
|
198
|
+
>`;
|
|
199
|
+
})}`;
|
|
200
|
+
if (this.type === "donut") {
|
|
201
|
+
if (numeric.reduce((sum, entry) => sum + Math.max(0, entry.value), 0) <= 0) return nothing;
|
|
202
|
+
const shape = arc().innerRadius(64).outerRadius(112);
|
|
203
|
+
return svg`<g transform="translate(${WIDTH / 2}, ${HEIGHT / 2})">
|
|
204
|
+
${pie().value((entry) => Math.max(0, entry.value))(numeric).map((slice, index) => svg`<path
|
|
205
|
+
class="mark series-${index % 6 + 1}"
|
|
206
|
+
d=${shape(slice) ?? ""}
|
|
207
|
+
><title>
|
|
208
|
+
${labelAt(slice.data.row, this.labelField, slice.data.index)}: ${slice.data.value}
|
|
209
|
+
</title></path
|
|
210
|
+
>`)}
|
|
211
|
+
</g>`;
|
|
212
|
+
}
|
|
213
|
+
if (this.type === "histogram") {
|
|
214
|
+
const values = numeric.map((entry) => entry.value);
|
|
215
|
+
const bins = bin().thresholds(Math.min(12, Math.max(1, Math.ceil(Math.sqrt(values.length)))))(values);
|
|
216
|
+
const countScale = scaleLinear().domain([0, Math.max(1, ...bins.map((bucket) => bucket.length))]).range([innerHeight, 0]);
|
|
217
|
+
const bucketWidth = innerWidth / Math.max(1, bins.length);
|
|
218
|
+
return svg`${axes}<g transform="translate(${PADDING.left}, ${PADDING.top})"
|
|
219
|
+
>${bins.map((bucket, index) => svg`<rect
|
|
220
|
+
class="mark"
|
|
221
|
+
x=${index * bucketWidth + 1}
|
|
222
|
+
y=${countScale(bucket.length)}
|
|
223
|
+
width=${Math.max(1, bucketWidth - 2)}
|
|
224
|
+
height=${innerHeight - countScale(bucket.length)}
|
|
225
|
+
><title>${bucket.x0 ?? 0}–${bucket.x1 ?? 0}: ${bucket.length}</title></rect
|
|
226
|
+
>`)}</g
|
|
227
|
+
>`;
|
|
228
|
+
}
|
|
229
|
+
if (this.type === "bar") return svg`${axes}${categoryTicks}<g transform="translate(${PADDING.left}, ${PADDING.top})"
|
|
230
|
+
>${numeric.map((entry, index) => {
|
|
231
|
+
const x = xBand(index) ?? 0;
|
|
232
|
+
const yValue = y(entry.value);
|
|
233
|
+
return svg`<rect
|
|
234
|
+
class="mark"
|
|
235
|
+
x=${x}
|
|
236
|
+
y=${Math.min(yValue, baseline)}
|
|
237
|
+
width=${xBand.bandwidth()}
|
|
238
|
+
height=${Math.abs(baseline - yValue)}
|
|
239
|
+
><title>
|
|
240
|
+
${labelAt(entry.row, this.labelField, entry.index)}: ${entry.value}
|
|
241
|
+
</title></rect
|
|
242
|
+
>`;
|
|
243
|
+
})}</g
|
|
244
|
+
>`;
|
|
245
|
+
const points = numeric.map((entry, index) => ({
|
|
246
|
+
...entry,
|
|
247
|
+
x: (xBand(index) ?? 0) + xBand.bandwidth() / 2
|
|
248
|
+
}));
|
|
249
|
+
if (this.type === "scatter") return svg`${axes}${categoryTicks}<g transform="translate(${PADDING.left}, ${PADDING.top})"
|
|
250
|
+
>${points.map((point) => svg`<circle
|
|
251
|
+
class="mark"
|
|
252
|
+
cx=${point.x}
|
|
253
|
+
cy=${y(point.value)}
|
|
254
|
+
r="5"
|
|
255
|
+
><title>
|
|
256
|
+
${labelAt(point.row, this.labelField, point.index)}: ${point.value}
|
|
257
|
+
</title></circle
|
|
258
|
+
>`)}</g
|
|
259
|
+
>`;
|
|
260
|
+
const path = line().x((point) => point.x).y((point) => y(point.value))(points) ?? "";
|
|
261
|
+
if (this.type === "area") {
|
|
262
|
+
const areaPath = area().x((point) => point.x).y0(baseline).y1((point) => y(point.value))(points) ?? "";
|
|
263
|
+
return svg`${axes}${categoryTicks}<g transform="translate(${PADDING.left}, ${PADDING.top})"
|
|
264
|
+
><path class="area" d=${areaPath}></path></g>`;
|
|
265
|
+
}
|
|
266
|
+
return svg`${axes}${categoryTicks}<g transform="translate(${PADDING.left}, ${PADDING.top})"
|
|
267
|
+
><path class="line" d=${path}></path>${points.map((point) => svg`<circle
|
|
268
|
+
class="mark"
|
|
269
|
+
cx=${point.x}
|
|
270
|
+
cy=${y(point.value)}
|
|
271
|
+
r="5"
|
|
272
|
+
><title>
|
|
273
|
+
${labelAt(point.row, this.labelField, point.index)}: ${point.value}
|
|
274
|
+
</title></circle
|
|
275
|
+
>`)}</g
|
|
276
|
+
>`;
|
|
277
|
+
}
|
|
278
|
+
render() {
|
|
279
|
+
const plot = this.#plot();
|
|
280
|
+
return plot === nothing ? html`<p class="empty" part="empty">No numeric data available.</p>` : html`<svg viewBox="0 0 ${WIDTH} ${HEIGHT}" role="img" aria-label=${this.label} part="chart">
|
|
281
|
+
${plot}
|
|
282
|
+
</svg>`;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
__decorate([property({ reflect: true })], SigveloChart.prototype, "type", void 0);
|
|
286
|
+
__decorate([property({ attribute: false })], SigveloChart.prototype, "data", void 0);
|
|
287
|
+
__decorate([property({ attribute: "x-field" })], SigveloChart.prototype, "xField", void 0);
|
|
288
|
+
__decorate([property({ attribute: "y-field" })], SigveloChart.prototype, "yField", void 0);
|
|
289
|
+
__decorate([property({ attribute: "label-field" })], SigveloChart.prototype, "labelField", void 0);
|
|
290
|
+
__decorate([property()], SigveloChart.prototype, "label", void 0);
|
|
291
|
+
customElements.define("sigvelo-chart", SigveloChart);
|
|
292
|
+
//#endregion
|
|
293
|
+
export { SigveloChart as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
3
|
+
|
|
4
|
+
//#region src/components/chart/chart.d.ts
|
|
5
|
+
type ChartType = "bar" | "line" | "area" | "scatter" | "donut" | "histogram";
|
|
6
|
+
type ChartDatum = Readonly<Record<string, string | number | boolean | null>>;
|
|
7
|
+
/**
|
|
8
|
+
* <sigvelo-chart>
|
|
9
|
+
*
|
|
10
|
+
* @summary Renders a bounded set of data-driven SVG chart types using D3 scales and shapes.
|
|
11
|
+
* @tag sigvelo-chart
|
|
12
|
+
* @status stable
|
|
13
|
+
* @since 1.0
|
|
14
|
+
*/
|
|
15
|
+
declare class SigveloChart extends SigveloElement {
|
|
16
|
+
#private;
|
|
17
|
+
static styles: CSSResultGroup;
|
|
18
|
+
type: ChartType;
|
|
19
|
+
data: readonly ChartDatum[];
|
|
20
|
+
xField: string;
|
|
21
|
+
yField: string;
|
|
22
|
+
labelField: string;
|
|
23
|
+
label: string;
|
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
"sigvelo-chart": SigveloChart;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ChartDatum, ChartType, SigveloChart };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
3
|
+
|
|
4
|
+
//#region src/components/chart-card/chart-card.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* @tag sigvelo-chart-card
|
|
7
|
+
* @summary A titled card composition for a chart or thematic map.
|
|
8
|
+
* @slot - A chart or distribution component.
|
|
9
|
+
*/
|
|
10
|
+
declare class SigveloChartCard extends SigveloElement {
|
|
11
|
+
static styles: CSSResultGroup;
|
|
12
|
+
heading: string;
|
|
13
|
+
description: string;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"sigvelo-chart-card": SigveloChartCard;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { SigveloChartCard };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { t as __decorate } from "../../decorate-DcF3lt7P.js";
|
|
2
|
+
import { css, html } from "lit";
|
|
3
|
+
import { property } from "lit/decorators.js";
|
|
4
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
5
|
+
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
6
|
+
//#region src/components/chart-card/chart-card.ts
|
|
7
|
+
const styles = css`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
border: 1px solid var(--sigvelo-color-neutral-border-muted);
|
|
11
|
+
border-radius: var(--sigvelo-radius-md);
|
|
12
|
+
padding: var(--sigvelo-spacing-4);
|
|
13
|
+
}
|
|
14
|
+
h3 {
|
|
15
|
+
margin: 0 0 var(--sigvelo-spacing-1);
|
|
16
|
+
font: var(--sigvelo-font-weight-semibold)
|
|
17
|
+
var(--sigvelo-text-base) / var(--sigvelo-text-base-leading) var(--sigvelo-font-heading);
|
|
18
|
+
}
|
|
19
|
+
p {
|
|
20
|
+
margin: 0 0 var(--sigvelo-spacing-4);
|
|
21
|
+
color: var(--sigvelo-color-text-muted);
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
/**
|
|
25
|
+
* @tag sigvelo-chart-card
|
|
26
|
+
* @summary A titled card composition for a chart or thematic map.
|
|
27
|
+
* @slot - A chart or distribution component.
|
|
28
|
+
*/
|
|
29
|
+
var SigveloChartCard = class extends SigveloElement {
|
|
30
|
+
constructor(..._args) {
|
|
31
|
+
super(..._args);
|
|
32
|
+
this.heading = "";
|
|
33
|
+
this.description = "";
|
|
34
|
+
}
|
|
35
|
+
static {
|
|
36
|
+
this.styles = [hostStyles, styles];
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return html`<section part="card">
|
|
40
|
+
<h3 part="heading">${this.heading}</h3>
|
|
41
|
+
${this.description ? html`<p part="description">${this.description}</p>` : ""}<slot></slot>
|
|
42
|
+
</section>`;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
__decorate([property()], SigveloChartCard.prototype, "heading", void 0);
|
|
46
|
+
__decorate([property()], SigveloChartCard.prototype, "description", void 0);
|
|
47
|
+
customElements.define("sigvelo-chart-card", SigveloChartCard);
|
|
48
|
+
//#endregion
|
|
49
|
+
export { SigveloChartCard };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
3
|
+
|
|
4
|
+
//#region src/components/distribution/distribution.d.ts
|
|
5
|
+
/** @tag sigvelo-distribution @summary Renders a numeric distribution as a bounded histogram. */
|
|
6
|
+
declare class SigveloDistribution extends SigveloElement {
|
|
7
|
+
static styles: CSSResultGroup;
|
|
8
|
+
values: readonly (number | null)[];
|
|
9
|
+
label: string;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
"sigvelo-distribution": SigveloDistribution;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SigveloDistribution };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "../../chart-B-xXO_Qw.js";
|
|
2
|
+
import { t as __decorate } from "../../decorate-DcF3lt7P.js";
|
|
3
|
+
import { html } from "lit";
|
|
4
|
+
import { property } from "lit/decorators.js";
|
|
5
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
6
|
+
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
7
|
+
//#region src/components/distribution/distribution.ts
|
|
8
|
+
/** @tag sigvelo-distribution @summary Renders a numeric distribution as a bounded histogram. */
|
|
9
|
+
var SigveloDistribution = class extends SigveloElement {
|
|
10
|
+
constructor(..._args) {
|
|
11
|
+
super(..._args);
|
|
12
|
+
this.values = [];
|
|
13
|
+
this.label = "Distribution";
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.styles = [hostStyles];
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return html`<sigvelo-chart
|
|
20
|
+
type="histogram"
|
|
21
|
+
label=${this.label}
|
|
22
|
+
y-field="value"
|
|
23
|
+
.data=${this.values.map((value) => ({ value }))}
|
|
24
|
+
></sigvelo-chart>`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
__decorate([property({ attribute: false })], SigveloDistribution.prototype, "values", void 0);
|
|
28
|
+
__decorate([property()], SigveloDistribution.prototype, "label", void 0);
|
|
29
|
+
customElements.define("sigvelo-distribution", SigveloDistribution);
|
|
30
|
+
//#endregion
|
|
31
|
+
export { SigveloDistribution };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
3
|
+
|
|
4
|
+
//#region src/components/legend/legend.d.ts
|
|
5
|
+
interface LegendItem {
|
|
6
|
+
label: string;
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
/** @tag sigvelo-viz-legend @summary Displays a compact color legend for charts and thematic maps. */
|
|
10
|
+
declare class SigveloVizLegend extends SigveloElement {
|
|
11
|
+
static styles: CSSResultGroup;
|
|
12
|
+
title: string;
|
|
13
|
+
items: readonly LegendItem[];
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"sigvelo-viz-legend": SigveloVizLegend;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { LegendItem, SigveloVizLegend };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as __decorate } from "../../decorate-DcF3lt7P.js";
|
|
2
|
+
import { css, html } from "lit";
|
|
3
|
+
import { property } from "lit/decorators.js";
|
|
4
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
5
|
+
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
6
|
+
//#region src/components/legend/legend.ts
|
|
7
|
+
const styles = css`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
.items {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
gap: var(--sigvelo-spacing-2);
|
|
15
|
+
}
|
|
16
|
+
.item {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 6px;
|
|
20
|
+
}
|
|
21
|
+
.swatch {
|
|
22
|
+
inline-size: 12px;
|
|
23
|
+
block-size: 12px;
|
|
24
|
+
border-radius: 2px;
|
|
25
|
+
border: 1px solid var(--sigvelo-color-neutral-border-muted);
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
/** @tag sigvelo-viz-legend @summary Displays a compact color legend for charts and thematic maps. */
|
|
29
|
+
var SigveloVizLegend = class extends SigveloElement {
|
|
30
|
+
constructor(..._args) {
|
|
31
|
+
super(..._args);
|
|
32
|
+
this.title = "Legend";
|
|
33
|
+
this.items = [];
|
|
34
|
+
}
|
|
35
|
+
static {
|
|
36
|
+
this.styles = [hostStyles, styles];
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return html`<section aria-label=${this.title} part="legend">
|
|
40
|
+
<strong part="title">${this.title}</strong>
|
|
41
|
+
<div class="items">
|
|
42
|
+
${this.items.map((item) => html`<span class="item" part="item"
|
|
43
|
+
><span class="swatch" style=${`background:${item.color}`} part="swatch"></span
|
|
44
|
+
>${item.label}</span
|
|
45
|
+
>`)}
|
|
46
|
+
</div>
|
|
47
|
+
</section>`;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
__decorate([property()], SigveloVizLegend.prototype, "title", void 0);
|
|
51
|
+
__decorate([property({ attribute: false })], SigveloVizLegend.prototype, "items", void 0);
|
|
52
|
+
customElements.define("sigvelo-viz-legend", SigveloVizLegend);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { SigveloVizLegend };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
3
|
+
|
|
4
|
+
//#region src/components/metric-card/metric-card.d.ts
|
|
5
|
+
/** @tag sigvelo-metric-card @summary A labeled key-metric card composition. */
|
|
6
|
+
declare class SigveloMetricCard extends SigveloElement {
|
|
7
|
+
static styles: CSSResultGroup;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
detail: string;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
"sigvelo-metric-card": SigveloMetricCard;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { SigveloMetricCard };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { t as __decorate } from "../../decorate-DcF3lt7P.js";
|
|
2
|
+
import { css, html } from "lit";
|
|
3
|
+
import { property } from "lit/decorators.js";
|
|
4
|
+
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
5
|
+
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
6
|
+
//#region src/components/metric-card/metric-card.ts
|
|
7
|
+
const styles = css`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
border: 1px solid var(--sigvelo-color-neutral-border-muted);
|
|
11
|
+
border-radius: var(--sigvelo-radius-md);
|
|
12
|
+
padding: var(--sigvelo-spacing-4);
|
|
13
|
+
}
|
|
14
|
+
p {
|
|
15
|
+
margin: 0;
|
|
16
|
+
color: var(--sigvelo-color-text-muted);
|
|
17
|
+
}
|
|
18
|
+
strong {
|
|
19
|
+
display: block;
|
|
20
|
+
margin-top: var(--sigvelo-spacing-1);
|
|
21
|
+
font: var(--sigvelo-font-weight-semibold)
|
|
22
|
+
var(--sigvelo-text-2xl) / var(--sigvelo-text-2xl-leading) var(--sigvelo-font-heading);
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
/** @tag sigvelo-metric-card @summary A labeled key-metric card composition. */
|
|
26
|
+
var SigveloMetricCard = class extends SigveloElement {
|
|
27
|
+
constructor(..._args) {
|
|
28
|
+
super(..._args);
|
|
29
|
+
this.label = "";
|
|
30
|
+
this.value = "";
|
|
31
|
+
this.detail = "";
|
|
32
|
+
}
|
|
33
|
+
static {
|
|
34
|
+
this.styles = [hostStyles, styles];
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return html`<section part="card">
|
|
38
|
+
<p part="label">${this.label}</p>
|
|
39
|
+
<strong part="value">${this.value}</strong>${this.detail ? html`<p part="detail">${this.detail}</p>` : ""}
|
|
40
|
+
</section>`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorate([property()], SigveloMetricCard.prototype, "label", void 0);
|
|
44
|
+
__decorate([property()], SigveloMetricCard.prototype, "value", void 0);
|
|
45
|
+
__decorate([property()], SigveloMetricCard.prototype, "detail", void 0);
|
|
46
|
+
customElements.define("sigvelo-metric-card", SigveloMetricCard);
|
|
47
|
+
//#endregion
|
|
48
|
+
export { SigveloMetricCard };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.138.0/helpers/esm/decorate.js
|
|
2
|
+
function __decorate(decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { __decorate as t };
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/index.ts",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "js",
|
|
12
|
+
"name": "*",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "*",
|
|
15
|
+
"module": "src/components/chart/chart.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "*",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "*",
|
|
23
|
+
"module": "src/components/chart-card/chart-card.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "js",
|
|
28
|
+
"name": "*",
|
|
29
|
+
"declaration": {
|
|
30
|
+
"name": "*",
|
|
31
|
+
"module": "src/components/distribution/distribution.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"kind": "js",
|
|
36
|
+
"name": "*",
|
|
37
|
+
"declaration": {
|
|
38
|
+
"name": "*",
|
|
39
|
+
"module": "src/components/legend/legend.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"kind": "js",
|
|
44
|
+
"name": "*",
|
|
45
|
+
"declaration": {
|
|
46
|
+
"name": "*",
|
|
47
|
+
"module": "src/components/metric-card/metric-card.js"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"kind": "javascript-module",
|
|
54
|
+
"path": "src/components/chart/chart.ts",
|
|
55
|
+
"declarations": [
|
|
56
|
+
{
|
|
57
|
+
"kind": "class",
|
|
58
|
+
"description": "<sigvelo-chart>",
|
|
59
|
+
"name": "SigveloChart",
|
|
60
|
+
"members": [
|
|
61
|
+
{
|
|
62
|
+
"kind": "field",
|
|
63
|
+
"name": "styles",
|
|
64
|
+
"type": {
|
|
65
|
+
"text": "CSSResultGroup"
|
|
66
|
+
},
|
|
67
|
+
"static": true,
|
|
68
|
+
"default": "[hostStyles, styles]"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"kind": "field",
|
|
72
|
+
"name": "type",
|
|
73
|
+
"type": {
|
|
74
|
+
"text": "ChartType"
|
|
75
|
+
},
|
|
76
|
+
"default": "\"bar\""
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"kind": "field",
|
|
80
|
+
"name": "data",
|
|
81
|
+
"type": {
|
|
82
|
+
"text": "readonly ChartDatum[]"
|
|
83
|
+
},
|
|
84
|
+
"default": "[]"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"kind": "field",
|
|
88
|
+
"name": "xField",
|
|
89
|
+
"type": {
|
|
90
|
+
"text": "string"
|
|
91
|
+
},
|
|
92
|
+
"default": "\"label\""
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"kind": "field",
|
|
96
|
+
"name": "yField",
|
|
97
|
+
"type": {
|
|
98
|
+
"text": "string"
|
|
99
|
+
},
|
|
100
|
+
"default": "\"value\""
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"kind": "field",
|
|
104
|
+
"name": "labelField",
|
|
105
|
+
"type": {
|
|
106
|
+
"text": "string"
|
|
107
|
+
},
|
|
108
|
+
"default": "\"label\""
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"kind": "field",
|
|
112
|
+
"name": "label",
|
|
113
|
+
"type": {
|
|
114
|
+
"text": "string"
|
|
115
|
+
},
|
|
116
|
+
"default": "\"Chart\""
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"kind": "method",
|
|
120
|
+
"name": "#plot",
|
|
121
|
+
"privacy": "private",
|
|
122
|
+
"return": {
|
|
123
|
+
"type": {
|
|
124
|
+
"text": "unknown"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"kind": "method",
|
|
130
|
+
"name": "render"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"superclass": {
|
|
134
|
+
"name": "SigveloElement",
|
|
135
|
+
"package": "@mcp-b/wc-support/base/sigvelo-element"
|
|
136
|
+
},
|
|
137
|
+
"tagName": "sigvelo-chart",
|
|
138
|
+
"customElement": true,
|
|
139
|
+
"summary": "Renders a bounded set of data-driven SVG chart types using D3 scales and shapes."
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"exports": [
|
|
143
|
+
{
|
|
144
|
+
"kind": "js",
|
|
145
|
+
"name": "SigveloChart",
|
|
146
|
+
"declaration": {
|
|
147
|
+
"name": "SigveloChart",
|
|
148
|
+
"module": "src/components/chart/chart.ts"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"kind": "custom-element-definition",
|
|
153
|
+
"name": "sigvelo-chart",
|
|
154
|
+
"declaration": {
|
|
155
|
+
"name": "SigveloChart",
|
|
156
|
+
"module": "src/components/chart/chart.ts"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"kind": "javascript-module",
|
|
163
|
+
"path": "src/components/distribution/distribution.ts",
|
|
164
|
+
"declarations": [
|
|
165
|
+
{
|
|
166
|
+
"kind": "class",
|
|
167
|
+
"description": "",
|
|
168
|
+
"name": "SigveloDistribution",
|
|
169
|
+
"members": [
|
|
170
|
+
{
|
|
171
|
+
"kind": "field",
|
|
172
|
+
"name": "styles",
|
|
173
|
+
"type": {
|
|
174
|
+
"text": "CSSResultGroup"
|
|
175
|
+
},
|
|
176
|
+
"static": true,
|
|
177
|
+
"default": "[hostStyles]"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"kind": "field",
|
|
181
|
+
"name": "values",
|
|
182
|
+
"type": {
|
|
183
|
+
"text": "readonly (number | null)[]"
|
|
184
|
+
},
|
|
185
|
+
"default": "[]"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"kind": "field",
|
|
189
|
+
"name": "label",
|
|
190
|
+
"type": {
|
|
191
|
+
"text": "string"
|
|
192
|
+
},
|
|
193
|
+
"default": "\"Distribution\""
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"kind": "method",
|
|
197
|
+
"name": "render"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"superclass": {
|
|
201
|
+
"name": "SigveloElement",
|
|
202
|
+
"package": "@mcp-b/wc-support/base/sigvelo-element"
|
|
203
|
+
},
|
|
204
|
+
"tagName": "sigvelo-distribution",
|
|
205
|
+
"customElement": true,
|
|
206
|
+
"summary": "Renders a numeric distribution as a bounded histogram."
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"exports": [
|
|
210
|
+
{
|
|
211
|
+
"kind": "js",
|
|
212
|
+
"name": "SigveloDistribution",
|
|
213
|
+
"declaration": {
|
|
214
|
+
"name": "SigveloDistribution",
|
|
215
|
+
"module": "src/components/distribution/distribution.ts"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"kind": "custom-element-definition",
|
|
220
|
+
"name": "sigvelo-distribution",
|
|
221
|
+
"declaration": {
|
|
222
|
+
"name": "SigveloDistribution",
|
|
223
|
+
"module": "src/components/distribution/distribution.ts"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"kind": "javascript-module",
|
|
230
|
+
"path": "src/components/chart-card/chart-card.ts",
|
|
231
|
+
"declarations": [
|
|
232
|
+
{
|
|
233
|
+
"kind": "class",
|
|
234
|
+
"description": "",
|
|
235
|
+
"name": "SigveloChartCard",
|
|
236
|
+
"slots": [
|
|
237
|
+
{
|
|
238
|
+
"description": "A chart or distribution component.",
|
|
239
|
+
"name": ""
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"members": [
|
|
243
|
+
{
|
|
244
|
+
"kind": "field",
|
|
245
|
+
"name": "styles",
|
|
246
|
+
"type": {
|
|
247
|
+
"text": "CSSResultGroup"
|
|
248
|
+
},
|
|
249
|
+
"static": true,
|
|
250
|
+
"default": "[hostStyles, styles]"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"kind": "field",
|
|
254
|
+
"name": "heading",
|
|
255
|
+
"type": {
|
|
256
|
+
"text": "string"
|
|
257
|
+
},
|
|
258
|
+
"default": "\"\""
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"kind": "field",
|
|
262
|
+
"name": "description",
|
|
263
|
+
"type": {
|
|
264
|
+
"text": "string"
|
|
265
|
+
},
|
|
266
|
+
"default": "\"\""
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"kind": "method",
|
|
270
|
+
"name": "render"
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"superclass": {
|
|
274
|
+
"name": "SigveloElement",
|
|
275
|
+
"package": "@mcp-b/wc-support/base/sigvelo-element"
|
|
276
|
+
},
|
|
277
|
+
"tagName": "sigvelo-chart-card",
|
|
278
|
+
"customElement": true,
|
|
279
|
+
"summary": "A titled card composition for a chart or thematic map."
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"exports": [
|
|
283
|
+
{
|
|
284
|
+
"kind": "js",
|
|
285
|
+
"name": "SigveloChartCard",
|
|
286
|
+
"declaration": {
|
|
287
|
+
"name": "SigveloChartCard",
|
|
288
|
+
"module": "src/components/chart-card/chart-card.ts"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"kind": "custom-element-definition",
|
|
293
|
+
"name": "sigvelo-chart-card",
|
|
294
|
+
"declaration": {
|
|
295
|
+
"name": "SigveloChartCard",
|
|
296
|
+
"module": "src/components/chart-card/chart-card.ts"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"kind": "javascript-module",
|
|
303
|
+
"path": "src/components/metric-card/metric-card.ts",
|
|
304
|
+
"declarations": [
|
|
305
|
+
{
|
|
306
|
+
"kind": "class",
|
|
307
|
+
"description": "",
|
|
308
|
+
"name": "SigveloMetricCard",
|
|
309
|
+
"members": [
|
|
310
|
+
{
|
|
311
|
+
"kind": "field",
|
|
312
|
+
"name": "styles",
|
|
313
|
+
"type": {
|
|
314
|
+
"text": "CSSResultGroup"
|
|
315
|
+
},
|
|
316
|
+
"static": true,
|
|
317
|
+
"default": "[hostStyles, styles]"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"kind": "field",
|
|
321
|
+
"name": "label",
|
|
322
|
+
"type": {
|
|
323
|
+
"text": "string"
|
|
324
|
+
},
|
|
325
|
+
"default": "\"\""
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"kind": "field",
|
|
329
|
+
"name": "value",
|
|
330
|
+
"type": {
|
|
331
|
+
"text": "string"
|
|
332
|
+
},
|
|
333
|
+
"default": "\"\""
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"kind": "field",
|
|
337
|
+
"name": "detail",
|
|
338
|
+
"type": {
|
|
339
|
+
"text": "string"
|
|
340
|
+
},
|
|
341
|
+
"default": "\"\""
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"kind": "method",
|
|
345
|
+
"name": "render"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"superclass": {
|
|
349
|
+
"name": "SigveloElement",
|
|
350
|
+
"package": "@mcp-b/wc-support/base/sigvelo-element"
|
|
351
|
+
},
|
|
352
|
+
"tagName": "sigvelo-metric-card",
|
|
353
|
+
"customElement": true,
|
|
354
|
+
"summary": "A labeled key-metric card composition."
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
"exports": [
|
|
358
|
+
{
|
|
359
|
+
"kind": "js",
|
|
360
|
+
"name": "SigveloMetricCard",
|
|
361
|
+
"declaration": {
|
|
362
|
+
"name": "SigveloMetricCard",
|
|
363
|
+
"module": "src/components/metric-card/metric-card.ts"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"kind": "custom-element-definition",
|
|
368
|
+
"name": "sigvelo-metric-card",
|
|
369
|
+
"declaration": {
|
|
370
|
+
"name": "SigveloMetricCard",
|
|
371
|
+
"module": "src/components/metric-card/metric-card.ts"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
]
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"kind": "javascript-module",
|
|
378
|
+
"path": "src/components/legend/legend.ts",
|
|
379
|
+
"declarations": [
|
|
380
|
+
{
|
|
381
|
+
"kind": "class",
|
|
382
|
+
"description": "",
|
|
383
|
+
"name": "SigveloVizLegend",
|
|
384
|
+
"members": [
|
|
385
|
+
{
|
|
386
|
+
"kind": "field",
|
|
387
|
+
"name": "styles",
|
|
388
|
+
"type": {
|
|
389
|
+
"text": "CSSResultGroup"
|
|
390
|
+
},
|
|
391
|
+
"static": true,
|
|
392
|
+
"default": "[hostStyles, styles]"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"kind": "field",
|
|
396
|
+
"name": "title",
|
|
397
|
+
"type": {
|
|
398
|
+
"text": "string"
|
|
399
|
+
},
|
|
400
|
+
"default": "\"Legend\""
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"kind": "field",
|
|
404
|
+
"name": "items",
|
|
405
|
+
"type": {
|
|
406
|
+
"text": "readonly LegendItem[]"
|
|
407
|
+
},
|
|
408
|
+
"default": "[]"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"kind": "method",
|
|
412
|
+
"name": "render"
|
|
413
|
+
}
|
|
414
|
+
],
|
|
415
|
+
"superclass": {
|
|
416
|
+
"name": "SigveloElement",
|
|
417
|
+
"package": "@mcp-b/wc-support/base/sigvelo-element"
|
|
418
|
+
},
|
|
419
|
+
"tagName": "sigvelo-viz-legend",
|
|
420
|
+
"customElement": true,
|
|
421
|
+
"summary": "Displays a compact color legend for charts and thematic maps."
|
|
422
|
+
}
|
|
423
|
+
],
|
|
424
|
+
"exports": [
|
|
425
|
+
{
|
|
426
|
+
"kind": "js",
|
|
427
|
+
"name": "SigveloVizLegend",
|
|
428
|
+
"declaration": {
|
|
429
|
+
"name": "SigveloVizLegend",
|
|
430
|
+
"module": "src/components/legend/legend.ts"
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"kind": "custom-element-definition",
|
|
435
|
+
"name": "sigvelo-viz-legend",
|
|
436
|
+
"declaration": {
|
|
437
|
+
"name": "SigveloVizLegend",
|
|
438
|
+
"module": "src/components/legend/legend.ts"
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SigveloChartCard } from "./components/chart-card/chart-card.js";
|
|
2
|
+
import { ChartDatum, ChartType, SigveloChart } from "./components/chart/chart.js";
|
|
3
|
+
import { SigveloDistribution } from "./components/distribution/distribution.js";
|
|
4
|
+
import { LegendItem, SigveloVizLegend } from "./components/legend/legend.js";
|
|
5
|
+
import { SigveloMetricCard } from "./components/metric-card/metric-card.js";
|
|
6
|
+
export { ChartDatum, ChartType, LegendItem, SigveloChart, SigveloChartCard, SigveloDistribution, SigveloMetricCard, SigveloVizLegend };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { t as SigveloChart } from "./chart-B-xXO_Qw.js";
|
|
2
|
+
import { SigveloChartCard } from "./components/chart-card/chart-card.js";
|
|
3
|
+
import { SigveloDistribution } from "./components/distribution/distribution.js";
|
|
4
|
+
import { SigveloVizLegend } from "./components/legend/legend.js";
|
|
5
|
+
import { SigveloMetricCard } from "./components/metric-card/metric-card.js";
|
|
6
|
+
export { SigveloChart, SigveloChartCard, SigveloDistribution, SigveloMetricCard, SigveloVizLegend };
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcp-b/viz-components",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "D3-backed, framework-agnostic Sigvelo visualization web components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"charts",
|
|
7
|
+
"d3",
|
|
8
|
+
"lit",
|
|
9
|
+
"visualization",
|
|
10
|
+
"web-components"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./components/*": "./dist/components/*",
|
|
24
|
+
"./custom-elements.json": "./dist/docs/custom-elements.json"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@mcp-b/wc-support": "0.2.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@custom-elements-manifest/analyzer": "^0.10.4",
|
|
34
|
+
"@storybook/addon-a11y": "^10.5.2",
|
|
35
|
+
"@storybook/addon-docs": "^10.5.2",
|
|
36
|
+
"@storybook/addon-vitest": "^10.5.2",
|
|
37
|
+
"@storybook/web-components-vite": "10.5.2",
|
|
38
|
+
"@types/d3-array": "^3.2.2",
|
|
39
|
+
"@types/d3-format": "^3.0.4",
|
|
40
|
+
"@types/d3-geo": "^3.1.0",
|
|
41
|
+
"@types/d3-scale": "^4.0.9",
|
|
42
|
+
"@types/d3-shape": "^3.1.7",
|
|
43
|
+
"d3-array": "^3.2.4",
|
|
44
|
+
"d3-format": "^3.1.0",
|
|
45
|
+
"d3-geo": "^3.1.1",
|
|
46
|
+
"d3-scale": "^4.0.2",
|
|
47
|
+
"d3-shape": "^3.2.0",
|
|
48
|
+
"lit": "^3.3.2",
|
|
49
|
+
"playwright": "~1.61.0",
|
|
50
|
+
"storybook": "^10.5.2",
|
|
51
|
+
"tinyglobby": "^0.2.15",
|
|
52
|
+
"typescript": "^6.0.3",
|
|
53
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.4",
|
|
54
|
+
"vitest": "^4.1.10"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"d3-array": "^3.2.4",
|
|
58
|
+
"d3-format": "^3.1.0",
|
|
59
|
+
"d3-geo": "^3.1.1",
|
|
60
|
+
"d3-scale": "^4.0.2",
|
|
61
|
+
"d3-shape": "^3.2.0",
|
|
62
|
+
"lit": "^3.0.0",
|
|
63
|
+
"lit-html": "^3.0.0"
|
|
64
|
+
},
|
|
65
|
+
"customElements": "dist/docs/custom-elements.json",
|
|
66
|
+
"scripts": {
|
|
67
|
+
"analyze": "cem analyze --globs \"src/**/*.ts\" --exclude \"**/*.stories.ts\" --exclude \"**/*.test.ts\" --exclude \"**/*.styles.ts\" --outdir \"dist/docs\"",
|
|
68
|
+
"build": "tsc -p tsconfig.prod.json && vp run build:lib && vp run analyze",
|
|
69
|
+
"build:lib": "vp pack",
|
|
70
|
+
"storybook": "vp run @mcp-b/web-components#storybook",
|
|
71
|
+
"test": "vp run @mcp-b/web-components#test",
|
|
72
|
+
"typecheck": "tsc --noEmit"
|
|
73
|
+
}
|
|
74
|
+
}
|