@usetheo/ui 0.33.0 → 0.34.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export { linScale,
|
|
1
|
+
export { linScale, markedPoints, niceMax, seriesPath, TrendChart, type TrendChartProps, type TrendPoint, type TrendSeries, } from "./trend-chart.js";
|
|
@@ -56,8 +56,9 @@ export declare function seriesPath(points: TrendPoint[], xScale: (x: number) =>
|
|
|
56
56
|
* Duas razões distintas para marcar, e a segunda só apareceu quando séries com lacuna passaram a
|
|
57
57
|
* existir (M144):
|
|
58
58
|
*
|
|
59
|
-
* 1. **Série esparsa** (< `SPARSE_MARKER_MAX`
|
|
60
|
-
* o marcador ancora o leitor no dado real. Regra do M76,
|
|
59
|
+
* 1. **Série esparsa** (< `SPARSE_MARKER_MAX` pontos FINITOS) — 1-4 pontos leem como um penhasco
|
|
60
|
+
* dramático; o marcador ancora o leitor no dado real. Regra do M76 — que passou a contar dado,
|
|
61
|
+
* não slot, porque a densificação do M144 desfez a equivalência entre os dois.
|
|
61
62
|
* 2. **Ponto isolado** — um ponto finito cercado de lacunas dos dois lados vira um `M` sozinho no
|
|
62
63
|
* `path`, e um `M` sozinho **desenha nada**: bounding-box zero, invisível. O dado existe, está
|
|
63
64
|
* correto, e o operador não vê. Medido no e2e do M144 (`d="M419.86,92.00 M448.00,36.00"`).
|
|
@@ -71,7 +72,7 @@ export declare function seriesPath(points: TrendPoint[], xScale: (x: number) =>
|
|
|
71
72
|
* Fora do JSX de propósito: é a aritmética da decisão, e aritmética isolada é aritmética que a
|
|
72
73
|
* mutação alcança.
|
|
73
74
|
*/
|
|
74
|
-
export declare function
|
|
75
|
+
export declare function markedPoints(points: TrendPoint[]): TrendPoint[];
|
|
75
76
|
export interface TrendChartProps extends HTMLAttributes<HTMLElement> {
|
|
76
77
|
title: string;
|
|
77
78
|
series: TrendSeries[];
|
package/dist/index.js
CHANGED
|
@@ -5110,9 +5110,10 @@ function seriesPath(points, xScale, yScale) {
|
|
|
5110
5110
|
var VIEW_W = 600;
|
|
5111
5111
|
var PAD = { top: 8, right: 8, bottom: 4, left: 40 };
|
|
5112
5112
|
var SPARSE_MARKER_MAX = 5;
|
|
5113
|
-
function
|
|
5113
|
+
function markedPoints(points) {
|
|
5114
5114
|
const finito = (p) => Number.isFinite(p?.y);
|
|
5115
|
-
|
|
5115
|
+
const finitos = points.filter(finito);
|
|
5116
|
+
if (finitos.length < SPARSE_MARKER_MAX) return finitos;
|
|
5116
5117
|
return points.filter((p, i) => finito(p) && !finito(points[i - 1]) && !finito(points[i + 1]));
|
|
5117
5118
|
}
|
|
5118
5119
|
var TrendChart = forwardRef(
|
|
@@ -5224,13 +5225,13 @@ var TrendChart = forwardRef(
|
|
|
5224
5225
|
children: /* @__PURE__ */ jsx("title", { children: s.name })
|
|
5225
5226
|
}
|
|
5226
5227
|
),
|
|
5227
|
-
|
|
5228
|
+
markedPoints(s.points).map((p, i) => /* @__PURE__ */ jsx(
|
|
5228
5229
|
"circle",
|
|
5229
5230
|
{
|
|
5230
5231
|
"data-slot": "trend-chart-dot",
|
|
5231
5232
|
cx: xScale(p.x),
|
|
5232
5233
|
cy: yScale(p.y),
|
|
5233
|
-
r:
|
|
5234
|
+
r: 4,
|
|
5234
5235
|
fill: s.color,
|
|
5235
5236
|
children: /* @__PURE__ */ jsx("title", { children: s.name })
|
|
5236
5237
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usetheo/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|