@tangle-network/charts 0.4.0 → 0.6.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 +50 -15
- package/dist/react/index.js +522 -152
- 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";
|
|
@@ -131,6 +132,10 @@ interface WaterfallHeaderProps extends WaterfallTimeAxisProps {
|
|
|
131
132
|
}
|
|
132
133
|
export declare function WaterfallHeader({ label, attribution, durationLabel, ...axis }: WaterfallHeaderProps): import("react").JSX.Element;
|
|
133
134
|
//#endregion
|
|
135
|
+
//#region src/svg.d.ts
|
|
136
|
+
/** Point shapes: the second channel that keeps series distinct without colour. */
|
|
137
|
+
type MarkerShape = "circle" | "square" | "triangle" | "diamond";
|
|
138
|
+
//#endregion
|
|
134
139
|
//#region src/react/live.d.ts
|
|
135
140
|
export declare const LIVE_SERIES: readonly ['#8b7cf6', '#0ea5a0', '#c98500', '#e2508f', '#4a90e2'];
|
|
136
141
|
export declare const formatCompact: (value: number | null | undefined) => string;
|
|
@@ -177,25 +182,41 @@ export declare function Histogram({ bins, format, color, unit, rows }: {
|
|
|
177
182
|
}): import("react").JSX.Element;
|
|
178
183
|
/** Lines over time on one axis (at most four series); the crosshair readout lists each series at the nearest time. A
|
|
179
184
|
* `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
|
-
}[];
|
|
185
|
+
export declare function Lines({ series, format, rows, axis, marks, bands }: {
|
|
186
|
+
series: LineSeries[];
|
|
188
187
|
format?: (v: number) => string;
|
|
189
188
|
rows?: number;
|
|
190
189
|
axis?: (t: number) => string;
|
|
190
|
+
marks?: ChartMark[];
|
|
191
|
+
bands?: ChartBand[];
|
|
191
192
|
}): import("react").JSX.Element;
|
|
192
|
-
/** A
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
/** A line series. `dash` and `marker` are a second channel, so arms stay distinct without colour. */
|
|
194
|
+
interface LineSeries {
|
|
195
|
+
name: string;
|
|
196
|
+
color: string;
|
|
197
|
+
points: [number, number][];
|
|
198
|
+
dots?: boolean;
|
|
199
|
+
label?: (t: number) => string;
|
|
200
|
+
dash?: 'solid' | 'dash' | 'dot';
|
|
201
|
+
marker?: MarkerShape;
|
|
202
|
+
}
|
|
203
|
+
/** One part of a whole. A null value is listed as not recorded and takes no width; `untraced` parts are hatched. */
|
|
204
|
+
interface MeterSegment {
|
|
205
|
+
label: string;
|
|
206
|
+
value: number | null;
|
|
207
|
+
color?: string;
|
|
208
|
+
kind?: 'measured' | 'untraced';
|
|
209
|
+
}
|
|
210
|
+
/** A used-of-total meter with its numbers. With `segments` it is a part-of-whole bar: the remainder of `total` that no
|
|
211
|
+
* segment accounts for is drawn hatched and labelled `untraced`, and a missing total hatches the whole track. */
|
|
212
|
+
export declare function Meter({ used, total, format, tone, text, segments, untraced }: {
|
|
213
|
+
used?: number | null | undefined;
|
|
195
214
|
total: number | null | undefined;
|
|
196
215
|
format?: (v: number) => string;
|
|
197
216
|
tone?: string;
|
|
198
217
|
text?: string;
|
|
218
|
+
segments?: MeterSegment[];
|
|
219
|
+
untraced?: string;
|
|
199
220
|
}): import("react").JSX.Element;
|
|
200
221
|
/** A small line of one series for a row in a list (one hue; the row's label carries identity). */
|
|
201
222
|
export declare function Spark({ points, max, color }: {
|
|
@@ -204,18 +225,32 @@ export declare function Spark({ points, max, color }: {
|
|
|
204
225
|
color?: string;
|
|
205
226
|
}): import("react").JSX.Element;
|
|
206
227
|
/** 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
|
-
|
|
228
|
+
* state; hovering a span names it, its state and its span. Times are epoch ms; `axis` labels the time axis.
|
|
229
|
+
* `lanes` give a row several spans (the same shape as the static `timeline`); a span with `end: null` is open and runs
|
|
230
|
+
* to `now`. `marks` draw recorded events across every lane, and states in `hatch` are drawn hatched (no data). */
|
|
231
|
+
export declare function Gantt({ rows, lanes: laneInput, colors, axis, span, marks, now, hatch }: {
|
|
232
|
+
rows?: {
|
|
210
233
|
label: string;
|
|
211
234
|
start: number;
|
|
212
235
|
end: number;
|
|
213
236
|
state: string;
|
|
214
237
|
note?: string;
|
|
215
238
|
}[];
|
|
239
|
+
lanes?: TimelineLane[];
|
|
216
240
|
colors: Record<string, string>;
|
|
217
241
|
axis: (t: number) => string;
|
|
218
242
|
span: (start: number, end: number) => string;
|
|
243
|
+
marks?: ChartMark[];
|
|
244
|
+
now?: number;
|
|
245
|
+
hatch?: string[];
|
|
219
246
|
}): import("react").JSX.Element;
|
|
220
247
|
//#endregion
|
|
221
|
-
|
|
248
|
+
//#region src/react/figure-view.d.ts
|
|
249
|
+
interface FigureViewProps {
|
|
250
|
+
figure: Figure | Refusal;
|
|
251
|
+
/** `chart` (default) keeps the lede, reading and method in the disclosure; `report` also shows the finding and lede. */
|
|
252
|
+
presentation?: 'chart' | 'report';
|
|
253
|
+
}
|
|
254
|
+
export declare function FigureView({ figure, presentation }: FigureViewProps): import("react").JSX.Element;
|
|
255
|
+
//#endregion
|
|
256
|
+
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 };
|