@nanahoshi/mona-ui 0.26.0 → 0.26.2
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/chart/README.md +2 -2
- package/docs/chart-bar.md +714 -0
- package/docs/chart-financial.md +567 -0
- package/docs/chart-funnel.md +546 -0
- package/docs/chart-heatmap.md +535 -0
- package/docs/chart-line-area.md +462 -0
- package/docs/chart-pie.md +645 -0
- package/docs/chart-radar.md +518 -0
- package/docs/chart-radial.md +658 -0
- package/docs/chart-scatter.md +479 -0
- package/docs/chart-treemap.md +651 -0
- package/docs/chart.md +263 -1856
- package/fesm2022/nanahoshi-mona-ui-button.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +126 -66
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +5 -8
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +7 -2
- package/llms.txt +11 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-chart.d.ts +50 -20
- package/types/nanahoshi-mona-ui-internal.d.ts +6 -2
|
@@ -169,6 +169,7 @@ const buttonThemeVariants = cva(`
|
|
|
169
169
|
look: "default",
|
|
170
170
|
selected: true,
|
|
171
171
|
class: `
|
|
172
|
+
after:-inset-px
|
|
172
173
|
bg-(--color-selected) text-(--color-selected-foreground)
|
|
173
174
|
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
174
175
|
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
@@ -232,6 +233,7 @@ const buttonThemeVariants = cva(`
|
|
|
232
233
|
look: "outline",
|
|
233
234
|
selected: true,
|
|
234
235
|
class: `
|
|
236
|
+
after:-inset-px
|
|
235
237
|
bg-(--color-selected) text-(--color-selected-foreground)
|
|
236
238
|
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
237
239
|
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
@@ -9992,6 +9992,14 @@ function serializeKeyPart(value) {
|
|
|
9992
9992
|
}
|
|
9993
9993
|
return null;
|
|
9994
9994
|
}
|
|
9995
|
+
/**
|
|
9996
|
+
* Writes an item ID: the prefix (`k` for a key, `c` for a category), the kind of the value and the value, such as
|
|
9997
|
+
* `k:s:trial`. Returns `null` for a value that can't identify an item.
|
|
9998
|
+
*/
|
|
9999
|
+
function formatItemId(prefix, value) {
|
|
10000
|
+
const part = serializeKeyPart(value);
|
|
10001
|
+
return part === null ? null : `${prefix}:${part.type}:${String(part.value)}`;
|
|
10002
|
+
}
|
|
9995
10003
|
function normalizeSeriesKey(value) {
|
|
9996
10004
|
if (value === undefined || value === null) {
|
|
9997
10005
|
return undefined;
|
|
@@ -19074,7 +19082,7 @@ class FinancialLayoutEngine {
|
|
|
19074
19082
|
const maxBodyWidth = isFiniteNumber(explicitMaxBodyWidth) && explicitMaxBodyWidth > 0
|
|
19075
19083
|
? Math.max(2, explicitMaxBodyWidth)
|
|
19076
19084
|
: 32;
|
|
19077
|
-
const wickWidth = Math.max(0.5, normalizeNonNegativeNumber(
|
|
19085
|
+
const wickWidth = Math.max(0.5, normalizeNonNegativeNumber(resolvedStyle.wickWidth, 1));
|
|
19078
19086
|
const seriesFormatter = series.valueFormatter?.() ?? valueFormatter;
|
|
19079
19087
|
const seriesName = series.name();
|
|
19080
19088
|
const sceneMarks = validMarks.map((v, i) => {
|
|
@@ -19196,7 +19204,7 @@ class FinancialLayoutEngine {
|
|
|
19196
19204
|
const maxBodyWidth = isFiniteNumber(explicitMaxBodyWidth) && explicitMaxBodyWidth > 0
|
|
19197
19205
|
? Math.max(2, explicitMaxBodyWidth)
|
|
19198
19206
|
: 32;
|
|
19199
|
-
const wickWidth = Math.max(0.5, normalizeNonNegativeNumber(
|
|
19207
|
+
const wickWidth = Math.max(0.5, normalizeNonNegativeNumber(resolvedStyle.wickWidth, 1));
|
|
19200
19208
|
const seriesFormatter = series.valueFormatter?.() ?? valueFormatter;
|
|
19201
19209
|
const seriesName = series.name();
|
|
19202
19210
|
const sceneMarks = validMarks.map((v, i) => {
|
|
@@ -30199,9 +30207,8 @@ class FunnelIdentity {
|
|
|
30199
30207
|
let explicitKey;
|
|
30200
30208
|
if (keyField) {
|
|
30201
30209
|
const rawKey = resolveValue(datum, keyField, sourceIndex);
|
|
30202
|
-
const
|
|
30203
|
-
if (
|
|
30204
|
-
const keyStr = `k:${keyPart.type}:${String(keyPart.value)}`;
|
|
30210
|
+
const keyStr = formatItemId("k", rawKey);
|
|
30211
|
+
if (keyStr !== null) {
|
|
30205
30212
|
if (seenExplicitKeys?.has(keyStr)) {
|
|
30206
30213
|
if (warnedDiagnosticSignatures) {
|
|
30207
30214
|
ChartDiagnostics.warnOnce(warnedDiagnosticSignatures, `Funnel series "${seriesName}" encountered duplicate explicit key "${String(rawKey)}" at index ${sourceIndex}. Falling back to index identity.`, `${seriesId}:duplicate-keys`);
|
|
@@ -31728,9 +31735,8 @@ class TreemapIdentity {
|
|
|
31728
31735
|
let nodeId;
|
|
31729
31736
|
if (keyField) {
|
|
31730
31737
|
const rawKey = resolveValue(datum, keyField, dataIndex);
|
|
31731
|
-
const
|
|
31732
|
-
if (
|
|
31733
|
-
const keyStr = `k:${keyPart.type}:${String(keyPart.value)}`;
|
|
31738
|
+
const keyStr = formatItemId("k", rawKey);
|
|
31739
|
+
if (keyStr !== null) {
|
|
31734
31740
|
if (seenExplicitKeys && seenExplicitKeys.has(keyStr)) {
|
|
31735
31741
|
if (warnedDiagnosticSignatures && seriesId) {
|
|
31736
31742
|
ChartDiagnostics.warnOnce(warnedDiagnosticSignatures, `Treemap series "${seriesName ?? seriesId}" encountered duplicate explicit key "${String(rawKey)}" at data index ${dataIndex}. Falling back to path identity.`, `${seriesId}:duplicate-keys`);
|
|
@@ -32528,37 +32534,13 @@ class HierarchicalLayoutEngine {
|
|
|
32528
32534
|
}
|
|
32529
32535
|
|
|
32530
32536
|
function deriveRadialDatumId(_datum, categoryValue, explicitKeyValue, dataIndex) {
|
|
32531
|
-
|
|
32532
|
-
const keyPart = serializeKeyPart(explicitKeyValue);
|
|
32533
|
-
if (keyPart !== null) {
|
|
32534
|
-
return `k:${keyPart.type}:${String(keyPart.value)}`;
|
|
32535
|
-
}
|
|
32536
|
-
}
|
|
32537
|
-
if (categoryValue !== undefined && categoryValue !== null) {
|
|
32538
|
-
const catPart = serializeKeyPart(categoryValue);
|
|
32539
|
-
if (catPart !== null) {
|
|
32540
|
-
return `c:${catPart.type}:${String(catPart.value)}`;
|
|
32541
|
-
}
|
|
32542
|
-
}
|
|
32543
|
-
return `i:${dataIndex}`;
|
|
32537
|
+
return formatItemId("k", explicitKeyValue) ?? formatItemId("c", categoryValue) ?? `i:${dataIndex}`;
|
|
32544
32538
|
}
|
|
32545
32539
|
function serializeRadialCategoryKey(categoryValue, fallbackIndex) {
|
|
32546
|
-
|
|
32547
|
-
const part = serializeKeyPart(categoryValue);
|
|
32548
|
-
if (part !== null) {
|
|
32549
|
-
return `c:${part.type}:${String(part.value)}`;
|
|
32550
|
-
}
|
|
32551
|
-
}
|
|
32552
|
-
return `c:i:${fallbackIndex}`;
|
|
32540
|
+
return formatItemId("c", categoryValue) ?? `c:i:${fallbackIndex}`;
|
|
32553
32541
|
}
|
|
32554
32542
|
function serializeRadialExplicitKey(explicitKeyValue) {
|
|
32555
|
-
|
|
32556
|
-
const part = serializeKeyPart(explicitKeyValue);
|
|
32557
|
-
if (part !== null) {
|
|
32558
|
-
return `k:${part.type}:${String(part.value)}`;
|
|
32559
|
-
}
|
|
32560
|
-
}
|
|
32561
|
-
return null;
|
|
32543
|
+
return formatItemId("k", explicitKeyValue);
|
|
32562
32544
|
}
|
|
32563
32545
|
function extractRadialDatumIdentities(data, categoryField, keyField) {
|
|
32564
32546
|
const results = [];
|
|
@@ -35442,9 +35424,8 @@ class WaterfallDataProcessor {
|
|
|
35442
35424
|
let explicitKey;
|
|
35443
35425
|
if (keyField) {
|
|
35444
35426
|
const rawKey = resolveValue(datum, keyField, i);
|
|
35445
|
-
const
|
|
35446
|
-
if (
|
|
35447
|
-
const keyStr = `k:${keyPart.type}:${String(keyPart.value)}`;
|
|
35427
|
+
const keyStr = formatItemId("k", rawKey);
|
|
35428
|
+
if (keyStr !== null) {
|
|
35448
35429
|
if (seenExplicitKeys.has(keyStr)) {
|
|
35449
35430
|
if (warnedDiagnosticSignatures) {
|
|
35450
35431
|
ChartDiagnostics.warnOnce(warnedDiagnosticSignatures, `Waterfall series "${seriesName}" encountered duplicate explicit key "${String(rawKey)}" at index ${i}. Falling back to index identity.`, `${seriesId}:duplicate-keys`);
|
|
@@ -38196,6 +38177,37 @@ class FunnelChartRenderer {
|
|
|
38196
38177
|
}
|
|
38197
38178
|
}
|
|
38198
38179
|
|
|
38180
|
+
/**
|
|
38181
|
+
* Lists the tick marks of a heatmap's axes. A heatmap's axes sit on the plot's edges, so each tick starts at the edge
|
|
38182
|
+
* and runs `tickSize` pixels outward, centered on its category.
|
|
38183
|
+
*/
|
|
38184
|
+
function buildHeatmapTickSegments(axes, plotRect) {
|
|
38185
|
+
const segments = [];
|
|
38186
|
+
for (const axis of axes) {
|
|
38187
|
+
if (!axis.visible || !axis.tickMarks) {
|
|
38188
|
+
continue;
|
|
38189
|
+
}
|
|
38190
|
+
const size = axis.tickSize ?? 6;
|
|
38191
|
+
if (axis.axis === "x") {
|
|
38192
|
+
const top = axis.position === "top";
|
|
38193
|
+
const edge = top ? plotRect.y : plotRect.y + plotRect.height;
|
|
38194
|
+
const end = top ? edge - size : edge + size;
|
|
38195
|
+
for (const tick of axis.ticks) {
|
|
38196
|
+
segments.push({ x1: tick.coordinate, x2: tick.coordinate, y1: edge, y2: end });
|
|
38197
|
+
}
|
|
38198
|
+
}
|
|
38199
|
+
else {
|
|
38200
|
+
const right = axis.position === "right";
|
|
38201
|
+
const edge = right ? plotRect.x + plotRect.width : plotRect.x;
|
|
38202
|
+
const end = right ? edge + size : edge - size;
|
|
38203
|
+
for (const tick of axis.ticks) {
|
|
38204
|
+
segments.push({ x1: edge, x2: end, y1: tick.coordinate, y2: tick.coordinate });
|
|
38205
|
+
}
|
|
38206
|
+
}
|
|
38207
|
+
}
|
|
38208
|
+
return segments;
|
|
38209
|
+
}
|
|
38210
|
+
|
|
38199
38211
|
class HeatmapSeriesRenderer {
|
|
38200
38212
|
static render(context, series) {
|
|
38201
38213
|
const { cells, showLabels } = series;
|
|
@@ -38322,6 +38334,17 @@ class HeatmapChartRenderer {
|
|
|
38322
38334
|
}
|
|
38323
38335
|
context.stroke();
|
|
38324
38336
|
}
|
|
38337
|
+
const ticks = buildHeatmapTickSegments(axes, plotRect);
|
|
38338
|
+
if (ticks.length > 0) {
|
|
38339
|
+
context.strokeStyle = axisLineColor;
|
|
38340
|
+
context.lineWidth = 1;
|
|
38341
|
+
context.beginPath();
|
|
38342
|
+
for (const tick of ticks) {
|
|
38343
|
+
context.moveTo(crispPixel(tick.x1, 1), crispPixel(tick.y1, 1));
|
|
38344
|
+
context.lineTo(crispPixel(tick.x2, 1), crispPixel(tick.y2, 1));
|
|
38345
|
+
}
|
|
38346
|
+
context.stroke();
|
|
38347
|
+
}
|
|
38325
38348
|
// 4. Draw Interaction Indicators (hover & keyboard focus)
|
|
38326
38349
|
if (interactionState) {
|
|
38327
38350
|
const isKeyboard = interactionState.source === "keyboard";
|
|
@@ -41545,6 +41568,7 @@ class SvgMarkerSeriesRenderer {
|
|
|
41545
41568
|
}
|
|
41546
41569
|
}
|
|
41547
41570
|
|
|
41571
|
+
/** Draws each OHLC mark as a group of two paths: the high-low stem in `wickColor`, and the open and close ticks. */
|
|
41548
41572
|
class SvgOhlcSeriesRenderer {
|
|
41549
41573
|
#keyedGroup;
|
|
41550
41574
|
constructor(container) {
|
|
@@ -41556,6 +41580,17 @@ class SvgOhlcSeriesRenderer {
|
|
|
41556
41580
|
destroy() {
|
|
41557
41581
|
this.#keyedGroup.destroy();
|
|
41558
41582
|
}
|
|
41583
|
+
static #ensurePaths(group) {
|
|
41584
|
+
const paths = group.querySelectorAll(":scope > path");
|
|
41585
|
+
if (paths.length === 2) {
|
|
41586
|
+
return [paths[0], paths[1]];
|
|
41587
|
+
}
|
|
41588
|
+
group.replaceChildren();
|
|
41589
|
+
const stem = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
41590
|
+
const ticks = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
41591
|
+
group.append(stem, ticks);
|
|
41592
|
+
return [stem, ticks];
|
|
41593
|
+
}
|
|
41559
41594
|
render(scene) {
|
|
41560
41595
|
const marks = scene.marks ?? [];
|
|
41561
41596
|
const { style } = scene;
|
|
@@ -41566,11 +41601,12 @@ class SvgOhlcSeriesRenderer {
|
|
|
41566
41601
|
const baseAlpha = (style.opacity ?? 1) * (scene.renderOpacity ?? 1);
|
|
41567
41602
|
this.#keyedGroup.reconcile(marks, {
|
|
41568
41603
|
key: (mark, index) => mark.animationKey ?? String(index),
|
|
41569
|
-
tag: "
|
|
41570
|
-
update: (
|
|
41604
|
+
tag: "g",
|
|
41605
|
+
update: (group, mark) => {
|
|
41606
|
+
const [stem, ticks] = SvgOhlcSeriesRenderer.#ensurePaths(group);
|
|
41571
41607
|
const markAlpha = baseAlpha * (mark.renderOpacity ?? 1);
|
|
41572
41608
|
if (markAlpha <= 0) {
|
|
41573
|
-
setSvgAttribute(
|
|
41609
|
+
setSvgAttribute(group, "opacity", 0);
|
|
41574
41610
|
return;
|
|
41575
41611
|
}
|
|
41576
41612
|
const markColor = style.color ||
|
|
@@ -41580,18 +41616,17 @@ class SvgOhlcSeriesRenderer {
|
|
|
41580
41616
|
? style.fallingColor
|
|
41581
41617
|
: style.neutralColor);
|
|
41582
41618
|
const cx = Math.round(mark.centerX);
|
|
41583
|
-
const highY = Math.round(mark.highY);
|
|
41584
|
-
const lowY = Math.round(mark.lowY);
|
|
41585
41619
|
const openY = Math.round(mark.openY);
|
|
41586
41620
|
const closeY = Math.round(mark.closeY);
|
|
41587
41621
|
const tickWidth = mark.tickWidth;
|
|
41588
|
-
|
|
41589
|
-
setSvgAttribute(
|
|
41590
|
-
setSvgAttribute(
|
|
41591
|
-
setSvgAttribute(
|
|
41592
|
-
setSvgAttribute(
|
|
41593
|
-
setSvgAttribute(
|
|
41594
|
-
setSvgAttribute(
|
|
41622
|
+
setSvgAttribute(group, "opacity", markAlpha);
|
|
41623
|
+
setSvgAttribute(group, "fill", "none");
|
|
41624
|
+
setSvgAttribute(group, "stroke-width", mark.wickWidth);
|
|
41625
|
+
setSvgAttribute(group, "shape-rendering", "crispEdges");
|
|
41626
|
+
setSvgAttribute(stem, "d", `M ${cx} ${Math.round(mark.highY)} V ${Math.round(mark.lowY)}`);
|
|
41627
|
+
setSvgAttribute(stem, "stroke", style.wickColor || markColor);
|
|
41628
|
+
setSvgAttribute(ticks, "d", `M ${cx - tickWidth} ${openY} H ${cx} M ${cx} ${closeY} H ${cx + tickWidth}`);
|
|
41629
|
+
setSvgAttribute(ticks, "stroke", markColor);
|
|
41595
41630
|
}
|
|
41596
41631
|
});
|
|
41597
41632
|
}
|
|
@@ -43903,6 +43938,9 @@ class SvgHeatmapRenderer {
|
|
|
43903
43938
|
axisSegments.push(`M ${plotRect.x} ${y} H ${plotRect.x + plotRect.width}`);
|
|
43904
43939
|
}
|
|
43905
43940
|
}
|
|
43941
|
+
for (const tick of buildHeatmapTickSegments(axes, plotRect)) {
|
|
43942
|
+
axisSegments.push(`M ${Math.round(tick.x1)} ${Math.round(tick.y1)} L ${Math.round(tick.x2)} ${Math.round(tick.y2)}`);
|
|
43943
|
+
}
|
|
43906
43944
|
if (axisSegments.length > 0) {
|
|
43907
43945
|
if (!this.#axisPath) {
|
|
43908
43946
|
this.#axisPath = createSvgElement("path");
|
|
@@ -59848,7 +59886,7 @@ class PieSeriesComponent {
|
|
|
59848
59886
|
this.padAngle = input(0, /* @ts-ignore */
|
|
59849
59887
|
...(ngDevMode ? [{ debugName: "padAngle" }] : /* istanbul ignore next */ []));
|
|
59850
59888
|
/**
|
|
59851
|
-
* @description Whether to display inside
|
|
59889
|
+
* @description Whether to display slice labels, inside or outside as `labelPosition` sets.
|
|
59852
59890
|
* @default false
|
|
59853
59891
|
*/
|
|
59854
59892
|
this.showLabels = input(false, /* @ts-ignore */
|
|
@@ -60172,7 +60210,7 @@ class DonutSeriesComponent {
|
|
|
60172
60210
|
this.padAngle = input(0, /* @ts-ignore */
|
|
60173
60211
|
...(ngDevMode ? [{ debugName: "padAngle" }] : /* istanbul ignore next */ []));
|
|
60174
60212
|
/**
|
|
60175
|
-
* @description Whether to display inside
|
|
60213
|
+
* @description Whether to display slice labels, inside or outside as `labelPosition` sets.
|
|
60176
60214
|
* @default false
|
|
60177
60215
|
*/
|
|
60178
60216
|
this.showLabels = input(false, /* @ts-ignore */
|
|
@@ -61363,16 +61401,18 @@ class BubbleSeriesComponent {
|
|
|
61363
61401
|
this.keyField = input(undefined, /* @ts-ignore */
|
|
61364
61402
|
...(ngDevMode ? [{ debugName: "keyField" }] : /* istanbul ignore next */ []));
|
|
61365
61403
|
/**
|
|
61366
|
-
* @description Maximum rendered pixel radius for the largest data size value.
|
|
61367
|
-
*
|
|
61404
|
+
* @description Maximum rendered pixel radius for the largest data size value. When unset, the series reads
|
|
61405
|
+
* `--mona-chart-bubble-max-radius`, or uses `24`.
|
|
61406
|
+
* @default undefined
|
|
61368
61407
|
*/
|
|
61369
|
-
this.maxRadius = input(
|
|
61408
|
+
this.maxRadius = input(undefined, /* @ts-ignore */
|
|
61370
61409
|
...(ngDevMode ? [{ debugName: "maxRadius" }] : /* istanbul ignore next */ []));
|
|
61371
61410
|
/**
|
|
61372
|
-
* @description Minimum rendered pixel radius for the smallest data size value.
|
|
61373
|
-
*
|
|
61411
|
+
* @description Minimum rendered pixel radius for the smallest data size value. When unset, the series reads
|
|
61412
|
+
* `--mona-chart-bubble-min-radius`, or uses `4`.
|
|
61413
|
+
* @default undefined
|
|
61374
61414
|
*/
|
|
61375
|
-
this.minRadius = input(
|
|
61415
|
+
this.minRadius = input(undefined, /* @ts-ignore */
|
|
61376
61416
|
...(ngDevMode ? [{ debugName: "minRadius" }] : /* istanbul ignore next */ []));
|
|
61377
61417
|
/**
|
|
61378
61418
|
* @description Name of the series displayed in legends and tooltips.
|
|
@@ -62320,7 +62360,7 @@ class CandlestickSeriesComponent {
|
|
|
62320
62360
|
...(ngDevMode ? [{ debugName: "fallingColor" }] : /* istanbul ignore next */ []));
|
|
62321
62361
|
/**
|
|
62322
62362
|
* @description Visual fill mode for candle bodies: 'filled' (solid fill) or 'hollow' (rising hollow, falling filled).
|
|
62323
|
-
* @default "
|
|
62363
|
+
* @default "hollow"
|
|
62324
62364
|
*/
|
|
62325
62365
|
this.fillMode = input("hollow", /* @ts-ignore */
|
|
62326
62366
|
...(ngDevMode ? [{ debugName: "fillMode" }] : /* istanbul ignore next */ []));
|
|
@@ -62412,10 +62452,11 @@ class CandlestickSeriesComponent {
|
|
|
62412
62452
|
this.wickColor = input("", /* @ts-ignore */
|
|
62413
62453
|
...(ngDevMode ? [{ debugName: "wickColor" }] : /* istanbul ignore next */ []));
|
|
62414
62454
|
/**
|
|
62415
|
-
* @description Pixel stroke width for candle wicks.
|
|
62416
|
-
*
|
|
62455
|
+
* @description Pixel stroke width for candle wicks. When unset, the series reads
|
|
62456
|
+
* `--mona-chart-financial-wick-width`, or uses `1`.
|
|
62457
|
+
* @default undefined
|
|
62417
62458
|
*/
|
|
62418
|
-
this.wickWidth = input(
|
|
62459
|
+
this.wickWidth = input(undefined, /* @ts-ignore */
|
|
62419
62460
|
...(ngDevMode ? [{ debugName: "wickWidth" }] : /* istanbul ignore next */ []));
|
|
62420
62461
|
/**
|
|
62421
62462
|
* @description Optional ID of the Cartesian X axis this series binds to. When omitted, the primary X axis is used.
|
|
@@ -62706,10 +62747,11 @@ class OhlcSeriesComponent {
|
|
|
62706
62747
|
this.wickColor = input("", /* @ts-ignore */
|
|
62707
62748
|
...(ngDevMode ? [{ debugName: "wickColor" }] : /* istanbul ignore next */ []));
|
|
62708
62749
|
/**
|
|
62709
|
-
* @description Pixel stroke width for OHLC stems and tick arms.
|
|
62710
|
-
*
|
|
62750
|
+
* @description Pixel stroke width for OHLC stems and tick arms. When unset, the series reads
|
|
62751
|
+
* `--mona-chart-financial-wick-width`, or uses `1`.
|
|
62752
|
+
* @default undefined
|
|
62711
62753
|
*/
|
|
62712
|
-
this.wickWidth = input(
|
|
62754
|
+
this.wickWidth = input(undefined, /* @ts-ignore */
|
|
62713
62755
|
...(ngDevMode ? [{ debugName: "wickWidth" }] : /* istanbul ignore next */ []));
|
|
62714
62756
|
/**
|
|
62715
62757
|
* @description Optional ID of the Cartesian X axis this series binds to. When omitted, the primary X axis is used.
|
|
@@ -62938,6 +62980,7 @@ class RadialBarSeriesComponent {
|
|
|
62938
62980
|
...(ngDevMode ? [{ debugName: "fillOpacity" }] : /* istanbul ignore next */ []));
|
|
62939
62981
|
/**
|
|
62940
62982
|
* @description The hidden item IDs. Bind `[(hiddenItemIds)]` for two-way binding; legend toggles write to it.
|
|
62983
|
+
* Build an ID with `chartItemKeyId(key)` when `keyField` is set, or else with `chartItemCategoryId(category)`.
|
|
62941
62984
|
* @default []
|
|
62942
62985
|
*/
|
|
62943
62986
|
this.hiddenItemIds = model([], /* @ts-ignore */
|
|
@@ -63259,6 +63302,7 @@ class RoseSeriesComponent {
|
|
|
63259
63302
|
...(ngDevMode ? [{ debugName: "fillOpacity" }] : /* istanbul ignore next */ []));
|
|
63260
63303
|
/**
|
|
63261
63304
|
* @description The hidden item IDs. Bind `[(hiddenItemIds)]` for two-way binding; legend toggles write to it.
|
|
63305
|
+
* Build an ID with `chartItemKeyId(key)` when `keyField` is set, or else with `chartItemCategoryId(category)`.
|
|
63262
63306
|
* @default []
|
|
63263
63307
|
*/
|
|
63264
63308
|
this.hiddenItemIds = model([], /* @ts-ignore */
|
|
@@ -63851,6 +63895,7 @@ class TreemapSeriesComponent {
|
|
|
63851
63895
|
...(ngDevMode ? [{ debugName: "fillOpacity" }] : /* istanbul ignore next */ []));
|
|
63852
63896
|
/**
|
|
63853
63897
|
* @description The hidden top-level node IDs. Bind `[(hiddenNodeIds)]` for two-way binding; legend toggles write to it.
|
|
63898
|
+
* With `keyField`, build an ID with `chartItemKeyId(key)`; otherwise read IDs from `nodeVisibilityChange`.
|
|
63854
63899
|
* @default []
|
|
63855
63900
|
*/
|
|
63856
63901
|
this.hiddenNodeIds = model([], /* @ts-ignore */
|
|
@@ -64241,6 +64286,7 @@ class FunnelSeriesComponent {
|
|
|
64241
64286
|
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
64242
64287
|
/**
|
|
64243
64288
|
* @description The hidden stage IDs. Bind `[(hiddenStageIds)]` for two-way binding; legend toggles write to it.
|
|
64289
|
+
* Build an ID with `chartItemKeyId(key)` when `keyField` is set, or with `chartItemIndexId(index)`.
|
|
64244
64290
|
* @default []
|
|
64245
64291
|
*/
|
|
64246
64292
|
this.hiddenStageIds = model([], /* @ts-ignore */
|
|
@@ -65807,9 +65853,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
65807
65853
|
}]
|
|
65808
65854
|
}], ctorParameters: () => [], propDecorators: { activation: [{ type: i0.Input, args: [{ isSignal: true, alias: "activation", required: false }] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }], borderWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderWidth", required: false }] }], brushChange: [{ type: i0.Output, args: ["brushChange"] }], enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], fillColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillColor", required: false }] }], fillOpacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillOpacity", required: false }] }], hitPolicy: [{ type: i0.Input, args: [{ isSignal: true, alias: "hitPolicy", required: false }] }], lineStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineStyle", required: false }] }], minDragDistance: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDragDistance", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], selectionBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionBehavior", required: false }] }], xAxisId: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAxisId", required: false }] }], yAxisId: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisId", required: false }] }] } });
|
|
65809
65855
|
|
|
65856
|
+
function chartItemCategoryId(category) {
|
|
65857
|
+
return formatItemId("c", category) ?? undefined;
|
|
65858
|
+
}
|
|
65859
|
+
/**
|
|
65860
|
+
* The ID of the item in row `index`, as a funnel stage, waterfall step, or radial bar or rose item gets it when it has
|
|
65861
|
+
* no `keyField` value (and, for a radial series, no category). It follows the position, not the row.
|
|
65862
|
+
*/
|
|
65863
|
+
function chartItemIndexId(index) {
|
|
65864
|
+
return `i:${index}`;
|
|
65865
|
+
}
|
|
65866
|
+
function chartItemKeyId(key) {
|
|
65867
|
+
return formatItemId("k", key) ?? undefined;
|
|
65868
|
+
}
|
|
65869
|
+
|
|
65810
65870
|
/**
|
|
65811
65871
|
* Generated bundle index. Do not edit.
|
|
65812
65872
|
*/
|
|
65813
65873
|
|
|
65814
|
-
export { AreaSeriesComponent, BarSeriesComponent, BubbleSeriesComponent, CHART_DEFAULT_MESSAGES, CandlestickSeriesComponent, ChartAngularAxisComponent, ChartAnnotationComponent, ChartAnnotationLabelTemplateDirective, ChartAxisLabelTemplateDirective, ChartBrushComponent, ChartCenterTemplateDirective, ChartComponent, ChartCrosshairComponent, ChartCrosshairLabelTemplateDirective, ChartDataLabelTemplateDirective, ChartExportError, ChartFunnelLabelTemplateDirective, ChartGaugeCenterTemplateDirective, ChartLegendComponent, ChartLegendItemTemplateDirective, ChartNoDataTemplateDirective, ChartRadialAxisComponent, ChartReferenceBandComponent, ChartReferenceLabelTemplateDirective, ChartReferenceLineComponent, ChartSelectionComponent, ChartSliceLabelTemplateDirective, ChartSubtitleTemplateDirective, ChartTitleTemplateDirective, ChartTooltipComponent, ChartTooltipTemplateDirective, ChartTreemapLabelTemplateDirective, ChartWaterfallLabelTemplateDirective, ChartXAxisComponent, ChartYAxisComponent, DonutSeriesComponent, FunnelSeriesComponent, GaugeSeriesComponent, HeatmapSeriesComponent, LineSeriesComponent, OhlcSeriesComponent, PieSeriesComponent, PolarSeriesComponent, RadarSeriesComponent, RadialBarSeriesComponent, RangeAreaSeriesComponent, RangeBarSeriesComponent, RoseSeriesComponent, ScatterSeriesComponent, TreemapSeriesComponent, WaterfallSeriesComponent, getChartSeriesFamily, isCartesianCoordinateFamily, isHierarchicalCoordinateFamily, isPolarCoordinateFamily };
|
|
65874
|
+
export { AreaSeriesComponent, BarSeriesComponent, BubbleSeriesComponent, CHART_DEFAULT_MESSAGES, CandlestickSeriesComponent, ChartAngularAxisComponent, ChartAnnotationComponent, ChartAnnotationLabelTemplateDirective, ChartAxisLabelTemplateDirective, ChartBrushComponent, ChartCenterTemplateDirective, ChartComponent, ChartCrosshairComponent, ChartCrosshairLabelTemplateDirective, ChartDataLabelTemplateDirective, ChartExportError, ChartFunnelLabelTemplateDirective, ChartGaugeCenterTemplateDirective, ChartLegendComponent, ChartLegendItemTemplateDirective, ChartNoDataTemplateDirective, ChartRadialAxisComponent, ChartReferenceBandComponent, ChartReferenceLabelTemplateDirective, ChartReferenceLineComponent, ChartSelectionComponent, ChartSliceLabelTemplateDirective, ChartSubtitleTemplateDirective, ChartTitleTemplateDirective, ChartTooltipComponent, ChartTooltipTemplateDirective, ChartTreemapLabelTemplateDirective, ChartWaterfallLabelTemplateDirective, ChartXAxisComponent, ChartYAxisComponent, DonutSeriesComponent, FunnelSeriesComponent, GaugeSeriesComponent, HeatmapSeriesComponent, LineSeriesComponent, OhlcSeriesComponent, PieSeriesComponent, PolarSeriesComponent, RadarSeriesComponent, RadialBarSeriesComponent, RangeAreaSeriesComponent, RangeBarSeriesComponent, RoseSeriesComponent, ScatterSeriesComponent, TreemapSeriesComponent, WaterfallSeriesComponent, chartItemCategoryId, chartItemIndexId, chartItemKeyId, getChartSeriesFamily, isCartesianCoordinateFamily, isHierarchicalCoordinateFamily, isPolarCoordinateFamily };
|
|
65815
65875
|
//# sourceMappingURL=nanahoshi-mona-ui-chart.mjs.map
|
|
@@ -9,7 +9,7 @@ import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
|
9
9
|
import { fromEvent } from 'rxjs';
|
|
10
10
|
import { twMerge } from 'tailwind-merge';
|
|
11
11
|
import { cva } from 'class-variance-authority';
|
|
12
|
-
import { themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
12
|
+
import { themeSelectionBorderClasses, themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
13
13
|
|
|
14
14
|
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
15
15
|
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
@@ -101,11 +101,8 @@ const chipThemeVariants = cva(`
|
|
|
101
101
|
`
|
|
102
102
|
},
|
|
103
103
|
selected: {
|
|
104
|
-
// A border in the text's color
|
|
105
|
-
true:
|
|
106
|
-
after:pointer-events-none after:absolute after:inset-0
|
|
107
|
-
after:rounded-[inherit] after:border-2 after:border-current
|
|
108
|
-
`,
|
|
104
|
+
// A border in the text's color under prefers-contrast: more and forced colors, where the fill alone isn't enough.
|
|
105
|
+
true: themeSelectionBorderClasses,
|
|
109
106
|
false: ""
|
|
110
107
|
}
|
|
111
108
|
},
|
|
@@ -113,7 +110,7 @@ const chipThemeVariants = cva(`
|
|
|
113
110
|
{
|
|
114
111
|
look: "default",
|
|
115
112
|
selected: true,
|
|
116
|
-
class: "bg-(--color-selected) text-(--color-selected-foreground)"
|
|
113
|
+
class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
|
|
117
114
|
},
|
|
118
115
|
{
|
|
119
116
|
look: "primary",
|
|
@@ -148,7 +145,7 @@ const chipThemeVariants = cva(`
|
|
|
148
145
|
{
|
|
149
146
|
look: "outline",
|
|
150
147
|
selected: true,
|
|
151
|
-
class: "bg-(--color-selected) text-(--color-selected-foreground)"
|
|
148
|
+
class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
|
|
152
149
|
},
|
|
153
150
|
{
|
|
154
151
|
look: "ghost",
|
|
@@ -687,11 +687,16 @@ const themeSelectionBarClasses = `
|
|
|
687
687
|
before:absolute before:inset-y-0 before:start-0 before:w-0.5 before:bg-(--color-selected-border)
|
|
688
688
|
before:forced-color-adjust-none forced-colors:before:bg-[Highlight]
|
|
689
689
|
`;
|
|
690
|
-
/**
|
|
690
|
+
/**
|
|
691
|
+
* A border in the text's color for a selected control, drawn only when the user asks for more contrast or forced colors
|
|
692
|
+
* are on. Elsewhere the fill says it alone. A control with a border of its own adds `after:-inset-px`, so this one
|
|
693
|
+
* replaces it.
|
|
694
|
+
*/
|
|
691
695
|
const themeSelectionBorderClasses = `
|
|
692
696
|
relative
|
|
693
697
|
after:pointer-events-none after:absolute after:inset-0
|
|
694
|
-
after:rounded-[inherit] after:border-
|
|
698
|
+
after:rounded-[inherit] after:border-current
|
|
699
|
+
contrast-more:after:border-2 forced-colors:after:border-2
|
|
695
700
|
`;
|
|
696
701
|
const themeControlBackdropClasses = `
|
|
697
702
|
[background-image:var(--mona-effect-control-background-image,none)]
|
package/llms.txt
CHANGED
|
@@ -82,7 +82,17 @@ Mona UI is an Angular component library styled with Tailwind CSS 4. Its componen
|
|
|
82
82
|
|
|
83
83
|
## Charts
|
|
84
84
|
|
|
85
|
-
- [Chart](docs/chart.md): High-performance Canvas charts composed from series, axes and interaction parts.
|
|
85
|
+
- [Chart Overview](docs/chart.md): High-performance Canvas charts composed from series, axes and interaction parts.
|
|
86
|
+
- [Line & Area](docs/chart-line-area.md): Line, area and range area series for values that change across a continuous or category axis.
|
|
87
|
+
- [Bar & Waterfall](docs/chart-bar.md): Bar, range bar and waterfall series for comparing values, intervals and running totals.
|
|
88
|
+
- [Scatter & Bubble](docs/chart-scatter.md): Scatter and bubble series for the relationship between two or three numeric values.
|
|
89
|
+
- [Financial](docs/chart-financial.md): Candlestick and OHLC series for open, high, low and close prices.
|
|
90
|
+
- [Heatmap](docs/chart-heatmap.md): A heatmap series that colors a grid of cells by value, with a color legend.
|
|
91
|
+
- [Pie & Donut](docs/chart-pie.md): Pie and donut series for the parts of a whole, with slice labels and a donut center.
|
|
92
|
+
- [Funnel](docs/chart-funnel.md): A funnel series for stages that narrow, with conversion and drop-off between them.
|
|
93
|
+
- [Treemap](docs/chart-treemap.md): A treemap series that tiles hierarchical data by value.
|
|
94
|
+
- [Radar & Polar](docs/chart-radar.md): Radar and polar series on angular and radial axes, for comparing metrics or directions.
|
|
95
|
+
- [Radial](docs/chart-radial.md): Radial bar, rose and gauge series that draw values as arcs around a center.
|
|
86
96
|
|
|
87
97
|
## Navigation
|
|
88
98
|
|