blazeplot 0.2.2 → 0.3.1
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 +439 -187
- package/dist/Chart-BW9JaHs6.js +2903 -0
- package/dist/Chart-BW9JaHs6.js.map +1 -0
- package/dist/OverlayUtils-Cw1o8UH-.js +35 -0
- package/dist/OverlayUtils-Cw1o8UH-.js.map +1 -0
- package/dist/core/SeriesStore.d.ts +2 -0
- package/dist/core/SeriesStore.d.ts.map +1 -1
- package/dist/core/UniformRingBuffer.d.ts +67 -0
- package/dist/core/UniformRingBuffer.d.ts.map +1 -0
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/types.d.ts +5 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +153 -2304
- package/dist/index.js.map +1 -1
- package/dist/interaction/AxisController.d.ts +45 -3
- package/dist/interaction/AxisController.d.ts.map +1 -1
- package/dist/interaction/index.d.ts +1 -0
- package/dist/interaction/index.d.ts.map +1 -1
- package/dist/linked.d.ts +3 -0
- package/dist/linked.d.ts.map +1 -0
- package/dist/linked.js +64 -0
- package/dist/linked.js.map +1 -0
- package/dist/plugins/crosshair.d.ts +3 -0
- package/dist/plugins/crosshair.d.ts.map +1 -0
- package/dist/plugins/crosshair.js +192 -0
- package/dist/plugins/crosshair.js.map +1 -0
- package/dist/plugins/interactions.js +87 -65
- package/dist/plugins/interactions.js.map +1 -1
- package/dist/plugins/navigator.d.ts +3 -0
- package/dist/plugins/navigator.d.ts.map +1 -0
- package/dist/plugins/navigator.js +147 -0
- package/dist/plugins/navigator.js.map +1 -0
- package/dist/plugins/selection.d.ts +3 -0
- package/dist/plugins/selection.d.ts.map +1 -0
- package/dist/plugins/selection.js +144 -0
- package/dist/plugins/selection.js.map +1 -0
- package/dist/plugins/tooltip.js +29 -45
- package/dist/plugins/tooltip.js.map +1 -1
- package/dist/react.d.ts +14 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +30 -0
- package/dist/react.js.map +1 -0
- package/dist/ui/Chart.d.ts +79 -1
- package/dist/ui/Chart.d.ts.map +1 -1
- package/dist/ui/ChartLayout.d.ts +10 -0
- package/dist/ui/ChartLayout.d.ts.map +1 -1
- package/dist/ui/Crosshair.d.ts +60 -0
- package/dist/ui/Crosshair.d.ts.map +1 -0
- package/dist/ui/Interactions.d.ts.map +1 -1
- package/dist/ui/LinkedCharts.d.ts +23 -0
- package/dist/ui/LinkedCharts.d.ts.map +1 -0
- package/dist/ui/Navigator.d.ts +32 -0
- package/dist/ui/Navigator.d.ts.map +1 -0
- package/dist/ui/OverlayUtils.d.ts +17 -0
- package/dist/ui/OverlayUtils.d.ts.map +1 -0
- package/dist/ui/Selection.d.ts +64 -0
- package/dist/ui/Selection.d.ts.map +1 -0
- package/dist/ui/Tooltip.d.ts.map +1 -1
- package/dist/ui/theme.d.ts +12 -0
- package/dist/ui/theme.d.ts.map +1 -1
- package/package.json +35 -5
|
@@ -1,11 +1,53 @@
|
|
|
1
1
|
import { Camera2D } from './Camera2D.js';
|
|
2
|
+
export type AxisRenderTarget = "x" | "y";
|
|
3
|
+
export type BuiltInAxisScale = "linear" | "time" | "log" | "symlog" | "categorical";
|
|
4
|
+
export interface CustomAxisScale {
|
|
5
|
+
readonly type: "custom";
|
|
6
|
+
ticks?(min: number, max: number, maxTicks: number): readonly number[];
|
|
7
|
+
formatTick?(value: number, axis: AxisRenderTarget): string;
|
|
8
|
+
toScreen?(value: number): number;
|
|
9
|
+
fromScreen?(value: number): number;
|
|
10
|
+
}
|
|
11
|
+
export type AxisScale = BuiltInAxisScale | CustomAxisScale;
|
|
12
|
+
export type AxisTimeZone = "local" | "utc";
|
|
13
|
+
export type AxisTickFormatter = (value: number, axis: AxisRenderTarget) => string;
|
|
14
|
+
export type AxisTickFormat = string | AxisTickFormatter;
|
|
15
|
+
export interface AxisControllerAxisOptions {
|
|
16
|
+
readonly scale?: AxisScale;
|
|
17
|
+
readonly tickFormat?: AxisTickFormat;
|
|
18
|
+
readonly timezone?: AxisTimeZone;
|
|
19
|
+
readonly logBase?: number;
|
|
20
|
+
readonly symlogConstant?: number;
|
|
21
|
+
readonly categories?: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
export interface AxisControllerOptions {
|
|
24
|
+
readonly x?: AxisControllerAxisOptions;
|
|
25
|
+
readonly y?: AxisControllerAxisOptions;
|
|
26
|
+
}
|
|
2
27
|
export declare class AxisController {
|
|
3
28
|
private readonly camera;
|
|
4
|
-
|
|
29
|
+
private options;
|
|
30
|
+
private lastXTimeInterval;
|
|
31
|
+
private lastYTimeInterval;
|
|
32
|
+
constructor(camera: Camera2D, options?: AxisControllerOptions);
|
|
33
|
+
setOptions(options: AxisControllerOptions): void;
|
|
5
34
|
getXTickValues(canvasWidth: number, maxTicks?: number, target?: number[]): number[];
|
|
6
35
|
getYTickValues(canvasHeight: number, maxTicks?: number, target?: number[]): number[];
|
|
7
|
-
formatValue(value: number): string;
|
|
8
|
-
private
|
|
36
|
+
formatValue(value: number, axis?: AxisRenderTarget): string;
|
|
37
|
+
private lastTimeInterval;
|
|
38
|
+
private getScaledTickValues;
|
|
39
|
+
private getLogTickValues;
|
|
40
|
+
private getSymlogTickValues;
|
|
41
|
+
private getCategoricalTickValues;
|
|
42
|
+
private formatLinearValue;
|
|
43
|
+
private getLinearTickValues;
|
|
44
|
+
private getTimeTickValues;
|
|
45
|
+
private chooseTimeInterval;
|
|
46
|
+
private floorTime;
|
|
47
|
+
private advanceTime;
|
|
48
|
+
private makeTime;
|
|
49
|
+
private formatTimeValue;
|
|
50
|
+
private formatTimePattern;
|
|
9
51
|
private niceStep;
|
|
10
52
|
private normalizeTick;
|
|
11
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxisController.d.ts","sourceRoot":"","sources":["../../src/interaction/AxisController.ts"],"names":[],"mappings":"AAAA,OA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AiB;IA+BzB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,aAAa;CAKtB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Camera2D } from './Camera2D.js';
|
|
2
2
|
export { AxisController } from './AxisController.js';
|
|
3
|
+
export type { AxisControllerAxisOptions, AxisControllerOptions, AxisRenderTarget, AxisScale, AxisTickFormat, AxisTickFormatter, AxisTimeZone, BuiltInAxisScale, CustomAxisScale } from './AxisController.js';
|
|
3
4
|
export type { PanIntent, ZoomAxis, ZoomIntent, ViewportPolicy } from './types.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC7M,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/linked.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../src/linked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/linked.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { t as e } from "./Chart-BW9JaHs6.js";
|
|
2
|
+
//#region src/ui/LinkedCharts.ts
|
|
3
|
+
function t(e, t) {
|
|
4
|
+
return typeof e == "number" ? `${e}px` : e ?? t;
|
|
5
|
+
}
|
|
6
|
+
function n(n, r) {
|
|
7
|
+
let i = Math.max(1, Math.floor(r.rows ?? r.panels.length)), a = Math.max(1, Math.floor(r.columns ?? Math.ceil(r.panels.length / i))), o = document.createElement("div"), s = [], c = [], l = !1, u = !1;
|
|
8
|
+
o.className = r.className ?? "blazeplot-linked-charts", o.style.display = "grid", o.style.width = "100%", o.style.height = "100%", o.style.minWidth = "0", o.style.minHeight = "0", o.style.gridTemplateRows = `repeat(${i}, minmax(0, 1fr))`, o.style.gridTemplateColumns = `repeat(${a}, minmax(0, 1fr))`, o.style.gap = t(r.spacing, "8px"), n.appendChild(o);
|
|
9
|
+
for (let t of r.panels) {
|
|
10
|
+
let n = document.createElement("div");
|
|
11
|
+
n.className = t.className ?? "blazeplot-linked-panel", n.style.position = "relative", n.style.minWidth = "0", n.style.minHeight = "0", o.appendChild(n), s.push(new e(n, t.options));
|
|
12
|
+
}
|
|
13
|
+
let d = (e, t) => {
|
|
14
|
+
l = !0;
|
|
15
|
+
try {
|
|
16
|
+
for (let n of s) n.setViewport({
|
|
17
|
+
xMin: e,
|
|
18
|
+
xMax: t
|
|
19
|
+
});
|
|
20
|
+
} finally {
|
|
21
|
+
l = !1;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
if (r.sharedX !== !1) for (let e of s) c.push(e.subscribe("viewportchange", (t) => {
|
|
25
|
+
if (!l) {
|
|
26
|
+
l = !0;
|
|
27
|
+
try {
|
|
28
|
+
for (let n of s) n !== e && n.setViewport({
|
|
29
|
+
xMin: t.viewport.xMin,
|
|
30
|
+
xMax: t.viewport.xMax
|
|
31
|
+
});
|
|
32
|
+
} finally {
|
|
33
|
+
l = !1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
if (r.syncSelections) for (let e of s) c.push(e.subscribe("select", (t) => {
|
|
38
|
+
if (!u) {
|
|
39
|
+
u = !0;
|
|
40
|
+
try {
|
|
41
|
+
for (let n of s) n !== e && n.emitSelect(t.selection);
|
|
42
|
+
} finally {
|
|
43
|
+
u = !1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
return {
|
|
48
|
+
root: o,
|
|
49
|
+
charts: s,
|
|
50
|
+
setXRange: d,
|
|
51
|
+
dispose() {
|
|
52
|
+
for (let e of c.splice(0)) e();
|
|
53
|
+
for (let e of s.splice(0)) e.dispose();
|
|
54
|
+
o.remove();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function r() {
|
|
59
|
+
return { install() {} };
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { n as createLinkedCharts, r as linkedChartsPlugin };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=linked.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linked.js","names":[],"sources":["../src/ui/LinkedCharts.ts"],"sourcesContent":["import { Chart } from \"./Chart.js\";\nimport type { ChartOptions, ChartPlugin, ChartSelectEvent, ChartViewportChangeEvent } from \"./Chart.js\";\n\nexport interface LinkedChartPanelOptions {\n readonly options?: ChartOptions;\n readonly className?: string;\n}\n\nexport interface LinkedChartsOptions {\n readonly rows?: number;\n readonly columns?: number;\n readonly panels: readonly LinkedChartPanelOptions[];\n readonly sharedX?: boolean;\n readonly syncSelections?: boolean;\n readonly spacing?: number | string;\n readonly className?: string;\n}\n\nexport interface LinkedChartsHandle {\n readonly root: HTMLDivElement;\n readonly charts: readonly Chart[];\n setXRange(xMin: number, xMax: number): void;\n dispose(): void;\n}\n\nfunction cssSize(value: number | string | undefined, fallback: string): string {\n return typeof value === \"number\" ? `${value}px` : value ?? fallback;\n}\n\nexport function createLinkedCharts(target: HTMLElement, options: LinkedChartsOptions): LinkedChartsHandle {\n const rows = Math.max(1, Math.floor(options.rows ?? options.panels.length));\n const columns = Math.max(1, Math.floor(options.columns ?? Math.ceil(options.panels.length / rows)));\n const root = document.createElement(\"div\");\n const charts: Chart[] = [];\n const disposers: Array<() => void> = [];\n let syncingViewport = false;\n let syncingSelection = false;\n\n root.className = options.className ?? \"blazeplot-linked-charts\";\n root.style.display = \"grid\";\n root.style.width = \"100%\";\n root.style.height = \"100%\";\n root.style.minWidth = \"0\";\n root.style.minHeight = \"0\";\n root.style.gridTemplateRows = `repeat(${rows}, minmax(0, 1fr))`;\n root.style.gridTemplateColumns = `repeat(${columns}, minmax(0, 1fr))`;\n root.style.gap = cssSize(options.spacing, \"8px\");\n target.appendChild(root);\n\n for (const panel of options.panels) {\n const cell = document.createElement(\"div\");\n cell.className = panel.className ?? \"blazeplot-linked-panel\";\n cell.style.position = \"relative\";\n cell.style.minWidth = \"0\";\n cell.style.minHeight = \"0\";\n root.appendChild(cell);\n charts.push(new Chart(cell, panel.options));\n }\n\n const setXRange = (xMin: number, xMax: number): void => {\n syncingViewport = true;\n try {\n for (const chart of charts) chart.setViewport({ xMin, xMax });\n } finally {\n syncingViewport = false;\n }\n };\n\n if (options.sharedX !== false) {\n for (const chart of charts) {\n disposers.push(chart.subscribe(\"viewportchange\", (event: ChartViewportChangeEvent) => {\n if (syncingViewport) return;\n syncingViewport = true;\n try {\n for (const other of charts) {\n if (other !== chart) other.setViewport({ xMin: event.viewport.xMin, xMax: event.viewport.xMax });\n }\n } finally {\n syncingViewport = false;\n }\n }));\n }\n }\n\n if (options.syncSelections) {\n for (const chart of charts) {\n disposers.push(chart.subscribe(\"select\", (event: ChartSelectEvent) => {\n if (syncingSelection) return;\n syncingSelection = true;\n try {\n for (const other of charts) {\n if (other !== chart) other.emitSelect(event.selection);\n }\n } finally {\n syncingSelection = false;\n }\n }));\n }\n }\n\n return {\n root,\n charts,\n setXRange,\n dispose(): void {\n for (const dispose of disposers.splice(0)) dispose();\n for (const chart of charts.splice(0)) chart.dispose();\n root.remove();\n },\n };\n}\n\nexport function linkedChartsPlugin(): ChartPlugin {\n return {\n install() {\n // Marker plugin for codebases that share plugin arrays between single charts and linked layouts.\n },\n };\n}\n"],"mappings":";;AAyBA,SAAS,EAAQ,GAAoC,GAA0B;CAC7E,OAAO,OAAO,KAAU,WAAW,GAAG,EAAM,MAAM,KAAS;AAC7D;AAEA,SAAgB,EAAmB,GAAqB,GAAkD;CACxG,IAAM,IAAO,KAAK,IAAI,GAAG,KAAK,MAAM,EAAQ,QAAQ,EAAQ,OAAO,MAAM,CAAC,GACpE,IAAU,KAAK,IAAI,GAAG,KAAK,MAAM,EAAQ,WAAW,KAAK,KAAK,EAAQ,OAAO,SAAS,CAAI,CAAC,CAAC,GAC5F,IAAO,SAAS,cAAc,KAAK,GACnC,IAAkB,CAAC,GACnB,IAA+B,CAAC,GAClC,IAAkB,IAClB,IAAmB;CAWvB,AATA,EAAK,YAAY,EAAQ,aAAa,2BACtC,EAAK,MAAM,UAAU,QACrB,EAAK,MAAM,QAAQ,QACnB,EAAK,MAAM,SAAS,QACpB,EAAK,MAAM,WAAW,KACtB,EAAK,MAAM,YAAY,KACvB,EAAK,MAAM,mBAAmB,UAAU,EAAK,oBAC7C,EAAK,MAAM,sBAAsB,UAAU,EAAQ,oBACnD,EAAK,MAAM,MAAM,EAAQ,EAAQ,SAAS,KAAK,GAC/C,EAAO,YAAY,CAAI;CAEvB,KAAK,IAAM,KAAS,EAAQ,QAAQ;EAClC,IAAM,IAAO,SAAS,cAAc,KAAK;EAMzC,AALA,EAAK,YAAY,EAAM,aAAa,0BACpC,EAAK,MAAM,WAAW,YACtB,EAAK,MAAM,WAAW,KACtB,EAAK,MAAM,YAAY,KACvB,EAAK,YAAY,CAAI,GACrB,EAAO,KAAK,IAAI,EAAM,GAAM,EAAM,OAAO,CAAC;CAC5C;CAEA,IAAM,KAAa,GAAc,MAAuB;EACtD,IAAkB;EAClB,IAAI;GACF,KAAK,IAAM,KAAS,GAAQ,EAAM,YAAY;IAAE;IAAM;GAAK,CAAC;EAC9D,UAAU;GACR,IAAkB;EACpB;CACF;CAEA,IAAI,EAAQ,YAAY,IACtB,KAAK,IAAM,KAAS,GAClB,EAAU,KAAK,EAAM,UAAU,mBAAmB,MAAoC;EAChF,QACJ;OAAkB;GAClB,IAAI;IACF,KAAK,IAAM,KAAS,GAClB,AAAI,MAAU,KAAO,EAAM,YAAY;KAAE,MAAM,EAAM,SAAS;KAAM,MAAM,EAAM,SAAS;IAAK,CAAC;GAEnG,UAAU;IACR,IAAkB;GACpB;EAPkB;CAQpB,CAAC,CAAC;CAIN,IAAI,EAAQ,gBACV,KAAK,IAAM,KAAS,GAClB,EAAU,KAAK,EAAM,UAAU,WAAW,MAA4B;EAChE,QACJ;OAAmB;GACnB,IAAI;IACF,KAAK,IAAM,KAAS,GAClB,AAAI,MAAU,KAAO,EAAM,WAAW,EAAM,SAAS;GAEzD,UAAU;IACR,IAAmB;GACrB;EAPmB;CAQrB,CAAC,CAAC;CAIN,OAAO;EACL;EACA;EACA;EACA,UAAgB;GACd,KAAK,IAAM,KAAW,EAAU,OAAO,CAAC,GAAG,EAAQ;GACnD,KAAK,IAAM,KAAS,EAAO,OAAO,CAAC,GAAG,EAAM,QAAQ;GACpD,EAAK,OAAO;EACd;CACF;AACF;AAEA,SAAgB,IAAkC;CAChD,OAAO,EACL,UAAU,CAEV,EACF;AACF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { crosshairPlugin } from '../ui/Crosshair.js';
|
|
2
|
+
export type { CrosshairAxis, CrosshairEventType, CrosshairMode, CrosshairPlugin, CrosshairPluginOptions, CrosshairPosition, CrosshairSnapMode, RulerMeasurement } from '../ui/Crosshair.js';
|
|
3
|
+
//# sourceMappingURL=crosshair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crosshair.d.ts","sourceRoot":"","sources":["../../src/plugins/crosshair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { a as e, i as t, n, t as r } from "../OverlayUtils-Cw1o8UH-.js";
|
|
2
|
+
//#region src/ui/Crosshair.ts
|
|
3
|
+
var i = /* @__PURE__ */ new Map();
|
|
4
|
+
function a(e, t, n) {
|
|
5
|
+
let r = {
|
|
6
|
+
xMin: t,
|
|
7
|
+
xMax: n,
|
|
8
|
+
yMin: -Infinity,
|
|
9
|
+
yMax: Infinity
|
|
10
|
+
}, i = 0;
|
|
11
|
+
for (let t of e.getSeriesState()) {
|
|
12
|
+
if (!t.visible) continue;
|
|
13
|
+
let e = t.series.visibleIndexRange(r);
|
|
14
|
+
i += Math.max(0, e.end - e.start);
|
|
15
|
+
}
|
|
16
|
+
return i;
|
|
17
|
+
}
|
|
18
|
+
function o(e, t) {
|
|
19
|
+
return !t || t === "none" ? !0 : t === "ctrl" ? e.ctrlKey : t === "shift" ? e.shiftKey : t === "alt" ? e.altKey : e.metaKey;
|
|
20
|
+
}
|
|
21
|
+
function s(e, t, n, r) {
|
|
22
|
+
let i = e.pick(t, n, {
|
|
23
|
+
mode: r,
|
|
24
|
+
group: "none"
|
|
25
|
+
})?.items[0];
|
|
26
|
+
return i ? {
|
|
27
|
+
dataX: i.x,
|
|
28
|
+
dataY: i.y,
|
|
29
|
+
plotX: i.plotX,
|
|
30
|
+
plotY: i.plotY,
|
|
31
|
+
items: [i]
|
|
32
|
+
} : null;
|
|
33
|
+
}
|
|
34
|
+
function c(e, t, n, r, i) {
|
|
35
|
+
let a = e.canvas.getBoundingClientRect();
|
|
36
|
+
if (a.width <= 0 || a.height <= 0) return null;
|
|
37
|
+
let o = i === "nearest-point" ? "nearest-point" : "nearest-x";
|
|
38
|
+
if (i !== "none") {
|
|
39
|
+
let r = s(e, t, n, o);
|
|
40
|
+
if (r) return r;
|
|
41
|
+
}
|
|
42
|
+
let c = e.clientToData(t, n, r);
|
|
43
|
+
if (!c) return null;
|
|
44
|
+
let [l, u] = e.dataToPlot(c[0], c[1], r);
|
|
45
|
+
return {
|
|
46
|
+
dataX: c[0],
|
|
47
|
+
dataY: c[1],
|
|
48
|
+
plotX: l,
|
|
49
|
+
plotY: u,
|
|
50
|
+
items: []
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function l(e, t, n) {
|
|
54
|
+
let r = e.canvas.getBoundingClientRect();
|
|
55
|
+
if (r.width <= 0 || r.height <= 0) return null;
|
|
56
|
+
let i = e.getViewport(n), a = i.yMin + (i.yMax - i.yMin) * .5, [o, c] = e.dataToPlot(t, a, n);
|
|
57
|
+
return s(e, r.left + o, r.top + c, "nearest-x") || {
|
|
58
|
+
dataX: t,
|
|
59
|
+
dataY: a,
|
|
60
|
+
plotX: o,
|
|
61
|
+
plotY: c,
|
|
62
|
+
items: []
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function u(e, n, r, i, a) {
|
|
66
|
+
if (e.items.length === 0) {
|
|
67
|
+
n.textContent = `x ${r(e.dataX)} y ${i(e.dataY)}`;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
t(n, e.items, e, a, (e) => `(${r(e.x)}, ${i(e.y)})`);
|
|
71
|
+
}
|
|
72
|
+
function d(t = {}) {
|
|
73
|
+
let s = t.axis ?? "xy", d = t.yAxis ?? "left", f = t.snap ?? "none", p = t.mode ?? "crosshair", m = t.rulerModifier ?? "none", h = null, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = t.formatX ?? r, T = t.formatY ?? r, E = null, D = null, O = /* @__PURE__ */ new Set(), k = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Set(), M = (e) => {
|
|
74
|
+
g && (g.style.display = e ? "block" : "none");
|
|
75
|
+
}, N = (e) => {
|
|
76
|
+
E = e, t.onMove?.(e);
|
|
77
|
+
for (let t of O) t(e);
|
|
78
|
+
}, P = (e) => {
|
|
79
|
+
t.onMeasureStart?.(e);
|
|
80
|
+
for (let t of k) t(e);
|
|
81
|
+
}, F = (e) => {
|
|
82
|
+
D = e, t.onMeasureChange?.(e);
|
|
83
|
+
for (let t of A) t(e);
|
|
84
|
+
}, I = (e) => {
|
|
85
|
+
D = e, t.onMeasureEnd?.(e), t.onMeasure?.(e);
|
|
86
|
+
for (let t of j) t(e);
|
|
87
|
+
}, L = (e) => {
|
|
88
|
+
let t = h;
|
|
89
|
+
!t || !b || n(b, e.plotX, e.plotY, t.canvas.clientWidth, t.canvas.clientHeight, {
|
|
90
|
+
offsetX: 12,
|
|
91
|
+
offsetY: 12
|
|
92
|
+
});
|
|
93
|
+
}, R = (n) => {
|
|
94
|
+
if (!y || (y.replaceChildren(), t.highlight === !1 || !n)) return;
|
|
95
|
+
let r = Math.max(2, t.markerSize ?? 10), i = Math.max(0, t.markerStrokeWidth ?? 2);
|
|
96
|
+
for (let a of n.items) {
|
|
97
|
+
let n = document.createElement("div");
|
|
98
|
+
n.style.position = "absolute", n.style.left = `${a.plotX}px`, n.style.top = `${a.plotY}px`, n.style.width = `${r}px`, n.style.height = `${r}px`, n.style.border = `${i}px solid ${t.markerStrokeColor ?? "#f8fafc"}`, n.style.borderRadius = "999px", n.style.background = e(a.series.style.color), n.style.boxShadow = "0 0 0 1px rgba(4, 8, 16, 0.85)", n.style.transform = "translate(-50%, -50%)", y.appendChild(n);
|
|
99
|
+
}
|
|
100
|
+
}, z = (e) => {
|
|
101
|
+
if (R(e), !e || !g || !_ || !v || !b) {
|
|
102
|
+
M(!1);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
M(!0), _.style.display = s === "y" ? "none" : "block", v.style.display = s === "x" ? "none" : "block", _.style.left = `${e.plotX}px`, v.style.top = `${e.plotY}px`, t.label === !1 ? b.style.display = "none" : (b.style.display = "block", t.render ? t.render(e, b, h) : u(e, b, w, T, t.formatter), L(e));
|
|
106
|
+
}, B = (e, t, n) => {
|
|
107
|
+
let r = t.dataX - e.dataX, i = t.dataY - e.dataY;
|
|
108
|
+
return {
|
|
109
|
+
start: e,
|
|
110
|
+
end: t,
|
|
111
|
+
deltaX: r,
|
|
112
|
+
deltaY: i,
|
|
113
|
+
slope: r === 0 ? Infinity : i / r,
|
|
114
|
+
sampleCount: a(n, Math.min(e.dataX, t.dataX), Math.max(e.dataX, t.dataX))
|
|
115
|
+
};
|
|
116
|
+
}, V = (e) => {
|
|
117
|
+
let t = h;
|
|
118
|
+
!t || !x || !S || !C || !e || (x.style.display = "block", S.setAttribute("x1", String(C.plotX)), S.setAttribute("y1", String(C.plotY)), S.setAttribute("x2", String(e.plotX)), S.setAttribute("y2", String(e.plotY)), F(B(C, e, t)));
|
|
119
|
+
}, H = (e) => {
|
|
120
|
+
if (!(!t.group || !W)) for (let n of i.get(t.group) ?? []) n !== W && n.showShared(e.dataX, W);
|
|
121
|
+
}, U = () => {
|
|
122
|
+
if (!(!t.group || !W)) for (let e of i.get(t.group) ?? []) e !== W && e.hideShared(W);
|
|
123
|
+
}, W = {
|
|
124
|
+
showShared(e, t) {
|
|
125
|
+
if (t === W || !h) return;
|
|
126
|
+
let n = l(h, e, d);
|
|
127
|
+
z(n), N(n);
|
|
128
|
+
},
|
|
129
|
+
hideShared(e) {
|
|
130
|
+
e !== W && (z(null), N(null));
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
return {
|
|
134
|
+
install(e) {
|
|
135
|
+
h = e;
|
|
136
|
+
let n = t.color ?? "rgba(148, 163, 184, 0.55)", r = `${t.width ?? 1}px`, a = t.dash;
|
|
137
|
+
if (g = document.createElement("div"), g.className = "blazeplot-crosshair", g.style.position = "absolute", g.style.inset = "0", g.style.display = "none", g.style.pointerEvents = "none", g.style.zIndex = String(t.zIndex ?? 1e4), _ = document.createElement("div"), _.style.position = "absolute", _.style.top = "0", _.style.bottom = "0", _.style.zIndex = "1", _.style.borderLeft = `${r} solid ${n}`, a && (_.style.borderLeftStyle = "dashed"), v = document.createElement("div"), v.style.position = "absolute", v.style.left = "0", v.style.right = "0", v.style.zIndex = "1", v.style.borderTop = `${r} solid ${n}`, a && (v.style.borderTopStyle = "dashed"), y = document.createElement("div"), y.className = "blazeplot-crosshair-markers", y.style.position = "absolute", y.style.inset = "0", y.style.zIndex = "2", y.style.pointerEvents = "none", b = document.createElement("div"), b.style.position = "absolute", b.style.zIndex = "3", b.style.padding = "4px 6px", b.style.borderRadius = "3px", b.style.background = t.labelBackground ?? e.theme.tooltipBackgroundColor, b.style.color = t.labelColor ?? e.theme.tooltipTextColor, b.style.font = t.labelFont ?? e.theme.tooltipFont, b.style.whiteSpace = "nowrap", x = document.createElementNS("http://www.w3.org/2000/svg", "svg"), x.style.position = "absolute", x.style.inset = "0", x.style.width = "100%", x.style.height = "100%", x.style.display = "none", x.style.overflow = "hidden", x.style.zIndex = "1", S = document.createElementNS("http://www.w3.org/2000/svg", "line"), S.setAttribute("stroke", n), S.setAttribute("stroke-width", String(t.width ?? 1)), a && S.setAttribute("stroke-dasharray", a), x.appendChild(S), g.appendChild(_), g.appendChild(v), g.appendChild(x), g.appendChild(y), g.appendChild(b), e.plotElement.appendChild(g), t.group) {
|
|
138
|
+
let e = i.get(t.group) ?? /* @__PURE__ */ new Set();
|
|
139
|
+
e.add(W), i.set(t.group, e);
|
|
140
|
+
}
|
|
141
|
+
let s = (t) => {
|
|
142
|
+
let n = c(e, t.clientX, t.clientY, d, f);
|
|
143
|
+
z(n), N(n), n && H(n), p === "ruler" && V(n);
|
|
144
|
+
}, l = () => {
|
|
145
|
+
C || z(null), N(null), U();
|
|
146
|
+
}, u = (t) => {
|
|
147
|
+
p !== "ruler" || t.button !== 0 || !o(t, m) || (C = c(e, t.clientX, t.clientY, d, f), C && (P(C), t.preventDefault(), t.stopImmediatePropagation()));
|
|
148
|
+
}, w = (t) => {
|
|
149
|
+
if (p !== "ruler" || !C) return;
|
|
150
|
+
t.stopImmediatePropagation();
|
|
151
|
+
let n = c(e, t.clientX, t.clientY, d, f);
|
|
152
|
+
n && (I(B(C, n, e)), C = null);
|
|
153
|
+
};
|
|
154
|
+
return e.canvas.addEventListener("pointermove", s), e.canvas.addEventListener("pointerleave", l), e.canvas.addEventListener("pointerdown", u, { capture: !0 }), e.canvas.addEventListener("pointerup", w, { capture: !0 }), () => {
|
|
155
|
+
if (e.canvas.removeEventListener("pointermove", s), e.canvas.removeEventListener("pointerleave", l), e.canvas.removeEventListener("pointerdown", u, { capture: !0 }), e.canvas.removeEventListener("pointerup", w, { capture: !0 }), t.group) {
|
|
156
|
+
let e = i.get(t.group);
|
|
157
|
+
e?.delete(W), e?.size === 0 && i.delete(t.group);
|
|
158
|
+
}
|
|
159
|
+
g?.remove(), g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, h = null;
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
getPosition() {
|
|
163
|
+
return E;
|
|
164
|
+
},
|
|
165
|
+
getMeasurement() {
|
|
166
|
+
return D;
|
|
167
|
+
},
|
|
168
|
+
clearMeasurement() {
|
|
169
|
+
D = null, C = null, x && (x.style.display = "none");
|
|
170
|
+
},
|
|
171
|
+
subscribe(e, t) {
|
|
172
|
+
if (e === "move") {
|
|
173
|
+
let e = t;
|
|
174
|
+
return O.add(e), () => O.delete(e);
|
|
175
|
+
}
|
|
176
|
+
if (e === "measurestart") {
|
|
177
|
+
let e = t;
|
|
178
|
+
return k.add(e), () => k.delete(e);
|
|
179
|
+
}
|
|
180
|
+
if (e === "measurechange") {
|
|
181
|
+
let e = t;
|
|
182
|
+
return A.add(e), () => A.delete(e);
|
|
183
|
+
}
|
|
184
|
+
let n = t;
|
|
185
|
+
return j.add(n), () => j.delete(n);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
export { d as crosshairPlugin };
|
|
191
|
+
|
|
192
|
+
//# sourceMappingURL=crosshair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crosshair.js","names":[],"sources":["../../src/ui/Crosshair.ts"],"sourcesContent":["import type { SeriesYAxis } from \"../core/types.js\";\nimport type { Chart, ChartPickItem, ChartPickMode, ChartPlugin } from \"./Chart.js\";\nimport { formatCompactNumber, placeAbsoluteWithinBox, renderPickItems, rgba } from \"./OverlayUtils.js\";\n\nexport type CrosshairAxis = \"x\" | \"y\" | \"xy\";\nexport type CrosshairSnapMode = \"none\" | \"nearest-x\" | \"nearest-point\";\nexport type CrosshairMode = \"crosshair\" | \"ruler\";\n\nexport interface CrosshairPosition {\n readonly dataX: number;\n readonly dataY: number;\n readonly plotX: number;\n readonly plotY: number;\n readonly items: readonly ChartPickItem[];\n}\n\nexport interface RulerMeasurement {\n readonly start: CrosshairPosition;\n readonly end: CrosshairPosition;\n readonly deltaX: number;\n readonly deltaY: number;\n readonly slope: number;\n readonly sampleCount: number;\n}\n\nexport type CrosshairEventType = \"move\" | \"measurestart\" | \"measurechange\" | \"measureend\";\n\nexport interface CrosshairPluginOptions {\n readonly mode?: CrosshairMode;\n readonly axis?: CrosshairAxis;\n readonly yAxis?: SeriesYAxis;\n readonly snap?: CrosshairSnapMode;\n readonly group?: string;\n readonly color?: string;\n readonly width?: number;\n readonly dash?: string;\n readonly label?: boolean;\n readonly labelBackground?: string;\n readonly labelColor?: string;\n readonly labelFont?: string;\n readonly zIndex?: number;\n readonly highlight?: boolean;\n readonly markerSize?: number;\n readonly markerStrokeColor?: string;\n readonly markerStrokeWidth?: number;\n readonly rulerModifier?: \"none\" | \"ctrl\" | \"shift\" | \"alt\" | \"meta\";\n readonly formatX?: (value: number) => string;\n readonly formatY?: (value: number) => string;\n readonly formatter?: (item: ChartPickItem, position: CrosshairPosition) => string;\n readonly render?: (position: CrosshairPosition, container: HTMLElement, chart: Chart) => void;\n readonly onMove?: (position: CrosshairPosition | null) => void;\n readonly onMeasureStart?: (position: CrosshairPosition) => void;\n readonly onMeasureChange?: (measurement: RulerMeasurement) => void;\n readonly onMeasureEnd?: (measurement: RulerMeasurement) => void;\n readonly onMeasure?: (measurement: RulerMeasurement) => void;\n}\n\ninterface Peer {\n showShared(dataX: number, source: Peer): void;\n hideShared(source: Peer): void;\n}\n\nconst groups = new Map<string, Set<Peer>>();\n\nexport interface CrosshairPlugin extends ChartPlugin {\n getPosition(): CrosshairPosition | null;\n getMeasurement(): RulerMeasurement | null;\n clearMeasurement(): void;\n subscribe(event: \"move\", callback: (position: CrosshairPosition | null) => void): () => void;\n subscribe(event: \"measurestart\", callback: (position: CrosshairPosition) => void): () => void;\n subscribe(event: \"measurechange\" | \"measureend\", callback: (measurement: RulerMeasurement) => void): () => void;\n}\n\nfunction countSamplesInRange(chart: Chart, xMin: number, xMax: number): number {\n const viewport = { xMin, xMax, yMin: -Infinity, yMax: Infinity };\n let total = 0;\n for (const state of chart.getSeriesState()) {\n if (!state.visible) continue;\n const range = state.series.visibleIndexRange(viewport);\n total += Math.max(0, range.end - range.start);\n }\n return total;\n}\n\nfunction hasModifier(event: PointerEvent, modifier: CrosshairPluginOptions[\"rulerModifier\"]): boolean {\n if (!modifier || modifier === \"none\") return true;\n if (modifier === \"ctrl\") return event.ctrlKey;\n if (modifier === \"shift\") return event.shiftKey;\n if (modifier === \"alt\") return event.altKey;\n return event.metaKey;\n}\n\nfunction positionFromPick(chart: Chart, clientX: number, clientY: number, mode: ChartPickMode): CrosshairPosition | null {\n const picked = chart.pick(clientX, clientY, { mode, group: \"none\" });\n const item = picked?.items[0];\n return item ? { dataX: item.x, dataY: item.y, plotX: item.plotX, plotY: item.plotY, items: [item] } : null;\n}\n\nfunction resolvePosition(chart: Chart, clientX: number, clientY: number, yAxis: SeriesYAxis, snap: CrosshairSnapMode): CrosshairPosition | null {\n const rect = chart.canvas.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return null;\n\n const pickMode: ChartPickMode = snap === \"nearest-point\" ? \"nearest-point\" : \"nearest-x\";\n if (snap !== \"none\") {\n const picked = positionFromPick(chart, clientX, clientY, pickMode);\n if (picked) return picked;\n }\n\n const data = chart.clientToData(clientX, clientY, yAxis);\n if (!data) return null;\n const [plotX, plotY] = chart.dataToPlot(data[0], data[1], yAxis);\n return { dataX: data[0], dataY: data[1], plotX, plotY, items: [] };\n}\n\nfunction resolveSharedPosition(chart: Chart, dataX: number, yAxis: SeriesYAxis): CrosshairPosition | null {\n const rect = chart.canvas.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return null;\n\n const viewport = chart.getViewport(yAxis);\n const dataY = viewport.yMin + (viewport.yMax - viewport.yMin) * 0.5;\n const [plotX, plotY] = chart.dataToPlot(dataX, dataY, yAxis);\n const picked = positionFromPick(chart, rect.left + plotX, rect.top + plotY, \"nearest-x\");\n if (picked) return picked;\n return { dataX, dataY, plotX, plotY, items: [] };\n}\n\nfunction renderDefaultLabel(\n position: CrosshairPosition,\n container: HTMLElement,\n formatX: (value: number) => string,\n formatY: (value: number) => string,\n formatter: CrosshairPluginOptions[\"formatter\"],\n): void {\n if (position.items.length === 0) {\n container.textContent = `x ${formatX(position.dataX)} y ${formatY(position.dataY)}`;\n return;\n }\n\n renderPickItems(\n container,\n position.items,\n position,\n formatter,\n (item) => `(${formatX(item.x)}, ${formatY(item.y)})`,\n );\n}\n\nexport function crosshairPlugin(options: CrosshairPluginOptions = {}): CrosshairPlugin {\n const axis = options.axis ?? \"xy\";\n const yAxis = options.yAxis ?? \"left\";\n const snap = options.snap ?? \"none\";\n const mode = options.mode ?? \"crosshair\";\n const rulerModifier = options.rulerModifier ?? \"none\";\n let chartRef: Chart | null = null;\n let root: HTMLDivElement | null = null;\n let vertical: HTMLDivElement | null = null;\n let horizontal: HTMLDivElement | null = null;\n let markerLayer: HTMLDivElement | null = null;\n let label: HTMLDivElement | null = null;\n let rulerSvg: SVGSVGElement | null = null;\n let rulerLine: SVGLineElement | null = null;\n let rulerStart: CrosshairPosition | null = null;\n\n const formatX = options.formatX ?? formatCompactNumber;\n const formatY = options.formatY ?? formatCompactNumber;\n let currentPosition: CrosshairPosition | null = null;\n let currentMeasurement: RulerMeasurement | null = null;\n const moveSubscribers = new Set<(position: CrosshairPosition | null) => void>();\n const measureStartSubscribers = new Set<(position: CrosshairPosition) => void>();\n const measureChangeSubscribers = new Set<(measurement: RulerMeasurement) => void>();\n const measureEndSubscribers = new Set<(measurement: RulerMeasurement) => void>();\n\n const setVisible = (visible: boolean): void => {\n if (root) root.style.display = visible ? \"block\" : \"none\";\n };\n\n const emitMove = (position: CrosshairPosition | null): void => {\n currentPosition = position;\n options.onMove?.(position);\n for (const callback of moveSubscribers) callback(position);\n };\n\n const emitMeasureStart = (position: CrosshairPosition): void => {\n options.onMeasureStart?.(position);\n for (const callback of measureStartSubscribers) callback(position);\n };\n\n const emitMeasureChange = (measurement: RulerMeasurement): void => {\n currentMeasurement = measurement;\n options.onMeasureChange?.(measurement);\n for (const callback of measureChangeSubscribers) callback(measurement);\n };\n\n const emitMeasureEnd = (measurement: RulerMeasurement): void => {\n currentMeasurement = measurement;\n options.onMeasureEnd?.(measurement);\n options.onMeasure?.(measurement);\n for (const callback of measureEndSubscribers) callback(measurement);\n };\n\n const placeLabel = (position: CrosshairPosition): void => {\n const chart = chartRef;\n if (!chart || !label) return;\n placeAbsoluteWithinBox(label, position.plotX, position.plotY, chart.canvas.clientWidth, chart.canvas.clientHeight, {\n offsetX: 12,\n offsetY: 12,\n });\n };\n\n const renderMarkers = (position: CrosshairPosition | null): void => {\n if (!markerLayer) return;\n markerLayer.replaceChildren();\n if (options.highlight === false || !position) return;\n\n const size = Math.max(2, options.markerSize ?? 10);\n const strokeWidth = Math.max(0, options.markerStrokeWidth ?? 2);\n for (const item of position.items) {\n const marker = document.createElement(\"div\");\n marker.style.position = \"absolute\";\n marker.style.left = `${item.plotX}px`;\n marker.style.top = `${item.plotY}px`;\n marker.style.width = `${size}px`;\n marker.style.height = `${size}px`;\n marker.style.border = `${strokeWidth}px solid ${options.markerStrokeColor ?? \"#f8fafc\"}`;\n marker.style.borderRadius = \"999px\";\n marker.style.background = rgba(item.series.style.color);\n marker.style.boxShadow = \"0 0 0 1px rgba(4, 8, 16, 0.85)\";\n marker.style.transform = \"translate(-50%, -50%)\";\n markerLayer.appendChild(marker);\n }\n };\n\n const renderPosition = (position: CrosshairPosition | null): void => {\n renderMarkers(position);\n if (!position || !root || !vertical || !horizontal || !label) {\n setVisible(false);\n return;\n }\n setVisible(true);\n vertical.style.display = axis === \"y\" ? \"none\" : \"block\";\n horizontal.style.display = axis === \"x\" ? \"none\" : \"block\";\n vertical.style.left = `${position.plotX}px`;\n horizontal.style.top = `${position.plotY}px`;\n if (options.label !== false) {\n label.style.display = \"block\";\n if (options.render) {\n options.render(position, label, chartRef!);\n } else {\n renderDefaultLabel(position, label, formatX, formatY, options.formatter);\n }\n placeLabel(position);\n } else {\n label.style.display = \"none\";\n }\n };\n\n const measurementFrom = (start: CrosshairPosition, end: CrosshairPosition, chart: Chart): RulerMeasurement => {\n const deltaX = end.dataX - start.dataX;\n const deltaY = end.dataY - start.dataY;\n return {\n start,\n end,\n deltaX,\n deltaY,\n slope: deltaX === 0 ? Infinity : deltaY / deltaX,\n sampleCount: countSamplesInRange(chart, Math.min(start.dataX, end.dataX), Math.max(start.dataX, end.dataX)),\n };\n };\n\n const renderRuler = (end: CrosshairPosition | null): void => {\n const chart = chartRef;\n if (!chart || !rulerSvg || !rulerLine || !rulerStart || !end) return;\n rulerSvg.style.display = \"block\";\n rulerLine.setAttribute(\"x1\", String(rulerStart.plotX));\n rulerLine.setAttribute(\"y1\", String(rulerStart.plotY));\n rulerLine.setAttribute(\"x2\", String(end.plotX));\n rulerLine.setAttribute(\"y2\", String(end.plotY));\n emitMeasureChange(measurementFrom(rulerStart, end, chart));\n };\n\n const emitShared = (position: CrosshairPosition): void => {\n if (!options.group || !peer) return;\n for (const target of groups.get(options.group) ?? []) {\n if (target !== peer) target.showShared(position.dataX, peer);\n }\n };\n\n const emitHideShared = (): void => {\n if (!options.group || !peer) return;\n for (const target of groups.get(options.group) ?? []) {\n if (target !== peer) target.hideShared(peer);\n }\n };\n\n const peer: Peer = {\n showShared(dataX: number, source: Peer): void {\n if (source === peer || !chartRef) return;\n const position = resolveSharedPosition(chartRef, dataX, yAxis);\n renderPosition(position);\n emitMove(position);\n },\n hideShared(source: Peer): void {\n if (source === peer) return;\n renderPosition(null);\n emitMove(null);\n },\n };\n\n return {\n install(chart: Chart) {\n chartRef = chart;\n const color = options.color ?? \"rgba(148, 163, 184, 0.55)\";\n const width = `${options.width ?? 1}px`;\n const dash = options.dash;\n\n root = document.createElement(\"div\");\n root.className = \"blazeplot-crosshair\";\n root.style.position = \"absolute\";\n root.style.inset = \"0\";\n root.style.display = \"none\";\n root.style.pointerEvents = \"none\";\n root.style.zIndex = String(options.zIndex ?? 10_000);\n\n vertical = document.createElement(\"div\");\n vertical.style.position = \"absolute\";\n vertical.style.top = \"0\";\n vertical.style.bottom = \"0\";\n vertical.style.zIndex = \"1\";\n vertical.style.borderLeft = `${width} solid ${color}`;\n if (dash) vertical.style.borderLeftStyle = \"dashed\";\n\n horizontal = document.createElement(\"div\");\n horizontal.style.position = \"absolute\";\n horizontal.style.left = \"0\";\n horizontal.style.right = \"0\";\n horizontal.style.zIndex = \"1\";\n horizontal.style.borderTop = `${width} solid ${color}`;\n if (dash) horizontal.style.borderTopStyle = \"dashed\";\n\n markerLayer = document.createElement(\"div\");\n markerLayer.className = \"blazeplot-crosshair-markers\";\n markerLayer.style.position = \"absolute\";\n markerLayer.style.inset = \"0\";\n markerLayer.style.zIndex = \"2\";\n markerLayer.style.pointerEvents = \"none\";\n\n label = document.createElement(\"div\");\n label.style.position = \"absolute\";\n label.style.zIndex = \"3\";\n label.style.padding = \"4px 6px\";\n label.style.borderRadius = \"3px\";\n label.style.background = options.labelBackground ?? chart.theme.tooltipBackgroundColor;\n label.style.color = options.labelColor ?? chart.theme.tooltipTextColor;\n label.style.font = options.labelFont ?? chart.theme.tooltipFont;\n label.style.whiteSpace = \"nowrap\";\n\n rulerSvg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n rulerSvg.style.position = \"absolute\";\n rulerSvg.style.inset = \"0\";\n rulerSvg.style.width = \"100%\";\n rulerSvg.style.height = \"100%\";\n rulerSvg.style.display = \"none\";\n rulerSvg.style.overflow = \"hidden\";\n rulerSvg.style.zIndex = \"1\";\n rulerLine = document.createElementNS(\"http://www.w3.org/2000/svg\", \"line\");\n rulerLine.setAttribute(\"stroke\", color);\n rulerLine.setAttribute(\"stroke-width\", String(options.width ?? 1));\n if (dash) rulerLine.setAttribute(\"stroke-dasharray\", dash);\n rulerSvg.appendChild(rulerLine);\n\n root.appendChild(vertical);\n root.appendChild(horizontal);\n root.appendChild(rulerSvg);\n root.appendChild(markerLayer);\n root.appendChild(label);\n chart.plotElement.appendChild(root);\n\n if (options.group) {\n const set = groups.get(options.group) ?? new Set<Peer>();\n set.add(peer);\n groups.set(options.group, set);\n }\n\n const onPointerMove = (event: PointerEvent): void => {\n const position = resolvePosition(chart, event.clientX, event.clientY, yAxis, snap);\n renderPosition(position);\n emitMove(position);\n if (position) emitShared(position);\n if (mode === \"ruler\") renderRuler(position);\n };\n\n const onPointerLeave = (): void => {\n if (!rulerStart) renderPosition(null);\n emitMove(null);\n emitHideShared();\n };\n\n const onPointerDown = (event: PointerEvent): void => {\n if (mode !== \"ruler\" || event.button !== 0 || !hasModifier(event, rulerModifier)) return;\n rulerStart = resolvePosition(chart, event.clientX, event.clientY, yAxis, snap);\n if (rulerStart) {\n emitMeasureStart(rulerStart);\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n\n const onPointerUp = (event: PointerEvent): void => {\n if (mode !== \"ruler\" || !rulerStart) return;\n event.stopImmediatePropagation();\n const end = resolvePosition(chart, event.clientX, event.clientY, yAxis, snap);\n if (!end) return;\n const measurement = measurementFrom(rulerStart, end, chart);\n emitMeasureEnd(measurement);\n rulerStart = null;\n };\n\n chart.canvas.addEventListener(\"pointermove\", onPointerMove);\n chart.canvas.addEventListener(\"pointerleave\", onPointerLeave);\n chart.canvas.addEventListener(\"pointerdown\", onPointerDown, { capture: true });\n chart.canvas.addEventListener(\"pointerup\", onPointerUp, { capture: true });\n\n return () => {\n chart.canvas.removeEventListener(\"pointermove\", onPointerMove);\n chart.canvas.removeEventListener(\"pointerleave\", onPointerLeave);\n chart.canvas.removeEventListener(\"pointerdown\", onPointerDown, { capture: true });\n chart.canvas.removeEventListener(\"pointerup\", onPointerUp, { capture: true });\n if (options.group) {\n const set = groups.get(options.group);\n set?.delete(peer);\n if (set?.size === 0) groups.delete(options.group);\n }\n root?.remove();\n root = null;\n vertical = null;\n horizontal = null;\n markerLayer = null;\n label = null;\n rulerSvg = null;\n rulerLine = null;\n rulerStart = null;\n chartRef = null;\n };\n },\n getPosition(): CrosshairPosition | null {\n return currentPosition;\n },\n getMeasurement(): RulerMeasurement | null {\n return currentMeasurement;\n },\n clearMeasurement(): void {\n currentMeasurement = null;\n rulerStart = null;\n if (rulerSvg) rulerSvg.style.display = \"none\";\n },\n subscribe(event: CrosshairEventType, callback: ((position: CrosshairPosition | null) => void) | ((position: CrosshairPosition) => void) | ((measurement: RulerMeasurement) => void)): () => void {\n if (event === \"move\") {\n const cb = callback as (position: CrosshairPosition | null) => void;\n moveSubscribers.add(cb);\n return () => moveSubscribers.delete(cb);\n }\n if (event === \"measurestart\") {\n const cb = callback as (position: CrosshairPosition) => void;\n measureStartSubscribers.add(cb);\n return () => measureStartSubscribers.delete(cb);\n }\n if (event === \"measurechange\") {\n const cb = callback as (measurement: RulerMeasurement) => void;\n measureChangeSubscribers.add(cb);\n return () => measureChangeSubscribers.delete(cb);\n }\n const cb = callback as (measurement: RulerMeasurement) => void;\n measureEndSubscribers.add(cb);\n return () => measureEndSubscribers.delete(cb);\n },\n };\n}\n"],"mappings":";;AA8DA,IAAM,oBAAS,IAAI,IAAuB;AAW1C,SAAS,EAAoB,GAAc,GAAc,GAAsB;CAC7E,IAAM,IAAW;EAAE;EAAM;EAAM,MAAM;EAAW,MAAM;CAAS,GAC3D,IAAQ;CACZ,KAAK,IAAM,KAAS,EAAM,eAAe,GAAG;EAC1C,IAAI,CAAC,EAAM,SAAS;EACpB,IAAM,IAAQ,EAAM,OAAO,kBAAkB,CAAQ;EACrD,KAAS,KAAK,IAAI,GAAG,EAAM,MAAM,EAAM,KAAK;CAC9C;CACA,OAAO;AACT;AAEA,SAAS,EAAY,GAAqB,GAA4D;CAKpG,OAJI,CAAC,KAAY,MAAa,SAAe,KACzC,MAAa,SAAe,EAAM,UAClC,MAAa,UAAgB,EAAM,WACnC,MAAa,QAAc,EAAM,SAC9B,EAAM;AACf;AAEA,SAAS,EAAiB,GAAc,GAAiB,GAAiB,GAA+C;CAEvH,IAAM,IADS,EAAM,KAAK,GAAS,GAAS;EAAE;EAAM,OAAO;CAAO,CACrD,GAAQ,MAAM;CAC3B,OAAO,IAAO;EAAE,OAAO,EAAK;EAAG,OAAO,EAAK;EAAG,OAAO,EAAK;EAAO,OAAO,EAAK;EAAO,OAAO,CAAC,CAAI;CAAE,IAAI;AACxG;AAEA,SAAS,EAAgB,GAAc,GAAiB,GAAiB,GAAoB,GAAmD;CAC9I,IAAM,IAAO,EAAM,OAAO,sBAAsB;CAChD,IAAI,EAAK,SAAS,KAAK,EAAK,UAAU,GAAG,OAAO;CAEhD,IAAM,IAA0B,MAAS,kBAAkB,kBAAkB;CAC7E,IAAI,MAAS,QAAQ;EACnB,IAAM,IAAS,EAAiB,GAAO,GAAS,GAAS,CAAQ;EACj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