@adecore/charts 0.62.1 → 0.63.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/dist/Root.js +371 -351
- package/dist/SeriesLegend.d.ts +1 -9
- package/dist/annotations.js +111 -266
- package/dist/axes.d.ts +1 -1
- package/dist/axes.js +121 -223
- package/dist/band.d.ts +2 -7
- package/dist/band.js +1 -1
- package/dist/context.d.ts +5 -2
- package/dist/index.d.ts +2 -1
- package/dist/legend.d.ts +9 -1
- package/dist/overlays.js +0 -2
- package/dist/plane.d.ts +25 -0
- package/dist/plane.js +55 -0
- package/dist/scale.d.ts +2 -1
- package/dist/series.js +3 -3
- package/dist/spark.d.ts +2 -1
- package/dist/store.d.ts +6 -5
- package/dist/time-format.d.ts +2 -1
- package/dist/timeline-layout.d.ts +3 -2
- package/package.json +3 -3
- package/src/Heatmap.tsx +0 -1
- package/src/Root.tsx +7 -5
- package/src/SeriesLegend.tsx +1 -16
- package/src/annotations.tsx +10 -38
- package/src/axes.tsx +37 -82
- package/src/band.ts +3 -3
- package/src/context.ts +5 -4
- package/src/index.ts +2 -1
- package/src/legend.ts +14 -1
- package/src/overlays.tsx +0 -2
- package/src/plane.ts +76 -0
- package/src/scale.ts +1 -1
- package/src/scatter.tsx +0 -1
- package/src/series.tsx +3 -3
- package/src/spark.ts +1 -1
- package/src/store.ts +5 -6
- package/src/time-format.ts +1 -1
- package/src/timeline-layout.ts +2 -2
package/src/series.tsx
CHANGED
|
@@ -200,7 +200,7 @@ export function ChartLine<Row>({ value, label, tone, icon, curve = 'linear', das
|
|
|
200
200
|
valueLabels: false
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
if (chart.
|
|
203
|
+
if (!chart.plane.draws('line')) {
|
|
204
204
|
return null;
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -261,7 +261,7 @@ export function ChartPoint<Row>({ value, label, tone, icon, className, ref }: Ch
|
|
|
261
261
|
|
|
262
262
|
const fallback = chart.colors.get(id) ?? seriesColor(0);
|
|
263
263
|
|
|
264
|
-
if (chart.
|
|
264
|
+
if (!chart.plane.draws('point')) {
|
|
265
265
|
return null;
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -322,7 +322,7 @@ export function ChartArea<Row>({
|
|
|
322
322
|
valueLabels: false
|
|
323
323
|
});
|
|
324
324
|
|
|
325
|
-
if (chart.
|
|
325
|
+
if (!chart.plane.draws('area')) {
|
|
326
326
|
return null;
|
|
327
327
|
}
|
|
328
328
|
|
package/src/spark.ts
CHANGED
package/src/store.ts
CHANGED
|
@@ -43,17 +43,17 @@ export interface BandEntry {
|
|
|
43
43
|
readonly color: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
interface AxisSizes {
|
|
47
47
|
/* The room end labels take right of the plot, inside its svg. */
|
|
48
48
|
readonly end: number | null;
|
|
49
49
|
/* The room the row labels of a horizontal chart take left of the plot. */
|
|
50
50
|
readonly start: number | null;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
type YAxisSide = 'left' | 'right';
|
|
54
54
|
|
|
55
55
|
/* A y axis on one side. Both sides read the one value scale, so each keeps its own ticks, title and format. */
|
|
56
|
-
|
|
56
|
+
interface YAxisEntry {
|
|
57
57
|
/* Null before its labels have been measured. */
|
|
58
58
|
readonly width: number | null;
|
|
59
59
|
readonly ticks: number | null;
|
|
@@ -63,15 +63,14 @@ export interface YAxisEntry {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/* One row of labels under the plot; the rows stack in the order of the children. */
|
|
66
|
-
|
|
67
|
-
/* The height of the row. */
|
|
66
|
+
interface XAxisEntry {
|
|
68
67
|
readonly room: number;
|
|
69
68
|
/* The widest label, which decides how many fit; null before the row has been measured. */
|
|
70
69
|
readonly widest: number | null;
|
|
71
70
|
readonly format: ((x: ChartX) => string) | undefined;
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
interface ChartFormats {
|
|
75
74
|
/* The title of the x axis, which names the x where a point is read out. */
|
|
76
75
|
readonly xTitle?: string;
|
|
77
76
|
}
|
package/src/time-format.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { formatClock, formatDay, formatDayClock } from '@adecore/ui/format';
|
|
|
3
3
|
const HOUR = 60 * 60 * 1000;
|
|
4
4
|
const DAY = 24 * HOUR;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type TimeLabel = 'clock' | 'dayClock' | 'day';
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
* How a time axis writes its ticks: the clock within a day, the day once the ticks are a day apart, and
|
package/src/timeline-layout.ts
CHANGED
|
@@ -133,7 +133,7 @@ export function durationTicks(total: number, count = 5): number[] {
|
|
|
133
133
|
return ticks;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
interface TimelineBar {
|
|
137
137
|
/* Both in percent of the axis. */
|
|
138
138
|
readonly left: number;
|
|
139
139
|
readonly width: number;
|
|
@@ -172,7 +172,7 @@ export function kindTimes(rows: readonly TimelineTreeRow<TimelineSpan>[]): Map<s
|
|
|
172
172
|
return times;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
type TimelineMove = { readonly focus: number } | { readonly expand: string } | { readonly collapse: string } | { readonly select: string };
|
|
176
176
|
|
|
177
177
|
/*
|
|
178
178
|
* What a key does in the tree of rows, as in a tree view: Up and Down step, Home and End go to the ends, Right
|