@tangle-network/charts 0.4.0 → 0.7.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/README.md +69 -24
- package/dist/events-Cw6abvgR.js +491 -0
- package/dist/figure.css +45 -9
- package/dist/index.d.ts +104 -135
- package/dist/index.js +735 -371
- package/dist/react/index.d.ts +56 -15
- package/dist/react/index.js +525 -154
- package/dist/react/live.css +29 -0
- package/dist/timeline-BAjzF-wL.d.ts +183 -0
- package/package.json +25 -13
- package/LICENSE +0 -21
package/dist/react/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as BandKind, c as MarkKind, m as Figure, o as ChartBand, r as TimelineSpan, s as ChartMark, t as TimelineLane, y as Refusal } from "../timeline-BAjzF-wL.js";
|
|
1
2
|
import { ReactElement, ReactNode } from "react";
|
|
2
3
|
//#region src/react/sparkline.d.ts
|
|
3
4
|
type SparklineDirection = "rising" | "falling" | "flat";
|
|
@@ -65,6 +66,12 @@ interface StackedBarBucket {
|
|
|
65
66
|
readonly total: number | null;
|
|
66
67
|
/** Stack order is input order. Charts neither groups nor sorts. */
|
|
67
68
|
readonly segments: readonly StackedBarSegment[];
|
|
69
|
+
/**
|
|
70
|
+
* Caller-owned text about this bucket that the chart cannot derive, such as
|
|
71
|
+
* request counts. Appended to the bar's name, the live readout and the
|
|
72
|
+
* pointer tooltip; never parsed.
|
|
73
|
+
*/
|
|
74
|
+
readonly description?: string;
|
|
68
75
|
}
|
|
69
76
|
interface StackedBarChartProps {
|
|
70
77
|
label: string;
|
|
@@ -131,6 +138,10 @@ interface WaterfallHeaderProps extends WaterfallTimeAxisProps {
|
|
|
131
138
|
}
|
|
132
139
|
export declare function WaterfallHeader({ label, attribution, durationLabel, ...axis }: WaterfallHeaderProps): import("react").JSX.Element;
|
|
133
140
|
//#endregion
|
|
141
|
+
//#region src/svg.d.ts
|
|
142
|
+
/** Point shapes: the second channel that keeps series distinct without colour. */
|
|
143
|
+
type MarkerShape = "circle" | "square" | "triangle" | "diamond";
|
|
144
|
+
//#endregion
|
|
134
145
|
//#region src/react/live.d.ts
|
|
135
146
|
export declare const LIVE_SERIES: readonly ['#8b7cf6', '#0ea5a0', '#c98500', '#e2508f', '#4a90e2'];
|
|
136
147
|
export declare const formatCompact: (value: number | null | undefined) => string;
|
|
@@ -177,25 +188,41 @@ export declare function Histogram({ bins, format, color, unit, rows }: {
|
|
|
177
188
|
}): import("react").JSX.Element;
|
|
178
189
|
/** Lines over time on one axis (at most four series); the crosshair readout lists each series at the nearest time. A
|
|
179
190
|
* `dots` series draws its points as marks (checkpoints) instead of a line; `axis` labels the time axis (default MM-DD). */
|
|
180
|
-
export declare function Lines({ series, format, rows, axis }: {
|
|
181
|
-
series:
|
|
182
|
-
name: string;
|
|
183
|
-
color: string;
|
|
184
|
-
points: [number, number][];
|
|
185
|
-
dots?: boolean;
|
|
186
|
-
label?: (t: number) => string;
|
|
187
|
-
}[];
|
|
191
|
+
export declare function Lines({ series, format, rows, axis, marks, bands }: {
|
|
192
|
+
series: LineSeries[];
|
|
188
193
|
format?: (v: number) => string;
|
|
189
194
|
rows?: number;
|
|
190
195
|
axis?: (t: number) => string;
|
|
196
|
+
marks?: ChartMark[];
|
|
197
|
+
bands?: ChartBand[];
|
|
191
198
|
}): import("react").JSX.Element;
|
|
192
|
-
/** A
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
/** A line series. `dash` and `marker` are a second channel, so arms stay distinct without colour. */
|
|
200
|
+
interface LineSeries {
|
|
201
|
+
name: string;
|
|
202
|
+
color: string;
|
|
203
|
+
points: [number, number][];
|
|
204
|
+
dots?: boolean;
|
|
205
|
+
label?: (t: number) => string;
|
|
206
|
+
dash?: 'solid' | 'dash' | 'dot';
|
|
207
|
+
marker?: MarkerShape;
|
|
208
|
+
}
|
|
209
|
+
/** One part of a whole. A null value is listed as not recorded and takes no width; `untraced` parts are hatched. */
|
|
210
|
+
interface MeterSegment {
|
|
211
|
+
label: string;
|
|
212
|
+
value: number | null;
|
|
213
|
+
color?: string;
|
|
214
|
+
kind?: 'measured' | 'untraced';
|
|
215
|
+
}
|
|
216
|
+
/** A used-of-total meter with its numbers. With `segments` it is a part-of-whole bar: the remainder of `total` that no
|
|
217
|
+
* segment accounts for is drawn hatched and labelled `untraced`, and a missing total hatches the whole track. */
|
|
218
|
+
export declare function Meter({ used, total, format, tone, text, segments, untraced }: {
|
|
219
|
+
used?: number | null | undefined;
|
|
195
220
|
total: number | null | undefined;
|
|
196
221
|
format?: (v: number) => string;
|
|
197
222
|
tone?: string;
|
|
198
223
|
text?: string;
|
|
224
|
+
segments?: MeterSegment[];
|
|
225
|
+
untraced?: string;
|
|
199
226
|
}): import("react").JSX.Element;
|
|
200
227
|
/** A small line of one series for a row in a list (one hue; the row's label carries identity). */
|
|
201
228
|
export declare function Spark({ points, max, color }: {
|
|
@@ -204,18 +231,32 @@ export declare function Spark({ points, max, color }: {
|
|
|
204
231
|
color?: string;
|
|
205
232
|
}): import("react").JSX.Element;
|
|
206
233
|
/** One bar per row on a shared time axis (who worked when): each row's bar spans its start to its end, coloured by its
|
|
207
|
-
* state; hovering a
|
|
208
|
-
|
|
209
|
-
|
|
234
|
+
* state; hovering a span names it, its state and its span. Times are epoch ms; `axis` labels the time axis.
|
|
235
|
+
* `lanes` give a row several spans (the same shape as the static `timeline`); a span with `end: null` is open and runs
|
|
236
|
+
* to `now`. `marks` draw recorded events across every lane, and states in `hatch` are drawn hatched (no data). */
|
|
237
|
+
export declare function Gantt({ rows, lanes: laneInput, colors, axis, span, marks, now, hatch }: {
|
|
238
|
+
rows?: {
|
|
210
239
|
label: string;
|
|
211
240
|
start: number;
|
|
212
241
|
end: number;
|
|
213
242
|
state: string;
|
|
214
243
|
note?: string;
|
|
215
244
|
}[];
|
|
245
|
+
lanes?: TimelineLane[];
|
|
216
246
|
colors: Record<string, string>;
|
|
217
247
|
axis: (t: number) => string;
|
|
218
248
|
span: (start: number, end: number) => string;
|
|
249
|
+
marks?: ChartMark[];
|
|
250
|
+
now?: number;
|
|
251
|
+
hatch?: string[];
|
|
219
252
|
}): import("react").JSX.Element;
|
|
220
253
|
//#endregion
|
|
221
|
-
|
|
254
|
+
//#region src/react/figure-view.d.ts
|
|
255
|
+
interface FigureViewProps {
|
|
256
|
+
figure: Figure | Refusal;
|
|
257
|
+
/** `chart` (default) keeps the lede, reading and method in the disclosure; `report` also shows the finding and lede. */
|
|
258
|
+
presentation?: 'chart' | 'report';
|
|
259
|
+
}
|
|
260
|
+
export declare function FigureView({ figure, presentation }: FigureViewProps): import("react").JSX.Element;
|
|
261
|
+
//#endregion
|
|
262
|
+
export type { BandKind, ChartBand, ChartMark, Figure, FigureViewProps, LineSeries, MarkKind, MarkerShape, MeterSegment, Refusal, SparklineDirection, SparklineGeometry, SparklineGeometryOptions, SparklineLabelOptions, SparklinePoint, SparklineProps, SparklineValues, StackedBarBucket, StackedBarChartProps, StackedBarSegment, StackedBarSeries, TimelineLane, TimelineSpan, WaterfallBarProps, WaterfallHeaderProps, WaterfallRowProps, WaterfallSpanGeometry, WaterfallTimeAxisProps, WaterfallWindow };
|