@nova-lab/charts 0.0.0-stage → 1.0.0-dev.32
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 +202 -0
- package/README.md +158 -2
- package/dist/GeometryIndex-DDQ34Jf4.js +104 -0
- package/dist/MarkSeries-CQCAnV4s.js +245 -0
- package/dist/aggregation.d.ts +6 -0
- package/dist/aggregation.js +124 -0
- package/dist/annotations.d.ts +34 -0
- package/dist/annotations.js +71 -0
- package/dist/api/camera.d.ts +8 -0
- package/dist/api/cartesian.d.ts +21 -0
- package/dist/api/events.d.ts +13 -0
- package/dist/api/font.d.ts +3 -0
- package/dist/api/handle.d.ts +5 -0
- package/dist/api/host.d.ts +23 -0
- package/dist/api/internal.d.ts +41 -0
- package/dist/api/map-background.d.ts +12 -0
- package/dist/api/mark-paint.d.ts +5 -0
- package/dist/api/mark-style.d.ts +4 -0
- package/dist/api/navigation.d.ts +4 -0
- package/dist/api/overlay.d.ts +7 -0
- package/dist/api/partition.d.ts +11 -0
- package/dist/api/scene.d.ts +42 -0
- package/dist/api/state.d.ts +34 -0
- package/dist/api/types.d.ts +743 -0
- package/dist/area.d.ts +9 -0
- package/dist/area.js +706 -0
- package/dist/bar.d.ts +9 -0
- package/dist/bar.js +554 -0
- package/dist/brush.d.ts +17 -0
- package/dist/brush.js +86 -0
- package/dist/bubble.d.ts +8 -0
- package/dist/bubble.js +434 -0
- package/dist/camera-CUJAMfpx.js +57 -0
- package/dist/candlestick.d.ts +8 -0
- package/dist/candlestick.js +42 -0
- package/dist/cartesian-k_WIYsGp.js +1139 -0
- package/dist/chart-runtime-resolver-DwwXp3X8.js +20 -0
- package/dist/chart-series-runtime-C0P7h8Tl.js +127 -0
- package/dist/charts.js +1 -0
- package/dist/composed.d.ts +2 -0
- package/dist/composed.js +4 -0
- package/dist/crosshair.d.ts +23 -0
- package/dist/crosshair.js +60 -0
- package/dist/donut.d.ts +5 -0
- package/dist/donut.js +7 -0
- package/dist/funnel.d.ts +5 -0
- package/dist/funnel.js +40 -0
- package/dist/graph.d.ts +6 -0
- package/dist/graph.js +260 -0
- package/dist/heatmap.d.ts +8 -0
- package/dist/heatmap.js +37 -0
- package/dist/host-DLDeDU5k.js +4373 -0
- package/dist/index.d.ts +1 -0
- package/dist/internal-I5BDhahD.js +4 -0
- package/dist/layout-donut-BG4ubBtU.js +39 -0
- package/dist/line.d.ts +9 -0
- package/dist/line.js +452 -0
- package/dist/mark-paint-CMHKGegE.js +14 -0
- package/dist/mark-style-Cpl-ARQM.js +10 -0
- package/dist/model/area/create-area-series-layout.d.ts +15 -0
- package/dist/model/area/hit-test-area-layout.d.ts +2 -0
- package/dist/model/axis/ChartAxisModel.d.ts +28 -0
- package/dist/model/bar/create-bar-series-layout.d.ts +19 -0
- package/dist/model/bar/hit-test-bar-layout.d.ts +2 -0
- package/dist/model/bubble/create-bubble-series-layout.d.ts +15 -0
- package/dist/model/bubble/hit-test-bubble-layout.d.ts +2 -0
- package/dist/model/cartesian/append-line-contours.d.ts +4 -0
- package/dist/model/cartesian/axis-line-batch.d.ts +3 -0
- package/dist/model/cartesian/numeric-window.d.ts +7 -0
- package/dist/model/cartesian/point-series.d.ts +54 -0
- package/dist/model/cartesian/sample-extrema.d.ts +7 -0
- package/dist/model/cartesian/smooth-y.d.ts +4 -0
- package/dist/model/cartesian/translation-window.d.ts +17 -0
- package/dist/model/context/nova-chart-runtime.d.ts +54 -0
- package/dist/model/customization/chart-customization.d.ts +47 -0
- package/dist/model/customization/chart-presets.d.ts +6 -0
- package/dist/model/customization/chart-style-sheet.d.ts +9 -0
- package/dist/model/data/ChartDataStore.d.ts +113 -0
- package/dist/model/exploration/create-graph-layout.d.ts +11 -0
- package/dist/model/exploration/exploration-chart.types.d.ts +150 -0
- package/dist/model/exploration/force-layout.d.ts +9 -0
- package/dist/model/exploration/presets/airplane.d.ts +2 -0
- package/dist/model/exploration/presets/apartment.d.ts +2 -0
- package/dist/model/exploration/presets/botanical-park.d.ts +2 -0
- package/dist/model/exploration/presets/ferry.d.ts +2 -0
- package/dist/model/exploration/presets/ice-arena.d.ts +2 -0
- package/dist/model/exploration/presets/planetarium.d.ts +2 -0
- package/dist/model/exploration/presets/science-museum.d.ts +2 -0
- package/dist/model/exploration/presets/train.d.ts +2 -0
- package/dist/model/exploration/route-geometry.d.ts +9 -0
- package/dist/model/exploration/seat-shape.d.ts +7 -0
- package/dist/model/interaction/GeometryIndex.d.ts +14 -0
- package/dist/model/line/create-line-series-layout.d.ts +15 -0
- package/dist/model/line/hit-test-line-layout.d.ts +2 -0
- package/dist/model/novel/create-novel-layout.d.ts +5 -0
- package/dist/model/novel/hit-test-novel-layout.d.ts +3 -0
- package/dist/model/novel/layout-candlestick.d.ts +3 -0
- package/dist/model/novel/layout-donut.d.ts +3 -0
- package/dist/model/novel/layout-funnel.d.ts +3 -0
- package/dist/model/novel/layout-heatmap.d.ts +3 -0
- package/dist/model/novel/layout-input.d.ts +12 -0
- package/dist/model/novel/layout-radar.d.ts +3 -0
- package/dist/model/novel/layout-tree.d.ts +3 -0
- package/dist/model/novel/layout-treemap.d.ts +3 -0
- package/dist/model/novel/layout-values.d.ts +10 -0
- package/dist/model/novel/novel-chart.types.d.ts +140 -0
- package/dist/model/novel/novel-domains.d.ts +5 -0
- package/dist/model/scale/BandScale.d.ts +86 -0
- package/dist/model/scale/ChartScaleRegistry.d.ts +45 -0
- package/dist/model/scale/LinearScale.d.ts +48 -0
- package/dist/model/scale/TimeScale.d.ts +48 -0
- package/dist/model/scale/create-chart-scale.d.ts +3 -0
- package/dist/model/scale/resolve-chart-scale.d.ts +5 -0
- package/dist/model/scatter/create-scatter-series-layout.d.ts +14 -0
- package/dist/model/scatter/hit-test-scatter-layout.d.ts +4 -0
- package/dist/model/time/calendar-time.d.ts +16 -0
- package/dist/model/types/chart-axis.types.d.ts +43 -0
- package/dist/model/types/chart-components.types.d.ts +1393 -0
- package/dist/model/types/chart-scale.types.d.ts +78 -0
- package/dist/model/viewport-controller/viewport-controller.d.ts +5 -0
- package/dist/novel-domains-DBpA_AOT.js +24 -0
- package/dist/partition-D-0LTCr3.js +221 -0
- package/dist/presets/route-map/apartment.d.ts +2 -0
- package/dist/presets/route-map/apartment.js +116 -0
- package/dist/presets/route-map/botanical-park.d.ts +2 -0
- package/dist/presets/route-map/botanical-park.js +116 -0
- package/dist/presets/route-map/science-museum.d.ts +2 -0
- package/dist/presets/route-map/science-museum.js +45 -0
- package/dist/presets/seat-map/airplane.d.ts +2 -0
- package/dist/presets/seat-map/airplane.js +95 -0
- package/dist/presets/seat-map/ferry.d.ts +2 -0
- package/dist/presets/seat-map/ferry.js +54 -0
- package/dist/presets/seat-map/ice-arena.d.ts +2 -0
- package/dist/presets/seat-map/ice-arena.js +67 -0
- package/dist/presets/seat-map/planetarium.d.ts +2 -0
- package/dist/presets/seat-map/planetarium.js +54 -0
- package/dist/presets/seat-map/train.d.ts +2 -0
- package/dist/presets/seat-map/train.js +66 -0
- package/dist/presets.d.ts +78 -0
- package/dist/presets.js +14 -0
- package/dist/public.d.ts +2 -0
- package/dist/radar.d.ts +5 -0
- package/dist/radar.js +47 -0
- package/dist/rose.d.ts +5 -0
- package/dist/rose.js +7 -0
- package/dist/route-map.d.ts +6 -0
- package/dist/route-map.js +200 -0
- package/dist/scatter.d.ts +8 -0
- package/dist/scatter.js +433 -0
- package/dist/scene-CPvPzTaB.js +137 -0
- package/dist/seat-map.d.ts +6 -0
- package/dist/seat-map.js +84 -0
- package/dist/seat-shape--kEFiUXX.js +66 -0
- package/dist/state-C5pICb11.js +134 -0
- package/dist/sync.d.ts +82 -0
- package/dist/sync.js +326 -0
- package/dist/translation-window-Ca_rCenJ.js +57 -0
- package/dist/tree.d.ts +6 -0
- package/dist/tree.js +114 -0
- package/dist/treemap.d.ts +5 -0
- package/dist/treemap.js +85 -0
- package/dist/ui/area-series/AreaSeries.d.ts +44 -0
- package/dist/ui/area-series/area-series.config.d.ts +10 -0
- package/dist/ui/area-series/area-series.registry.d.ts +4 -0
- package/dist/ui/axis/Axis.d.ts +55 -0
- package/dist/ui/axis/axis.config.d.ts +10 -0
- package/dist/ui/axis/axis.registry.d.ts +4 -0
- package/dist/ui/bar-chart/BarChart.d.ts +124 -0
- package/dist/ui/bar-chart/bar-chart.config.d.ts +10 -0
- package/dist/ui/bar-chart/bar-chart.registry.d.ts +2 -0
- package/dist/ui/bar-series/BarSeries.d.ts +102 -0
- package/dist/ui/bar-series/bar-series.config.d.ts +10 -0
- package/dist/ui/bar-series/bar-series.registry.d.ts +4 -0
- package/dist/ui/bubble-series/BubbleSeries.d.ts +33 -0
- package/dist/ui/bubble-series/bubble-series.config.d.ts +10 -0
- package/dist/ui/bubble-series/bubble-series.registry.d.ts +4 -0
- package/dist/ui/composed-chart/ComposedChart.d.ts +41 -0
- package/dist/ui/composed-chart/composed-chart.config.d.ts +10 -0
- package/dist/ui/composed-chart/composed-chart.registry.d.ts +4 -0
- package/dist/ui/exploration-chart/ExplorationChart.d.ts +83 -0
- package/dist/ui/exploration-chart/exploration-chart.config.d.ts +7 -0
- package/dist/ui/exploration-chart/exploration-chart.registry.d.ts +6 -0
- package/dist/ui/grid/Grid.d.ts +35 -0
- package/dist/ui/grid/grid.config.d.ts +10 -0
- package/dist/ui/grid/grid.registry.d.ts +4 -0
- package/dist/ui/interaction/Interaction.d.ts +53 -0
- package/dist/ui/interaction/interaction.config.d.ts +10 -0
- package/dist/ui/interaction/interaction.registry.d.ts +4 -0
- package/dist/ui/legend/Legend.d.ts +38 -0
- package/dist/ui/legend/legend.config.d.ts +10 -0
- package/dist/ui/legend/legend.registry.d.ts +2 -0
- package/dist/ui/line-series/LineSeries.d.ts +67 -0
- package/dist/ui/line-series/line-series.config.d.ts +10 -0
- package/dist/ui/line-series/line-series.registry.d.ts +4 -0
- package/dist/ui/mark-series/MarkSeries.d.ts +55 -0
- package/dist/ui/novel-series/NovelSeries.d.ts +34 -0
- package/dist/ui/novel-series/novel-series.config.d.ts +9 -0
- package/dist/ui/novel-series/novel-series.registry.d.ts +4 -0
- package/dist/ui/partition-chart/PartitionChart.d.ts +24 -0
- package/dist/ui/partition-chart/partition-chart.config.d.ts +7 -0
- package/dist/ui/partition-chart/partition-chart.registry.d.ts +9 -0
- package/dist/ui/plot/Plot.d.ts +64 -0
- package/dist/ui/plot/plot.config.d.ts +10 -0
- package/dist/ui/plot/plot.registry.d.ts +4 -0
- package/dist/ui/root/Root.d.ts +206 -0
- package/dist/ui/root/root.config.d.ts +10 -0
- package/dist/ui/root/root.registry.d.ts +5 -0
- package/dist/ui/scale/Scale.d.ts +55 -0
- package/dist/ui/scale/scale.config.d.ts +10 -0
- package/dist/ui/scale/scale.registry.d.ts +4 -0
- package/dist/ui/scatter-series/ScatterSeries.d.ts +33 -0
- package/dist/ui/scatter-series/scatter-series.config.d.ts +10 -0
- package/dist/ui/scatter-series/scatter-series.registry.d.ts +4 -0
- package/dist/ui/shared/chart-props.d.ts +150 -0
- package/dist/ui/shared/chart-runtime-resolver.d.ts +4 -0
- package/dist/ui/shared/chart-semantic-marks.d.ts +20 -0
- package/dist/ui/shared/chart-series-runtime.d.ts +48 -0
- package/dist/ui/shared/schema-types.d.ts +34 -0
- package/dist/ui/tooltip/Tooltip.d.ts +64 -0
- package/dist/ui/tooltip/tooltip.config.d.ts +10 -0
- package/dist/ui/tooltip/tooltip.registry.d.ts +4 -0
- package/dist/ui/viewport/Viewport.d.ts +81 -0
- package/dist/ui/viewport/viewport.config.d.ts +10 -0
- package/dist/ui/viewport/viewport.registry.d.ts +2 -0
- package/dist/ui/viewport-controller/ViewportController.d.ts +30 -0
- package/dist/ui/viewport-controller/viewport-controller.config.d.ts +10 -0
- package/dist/ui/viewport-controller/viewport-controller.registry.d.ts +2 -0
- package/package.json +179 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './public';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { p as x, c as f } from "./MarkSeries-CQCAnV4s.js";
|
|
2
|
+
function R(l) {
|
|
3
|
+
const { props: e, dataStore: g, width: u, height: d } = l;
|
|
4
|
+
if (!e.categoryField || !e.valueField)
|
|
5
|
+
return [];
|
|
6
|
+
const a = x(l), c = a.reduce((t, s) => t + s.value, 0);
|
|
7
|
+
if (c <= 0)
|
|
8
|
+
return [];
|
|
9
|
+
const o = Math.max(0, Math.min(u, d) * 0.36), i = o * e.innerRadiusRatio;
|
|
10
|
+
let n = 0;
|
|
11
|
+
for (const t of a)
|
|
12
|
+
n = Math.max(n, t.value);
|
|
13
|
+
const m = u / 2, v = d / 2;
|
|
14
|
+
let r = -Math.PI / 2;
|
|
15
|
+
return a.map((t, s) => {
|
|
16
|
+
const p = r;
|
|
17
|
+
r += (e.kind === "rose" ? 1 / a.length : t.value / c) * Math.PI * 2;
|
|
18
|
+
const h = (e.kind === "rose" ? Math.sqrt(i ** 2 + (o ** 2 - i ** 2) * t.value / n) : o) - i;
|
|
19
|
+
return {
|
|
20
|
+
kind: e.kind === "rose" ? "rose" : "donut",
|
|
21
|
+
key: String(g.getRowKey(t.row, t.index)),
|
|
22
|
+
row: t.row,
|
|
23
|
+
label: t.label,
|
|
24
|
+
value: t.value,
|
|
25
|
+
color: f(e.palette, s),
|
|
26
|
+
x: m - o,
|
|
27
|
+
y: v - o,
|
|
28
|
+
width: o * 2,
|
|
29
|
+
height: o * 2,
|
|
30
|
+
startAngle: p,
|
|
31
|
+
endAngle: r,
|
|
32
|
+
radius: i + h / 2,
|
|
33
|
+
ringWidth: h
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
R as l
|
|
39
|
+
};
|
package/dist/line.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Самостоятельный LineChart и его серия для композиции. */
|
|
2
|
+
export declare const LineChart: {
|
|
3
|
+
series: <T = never, const S extends import('./public').SeriesOptions<never> = import('./public').SeriesOptions<T>>(options: S) => Omit<S, "type"> & {
|
|
4
|
+
readonly type: import('./public').CartesianKind;
|
|
5
|
+
};
|
|
6
|
+
mount<T>(target: string | HTMLElement, options: import('./public').CartesianOptions<T>): import('./public').CartesianHandle<T>;
|
|
7
|
+
attach<T>(target: import('./public').ChartAttachTarget, options: import('./public').CartesianOptions<T>): import('./public').CartesianHandle<T>;
|
|
8
|
+
};
|
|
9
|
+
export type { CartesianHandle as LineChartHandle, CartesianOptions as LineChartOptions, SeriesOptions as LineSeriesOptions } from './api/types';
|
package/dist/line.js
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var b = (a, e, t) => e in a ? v(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var u = (a, e, t) => b(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { c as C } from "./cartesian-k_WIYsGp.js";
|
|
5
|
+
import { commonMeasureBounds as w, NovaUiComponentNode as M } from "@nova-lab/ui-kit";
|
|
6
|
+
import { a as V, b as E, g as f, r as x, h as N, j as R, k as T, f as k } from "./host-DLDeDU5k.js";
|
|
7
|
+
import { T as z, a as $ } from "./translation-window-Ca_rCenJ.js";
|
|
8
|
+
import { C as D, p as W } from "./chart-series-runtime-C0P7h8Tl.js";
|
|
9
|
+
import { c as B, t as O } from "./GeometryIndex-DDQ34Jf4.js";
|
|
10
|
+
const A = "NovaCharts.LineSeries";
|
|
11
|
+
function I(a) {
|
|
12
|
+
const e = {
|
|
13
|
+
type: A,
|
|
14
|
+
name: "NovaCharts.LineSeries",
|
|
15
|
+
title: "NovaCharts.LineSeries",
|
|
16
|
+
version: "0.1.0",
|
|
17
|
+
kind: "node-component",
|
|
18
|
+
dirtyPolicy: E,
|
|
19
|
+
fields: {
|
|
20
|
+
...V,
|
|
21
|
+
chartRef: { type: "string" },
|
|
22
|
+
xScaleId: { type: "string" },
|
|
23
|
+
yScaleId: { type: "string" },
|
|
24
|
+
xField: { type: "field" },
|
|
25
|
+
yField: { type: "field" },
|
|
26
|
+
seriesField: { type: "field" },
|
|
27
|
+
labelField: { type: "field" },
|
|
28
|
+
curve: { type: "string" },
|
|
29
|
+
stroke: { type: "string" },
|
|
30
|
+
strokeWidth: { type: "number" },
|
|
31
|
+
opacity: { type: "number" },
|
|
32
|
+
dashPattern: { type: "record" },
|
|
33
|
+
referenceLines: { type: "array" },
|
|
34
|
+
markers: { type: "record" },
|
|
35
|
+
colors: { type: "record" },
|
|
36
|
+
defined: { type: "record" },
|
|
37
|
+
connectNulls: { type: "boolean" },
|
|
38
|
+
hitRadiusPx: { type: "number" },
|
|
39
|
+
virtualization: { type: "record" }
|
|
40
|
+
},
|
|
41
|
+
normalize: (t) => f(t.props),
|
|
42
|
+
measureBounds: (t, s) => w(s, f)
|
|
43
|
+
};
|
|
44
|
+
return a && (e.createNode = a), e;
|
|
45
|
+
}
|
|
46
|
+
const K = I();
|
|
47
|
+
function F(a, e, t) {
|
|
48
|
+
if (e.points.length === 0)
|
|
49
|
+
return null;
|
|
50
|
+
const s = t.maxDistancePx ?? 12;
|
|
51
|
+
let i = null;
|
|
52
|
+
for (const l of e.points) {
|
|
53
|
+
const r = Math.hypot(l.x - t.x, l.y - t.y);
|
|
54
|
+
r > s || (!i || r < i.distance) && (i = { point: l, distance: r });
|
|
55
|
+
}
|
|
56
|
+
return i ? H(a, i.point, i.distance) : null;
|
|
57
|
+
}
|
|
58
|
+
function H(a, e, t) {
|
|
59
|
+
return {
|
|
60
|
+
seriesId: a,
|
|
61
|
+
seriesKind: "line",
|
|
62
|
+
key: e.key,
|
|
63
|
+
mode: "datum",
|
|
64
|
+
row: e.row,
|
|
65
|
+
value: e.yValue,
|
|
66
|
+
rawValue: e.rawValue,
|
|
67
|
+
xValue: e.xValue,
|
|
68
|
+
yValue: e.yValue,
|
|
69
|
+
label: e.seriesLabel === "__default" ? String(e.xValue) : e.seriesLabel,
|
|
70
|
+
category: typeof e.xValue == "string" ? e.xValue : void 0,
|
|
71
|
+
seriesKey: e.seriesKey,
|
|
72
|
+
seriesLabel: e.seriesLabel,
|
|
73
|
+
color: e.color,
|
|
74
|
+
point: {
|
|
75
|
+
x: e.x,
|
|
76
|
+
y: e.y
|
|
77
|
+
},
|
|
78
|
+
bounds: {
|
|
79
|
+
x: e.x,
|
|
80
|
+
y: e.y,
|
|
81
|
+
width: 1,
|
|
82
|
+
height: 1
|
|
83
|
+
},
|
|
84
|
+
distancePx: t
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const X = {
|
|
88
|
+
kind: "line",
|
|
89
|
+
inputRows: 0,
|
|
90
|
+
visibleRows: 0,
|
|
91
|
+
renderedPoints: 0,
|
|
92
|
+
renderedSegments: 0,
|
|
93
|
+
skippedRows: 0,
|
|
94
|
+
seriesCount: 0,
|
|
95
|
+
mode: "direct",
|
|
96
|
+
domainMs: 0,
|
|
97
|
+
layoutMs: 0,
|
|
98
|
+
schemaMs: 0,
|
|
99
|
+
totalMs: 0
|
|
100
|
+
}, g = {
|
|
101
|
+
points: [],
|
|
102
|
+
segments: [],
|
|
103
|
+
series: [],
|
|
104
|
+
diagnostics: X
|
|
105
|
+
};
|
|
106
|
+
class Y extends M {
|
|
107
|
+
/**
|
|
108
|
+
* Создает экземпляр ChartLineSeries.
|
|
109
|
+
*/
|
|
110
|
+
constructor(t, s, i, l = {}, r = K) {
|
|
111
|
+
super(t, s, r, i, { componentId: l.componentId });
|
|
112
|
+
u(this, "_layoutPlan", g);
|
|
113
|
+
u(this, "_api");
|
|
114
|
+
u(this, "_runtimeBinding");
|
|
115
|
+
u(this, "_layoutEpoch", 0);
|
|
116
|
+
u(this, "_computedEpoch", "");
|
|
117
|
+
u(this, "_translationWindow", new z());
|
|
118
|
+
u(this, "_translationMatrix", B());
|
|
119
|
+
u(this, "_translationX", 0);
|
|
120
|
+
u(this, "_projectedPlan", null);
|
|
121
|
+
u(this, "_schema", null);
|
|
122
|
+
this.options({ zIndex: 12 }), this._api = {
|
|
123
|
+
getLayoutPlan: () => (this._computeLayout(), this._readLayoutPlan()),
|
|
124
|
+
getDiagnostics: () => this._layoutPlan.diagnostics,
|
|
125
|
+
hitTest: (n) => this._hitTestSeries(n),
|
|
126
|
+
refresh: () => this._refresh(),
|
|
127
|
+
setVirtualization: (n) => this.setVirtualization(n)
|
|
128
|
+
}, this._runtimeBinding = new D(this, {
|
|
129
|
+
hitTest: (n) => this._hitTestSeries(n)
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Обновляет props LineSeries.
|
|
134
|
+
*/
|
|
135
|
+
setProps(t) {
|
|
136
|
+
return super.setProps(f({
|
|
137
|
+
...this.props,
|
|
138
|
+
...t
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Возвращает public API LineSeries.
|
|
143
|
+
*/
|
|
144
|
+
getApi() {
|
|
145
|
+
return this._api;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Обновляет runtime-состояние LineSeries.
|
|
149
|
+
*/
|
|
150
|
+
update() {
|
|
151
|
+
this._computeLayout();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Рендерит line segments и optional markers.
|
|
155
|
+
*/
|
|
156
|
+
render() {
|
|
157
|
+
var n, d, c;
|
|
158
|
+
const t = P(), s = this._runtimeBinding.runtime();
|
|
159
|
+
if (this._translationX && this.renderer.setTransform(O(this._translationMatrix, this.matrix, [this._translationX, 0])), this._schema) {
|
|
160
|
+
this.renderer.schema(this._schema);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const i = [], l = s == null ? void 0 : s.getScale(this.props.yScaleId);
|
|
164
|
+
for (const o of this.props.referenceLines) {
|
|
165
|
+
const h = Number(l == null ? void 0 : l.toPx(o));
|
|
166
|
+
Number.isFinite(h) && h >= 0 && h <= this.height && i.push({ type: "line", x1: 0, y1: h, x2: this.width, y2: h, styles: { color: "#aab3bc", width: 1, opacity: 0.65, dashPattern: [3, 3] } });
|
|
167
|
+
}
|
|
168
|
+
if ((n = this.props.renderers) != null && n.lineSegment)
|
|
169
|
+
for (const o of this._layoutPlan.segments) {
|
|
170
|
+
const h = this._createSegmentStyleContext(o, s), p = this._resolveLineStyle(h, s, o.color);
|
|
171
|
+
x(
|
|
172
|
+
i,
|
|
173
|
+
(d = this.props.renderers) == null ? void 0 : d.lineSegment,
|
|
174
|
+
{ ...h, style: p },
|
|
175
|
+
{
|
|
176
|
+
type: "line",
|
|
177
|
+
x1: o.x1,
|
|
178
|
+
y1: o.y1,
|
|
179
|
+
x2: o.x2,
|
|
180
|
+
y2: o.y2,
|
|
181
|
+
styles: {
|
|
182
|
+
color: p.color ?? p.stroke ?? o.color,
|
|
183
|
+
width: p.width ?? p.strokeWidth ?? this.props.strokeWidth,
|
|
184
|
+
opacity: p.opacity ?? this.props.opacity,
|
|
185
|
+
dashPattern: p.dashPattern ?? this.props.dashPattern
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
const o = /* @__PURE__ */ new Map(), h = !(s != null && s.customization.contextualStyles) && !this.props.style && !this.props.parts && !this.props.states;
|
|
192
|
+
$(i, this._layoutPlan.segments, (p) => {
|
|
193
|
+
const _ = h ? o.get(p.color) : void 0;
|
|
194
|
+
if (_)
|
|
195
|
+
return _;
|
|
196
|
+
const m = this._resolveLineStyle(this._createSegmentStyleContext(p, s), s, p.color);
|
|
197
|
+
return h && o.set(p.color, m), m;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
if (this.props.markers.visible)
|
|
201
|
+
for (const o of this._layoutPlan.points) {
|
|
202
|
+
const h = {
|
|
203
|
+
row: o.row,
|
|
204
|
+
rowIndex: o.rowIndex,
|
|
205
|
+
key: o.key,
|
|
206
|
+
xValue: o.xValue,
|
|
207
|
+
yValue: o.yValue,
|
|
208
|
+
seriesKey: o.seriesKey,
|
|
209
|
+
seriesLabel: o.seriesLabel
|
|
210
|
+
}, p = typeof this.props.markers.fill == "function" ? this.props.markers.fill(h) : this.props.markers.fill ?? o.color, _ = typeof this.props.markers.strokeColor == "function" ? this.props.markers.strokeColor(h) : this.props.markers.strokeColor ?? "#ffffff", m = typeof this.props.markers.radius == "function" ? this.props.markers.radius(h) : this.props.markers.radius ?? 3, S = this._createPointStyleContext(o, s), y = this._resolveMarkerStyle(S, s, {
|
|
211
|
+
fill: p,
|
|
212
|
+
strokeColor: _,
|
|
213
|
+
radius: m
|
|
214
|
+
});
|
|
215
|
+
x(
|
|
216
|
+
i,
|
|
217
|
+
(c = this.props.renderers) == null ? void 0 : c.lineMarker,
|
|
218
|
+
{ ...S, style: y },
|
|
219
|
+
{
|
|
220
|
+
type: "circle",
|
|
221
|
+
x: o.x,
|
|
222
|
+
y: o.y,
|
|
223
|
+
radius: Math.max(0, y.radius ?? m),
|
|
224
|
+
styles: {
|
|
225
|
+
background: y.background ?? y.fill ?? p,
|
|
226
|
+
border: {
|
|
227
|
+
color: y.strokeColor ?? y.stroke ?? _,
|
|
228
|
+
width: y.strokeWidth ?? this.props.markers.strokeWidth
|
|
229
|
+
},
|
|
230
|
+
opacity: y.opacity ?? this.props.opacity
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
const r = P() - t;
|
|
236
|
+
this._layoutPlan = {
|
|
237
|
+
...this._layoutPlan,
|
|
238
|
+
diagnostics: {
|
|
239
|
+
...this._layoutPlan.diagnostics,
|
|
240
|
+
schemaMs: r,
|
|
241
|
+
totalMs: this._layoutPlan.diagnostics.domainMs + this._layoutPlan.diagnostics.layoutMs + r
|
|
242
|
+
}
|
|
243
|
+
}, s && this._runtimeBinding.publishDiagnostics(s, this._layoutPlan.diagnostics), this._canRetainSchema(s) && (i.contentVersion = 0, i.snapshotVersion = 0, this._schema = i), i.length > 0 && this.renderer.schema(i);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Обновляет virtualization options.
|
|
247
|
+
*/
|
|
248
|
+
setVirtualization(t) {
|
|
249
|
+
this.props.virtualization = {
|
|
250
|
+
...this.props.virtualization,
|
|
251
|
+
...t
|
|
252
|
+
}, this._refresh();
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Регистрирует interactive provider.
|
|
256
|
+
*/
|
|
257
|
+
onMount() {
|
|
258
|
+
super.onMount(), this._runtimeBinding.syncInteractive();
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Чистит runtime регистрации.
|
|
262
|
+
*/
|
|
263
|
+
onUnmount() {
|
|
264
|
+
this._runtimeBinding.cleanup(), super.onUnmount();
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Реагирует на изменение props.
|
|
268
|
+
*/
|
|
269
|
+
onPropsChanged(t) {
|
|
270
|
+
this.applyCommonPropsChanged(t), t.includes("chartRef") && this._runtimeBinding.syncInteractive(), this._refresh();
|
|
271
|
+
}
|
|
272
|
+
_canRetainSchema(t) {
|
|
273
|
+
return !!(t && !t.customization.contextualStyles && (!t.props.accessibility || !t.props.accessibility.includeVisibleMarks) && !this.props.style && !this.props.parts && !this.props.states && !this.props.renderers && !this.props.markers.visible && this.props.referenceLines.length === 0);
|
|
274
|
+
}
|
|
275
|
+
_readLayoutPlan() {
|
|
276
|
+
const t = this._translationX;
|
|
277
|
+
return t ? (this._projectedPlan ?? (this._projectedPlan = {
|
|
278
|
+
...this._layoutPlan,
|
|
279
|
+
points: this._layoutPlan.points.map((s) => ({ ...s, x: s.x + t })),
|
|
280
|
+
segments: this._layoutPlan.segments.map((s) => ({ ...s, x1: s.x1 + t, x2: s.x2 + t }))
|
|
281
|
+
}), this._projectedPlan) : this._layoutPlan;
|
|
282
|
+
}
|
|
283
|
+
_hitTestSeries(t) {
|
|
284
|
+
return this._computeLayout(), F(this.componentId, this._readLayoutPlan(), {
|
|
285
|
+
...t,
|
|
286
|
+
maxDistancePx: t.maxDistancePx ?? this.props.hitRadiusPx
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
_refresh() {
|
|
290
|
+
this._layoutEpoch++, this._computeLayout(), this.runtime.batch(() => {
|
|
291
|
+
this.invalidate({ update: !0, render: !0 });
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
_computeLayout() {
|
|
295
|
+
const t = this._runtimeBinding.runtime(), s = t == null ? void 0 : t.getScale(this.props.xScaleId), i = t == null ? void 0 : t.getScale(this.props.yScaleId);
|
|
296
|
+
if (!t || !s || !i) {
|
|
297
|
+
this._layoutPlan = g;
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const l = `${t.customization.revision}:${t.dataStore.revision}:${t.scales.revision}:${this._layoutEpoch}:${this.width}:${this.height}`;
|
|
301
|
+
if (l === this._computedEpoch)
|
|
302
|
+
return;
|
|
303
|
+
const r = `${t.customization.revision}:${t.dataStore.revision}:${this._layoutEpoch}:${this.width}:${this.height}`, n = this._canRetainSchema(t) ? this._translationWindow.offset(r, s, i) : null;
|
|
304
|
+
if (n !== null) {
|
|
305
|
+
this._translationX = n, this._projectedPlan = null, this._computedEpoch = l;
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
this._translationX = 0, this._projectedPlan = null, this._schema = null, this._translationWindow.clear();
|
|
309
|
+
const d = {
|
|
310
|
+
props: this.props,
|
|
311
|
+
dataStore: t.dataStore,
|
|
312
|
+
xScale: s,
|
|
313
|
+
yScale: i,
|
|
314
|
+
width: this.width,
|
|
315
|
+
height: this.height
|
|
316
|
+
};
|
|
317
|
+
this._runtimeBinding.publishContributions(t, [
|
|
318
|
+
{
|
|
319
|
+
id: `${this.componentId}:x-domain`,
|
|
320
|
+
scaleId: this.props.xScaleId,
|
|
321
|
+
domain: N(d)
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
id: `${this.componentId}:y-domain`,
|
|
325
|
+
scaleId: this.props.yScaleId,
|
|
326
|
+
domain: R(d)
|
|
327
|
+
}
|
|
328
|
+
]), this._layoutPlan = T(d), this._canRetainSchema(t) && this._translationWindow.capture({ key: r, xScale: s, yScale: i, width: this.width, overscanPx: this.props.virtualization.enabled ? this.props.virtualization.overscanPx : 1 / 0, extent: t.dataStore.numericExtent(this.props.xField) }), this._computedEpoch = `${t.customization.revision}:${t.dataStore.revision}:${t.scales.revision}:${this._layoutEpoch}:${this.width}:${this.height}`, this._runtimeBinding.publishDiagnostics(t, this._layoutPlan.diagnostics), this._runtimeBinding.publishMetadata(t, this._layoutPlan.series.map((c) => ({
|
|
329
|
+
...c,
|
|
330
|
+
id: c.id === "__default" ? this.componentId : c.id,
|
|
331
|
+
label: c.id === "__default" ? "Line" : c.label,
|
|
332
|
+
kind: "line",
|
|
333
|
+
sourceSeriesId: this.componentId,
|
|
334
|
+
scaleIds: {
|
|
335
|
+
x: this.props.xScaleId,
|
|
336
|
+
y: this.props.yScaleId
|
|
337
|
+
}
|
|
338
|
+
}))), W(t, `${this.componentId}:marks`, this.componentId, "line", this._layoutPlan.points);
|
|
339
|
+
}
|
|
340
|
+
_createSegmentStyleContext(t, s) {
|
|
341
|
+
return {
|
|
342
|
+
componentId: this.componentId,
|
|
343
|
+
componentName: "LineSeries",
|
|
344
|
+
part: "lineSegment",
|
|
345
|
+
seriesKind: "line",
|
|
346
|
+
state: k(this.componentId, t.key, {
|
|
347
|
+
hovered: s == null ? void 0 : s.getInteractionState().hovered,
|
|
348
|
+
attrs: this.props.attrs,
|
|
349
|
+
disabled: this.props.disabled
|
|
350
|
+
}),
|
|
351
|
+
geometry: t,
|
|
352
|
+
tokens: (s == null ? void 0 : s.customization.tokens) ?? {},
|
|
353
|
+
scaleIds: { x: this.props.xScaleId, y: this.props.yScaleId },
|
|
354
|
+
className: this.props.className,
|
|
355
|
+
attrs: this.props.attrs
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
_createPointStyleContext(t, s) {
|
|
359
|
+
return {
|
|
360
|
+
componentId: this.componentId,
|
|
361
|
+
componentName: "LineSeries",
|
|
362
|
+
part: "lineMarker",
|
|
363
|
+
datum: {
|
|
364
|
+
seriesId: this.componentId,
|
|
365
|
+
seriesKind: "line",
|
|
366
|
+
key: t.key,
|
|
367
|
+
mode: "datum",
|
|
368
|
+
row: t.row,
|
|
369
|
+
value: t.yValue,
|
|
370
|
+
rawValue: t.rawValue,
|
|
371
|
+
xValue: t.xValue,
|
|
372
|
+
yValue: t.yValue,
|
|
373
|
+
seriesKey: t.seriesKey,
|
|
374
|
+
seriesLabel: t.seriesLabel,
|
|
375
|
+
color: t.color,
|
|
376
|
+
point: { x: t.x, y: t.y },
|
|
377
|
+
distancePx: 0
|
|
378
|
+
},
|
|
379
|
+
row: t.row,
|
|
380
|
+
rowIndex: t.rowIndex,
|
|
381
|
+
seriesKind: "line",
|
|
382
|
+
state: k(this.componentId, t.key, {
|
|
383
|
+
hovered: s == null ? void 0 : s.getInteractionState().hovered,
|
|
384
|
+
attrs: this.props.attrs,
|
|
385
|
+
disabled: this.props.disabled
|
|
386
|
+
}),
|
|
387
|
+
geometry: t,
|
|
388
|
+
tokens: (s == null ? void 0 : s.customization.tokens) ?? {},
|
|
389
|
+
scaleIds: { x: this.props.xScaleId, y: this.props.yScaleId },
|
|
390
|
+
className: this.props.className,
|
|
391
|
+
attrs: this.props.attrs
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
_resolveLineStyle(t, s, i) {
|
|
395
|
+
var r, n, d, c;
|
|
396
|
+
const l = (n = (r = this.props.style) == null ? void 0 : r.datum) == null ? void 0 : n.call(r, t);
|
|
397
|
+
return (s == null ? void 0 : s.customization.resolveMarkStyle(t, {
|
|
398
|
+
legacy: {
|
|
399
|
+
color: i,
|
|
400
|
+
stroke: i,
|
|
401
|
+
strokeWidth: this.props.strokeWidth,
|
|
402
|
+
width: this.props.strokeWidth,
|
|
403
|
+
opacity: this.props.opacity,
|
|
404
|
+
dashPattern: this.props.dashPattern
|
|
405
|
+
},
|
|
406
|
+
series: this.props.style,
|
|
407
|
+
part: (d = this.props.parts) == null ? void 0 : d.lineSegment,
|
|
408
|
+
state: (c = this.props.states) == null ? void 0 : c[t.state],
|
|
409
|
+
datum: l
|
|
410
|
+
})) ?? {
|
|
411
|
+
color: i,
|
|
412
|
+
strokeWidth: this.props.strokeWidth,
|
|
413
|
+
opacity: this.props.opacity,
|
|
414
|
+
dashPattern: this.props.dashPattern
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
_resolveMarkerStyle(t, s, i) {
|
|
418
|
+
var r, n, d, c;
|
|
419
|
+
const l = (n = (r = this.props.style) == null ? void 0 : r.datum) == null ? void 0 : n.call(r, t);
|
|
420
|
+
return (s == null ? void 0 : s.customization.resolveMarkStyle(t, {
|
|
421
|
+
legacy: {
|
|
422
|
+
background: i.fill,
|
|
423
|
+
fill: i.fill,
|
|
424
|
+
strokeColor: i.strokeColor,
|
|
425
|
+
strokeWidth: this.props.markers.strokeWidth,
|
|
426
|
+
radius: i.radius,
|
|
427
|
+
opacity: this.props.opacity
|
|
428
|
+
},
|
|
429
|
+
series: this.props.style,
|
|
430
|
+
part: (d = this.props.parts) == null ? void 0 : d.lineMarker,
|
|
431
|
+
state: (c = this.props.states) == null ? void 0 : c[t.state],
|
|
432
|
+
datum: l
|
|
433
|
+
})) ?? i;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function P() {
|
|
437
|
+
return typeof performance < "u" ? performance.now() : Date.now();
|
|
438
|
+
}
|
|
439
|
+
const L = I((a, e) => new Y(
|
|
440
|
+
a.app,
|
|
441
|
+
a.surface,
|
|
442
|
+
f(e.props),
|
|
443
|
+
{ componentId: e.id },
|
|
444
|
+
L
|
|
445
|
+
));
|
|
446
|
+
function j(a) {
|
|
447
|
+
a.register(L, { override: !0 });
|
|
448
|
+
}
|
|
449
|
+
const st = C({ kind: "line", schemaType: "NovaCharts.LineSeries", register: j });
|
|
450
|
+
export {
|
|
451
|
+
st as LineChart
|
|
452
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function i(t, e) {
|
|
2
|
+
return [{ type: "arc", x: t.x + t.width / 2, y: t.y + t.height / 2, radius: t.radius ?? 0, startAngle: t.startAngle ?? 0, endAngle: t.endAngle ?? 0, styles: { color: e, width: t.ringWidth ?? 0 } }];
|
|
3
|
+
}
|
|
4
|
+
function n(t, e) {
|
|
5
|
+
return [{ type: "rect", x: t.x, y: t.y, width: t.width, height: t.height, styles: { background: e } }];
|
|
6
|
+
}
|
|
7
|
+
function h(t, e) {
|
|
8
|
+
return [{ type: "circle", x: t.x + t.width / 2, y: t.y + t.height / 2, radius: t.width / 2, styles: { background: e } }];
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
i as a,
|
|
12
|
+
h as p,
|
|
13
|
+
n as r
|
|
14
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function f(d, o) {
|
|
2
|
+
return o ? d.map((r) => {
|
|
3
|
+
var k;
|
|
4
|
+
const i = {};
|
|
5
|
+
return o.opacity !== void 0 && (i.opacity = o.opacity), r.type === "line" ? (o.stroke !== void 0 && (i.color = o.stroke), o.strokeWidth !== void 0 && (i.width = o.strokeWidth)) : ["polygon", "arc"].includes(r.type) ? (o.fill !== void 0 && (i.background = o.fill), o.stroke !== void 0 && (i.stroke = o.stroke), o.strokeWidth !== void 0 && (i.lineWidth = o.strokeWidth)) : ["circle", "rect"].includes(r.type) && (o.fill !== void 0 && (i.background = o.fill), (o.stroke !== void 0 || o.strokeWidth !== void 0) && (i.border = { ...((k = r.styles) == null ? void 0 : k.border) ?? {}, ...o.stroke === void 0 ? {} : { color: o.stroke }, ...o.strokeWidth === void 0 ? {} : { width: o.strokeWidth } })), { ...r, styles: { ...r.styles, ...i } };
|
|
6
|
+
}) : d;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
f as a
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChartDataStore } from '../data/ChartDataStore';
|
|
2
|
+
import { NovaChartAreaLayoutPlan, NovaChartAreaSeriesResolvedProps, NovaChartLineLayoutSegment } from '../types/chart-components.types';
|
|
3
|
+
import { ChartScale, ChartScaleDomain, ChartScaleValue } from '../types/chart-scale.types';
|
|
4
|
+
export interface NovaChartAreaLayoutInput<TData = Record<string, unknown>> {
|
|
5
|
+
props: NovaChartAreaSeriesResolvedProps<TData>;
|
|
6
|
+
dataStore: ChartDataStore<TData>;
|
|
7
|
+
xScale: ChartScale<ChartScaleValue>;
|
|
8
|
+
yScale: ChartScale<ChartScaleValue>;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function createAreaSeriesLayout<TData>(input: NovaChartAreaLayoutInput<TData>): NovaChartAreaLayoutPlan<TData>;
|
|
13
|
+
export declare function resolveAreaXDomain<TData>(input: NovaChartAreaLayoutInput<TData>): ChartScaleDomain;
|
|
14
|
+
export declare function resolveAreaYDomain<TData>(input: NovaChartAreaLayoutInput<TData>): ChartScaleDomain;
|
|
15
|
+
export type { NovaChartLineLayoutSegment };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { NovaChartAreaLayoutPlan, NovaChartHitTestInput, NovaChartHitTestResult } from '../types/chart-components.types';
|
|
2
|
+
export declare function hitTestAreaLayoutPlan<TData>(seriesId: string, plan: NovaChartAreaLayoutPlan<TData>, input: NovaChartHitTestInput): NovaChartHitTestResult<TData> | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChartScaleRegistry } from '../scale/ChartScaleRegistry';
|
|
2
|
+
import { ChartAxisOptions, ChartAxisRenderPlan } from '../types/chart-axis.types';
|
|
3
|
+
/**
|
|
4
|
+
* Создает render plan оси из зарегистрированной шкалы без привязки к конкретному renderer.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChartAxisModel {
|
|
7
|
+
private readonly _scales;
|
|
8
|
+
/**
|
|
9
|
+
* Создает модель оси поверх registry шкал.
|
|
10
|
+
*/
|
|
11
|
+
constructor(_scales: ChartScaleRegistry);
|
|
12
|
+
/**
|
|
13
|
+
* Строит геометрию baseline, ticks и labels внутри rect компонента оси.
|
|
14
|
+
*/
|
|
15
|
+
createRenderPlan(options: ChartAxisOptions): ChartAxisRenderPlan;
|
|
16
|
+
/**
|
|
17
|
+
* Возвращает range шкалы по ориентации и rect оси.
|
|
18
|
+
*/
|
|
19
|
+
private _resolveScaleRange;
|
|
20
|
+
/**
|
|
21
|
+
* Строит baseline оси.
|
|
22
|
+
*/
|
|
23
|
+
private _createBaseline;
|
|
24
|
+
/**
|
|
25
|
+
* Строит tick и позицию label.
|
|
26
|
+
*/
|
|
27
|
+
private _createRenderTick;
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChartDataStore } from '../data/ChartDataStore';
|
|
2
|
+
import { NovaChartBarLayoutPlan, NovaChartBarSeriesResolvedProps } from '../types/chart-components.types';
|
|
3
|
+
import { ChartScale, ChartScaleValue } from '../types/chart-scale.types';
|
|
4
|
+
export declare const DEFAULT_BAR_VIRTUALIZATION: {
|
|
5
|
+
readonly enabled: true;
|
|
6
|
+
readonly overscanPx: 64;
|
|
7
|
+
readonly minBarWidthPx: 1;
|
|
8
|
+
readonly maxRenderedBars: 20000;
|
|
9
|
+
readonly aggregation: "auto";
|
|
10
|
+
};
|
|
11
|
+
export interface NovaChartBarLayoutInput<TData = Record<string, unknown>> {
|
|
12
|
+
props: NovaChartBarSeriesResolvedProps<TData>;
|
|
13
|
+
dataStore: ChartDataStore<TData>;
|
|
14
|
+
xScale: ChartScale<ChartScaleValue>;
|
|
15
|
+
yScale: ChartScale<ChartScaleValue>;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function createBarSeriesLayout<TData>(input: NovaChartBarLayoutInput<TData>): NovaChartBarLayoutPlan<TData>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { NovaChartBarLayoutPlan, NovaChartHitTestInput, NovaChartHitTestResult } from '../types/chart-components.types';
|
|
2
|
+
export declare function hitTestBarLayoutPlan<TData>(seriesId: string, plan: NovaChartBarLayoutPlan<TData>, input: NovaChartHitTestInput): NovaChartHitTestResult<TData> | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChartDataStore } from '../data/ChartDataStore';
|
|
2
|
+
import { NovaChartBubbleLayoutPlan, NovaChartBubbleSeriesResolvedProps } from '../types/chart-components.types';
|
|
3
|
+
import { ChartScale, ChartScaleDomain, ChartScaleValue } from '../types/chart-scale.types';
|
|
4
|
+
export interface NovaChartBubbleLayoutInput<TData = Record<string, unknown>> {
|
|
5
|
+
props: NovaChartBubbleSeriesResolvedProps<TData>;
|
|
6
|
+
dataStore: ChartDataStore<TData>;
|
|
7
|
+
xScale: ChartScale<ChartScaleValue>;
|
|
8
|
+
yScale: ChartScale<ChartScaleValue>;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function createBubbleSeriesLayout<TData>(input: NovaChartBubbleLayoutInput<TData>): NovaChartBubbleLayoutPlan<TData>;
|
|
13
|
+
export declare function resolveBubbleXDomain<TData>(input: NovaChartBubbleLayoutInput<TData>): ChartScaleDomain;
|
|
14
|
+
export declare function resolveBubbleYDomain<TData>(input: NovaChartBubbleLayoutInput<TData>): ChartScaleDomain;
|
|
15
|
+
export declare function resolveBubbleSizeDomain<TData>(input: NovaChartBubbleLayoutInput<TData>): [number, number];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { NovaChartBubbleLayoutPlan, NovaChartHitTestInput, NovaChartHitTestResult } from '../types/chart-components.types';
|
|
2
|
+
export declare function hitTestBubbleLayoutPlan<TData>(seriesId: string, plan: NovaChartBubbleLayoutPlan<TData>, input: NovaChartHitTestInput): NovaChartHitTestResult<TData> | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaSchema } from '@nova-lab/core';
|
|
2
|
+
import { NovaChartLineLayoutSegment, NovaChartResolvedMarkStyle } from '../types/chart-components.types';
|
|
3
|
+
/** Объединяет смежные segments одного стиля; разрывы и переходы цвета остаются. */
|
|
4
|
+
export declare function appendLineContours(schema: NovaSchema, segments: ReadonlyArray<NovaChartLineLayoutSegment>, resolve: (segment: NovaChartLineLayoutSegment) => NovaChartResolvedMarkStyle): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NovaChartCartesianPointCandidate, NovaChartCartesianPointInput } from './point-series';
|
|
2
|
+
/** Числовой упорядоченный ряд: windowing и extrema до выделения объектов геометрии. */
|
|
3
|
+
export declare function numericWindow<T>(input: NovaChartCartesianPointInput<T>, color: string): {
|
|
4
|
+
points: NovaChartCartesianPointCandidate<T>[];
|
|
5
|
+
visibleCount: number;
|
|
6
|
+
skippedCount: number;
|
|
7
|
+
} | null;
|