@lineandvertexsoftware/overlay-d3 0.1.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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/Overlay.d.ts +208 -0
- package/dist/Overlay.d.ts.map +1 -0
- package/dist/Overlay.js +772 -0
- package/dist/Overlay.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vertexa contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @vertexa-chart/overlay-d3
|
|
2
|
+
|
|
3
|
+
D3 overlay module used by Vertexa Chart for axes, zoom/pan, guides, selection, and legend.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @vertexa-chart/overlay-d3
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { OverlayD3 } from "@vertexa-chart/overlay-d3";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This package is primarily intended as an internal building block of
|
|
18
|
+
`@vertexa-chart/vertexa-chart-core`, but it can be used directly for custom
|
|
19
|
+
overlay workflows.
|
|
20
|
+
|
|
21
|
+
For full docs and examples, see:
|
|
22
|
+
[https://github.com/LineandVertexSoftware/vertexa-chart/blob/main/README.md](https://github.com/LineandVertexSoftware/vertexa-chart#readme)
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
export type ZoomState = {
|
|
2
|
+
k: number;
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
export type LegendItem = {
|
|
7
|
+
name: string;
|
|
8
|
+
color: string;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type AxisType = "linear" | "log" | "time";
|
|
12
|
+
export type AxisStyle = {
|
|
13
|
+
fontFamily?: string;
|
|
14
|
+
fontSizePx?: number;
|
|
15
|
+
};
|
|
16
|
+
export type AxisSpec = {
|
|
17
|
+
type: AxisType;
|
|
18
|
+
domain: [number, number];
|
|
19
|
+
title?: string;
|
|
20
|
+
tickValues?: Array<number | Date>;
|
|
21
|
+
tickFormat?: string;
|
|
22
|
+
precision?: number;
|
|
23
|
+
timeFormat?: string;
|
|
24
|
+
style?: AxisStyle;
|
|
25
|
+
};
|
|
26
|
+
export type HoverEvent = {
|
|
27
|
+
xSvg: number;
|
|
28
|
+
ySvg: number;
|
|
29
|
+
xPlot: number;
|
|
30
|
+
yPlot: number;
|
|
31
|
+
xData: number | Date;
|
|
32
|
+
yData: number | Date;
|
|
33
|
+
inside: boolean;
|
|
34
|
+
};
|
|
35
|
+
export type BoxSelectEvent = {
|
|
36
|
+
mode?: "box";
|
|
37
|
+
x0Svg: number;
|
|
38
|
+
y0Svg: number;
|
|
39
|
+
x1Svg: number;
|
|
40
|
+
y1Svg: number;
|
|
41
|
+
x0Plot: number;
|
|
42
|
+
y0Plot: number;
|
|
43
|
+
x1Plot: number;
|
|
44
|
+
y1Plot: number;
|
|
45
|
+
x0Data: number | Date;
|
|
46
|
+
y0Data: number | Date;
|
|
47
|
+
x1Data: number | Date;
|
|
48
|
+
y1Data: number | Date;
|
|
49
|
+
};
|
|
50
|
+
export type LassoSelectEvent = {
|
|
51
|
+
mode: "lasso";
|
|
52
|
+
x0Svg: number;
|
|
53
|
+
y0Svg: number;
|
|
54
|
+
x1Svg: number;
|
|
55
|
+
y1Svg: number;
|
|
56
|
+
x0Plot: number;
|
|
57
|
+
y0Plot: number;
|
|
58
|
+
x1Plot: number;
|
|
59
|
+
y1Plot: number;
|
|
60
|
+
x0Data: number | Date;
|
|
61
|
+
y0Data: number | Date;
|
|
62
|
+
x1Data: number | Date;
|
|
63
|
+
y1Data: number | Date;
|
|
64
|
+
lassoSvg: Array<{
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
}>;
|
|
68
|
+
lassoPlot: Array<{
|
|
69
|
+
x: number;
|
|
70
|
+
y: number;
|
|
71
|
+
}>;
|
|
72
|
+
lassoData: Array<{
|
|
73
|
+
x: number | Date;
|
|
74
|
+
y: number | Date;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
export type PlotSelectEvent = BoxSelectEvent | LassoSelectEvent;
|
|
78
|
+
export type OverlayLineDash = "solid" | "dash" | "dot" | "dashdot" | number[];
|
|
79
|
+
export type AnnotationLine = {
|
|
80
|
+
type: "line";
|
|
81
|
+
x0: number | Date;
|
|
82
|
+
y0: number | Date;
|
|
83
|
+
x1: number | Date;
|
|
84
|
+
y1: number | Date;
|
|
85
|
+
color?: string;
|
|
86
|
+
opacity?: number;
|
|
87
|
+
widthPx?: number;
|
|
88
|
+
dash?: OverlayLineDash;
|
|
89
|
+
};
|
|
90
|
+
export type AnnotationRegion = {
|
|
91
|
+
type: "region";
|
|
92
|
+
x0: number | Date;
|
|
93
|
+
y0: number | Date;
|
|
94
|
+
x1: number | Date;
|
|
95
|
+
y1: number | Date;
|
|
96
|
+
fill?: string;
|
|
97
|
+
fillOpacity?: number;
|
|
98
|
+
stroke?: string;
|
|
99
|
+
strokeOpacity?: number;
|
|
100
|
+
strokeWidthPx?: number;
|
|
101
|
+
};
|
|
102
|
+
export type AnnotationLabel = {
|
|
103
|
+
type: "label";
|
|
104
|
+
x: number | Date;
|
|
105
|
+
y: number | Date;
|
|
106
|
+
text: string;
|
|
107
|
+
color?: string;
|
|
108
|
+
fontFamily?: string;
|
|
109
|
+
fontSizePx?: number;
|
|
110
|
+
anchor?: "start" | "middle" | "end";
|
|
111
|
+
offsetXPx?: number;
|
|
112
|
+
offsetYPx?: number;
|
|
113
|
+
background?: string;
|
|
114
|
+
backgroundOpacity?: number;
|
|
115
|
+
paddingX?: number;
|
|
116
|
+
paddingY?: number;
|
|
117
|
+
};
|
|
118
|
+
export type AnnotationPrimitive = AnnotationLine | AnnotationRegion | AnnotationLabel;
|
|
119
|
+
export type GridStyle = {
|
|
120
|
+
show?: boolean;
|
|
121
|
+
color?: string;
|
|
122
|
+
axisColor?: string;
|
|
123
|
+
textColor?: string;
|
|
124
|
+
opacity?: number;
|
|
125
|
+
strokeWidth?: number;
|
|
126
|
+
};
|
|
127
|
+
export type OverlayOptions = {
|
|
128
|
+
svg: SVGSVGElement;
|
|
129
|
+
gridSvg?: SVGSVGElement;
|
|
130
|
+
width: number;
|
|
131
|
+
height: number;
|
|
132
|
+
padding: {
|
|
133
|
+
l: number;
|
|
134
|
+
r: number;
|
|
135
|
+
t: number;
|
|
136
|
+
b: number;
|
|
137
|
+
};
|
|
138
|
+
xAxis: AxisSpec;
|
|
139
|
+
yAxis: AxisSpec;
|
|
140
|
+
onZoom: (z: ZoomState) => void;
|
|
141
|
+
onHover?: (e: HoverEvent) => void;
|
|
142
|
+
onClick?: (e: HoverEvent) => void;
|
|
143
|
+
onBoxSelect?: (e: PlotSelectEvent) => void;
|
|
144
|
+
annotations?: AnnotationPrimitive[];
|
|
145
|
+
grid?: GridStyle;
|
|
146
|
+
legend?: {
|
|
147
|
+
items: LegendItem[];
|
|
148
|
+
onToggle: (index: number) => void;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export declare class OverlayD3 {
|
|
152
|
+
private opts;
|
|
153
|
+
private svgSel;
|
|
154
|
+
private gridSvgSel?;
|
|
155
|
+
private gRoot;
|
|
156
|
+
private gGridRoot?;
|
|
157
|
+
private gXAxis;
|
|
158
|
+
private gYAxis;
|
|
159
|
+
private zoomRect;
|
|
160
|
+
private gLegend;
|
|
161
|
+
private gGuides;
|
|
162
|
+
private vGuide;
|
|
163
|
+
private hGuide;
|
|
164
|
+
private selectionRect;
|
|
165
|
+
private selectionPath;
|
|
166
|
+
private gAnnotations;
|
|
167
|
+
private width;
|
|
168
|
+
private height;
|
|
169
|
+
private padding;
|
|
170
|
+
private plotW;
|
|
171
|
+
private plotH;
|
|
172
|
+
private baseX;
|
|
173
|
+
private baseY;
|
|
174
|
+
private gridStyle;
|
|
175
|
+
private currentT;
|
|
176
|
+
private zoomBehavior;
|
|
177
|
+
private annotations;
|
|
178
|
+
private selecting;
|
|
179
|
+
private selectionMode;
|
|
180
|
+
private selectionStart;
|
|
181
|
+
private lassoPoints;
|
|
182
|
+
private suppressClickUntil;
|
|
183
|
+
constructor(opts: OverlayOptions);
|
|
184
|
+
setSize(width: number, height: number, padding: OverlayOptions["padding"]): void;
|
|
185
|
+
setAxes(xAxis: AxisSpec, yAxis: AxisSpec): void;
|
|
186
|
+
setGrid(grid?: GridStyle): void;
|
|
187
|
+
setAnnotations(annotations: AnnotationPrimitive[]): void;
|
|
188
|
+
setLegend(items: LegendItem[], onToggle: (index: number) => void): void;
|
|
189
|
+
setHoverGuides(args: {
|
|
190
|
+
mode: "closest" | "x" | "y" | "none";
|
|
191
|
+
xPlot: number;
|
|
192
|
+
yPlot: number;
|
|
193
|
+
inside: boolean;
|
|
194
|
+
} | null): void;
|
|
195
|
+
private installZoom;
|
|
196
|
+
panBy(dxCss: number, dyCss: number): void;
|
|
197
|
+
zoomBy(factor: number, centerPlot?: {
|
|
198
|
+
x: number;
|
|
199
|
+
y: number;
|
|
200
|
+
}): void;
|
|
201
|
+
resetZoom(): void;
|
|
202
|
+
private makeLassoPath;
|
|
203
|
+
private computeLassoBounds;
|
|
204
|
+
private renderAxes;
|
|
205
|
+
private renderGridLines;
|
|
206
|
+
private renderAnnotations;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=Overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../src/Overlay.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IA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AK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAoCnH,OAAO,CAAC,WAAW;IAiNnB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IASlC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAiB5D,SAAS;IAKT,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,UAAU;IA0ElB,OAAO,CAAC,eAAe;IA4CvB,OAAO,CAAC,iBAAiB;CA8E1B"}
|
package/dist/Overlay.js
ADDED
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
import * as d3 from "d3";
|
|
2
|
+
const DEFAULT_GRID_STYLE = {
|
|
3
|
+
show: true,
|
|
4
|
+
color: "#e5e7eb",
|
|
5
|
+
axisColor: "#9ca3af",
|
|
6
|
+
textColor: "#4b5563",
|
|
7
|
+
opacity: 1,
|
|
8
|
+
strokeWidth: 1
|
|
9
|
+
};
|
|
10
|
+
export class OverlayD3 {
|
|
11
|
+
opts;
|
|
12
|
+
svgSel;
|
|
13
|
+
gridSvgSel;
|
|
14
|
+
gRoot;
|
|
15
|
+
gGridRoot;
|
|
16
|
+
gXAxis;
|
|
17
|
+
gYAxis;
|
|
18
|
+
zoomRect;
|
|
19
|
+
gLegend;
|
|
20
|
+
gGuides;
|
|
21
|
+
vGuide;
|
|
22
|
+
hGuide;
|
|
23
|
+
selectionRect;
|
|
24
|
+
selectionPath;
|
|
25
|
+
gAnnotations;
|
|
26
|
+
width = 0;
|
|
27
|
+
height = 0;
|
|
28
|
+
padding;
|
|
29
|
+
plotW = 1;
|
|
30
|
+
plotH = 1;
|
|
31
|
+
baseX;
|
|
32
|
+
baseY;
|
|
33
|
+
gridStyle;
|
|
34
|
+
currentT = d3.zoomIdentity;
|
|
35
|
+
zoomBehavior = null;
|
|
36
|
+
annotations = [];
|
|
37
|
+
selecting = false;
|
|
38
|
+
selectionMode = "box";
|
|
39
|
+
selectionStart = null;
|
|
40
|
+
lassoPoints = [];
|
|
41
|
+
suppressClickUntil = 0;
|
|
42
|
+
constructor(opts) {
|
|
43
|
+
this.opts = opts;
|
|
44
|
+
this.svgSel = d3.select(opts.svg);
|
|
45
|
+
this.svgSel.style("overflow", "hidden");
|
|
46
|
+
if (opts.gridSvg) {
|
|
47
|
+
this.gridSvgSel = d3.select(opts.gridSvg);
|
|
48
|
+
this.gridSvgSel.style("overflow", "hidden").style("pointer-events", "none");
|
|
49
|
+
this.gGridRoot = this.gridSvgSel.append("g").attr("class", "grid-root");
|
|
50
|
+
}
|
|
51
|
+
this.gRoot = this.svgSel.append("g").attr("class", "overlay-root");
|
|
52
|
+
this.gXAxis = this.gRoot.append("g").attr("class", "x-axis");
|
|
53
|
+
this.gYAxis = this.gRoot.append("g").attr("class", "y-axis");
|
|
54
|
+
this.gAnnotations = this.gRoot.append("g").attr("class", "annotations").style("pointer-events", "none");
|
|
55
|
+
// Guides (in plot coords)
|
|
56
|
+
this.gGuides = this.gRoot.append("g").attr("class", "guides").style("pointer-events", "none");
|
|
57
|
+
this.vGuide = this.gGuides.append("line")
|
|
58
|
+
.attr("class", "v-guide")
|
|
59
|
+
.attr("stroke", "#111")
|
|
60
|
+
.attr("stroke-opacity", 0)
|
|
61
|
+
.attr("stroke-width", 1)
|
|
62
|
+
.attr("shape-rendering", "crispEdges");
|
|
63
|
+
this.hGuide = this.gGuides.append("line")
|
|
64
|
+
.attr("class", "h-guide")
|
|
65
|
+
.attr("stroke", "#111")
|
|
66
|
+
.attr("stroke-opacity", 0)
|
|
67
|
+
.attr("stroke-width", 1)
|
|
68
|
+
.attr("shape-rendering", "crispEdges");
|
|
69
|
+
this.selectionRect = this.gRoot.append("rect")
|
|
70
|
+
.attr("class", "selection-rect")
|
|
71
|
+
.attr("x", 0)
|
|
72
|
+
.attr("y", 0)
|
|
73
|
+
.attr("width", 0)
|
|
74
|
+
.attr("height", 0)
|
|
75
|
+
.attr("fill", "rgba(37,99,235,0.18)")
|
|
76
|
+
.attr("stroke", "#2563eb")
|
|
77
|
+
.attr("stroke-width", 1)
|
|
78
|
+
.attr("stroke-dasharray", "4 3")
|
|
79
|
+
.attr("visibility", "hidden")
|
|
80
|
+
.style("pointer-events", "none");
|
|
81
|
+
this.selectionPath = this.gRoot.append("path")
|
|
82
|
+
.attr("class", "selection-path")
|
|
83
|
+
.attr("fill", "rgba(37,99,235,0.16)")
|
|
84
|
+
.attr("stroke", "#2563eb")
|
|
85
|
+
.attr("stroke-width", 1)
|
|
86
|
+
.attr("stroke-dasharray", "4 3")
|
|
87
|
+
.attr("visibility", "hidden")
|
|
88
|
+
.style("pointer-events", "none");
|
|
89
|
+
// Legend in SVG coords (top-right)
|
|
90
|
+
this.gLegend = this.svgSel.append("g").attr("class", "legend");
|
|
91
|
+
// Transparent rect to catch zoom
|
|
92
|
+
this.zoomRect = this.gRoot
|
|
93
|
+
.append("rect")
|
|
94
|
+
.attr("class", "zoom-rect")
|
|
95
|
+
.attr("fill", "transparent")
|
|
96
|
+
.style("cursor", "crosshair");
|
|
97
|
+
this.gridStyle = resolveGridStyle(opts.grid);
|
|
98
|
+
this.annotations = opts.annotations ?? [];
|
|
99
|
+
this.setSize(opts.width, opts.height, opts.padding);
|
|
100
|
+
this.installZoom(opts.onZoom);
|
|
101
|
+
this.renderAxes({ k: 1, x: 0, y: 0 });
|
|
102
|
+
if (opts.legend)
|
|
103
|
+
this.setLegend(opts.legend.items, opts.legend.onToggle);
|
|
104
|
+
}
|
|
105
|
+
setSize(width, height, padding) {
|
|
106
|
+
this.width = width;
|
|
107
|
+
this.height = height;
|
|
108
|
+
this.padding = padding;
|
|
109
|
+
this.svgSel.attr("width", width).attr("height", height);
|
|
110
|
+
this.gridSvgSel?.attr("width", width).attr("height", height);
|
|
111
|
+
const plotW = Math.max(1, width - padding.l - padding.r);
|
|
112
|
+
const plotH = Math.max(1, height - padding.t - padding.b);
|
|
113
|
+
this.plotW = plotW;
|
|
114
|
+
this.plotH = plotH;
|
|
115
|
+
this.baseX = makeScale(this.opts.xAxis.type, this.opts.xAxis.domain, [0, plotW]);
|
|
116
|
+
this.baseY = makeScale(this.opts.yAxis.type, this.opts.yAxis.domain, [plotH, 0]);
|
|
117
|
+
this.gRoot.attr("transform", `translate(${padding.l},${padding.t})`);
|
|
118
|
+
this.gGridRoot?.attr("transform", `translate(${padding.l},${padding.t})`);
|
|
119
|
+
this.gXAxis.attr("transform", `translate(0,${plotH})`);
|
|
120
|
+
this.gYAxis.attr("transform", `translate(0,0)`);
|
|
121
|
+
this.zoomRect.attr("x", 0).attr("y", 0).attr("width", plotW).attr("height", plotH);
|
|
122
|
+
// Legend anchor
|
|
123
|
+
this.gLegend.attr("transform", `translate(${padding.l + plotW - 8},${padding.t + 8})`);
|
|
124
|
+
this.renderAxes({ k: this.currentT.k, x: this.currentT.x, y: this.currentT.y });
|
|
125
|
+
}
|
|
126
|
+
setAxes(xAxis, yAxis) {
|
|
127
|
+
this.opts.xAxis = xAxis;
|
|
128
|
+
this.opts.yAxis = yAxis;
|
|
129
|
+
this.setSize(this.width, this.height, this.padding);
|
|
130
|
+
}
|
|
131
|
+
setGrid(grid) {
|
|
132
|
+
this.gridStyle = resolveGridStyle(grid);
|
|
133
|
+
this.renderAxes({ k: this.currentT.k, x: this.currentT.x, y: this.currentT.y });
|
|
134
|
+
}
|
|
135
|
+
setAnnotations(annotations) {
|
|
136
|
+
this.annotations = annotations.slice();
|
|
137
|
+
this.renderAxes({ k: this.currentT.k, x: this.currentT.x, y: this.currentT.y });
|
|
138
|
+
}
|
|
139
|
+
setLegend(items, onToggle) {
|
|
140
|
+
const rowH = 18;
|
|
141
|
+
const g = this.gLegend;
|
|
142
|
+
g.attr("role", "group").attr("aria-label", "Chart legend");
|
|
143
|
+
g.selectAll("*").remove();
|
|
144
|
+
const rows = g
|
|
145
|
+
.selectAll("g.row")
|
|
146
|
+
.data(items)
|
|
147
|
+
.enter()
|
|
148
|
+
.append("g")
|
|
149
|
+
.attr("class", "row")
|
|
150
|
+
.attr("transform", (_d, i) => `translate(0,${i * rowH})`)
|
|
151
|
+
.attr("role", "button")
|
|
152
|
+
.attr("tabindex", 0)
|
|
153
|
+
.attr("focusable", "true")
|
|
154
|
+
.attr("aria-pressed", (d) => (d.visible ? "true" : "false"))
|
|
155
|
+
.attr("aria-label", (d) => `${d.name} (${d.visible ? "visible" : "hidden"})`)
|
|
156
|
+
.style("cursor", "pointer")
|
|
157
|
+
.on("click", function () {
|
|
158
|
+
const nodes = rows.nodes();
|
|
159
|
+
const i = nodes.indexOf(this);
|
|
160
|
+
if (i >= 0)
|
|
161
|
+
onToggle(i);
|
|
162
|
+
})
|
|
163
|
+
.on("keydown", function (event) {
|
|
164
|
+
const nodes = rows.nodes();
|
|
165
|
+
const i = nodes.indexOf(this);
|
|
166
|
+
if (i < 0)
|
|
167
|
+
return;
|
|
168
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
event.stopPropagation();
|
|
171
|
+
onToggle(i);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
event.stopPropagation();
|
|
177
|
+
const dir = event.key === "ArrowDown" ? 1 : -1;
|
|
178
|
+
const next = (i + dir + nodes.length) % nodes.length;
|
|
179
|
+
nodes[next]?.focus?.();
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
rows.append("rect")
|
|
183
|
+
.attr("x", -160)
|
|
184
|
+
.attr("y", -12)
|
|
185
|
+
.attr("width", 160)
|
|
186
|
+
.attr("height", 18)
|
|
187
|
+
.attr("fill", "transparent");
|
|
188
|
+
rows.append("rect")
|
|
189
|
+
.attr("x", -150)
|
|
190
|
+
.attr("y", -9)
|
|
191
|
+
.attr("width", 10)
|
|
192
|
+
.attr("height", 10)
|
|
193
|
+
.attr("rx", 2)
|
|
194
|
+
.attr("fill", (d) => (d.visible ? d.color : this.gridStyle.axisColor))
|
|
195
|
+
.attr("stroke", this.gridStyle.axisColor)
|
|
196
|
+
.attr("stroke-opacity", 0.35);
|
|
197
|
+
rows.append("text")
|
|
198
|
+
.attr("x", -134)
|
|
199
|
+
.attr("y", 0)
|
|
200
|
+
.attr("dominant-baseline", "middle")
|
|
201
|
+
.attr("text-anchor", "start")
|
|
202
|
+
.attr("font-size", 12)
|
|
203
|
+
.attr("fill", this.gridStyle.textColor)
|
|
204
|
+
.attr("fill-opacity", (d) => (d.visible ? 1 : 0.65))
|
|
205
|
+
.text((d) => d.name);
|
|
206
|
+
}
|
|
207
|
+
setHoverGuides(args) {
|
|
208
|
+
if (!args || !args.inside) {
|
|
209
|
+
this.vGuide.attr("stroke-opacity", 0);
|
|
210
|
+
this.hGuide.attr("stroke-opacity", 0);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const { mode, xPlot, yPlot } = args;
|
|
214
|
+
if (mode === "x") {
|
|
215
|
+
this.vGuide
|
|
216
|
+
.attr("x1", xPlot).attr("y1", 0)
|
|
217
|
+
.attr("x2", xPlot).attr("y2", this.plotH)
|
|
218
|
+
.attr("stroke-opacity", 0.25);
|
|
219
|
+
this.hGuide.attr("stroke-opacity", 0);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (mode === "y") {
|
|
223
|
+
this.hGuide
|
|
224
|
+
.attr("x1", 0).attr("y1", yPlot)
|
|
225
|
+
.attr("x2", this.plotW).attr("y2", yPlot)
|
|
226
|
+
.attr("stroke-opacity", 0.25);
|
|
227
|
+
this.vGuide.attr("stroke-opacity", 0);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
this.vGuide
|
|
231
|
+
.attr("x1", xPlot).attr("y1", 0)
|
|
232
|
+
.attr("x2", xPlot).attr("y2", this.plotH)
|
|
233
|
+
.attr("stroke-opacity", 0.28);
|
|
234
|
+
this.hGuide
|
|
235
|
+
.attr("x1", 0).attr("y1", yPlot)
|
|
236
|
+
.attr("x2", this.plotW).attr("y2", yPlot)
|
|
237
|
+
.attr("stroke-opacity", 0.28);
|
|
238
|
+
}
|
|
239
|
+
installZoom(onZoom) {
|
|
240
|
+
const clampPlot = (value, max) => Math.max(0, Math.min(max, value));
|
|
241
|
+
const emitPointerEvent = (event, cb) => {
|
|
242
|
+
if (!cb)
|
|
243
|
+
return;
|
|
244
|
+
if (this.selecting)
|
|
245
|
+
return;
|
|
246
|
+
const [sx, sy] = d3.pointer(event, this.svgSel.node());
|
|
247
|
+
const xPlot = sx - this.padding.l;
|
|
248
|
+
const yPlot = sy - this.padding.t;
|
|
249
|
+
const inside = xPlot >= 0 && yPlot >= 0 && xPlot <= this.plotW && yPlot <= this.plotH;
|
|
250
|
+
const zx = this.currentT.rescaleX(this.baseX);
|
|
251
|
+
const zy = this.currentT.rescaleY(this.baseY);
|
|
252
|
+
const xData = invertValue(this.opts.xAxis.type, zx, xPlot);
|
|
253
|
+
const yData = invertValue(this.opts.yAxis.type, zy, yPlot);
|
|
254
|
+
cb({ xSvg: sx, ySvg: sy, xPlot, yPlot, xData, yData, inside });
|
|
255
|
+
};
|
|
256
|
+
const zoomed = (event) => {
|
|
257
|
+
const t = event.transform;
|
|
258
|
+
this.currentT = t;
|
|
259
|
+
this.renderAxes({ k: t.k, x: t.x, y: t.y });
|
|
260
|
+
onZoom({ k: t.k, x: t.x, y: t.y });
|
|
261
|
+
};
|
|
262
|
+
const zoomBehavior = d3.zoom()
|
|
263
|
+
.scaleExtent([0.5, 50])
|
|
264
|
+
.filter((event) => {
|
|
265
|
+
if (this.selecting)
|
|
266
|
+
return false;
|
|
267
|
+
if (event?.shiftKey)
|
|
268
|
+
return false;
|
|
269
|
+
if (typeof event?.button === "number" && event.button !== 0)
|
|
270
|
+
return false;
|
|
271
|
+
return true;
|
|
272
|
+
})
|
|
273
|
+
.on("zoom", zoomed);
|
|
274
|
+
this.zoomBehavior = zoomBehavior;
|
|
275
|
+
this.zoomRect.call(zoomBehavior);
|
|
276
|
+
// Hover events
|
|
277
|
+
this.zoomRect.on("mousemove", (event) => {
|
|
278
|
+
emitPointerEvent(event, this.opts.onHover);
|
|
279
|
+
});
|
|
280
|
+
this.zoomRect.on("click", (event) => {
|
|
281
|
+
if (performance.now() < this.suppressClickUntil)
|
|
282
|
+
return;
|
|
283
|
+
emitPointerEvent(event, this.opts.onClick);
|
|
284
|
+
});
|
|
285
|
+
this.zoomRect.on("mouseleave", () => {
|
|
286
|
+
if (!this.opts.onHover)
|
|
287
|
+
return;
|
|
288
|
+
this.opts.onHover({
|
|
289
|
+
xSvg: -1, ySvg: -1, xPlot: -1, yPlot: -1,
|
|
290
|
+
xData: NaN, yData: NaN,
|
|
291
|
+
inside: false
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
this.zoomRect.on("mousedown.selection", (event) => {
|
|
295
|
+
if (!this.opts.onBoxSelect)
|
|
296
|
+
return;
|
|
297
|
+
if (!event.shiftKey || event.button !== 0)
|
|
298
|
+
return;
|
|
299
|
+
event.preventDefault();
|
|
300
|
+
event.stopPropagation();
|
|
301
|
+
const [sx, sy] = d3.pointer(event, this.svgSel.node());
|
|
302
|
+
const xPlot = clampPlot(sx - this.padding.l, this.plotW);
|
|
303
|
+
const yPlot = clampPlot(sy - this.padding.t, this.plotH);
|
|
304
|
+
this.selecting = true;
|
|
305
|
+
this.selectionMode = event.altKey ? "lasso" : "box";
|
|
306
|
+
this.selectionStart = { xPlot, yPlot };
|
|
307
|
+
if (this.selectionMode === "lasso") {
|
|
308
|
+
this.lassoPoints = [{ xPlot, yPlot }];
|
|
309
|
+
this.selectionRect.attr("visibility", "hidden").attr("width", 0).attr("height", 0);
|
|
310
|
+
this.selectionPath.attr("d", `M ${xPlot} ${yPlot}`).attr("visibility", "visible");
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
this.lassoPoints = [];
|
|
314
|
+
this.selectionPath.attr("visibility", "hidden").attr("d", "");
|
|
315
|
+
this.selectionRect
|
|
316
|
+
.attr("x", xPlot)
|
|
317
|
+
.attr("y", yPlot)
|
|
318
|
+
.attr("width", 0)
|
|
319
|
+
.attr("height", 0)
|
|
320
|
+
.attr("visibility", "visible");
|
|
321
|
+
}
|
|
322
|
+
const onMove = (moveEvent) => {
|
|
323
|
+
if (!this.selecting || !this.selectionStart)
|
|
324
|
+
return;
|
|
325
|
+
const [mx, my] = d3.pointer(moveEvent, this.svgSel.node());
|
|
326
|
+
const cx = clampPlot(mx - this.padding.l, this.plotW);
|
|
327
|
+
const cy = clampPlot(my - this.padding.t, this.plotH);
|
|
328
|
+
if (this.selectionMode === "lasso") {
|
|
329
|
+
const last = this.lassoPoints[this.lassoPoints.length - 1];
|
|
330
|
+
if (!last || Math.hypot(cx - last.xPlot, cy - last.yPlot) >= 2) {
|
|
331
|
+
this.lassoPoints.push({ xPlot: cx, yPlot: cy });
|
|
332
|
+
this.selectionPath
|
|
333
|
+
.attr("d", this.makeLassoPath(this.lassoPoints))
|
|
334
|
+
.attr("visibility", "visible");
|
|
335
|
+
}
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const x0 = Math.min(this.selectionStart.xPlot, cx);
|
|
339
|
+
const x1 = Math.max(this.selectionStart.xPlot, cx);
|
|
340
|
+
const y0 = Math.min(this.selectionStart.yPlot, cy);
|
|
341
|
+
const y1 = Math.max(this.selectionStart.yPlot, cy);
|
|
342
|
+
this.selectionRect
|
|
343
|
+
.attr("x", x0)
|
|
344
|
+
.attr("y", y0)
|
|
345
|
+
.attr("width", x1 - x0)
|
|
346
|
+
.attr("height", y1 - y0);
|
|
347
|
+
};
|
|
348
|
+
const finishSelection = (upEvent) => {
|
|
349
|
+
if (!this.selecting || !this.selectionStart)
|
|
350
|
+
return;
|
|
351
|
+
const start = this.selectionStart;
|
|
352
|
+
this.selecting = false;
|
|
353
|
+
this.selectionStart = null;
|
|
354
|
+
const [ux, uy] = d3.pointer(upEvent, this.svgSel.node());
|
|
355
|
+
const endX = clampPlot(ux - this.padding.l, this.plotW);
|
|
356
|
+
const endY = clampPlot(uy - this.padding.t, this.plotH);
|
|
357
|
+
let x0Plot = Math.min(start.xPlot, endX);
|
|
358
|
+
let x1Plot = Math.max(start.xPlot, endX);
|
|
359
|
+
let y0Plot = Math.min(start.yPlot, endY);
|
|
360
|
+
let y1Plot = Math.max(start.yPlot, endY);
|
|
361
|
+
this.selectionRect.attr("visibility", "hidden").attr("width", 0).attr("height", 0);
|
|
362
|
+
this.selectionPath.attr("visibility", "hidden").attr("d", "");
|
|
363
|
+
window.removeEventListener("mousemove", onMove);
|
|
364
|
+
window.removeEventListener("mouseup", finishSelection);
|
|
365
|
+
const zx = this.currentT.rescaleX(this.baseX);
|
|
366
|
+
const zy = this.currentT.rescaleY(this.baseY);
|
|
367
|
+
this.suppressClickUntil = performance.now() + 140;
|
|
368
|
+
if (this.selectionMode === "lasso") {
|
|
369
|
+
const pts = this.lassoPoints.length > 1
|
|
370
|
+
? [...this.lassoPoints, { xPlot: endX, yPlot: endY }]
|
|
371
|
+
: this.lassoPoints;
|
|
372
|
+
if (pts.length < 3)
|
|
373
|
+
return;
|
|
374
|
+
const bounds = this.computeLassoBounds(pts);
|
|
375
|
+
x0Plot = bounds.x0;
|
|
376
|
+
x1Plot = bounds.x1;
|
|
377
|
+
y0Plot = bounds.y0;
|
|
378
|
+
y1Plot = bounds.y1;
|
|
379
|
+
const w = x1Plot - x0Plot;
|
|
380
|
+
const h = y1Plot - y0Plot;
|
|
381
|
+
if (w < 2 || h < 2)
|
|
382
|
+
return;
|
|
383
|
+
const lassoSvg = pts.map((p) => ({ x: p.xPlot + this.padding.l, y: p.yPlot + this.padding.t }));
|
|
384
|
+
const lassoData = pts.map((p) => ({
|
|
385
|
+
x: invertValue(this.opts.xAxis.type, zx, p.xPlot),
|
|
386
|
+
y: invertValue(this.opts.yAxis.type, zy, p.yPlot)
|
|
387
|
+
}));
|
|
388
|
+
this.opts.onBoxSelect?.({
|
|
389
|
+
mode: "lasso",
|
|
390
|
+
x0Svg: x0Plot + this.padding.l,
|
|
391
|
+
y0Svg: y0Plot + this.padding.t,
|
|
392
|
+
x1Svg: x1Plot + this.padding.l,
|
|
393
|
+
y1Svg: y1Plot + this.padding.t,
|
|
394
|
+
x0Plot,
|
|
395
|
+
y0Plot,
|
|
396
|
+
x1Plot,
|
|
397
|
+
y1Plot,
|
|
398
|
+
x0Data: invertValue(this.opts.xAxis.type, zx, x0Plot),
|
|
399
|
+
y0Data: invertValue(this.opts.yAxis.type, zy, y0Plot),
|
|
400
|
+
x1Data: invertValue(this.opts.xAxis.type, zx, x1Plot),
|
|
401
|
+
y1Data: invertValue(this.opts.yAxis.type, zy, y1Plot),
|
|
402
|
+
lassoSvg,
|
|
403
|
+
lassoPlot: pts.map((p) => ({ x: p.xPlot, y: p.yPlot })),
|
|
404
|
+
lassoData
|
|
405
|
+
});
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const w = x1Plot - x0Plot;
|
|
409
|
+
const h = y1Plot - y0Plot;
|
|
410
|
+
if (w < 2 || h < 2)
|
|
411
|
+
return;
|
|
412
|
+
this.opts.onBoxSelect?.({
|
|
413
|
+
mode: "box",
|
|
414
|
+
x0Svg: x0Plot + this.padding.l,
|
|
415
|
+
y0Svg: y0Plot + this.padding.t,
|
|
416
|
+
x1Svg: x1Plot + this.padding.l,
|
|
417
|
+
y1Svg: y1Plot + this.padding.t,
|
|
418
|
+
x0Plot,
|
|
419
|
+
y0Plot,
|
|
420
|
+
x1Plot,
|
|
421
|
+
y1Plot,
|
|
422
|
+
x0Data: invertValue(this.opts.xAxis.type, zx, x0Plot),
|
|
423
|
+
y0Data: invertValue(this.opts.yAxis.type, zy, y0Plot),
|
|
424
|
+
x1Data: invertValue(this.opts.xAxis.type, zx, x1Plot),
|
|
425
|
+
y1Data: invertValue(this.opts.yAxis.type, zy, y1Plot)
|
|
426
|
+
});
|
|
427
|
+
};
|
|
428
|
+
window.addEventListener("mousemove", onMove);
|
|
429
|
+
window.addEventListener("mouseup", finishSelection);
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
panBy(dxCss, dyCss) {
|
|
433
|
+
if (!this.zoomBehavior)
|
|
434
|
+
return;
|
|
435
|
+
if (!Number.isFinite(dxCss) || !Number.isFinite(dyCss))
|
|
436
|
+
return;
|
|
437
|
+
const k = Math.max(1e-6, this.currentT.k);
|
|
438
|
+
const next = this.currentT.translate(dxCss / k, dyCss / k);
|
|
439
|
+
this.zoomRect.call(this.zoomBehavior.transform, next);
|
|
440
|
+
}
|
|
441
|
+
zoomBy(factor, centerPlot) {
|
|
442
|
+
if (!this.zoomBehavior)
|
|
443
|
+
return;
|
|
444
|
+
if (!Number.isFinite(factor) || factor <= 0)
|
|
445
|
+
return;
|
|
446
|
+
const oldK = this.currentT.k;
|
|
447
|
+
const nextK = clamp(oldK * factor, 0.5, 50, oldK);
|
|
448
|
+
if (Math.abs(nextK - oldK) < 1e-9)
|
|
449
|
+
return;
|
|
450
|
+
const cx = clamp(centerPlot?.x, 0, this.plotW, this.plotW * 0.5);
|
|
451
|
+
const cy = clamp(centerPlot?.y, 0, this.plotH, this.plotH * 0.5);
|
|
452
|
+
const s = nextK / oldK;
|
|
453
|
+
const nextX = cx - (cx - this.currentT.x) * s;
|
|
454
|
+
const nextY = cy - (cy - this.currentT.y) * s;
|
|
455
|
+
const next = d3.zoomIdentity.translate(nextX, nextY).scale(nextK);
|
|
456
|
+
this.zoomRect.call(this.zoomBehavior.transform, next);
|
|
457
|
+
}
|
|
458
|
+
resetZoom() {
|
|
459
|
+
if (!this.zoomBehavior)
|
|
460
|
+
return;
|
|
461
|
+
this.zoomRect.call(this.zoomBehavior.transform, d3.zoomIdentity);
|
|
462
|
+
}
|
|
463
|
+
makeLassoPath(points) {
|
|
464
|
+
if (points.length === 0)
|
|
465
|
+
return "";
|
|
466
|
+
const [first, ...rest] = points;
|
|
467
|
+
let d = `M ${first.xPlot} ${first.yPlot}`;
|
|
468
|
+
for (const p of rest)
|
|
469
|
+
d += ` L ${p.xPlot} ${p.yPlot}`;
|
|
470
|
+
d += " Z";
|
|
471
|
+
return d;
|
|
472
|
+
}
|
|
473
|
+
computeLassoBounds(points) {
|
|
474
|
+
let x0 = Number.POSITIVE_INFINITY;
|
|
475
|
+
let y0 = Number.POSITIVE_INFINITY;
|
|
476
|
+
let x1 = Number.NEGATIVE_INFINITY;
|
|
477
|
+
let y1 = Number.NEGATIVE_INFINITY;
|
|
478
|
+
for (const p of points) {
|
|
479
|
+
if (p.xPlot < x0)
|
|
480
|
+
x0 = p.xPlot;
|
|
481
|
+
if (p.xPlot > x1)
|
|
482
|
+
x1 = p.xPlot;
|
|
483
|
+
if (p.yPlot < y0)
|
|
484
|
+
y0 = p.yPlot;
|
|
485
|
+
if (p.yPlot > y1)
|
|
486
|
+
y1 = p.yPlot;
|
|
487
|
+
}
|
|
488
|
+
return { x0, y0, x1, y1 };
|
|
489
|
+
}
|
|
490
|
+
renderAxes(z) {
|
|
491
|
+
const plotW = this.plotW;
|
|
492
|
+
const plotH = this.plotH;
|
|
493
|
+
const grid = this.gridStyle;
|
|
494
|
+
const t = d3.zoomIdentity.translate(z.x, z.y).scale(z.k);
|
|
495
|
+
const zx = t.rescaleX(this.baseX);
|
|
496
|
+
const zy = t.rescaleY(this.baseY);
|
|
497
|
+
this.renderAnnotations(zx, zy);
|
|
498
|
+
const xTickCount = Math.max(2, Math.floor(plotW / 80));
|
|
499
|
+
const yTickCount = Math.max(2, Math.floor(plotH / 60));
|
|
500
|
+
this.renderGridLines(zx, zy, xTickCount, yTickCount);
|
|
501
|
+
const drawGridInAxisLayer = !this.gGridRoot && grid.show;
|
|
502
|
+
const xTickSize = drawGridInAxisLayer ? -plotH : 6;
|
|
503
|
+
const yTickSize = drawGridInAxisLayer ? -plotW : 6;
|
|
504
|
+
const xAxis = d3.axisBottom(zx)
|
|
505
|
+
.ticks(xTickCount)
|
|
506
|
+
.tickSize(xTickSize)
|
|
507
|
+
.tickSizeOuter(0);
|
|
508
|
+
const yAxis = d3.axisLeft(zy)
|
|
509
|
+
.ticks(yTickCount)
|
|
510
|
+
.tickSize(yTickSize)
|
|
511
|
+
.tickSizeOuter(0);
|
|
512
|
+
if (this.opts.xAxis.tickValues && this.opts.xAxis.tickValues.length > 0) {
|
|
513
|
+
xAxis.tickValues(this.opts.xAxis.tickValues);
|
|
514
|
+
}
|
|
515
|
+
if (this.opts.yAxis.tickValues && this.opts.yAxis.tickValues.length > 0) {
|
|
516
|
+
yAxis.tickValues(this.opts.yAxis.tickValues);
|
|
517
|
+
}
|
|
518
|
+
const xTickFormatter = makeTickFormatter(this.opts.xAxis);
|
|
519
|
+
const yTickFormatter = makeTickFormatter(this.opts.yAxis);
|
|
520
|
+
if (xTickFormatter)
|
|
521
|
+
xAxis.tickFormat(xTickFormatter);
|
|
522
|
+
if (yTickFormatter)
|
|
523
|
+
yAxis.tickFormat(yTickFormatter);
|
|
524
|
+
this.gXAxis.call(xAxis);
|
|
525
|
+
this.gYAxis.call(yAxis);
|
|
526
|
+
this.gXAxis.selectAll(".domain").attr("opacity", 0.6).attr("stroke", grid.axisColor);
|
|
527
|
+
this.gYAxis.selectAll(".domain").attr("opacity", 0.6).attr("stroke", grid.axisColor);
|
|
528
|
+
this.gXAxis.selectAll(".tick line")
|
|
529
|
+
.attr("stroke", drawGridInAxisLayer ? grid.color : grid.axisColor)
|
|
530
|
+
.attr("stroke-width", grid.strokeWidth)
|
|
531
|
+
.attr("stroke-opacity", drawGridInAxisLayer ? grid.opacity : 0.45)
|
|
532
|
+
.attr("shape-rendering", "crispEdges");
|
|
533
|
+
this.gYAxis.selectAll(".tick line")
|
|
534
|
+
.attr("stroke", drawGridInAxisLayer ? grid.color : grid.axisColor)
|
|
535
|
+
.attr("stroke-width", grid.strokeWidth)
|
|
536
|
+
.attr("stroke-opacity", drawGridInAxisLayer ? grid.opacity : 0.45)
|
|
537
|
+
.attr("shape-rendering", "crispEdges");
|
|
538
|
+
const xFontFamily = normalizeFontFamily(this.opts.xAxis.style?.fontFamily);
|
|
539
|
+
const yFontFamily = normalizeFontFamily(this.opts.yAxis.style?.fontFamily);
|
|
540
|
+
const xFontSizePx = clamp(this.opts.xAxis.style?.fontSizePx, 1, 96, 12);
|
|
541
|
+
const yFontSizePx = clamp(this.opts.yAxis.style?.fontSizePx, 1, 96, 12);
|
|
542
|
+
this.gXAxis.selectAll(".tick text")
|
|
543
|
+
.attr("opacity", 0.9)
|
|
544
|
+
.attr("fill", grid.textColor)
|
|
545
|
+
.attr("font-family", xFontFamily)
|
|
546
|
+
.attr("font-size", `${xFontSizePx}px`);
|
|
547
|
+
this.gYAxis.selectAll(".tick text")
|
|
548
|
+
.attr("opacity", 0.9)
|
|
549
|
+
.attr("fill", grid.textColor)
|
|
550
|
+
.attr("font-family", yFontFamily)
|
|
551
|
+
.attr("font-size", `${yFontSizePx}px`);
|
|
552
|
+
}
|
|
553
|
+
renderGridLines(zx, zy, xTickCount, yTickCount) {
|
|
554
|
+
if (!this.gGridRoot)
|
|
555
|
+
return;
|
|
556
|
+
if (!this.gridStyle.show) {
|
|
557
|
+
this.gGridRoot.selectAll("line").remove();
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
const xTicks = (this.opts.xAxis.tickValues && this.opts.xAxis.tickValues.length > 0
|
|
561
|
+
? this.opts.xAxis.tickValues
|
|
562
|
+
: getTickValues(zx, xTickCount)).filter((d) => Number.isFinite(Number(zx(d))));
|
|
563
|
+
const yTicks = (this.opts.yAxis.tickValues && this.opts.yAxis.tickValues.length > 0
|
|
564
|
+
? this.opts.yAxis.tickValues
|
|
565
|
+
: getTickValues(zy, yTickCount)).filter((d) => Number.isFinite(Number(zy(d))));
|
|
566
|
+
this.gGridRoot
|
|
567
|
+
.selectAll("line.grid-x")
|
|
568
|
+
.data(xTicks)
|
|
569
|
+
.join("line")
|
|
570
|
+
.attr("class", "grid-x")
|
|
571
|
+
.attr("x1", (d) => Number(zx(d)))
|
|
572
|
+
.attr("y1", 0)
|
|
573
|
+
.attr("x2", (d) => Number(zx(d)))
|
|
574
|
+
.attr("y2", this.plotH)
|
|
575
|
+
.attr("stroke", this.gridStyle.color)
|
|
576
|
+
.attr("stroke-width", this.gridStyle.strokeWidth)
|
|
577
|
+
.attr("stroke-opacity", this.gridStyle.opacity)
|
|
578
|
+
.attr("shape-rendering", "crispEdges");
|
|
579
|
+
this.gGridRoot
|
|
580
|
+
.selectAll("line.grid-y")
|
|
581
|
+
.data(yTicks)
|
|
582
|
+
.join("line")
|
|
583
|
+
.attr("class", "grid-y")
|
|
584
|
+
.attr("x1", 0)
|
|
585
|
+
.attr("y1", (d) => Number(zy(d)))
|
|
586
|
+
.attr("x2", this.plotW)
|
|
587
|
+
.attr("y2", (d) => Number(zy(d)))
|
|
588
|
+
.attr("stroke", this.gridStyle.color)
|
|
589
|
+
.attr("stroke-width", this.gridStyle.strokeWidth)
|
|
590
|
+
.attr("stroke-opacity", this.gridStyle.opacity)
|
|
591
|
+
.attr("shape-rendering", "crispEdges");
|
|
592
|
+
}
|
|
593
|
+
renderAnnotations(zx, zy) {
|
|
594
|
+
this.gAnnotations.selectAll("*").remove();
|
|
595
|
+
if (!this.annotations.length)
|
|
596
|
+
return;
|
|
597
|
+
for (const anno of this.annotations) {
|
|
598
|
+
if (anno.type === "line") {
|
|
599
|
+
const [dashArray, dashCount] = overlayDashToStrokeArray(anno.dash);
|
|
600
|
+
this.gAnnotations.append("line")
|
|
601
|
+
.attr("x1", Number(zx(anno.x0)))
|
|
602
|
+
.attr("y1", Number(zy(anno.y0)))
|
|
603
|
+
.attr("x2", Number(zx(anno.x1)))
|
|
604
|
+
.attr("y2", Number(zy(anno.y1)))
|
|
605
|
+
.attr("stroke", anno.color ?? "#2563eb")
|
|
606
|
+
.attr("stroke-opacity", clamp(anno.opacity, 0, 1, 0.9))
|
|
607
|
+
.attr("stroke-width", Math.max(0.5, anno.widthPx ?? 1.5))
|
|
608
|
+
.attr("stroke-dasharray", dashCount > 0 ? dashArray : null)
|
|
609
|
+
.attr("shape-rendering", "geometricPrecision");
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
612
|
+
if (anno.type === "region") {
|
|
613
|
+
const rx0 = Number(zx(anno.x0));
|
|
614
|
+
const rx1 = Number(zx(anno.x1));
|
|
615
|
+
const ry0 = Number(zy(anno.y0));
|
|
616
|
+
const ry1 = Number(zy(anno.y1));
|
|
617
|
+
const x = Math.min(rx0, rx1);
|
|
618
|
+
const y = Math.min(ry0, ry1);
|
|
619
|
+
const w = Math.abs(rx1 - rx0);
|
|
620
|
+
const h = Math.abs(ry1 - ry0);
|
|
621
|
+
this.gAnnotations.append("rect")
|
|
622
|
+
.attr("x", x)
|
|
623
|
+
.attr("y", y)
|
|
624
|
+
.attr("width", w)
|
|
625
|
+
.attr("height", h)
|
|
626
|
+
.attr("fill", anno.fill ?? "#2563eb")
|
|
627
|
+
.attr("fill-opacity", clamp(anno.fillOpacity, 0, 1, 0.14))
|
|
628
|
+
.attr("stroke", anno.stroke ?? "#2563eb")
|
|
629
|
+
.attr("stroke-opacity", clamp(anno.strokeOpacity, 0, 1, 0.35))
|
|
630
|
+
.attr("stroke-width", Math.max(0, anno.strokeWidthPx ?? 1));
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
const gx = Number(zx(anno.x)) + (anno.offsetXPx ?? 0);
|
|
634
|
+
const gy = Number(zy(anno.y)) + (anno.offsetYPx ?? 0);
|
|
635
|
+
const g = this.gAnnotations.append("g")
|
|
636
|
+
.attr("transform", `translate(${gx},${gy})`);
|
|
637
|
+
const text = g.append("text")
|
|
638
|
+
.text(anno.text)
|
|
639
|
+
.attr("x", 0)
|
|
640
|
+
.attr("y", 0)
|
|
641
|
+
.attr("text-anchor", anno.anchor ?? "start")
|
|
642
|
+
.attr("dominant-baseline", "central")
|
|
643
|
+
.attr("fill", anno.color ?? "#111827")
|
|
644
|
+
.attr("font-family", normalizeFontFamily(anno.fontFamily))
|
|
645
|
+
.attr("font-size", `${clamp(anno.fontSizePx, 1, 96, 12)}px`);
|
|
646
|
+
if (anno.background) {
|
|
647
|
+
const node = text.node();
|
|
648
|
+
if (node) {
|
|
649
|
+
try {
|
|
650
|
+
const bb = node.getBBox();
|
|
651
|
+
const px = Math.max(0, anno.paddingX ?? 4);
|
|
652
|
+
const py = Math.max(0, anno.paddingY ?? 2);
|
|
653
|
+
g.insert("rect", "text")
|
|
654
|
+
.attr("x", bb.x - px)
|
|
655
|
+
.attr("y", bb.y - py)
|
|
656
|
+
.attr("width", bb.width + px * 2)
|
|
657
|
+
.attr("height", bb.height + py * 2)
|
|
658
|
+
.attr("rx", 3)
|
|
659
|
+
.attr("fill", anno.background)
|
|
660
|
+
.attr("fill-opacity", clamp(anno.backgroundOpacity, 0, 1, 0.85));
|
|
661
|
+
}
|
|
662
|
+
catch {
|
|
663
|
+
// Ignore text bbox failures in non-layout contexts.
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
function makeScale(type, domain, range) {
|
|
671
|
+
if (type === "log") {
|
|
672
|
+
return d3.scaleLog().domain(domain).range(range).clamp(true);
|
|
673
|
+
}
|
|
674
|
+
if (type === "time") {
|
|
675
|
+
return d3.scaleTime().domain([new Date(domain[0]), new Date(domain[1])]).range(range);
|
|
676
|
+
}
|
|
677
|
+
return d3.scaleLinear().domain(domain).range(range);
|
|
678
|
+
}
|
|
679
|
+
function invertValue(type, scale, v) {
|
|
680
|
+
const inv = scale.invert(v);
|
|
681
|
+
if (type === "time")
|
|
682
|
+
return inv;
|
|
683
|
+
return Number(inv);
|
|
684
|
+
}
|
|
685
|
+
function resolveGridStyle(grid) {
|
|
686
|
+
const show = grid?.show ?? DEFAULT_GRID_STYLE.show;
|
|
687
|
+
const color = resolveColor(grid?.color, DEFAULT_GRID_STYLE.color);
|
|
688
|
+
const axisColor = resolveColor(grid?.axisColor, DEFAULT_GRID_STYLE.axisColor);
|
|
689
|
+
const textColor = resolveColor(grid?.textColor, DEFAULT_GRID_STYLE.textColor);
|
|
690
|
+
const opacity = clamp(grid?.opacity, 0, 1, DEFAULT_GRID_STYLE.opacity);
|
|
691
|
+
const strokeWidth = clamp(grid?.strokeWidth, 0, Number.POSITIVE_INFINITY, DEFAULT_GRID_STYLE.strokeWidth);
|
|
692
|
+
return {
|
|
693
|
+
show,
|
|
694
|
+
color,
|
|
695
|
+
axisColor,
|
|
696
|
+
textColor,
|
|
697
|
+
opacity,
|
|
698
|
+
strokeWidth
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
function overlayDashToStrokeArray(dash) {
|
|
702
|
+
if (!dash || dash === "solid")
|
|
703
|
+
return ["", 0];
|
|
704
|
+
if (dash === "dash")
|
|
705
|
+
return ["8 6", 2];
|
|
706
|
+
if (dash === "dot")
|
|
707
|
+
return ["2 4", 2];
|
|
708
|
+
if (dash === "dashdot")
|
|
709
|
+
return ["8 4 2 4", 4];
|
|
710
|
+
const parts = dash.map((v) => Number(v)).filter((v) => Number.isFinite(v) && v > 0);
|
|
711
|
+
if (parts.length === 0)
|
|
712
|
+
return ["", 0];
|
|
713
|
+
return [parts.join(" "), parts.length];
|
|
714
|
+
}
|
|
715
|
+
function resolveColor(input, fallback) {
|
|
716
|
+
if (typeof input !== "string")
|
|
717
|
+
return fallback;
|
|
718
|
+
const trimmed = input.trim();
|
|
719
|
+
return trimmed.length > 0 ? trimmed : fallback;
|
|
720
|
+
}
|
|
721
|
+
function normalizeFontFamily(input) {
|
|
722
|
+
if (typeof input !== "string")
|
|
723
|
+
return null;
|
|
724
|
+
const trimmed = input.trim();
|
|
725
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
726
|
+
}
|
|
727
|
+
function clamp(value, min, max, fallback) {
|
|
728
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
729
|
+
return fallback;
|
|
730
|
+
if (value < min)
|
|
731
|
+
return min;
|
|
732
|
+
if (value > max)
|
|
733
|
+
return max;
|
|
734
|
+
return value;
|
|
735
|
+
}
|
|
736
|
+
function getTickValues(scale, count) {
|
|
737
|
+
if (typeof scale?.ticks === "function") {
|
|
738
|
+
return scale.ticks(count);
|
|
739
|
+
}
|
|
740
|
+
return [];
|
|
741
|
+
}
|
|
742
|
+
function makeTickFormatter(axis) {
|
|
743
|
+
if (axis.type === "time") {
|
|
744
|
+
const fmtPattern = axis.timeFormat ?? axis.tickFormat;
|
|
745
|
+
if (!fmtPattern)
|
|
746
|
+
return null;
|
|
747
|
+
const tf = d3.timeFormat(fmtPattern);
|
|
748
|
+
return (d) => tf(d instanceof Date ? d : new Date(Number(d)));
|
|
749
|
+
}
|
|
750
|
+
if (axis.tickFormat) {
|
|
751
|
+
try {
|
|
752
|
+
const f = d3.format(axis.tickFormat);
|
|
753
|
+
return (d) => f(Number(d));
|
|
754
|
+
}
|
|
755
|
+
catch {
|
|
756
|
+
return null;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
if (typeof axis.precision === "number" && Number.isFinite(axis.precision)) {
|
|
760
|
+
const p = Math.max(0, Math.min(20, Math.floor(axis.precision)));
|
|
761
|
+
try {
|
|
762
|
+
const spec = axis.type === "log" ? `.${p}~g` : `.${p}f`;
|
|
763
|
+
const f = d3.format(spec);
|
|
764
|
+
return (d) => f(Number(d));
|
|
765
|
+
}
|
|
766
|
+
catch {
|
|
767
|
+
return null;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
return null;
|
|
771
|
+
}
|
|
772
|
+
//# sourceMappingURL=Overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../src/Overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAwHzB,MAAM,kBAAkB,GAAwB;IAC9C,IAAI,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,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YACxD,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1B,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { OverlayD3 } from "./Overlay.js";
|
|
2
|
+
export type { OverlayOptions, ZoomState, LegendItem, AxisSpec, AxisType, AxisStyle, HoverEvent, BoxSelectEvent, LassoSelectEvent, PlotSelectEvent, OverlayLineDash, AnnotationLine, AnnotationRegion, AnnotationLabel, AnnotationPrimitive, GridStyle } from "./Overlay.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,SAAS,EACV,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lineandvertexsoftware/overlay-d3",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "D3.js overlay for interactive axes, zoom, and legends",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"d3": "^7.9.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.6.3",
|
|
24
|
+
"@types/d3": "^7.4.3"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"keywords": [
|
|
28
|
+
"d3",
|
|
29
|
+
"overlay",
|
|
30
|
+
"zoom",
|
|
31
|
+
"axes",
|
|
32
|
+
"legend",
|
|
33
|
+
"interaction"
|
|
34
|
+
],
|
|
35
|
+
"author": "Vertexa contributors",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/LineandVertexSoftware/vertexa-chart.git",
|
|
43
|
+
"directory": "packages/overlay-d3"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/LineandVertexSoftware/vertexa-chart#readme",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/LineandVertexSoftware/vertexa-chart/issues"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc",
|
|
54
|
+
"dev": "tsc --watch",
|
|
55
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
56
|
+
"typecheck": "tsc --noEmit"
|
|
57
|
+
}
|
|
58
|
+
}
|