@tangle-network/charts 0.3.1 → 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 +71 -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 +123 -1
- package/dist/react/index.js +931 -4
- package/dist/react/live.css +56 -0
- package/dist/timeline-BAjzF-wL.d.ts +183 -0
- package/package.json +28 -14
- 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,4 +132,125 @@ interface WaterfallHeaderProps extends WaterfallTimeAxisProps {
|
|
|
131
132
|
}
|
|
132
133
|
export declare function WaterfallHeader({ label, attribution, durationLabel, ...axis }: WaterfallHeaderProps): import("react").JSX.Element;
|
|
133
134
|
//#endregion
|
|
134
|
-
|
|
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
|
|
139
|
+
//#region src/react/live.d.ts
|
|
140
|
+
export declare const LIVE_SERIES: readonly ['#8b7cf6', '#0ea5a0', '#c98500', '#e2508f', '#4a90e2'];
|
|
141
|
+
export declare const formatCompact: (value: number | null | undefined) => string;
|
|
142
|
+
/** Bars per day (or per any label: `tick` shortens it on the axis), stacked by series, on one axis; hovering a bar lists
|
|
143
|
+
* every series' value for it, and `onOpen` makes a bar a link. */
|
|
144
|
+
export declare function DayBars({ days, series, format, rows, missing, tick, onOpen }: {
|
|
145
|
+
days: string[];
|
|
146
|
+
series: {
|
|
147
|
+
name: string;
|
|
148
|
+
color: string;
|
|
149
|
+
values: (number | null)[];
|
|
150
|
+
}[];
|
|
151
|
+
format?: (v: number) => string;
|
|
152
|
+
rows?: number;
|
|
153
|
+
missing?: string;
|
|
154
|
+
tick?: (day: string) => string;
|
|
155
|
+
onOpen?: (index: number) => void;
|
|
156
|
+
}): import("react").JSX.Element;
|
|
157
|
+
/** Ranked horizontal bars with the value and an optional note on each row; past `limit` rows the rest are counted. */
|
|
158
|
+
export declare function HBars({ rows, format, color, max, limit }: {
|
|
159
|
+
rows: {
|
|
160
|
+
label: string;
|
|
161
|
+
value: number;
|
|
162
|
+
note?: string;
|
|
163
|
+
color?: string;
|
|
164
|
+
href?: string;
|
|
165
|
+
}[];
|
|
166
|
+
format?: (v: number) => string;
|
|
167
|
+
color?: string;
|
|
168
|
+
max?: number;
|
|
169
|
+
limit?: number;
|
|
170
|
+
}): import("react").JSX.Element;
|
|
171
|
+
/** A histogram of counts per bin; each bar's tooltip names its range and count. */
|
|
172
|
+
export declare function Histogram({ bins, format, color, unit, rows }: {
|
|
173
|
+
bins: {
|
|
174
|
+
lo: number;
|
|
175
|
+
hi: number;
|
|
176
|
+
n: number;
|
|
177
|
+
}[];
|
|
178
|
+
format?: (v: number) => string;
|
|
179
|
+
color?: string;
|
|
180
|
+
unit: string;
|
|
181
|
+
rows?: number;
|
|
182
|
+
}): import("react").JSX.Element;
|
|
183
|
+
/** Lines over time on one axis (at most four series); the crosshair readout lists each series at the nearest time. A
|
|
184
|
+
* `dots` series draws its points as marks (checkpoints) instead of a line; `axis` labels the time axis (default MM-DD). */
|
|
185
|
+
export declare function Lines({ series, format, rows, axis, marks, bands }: {
|
|
186
|
+
series: LineSeries[];
|
|
187
|
+
format?: (v: number) => string;
|
|
188
|
+
rows?: number;
|
|
189
|
+
axis?: (t: number) => string;
|
|
190
|
+
marks?: ChartMark[];
|
|
191
|
+
bands?: ChartBand[];
|
|
192
|
+
}): import("react").JSX.Element;
|
|
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;
|
|
214
|
+
total: number | null | undefined;
|
|
215
|
+
format?: (v: number) => string;
|
|
216
|
+
tone?: string;
|
|
217
|
+
text?: string;
|
|
218
|
+
segments?: MeterSegment[];
|
|
219
|
+
untraced?: string;
|
|
220
|
+
}): import("react").JSX.Element;
|
|
221
|
+
/** A small line of one series for a row in a list (one hue; the row's label carries identity). */
|
|
222
|
+
export declare function Spark({ points, max, color }: {
|
|
223
|
+
points: [number, number][];
|
|
224
|
+
max?: number;
|
|
225
|
+
color?: string;
|
|
226
|
+
}): import("react").JSX.Element;
|
|
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
|
|
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?: {
|
|
233
|
+
label: string;
|
|
234
|
+
start: number;
|
|
235
|
+
end: number;
|
|
236
|
+
state: string;
|
|
237
|
+
note?: string;
|
|
238
|
+
}[];
|
|
239
|
+
lanes?: TimelineLane[];
|
|
240
|
+
colors: Record<string, string>;
|
|
241
|
+
axis: (t: number) => string;
|
|
242
|
+
span: (start: number, end: number) => string;
|
|
243
|
+
marks?: ChartMark[];
|
|
244
|
+
now?: number;
|
|
245
|
+
hatch?: string[];
|
|
246
|
+
}): import("react").JSX.Element;
|
|
247
|
+
//#endregion
|
|
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 };
|