@milaboratories/graph-maker 1.1.146 → 1.1.148

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.
Files changed (30) hide show
  1. package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.d.ts +1 -0
  2. package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.d.ts.map +1 -1
  3. package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.js +155 -121
  4. package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.js.map +1 -1
  5. package/dist/GraphMaker/dataBindAes.d.ts +1 -0
  6. package/dist/GraphMaker/dataBindAes.d.ts.map +1 -1
  7. package/dist/GraphMaker/dataBindAes.js +73 -66
  8. package/dist/GraphMaker/dataBindAes.js.map +1 -1
  9. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.d.ts.map +1 -1
  10. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js +2 -0
  11. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
  12. package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.d.ts.map +1 -1
  13. package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js +37 -36
  14. package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js.map +1 -1
  15. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
  16. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js +31 -29
  17. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js.map +1 -1
  18. package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.d.ts.map +1 -1
  19. package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.js +6 -6
  20. package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.js.map +1 -1
  21. package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
  22. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +12 -12
  23. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
  24. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +102 -101
  25. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
  26. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +112 -108
  27. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  28. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js +10 -2
  29. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js.map +1 -1
  30. package/package.json +2 -2
@@ -1,20 +1,20 @@
1
1
  import { j as b } from "../node_modules/react/jsx-runtime.js";
2
- import B from "../node_modules/@d3fc/d3fc-chart/src/cartesian.js";
2
+ import R from "../node_modules/@d3fc/d3fc-chart/src/cartesian.js";
3
3
  import "../node_modules/@d3fc/d3fc-webgl/src/scale/scaleMapper.js";
4
- import U from "../node_modules/@d3fc/d3fc-webgl/src/style/fillColor.js";
5
- import V from "../node_modules/@d3fc/d3fc-series/src/webgl/point.js";
4
+ import V from "../node_modules/@d3fc/d3fc-webgl/src/style/fillColor.js";
5
+ import k from "../node_modules/@d3fc/d3fc-series/src/webgl/point.js";
6
6
  import K from "../node_modules/@d3fc/d3fc-series/src/svg/multi.js";
7
7
  import j from "../node_modules/@d3fc/d3fc-series/src/webgl/multi.js";
8
- import q from "../node_modules/d3-zoom/src/zoom.js";
8
+ import X from "../node_modules/d3-zoom/src/zoom.js";
9
9
  import "../node_modules/d3-zoom/src/transform.js";
10
- import { createRoot as X } from "../node_modules/react-dom/client.js";
11
- import { Error as Y } from "../common/Error.js";
12
- import { DEFAULT_HEIGHT as w, DEFAULT_WIDTH as D, TITLE_LINE_HEIGHT as Q, BLACK as M, TITLE_MARGIN as J } from "../constants.js";
13
- import { splitTextByWidth as Z } from "../utils/splitTextByWidth.js";
10
+ import { createRoot as q } from "../node_modules/react-dom/client.js";
11
+ import { Error as Q } from "../common/Error.js";
12
+ import { DEFAULT_HEIGHT as w, DEFAULT_WIDTH as E, TITLE_LINE_HEIGHT as Y, MAX_SHOWN_UNIQUE_VALUES_IN_LABELS as J, BLACK as M, TITLE_MARGIN as Z } from "../constants.js";
13
+ import { splitTextByWidth as tt } from "../utils/splitTextByWidth.js";
14
14
  import { MIN_MARGIN as L, DEFAULT_DOT_AES as H } from "../scatterplot/constants.js";
15
- import { createAesGetter as F } from "../scatterplot/utils/createAesGetter.js";
16
- import { getTicksAndFormat as tt } from "../scatterplot/utils/getTicksAndFormat.js";
17
- import { createLabelPositioner as et } from "../scatterplot/utils/getVisibleLabels.js";
15
+ import { createAesGetter as W } from "../scatterplot/utils/createAesGetter.js";
16
+ import { getTicksAndFormat as et } from "../scatterplot/utils/getTicksAndFormat.js";
17
+ import { createLabelPositioner as st } from "../scatterplot/utils/getVisibleLabels.js";
18
18
  import { isContinuousAes as $ } from "../types/common.js";
19
19
  import "../types/discrete.js";
20
20
  import "../types/scatterplot.js";
@@ -22,40 +22,40 @@ import "../types/heatmap.js";
22
22
  import "../types/dendro.js";
23
23
  import "../types/histogram.js";
24
24
  import "../types/bubble.js";
25
- import { getContinuousColorScale as st } from "../utils/getContinuousColorScale.js";
26
- import { getContinuousLegendTicks as it } from "../utils/getContinuousLegendTicks.js";
25
+ import { getContinuousColorScale as it } from "../utils/getContinuousColorScale.js";
26
+ import { getContinuousLegendTicks as at } from "../utils/getContinuousLegendTicks.js";
27
27
  import { TextMeasurer as G } from "../utils/TextMeasurer/TextMeasurer.js";
28
- import { SVGLayer as at } from "./components/SVGLayer.js";
29
- import { PADDINGS as E, TITLE_LINE as I, LEGEND_OFFSET as ot } from "./constants.js";
30
- import rt from "../node_modules/@d3fc/d3fc-pointer/src/pointer.js";
31
- import lt from "../node_modules/kdbush/index.js";
32
- import { DataFrameProvider as nt } from "../common/useDataFrame.js";
33
- import { DataFrame as ht } from "../DataFrame.js";
34
- import { arrangeLegendParts as dt } from "../utils/arrangeLegendParts.js";
35
- import { stringToNumberRgba as P, getColorWithFakeOpacity as W, GET_BLACK as O } from "./colors.js";
28
+ import { SVGLayer as ot } from "./components/SVGLayer.js";
29
+ import { PADDINGS as A, TITLE_LINE as _, LEGEND_OFFSET as rt } from "./constants.js";
30
+ import lt from "../node_modules/@d3fc/d3fc-pointer/src/pointer.js";
31
+ import nt from "../node_modules/kdbush/index.js";
32
+ import { DataFrameProvider as ht } from "../common/useDataFrame.js";
33
+ import { DataFrame as dt } from "../DataFrame.js";
34
+ import { arrangeLegendParts as ct } from "../utils/arrangeLegendParts.js";
35
+ import { stringToNumberRgba as F, getColorWithFakeOpacity as P, GET_BLACK as I } from "./colors.js";
36
36
  import T from "../node_modules/d3-scale/src/linear.js";
37
- import _ from "../node_modules/d3-scale/src/log.js";
37
+ import O from "../node_modules/d3-scale/src/log.js";
38
38
  import N from "../node_modules/d3-selection/src/select.js";
39
- import ct from "../node_modules/d3-scale/src/ordinal.js";
40
- import mt from "../node_modules/d3-scale/src/symlog.js";
41
- import { sqrt as pt } from "../node_modules/d3-scale/src/pow.js";
42
- import ut from "../node_modules/d3-polygon/src/contains.js";
43
- var gt = Object.defineProperty, yt = (S, t, e) => t in S ? gt(S, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : S[t] = e, h = (S, t, e) => yt(S, typeof t != "symbol" ? t + "" : t, e);
44
- function R(S) {
45
- return S / 2.35 * (S / 2.35) * 64;
39
+ import mt from "../node_modules/d3-scale/src/ordinal.js";
40
+ import pt from "../node_modules/d3-scale/src/symlog.js";
41
+ import { sqrt as ut } from "../node_modules/d3-scale/src/pow.js";
42
+ import gt from "../node_modules/d3-polygon/src/contains.js";
43
+ var yt = Object.defineProperty, ft = (v, t, e) => t in v ? yt(v, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[t] = e, h = (v, t, e) => ft(v, typeof t != "symbol" ? t + "" : t, e);
44
+ function U(v) {
45
+ return v / 2.35 * (v / 2.35) * 64;
46
46
  }
47
- function A(S, t, e) {
48
- return e.length === 0 ? !0 : e.some((s) => s.closed && s.points.length > 2 && ut(s.points, [S, t]));
47
+ function D(v, t, e) {
48
+ return e.length === 0 ? !0 : e.some((s) => s.closed && s.points.length > 2 && gt(s.points, [v, t]));
49
49
  }
50
- function k(S, t, e) {
50
+ function B(v, t, e) {
51
51
  const s = e.find((a) => a.type === "dots"), n = e.find((a) => a.type === "curve");
52
52
  return {
53
- dotFill: F(S, t, (s == null ? void 0 : s.aes.dotFill) ?? H.color, "dotFill"),
54
- dotSize: F(S, t, (s == null ? void 0 : s.aes.dotSize) ?? H.size, "dotSize"),
55
- lineType: F(S, t, (n == null ? void 0 : n.aes.lineShape) ?? "solid", "lineShape")
53
+ dotFill: W(v, t, (s == null ? void 0 : s.aes.dotFill) ?? H.color, "dotFill"),
54
+ dotSize: W(v, t, (s == null ? void 0 : s.aes.dotSize) ?? H.size, "dotSize"),
55
+ lineType: W(v, t, (n == null ? void 0 : n.aes.lineShape) ?? "solid", "lineShape")
56
56
  };
57
57
  }
58
- class oe {
58
+ class re {
59
59
  constructor() {
60
60
  h(this, "reactRoot", null), h(this, "parentNode", null), h(this, "rootNode", null), h(this, "canvasNode", null), h(this, "svgLayerElement", null), h(this, "svgLayerComponent", /* @__PURE__ */ b.jsx(b.Fragment, {})), h(this, "aesGetters", {
61
61
  dotSize: () => 2,
@@ -67,18 +67,18 @@ class oe {
67
67
  left: L,
68
68
  right: L
69
69
  }), h(this, "chartSizes", {
70
- chartWidth: D,
70
+ chartWidth: E,
71
71
  // width of single chart
72
72
  chartHeight: w,
73
73
  // height of single chart
74
- totalWidth: D,
74
+ totalWidth: E,
75
75
  // width of all charts in charts row, plus left axis, plus legend
76
76
  totalHeight: w
77
77
  // width of all charts in charts height, plus bottom axis, plus top title
78
78
  }), h(this, "scales", {
79
- x: T().domain([0, 10]).range([0, D]),
79
+ x: T().domain([0, 10]).range([0, E]),
80
80
  y: T().domain([0, 10]).range([w, 0]),
81
- xOriginal: T().domain([0, 10]).range([0, D]),
81
+ xOriginal: T().domain([0, 10]).range([0, E]),
82
82
  yOriginal: T().domain([0, 10]).range([w, 0])
83
83
  }), h(this, "polygons", []), h(this, "onPolygonUpdateOutside", () => {
84
84
  }), h(this, "onTooltipHintSwitch", () => {
@@ -86,9 +86,9 @@ class oe {
86
86
  }), h(this, "zoomTransform", null), h(this, "zoomStateKey", ""), h(this, "selectedDot", null), h(this, "captionsSizes", {
87
87
  xAxisCaptionsWidth: 30,
88
88
  yAxisCaptionsWidth: 100
89
- }), h(this, "mainTitle", []), h(this, "legend", { width: 0, height: 0, items: [] }), h(this, "notCalculatedProps", {}), h(this, "allDots", []), h(this, "visibleLabels", []), h(this, "dataFrame", new ht("", {})), h(this, "onPolygonUpdate", (t) => {
89
+ }), h(this, "mainTitle", []), h(this, "legend", { width: 0, height: 0, items: [] }), h(this, "notCalculatedProps", {}), h(this, "allDots", []), h(this, "visibleLabels", []), h(this, "dataFrame", new dt("", {})), h(this, "onPolygonUpdate", (t) => {
90
90
  this.polygons = t, this.updateByLasso();
91
- const e = this.allDots.filter((s) => A(s.x, s.y, this.polygons)).map((s) => s.idx);
91
+ const e = this.allDots.filter((s) => D(s.x, s.y, this.polygons)).map((s) => s.idx);
92
92
  this.onPolygonUpdateOutside(e, t);
93
93
  });
94
94
  }
@@ -100,57 +100,57 @@ class oe {
100
100
  });
101
101
  }
102
102
  init(t) {
103
- this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.canvasNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.parentNode.appendChild(this.canvasNode), this.reactRoot = X(this.rootNode));
103
+ this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.canvasNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.parentNode.appendChild(this.canvasNode), this.reactRoot = q(this.rootNode));
104
104
  }
105
105
  updateChartSizes(t) {
106
106
  (t.width !== this.chartSizes.chartWidth || t.height !== this.chartSizes.chartHeight) && (this.chartSizes.chartWidth = t.width, this.chartSizes.chartHeight = t.height, this.scales.x.range([0, this.chartSizes.chartWidth]), this.scales.y.range([this.chartSizes.chartHeight, 0]));
107
107
  }
108
108
  updateViewport(t, e, s) {
109
- const n = t.scale === "log" ? _() : T();
109
+ const n = t.scale === "log" ? O() : T();
110
110
  let { minX: a, minY: d, maxX: u, maxY: p } = s;
111
111
  if (t.lowerValue !== void 0 && (a = Math.max(a, t.lowerValue)), t.upperValue !== void 0 && (u = Math.min(u, t.upperValue)), e.lowerValue !== void 0 && (d = Math.max(d, e.lowerValue)), e.upperValue !== void 0 && (p = Math.min(p, e.upperValue)), t.symmetricRange !== void 0) {
112
- const o = t.symmetricRange;
113
- if (o >= a && o <= u) {
114
- const y = Math.max(o - a, u - o);
115
- a = o - y, u = o + y;
112
+ const r = t.symmetricRange;
113
+ if (r >= a && r <= u) {
114
+ const y = Math.max(r - a, u - r);
115
+ a = r - y, u = r + y;
116
116
  }
117
117
  }
118
118
  if (typeof e.symmetricRange < "u") {
119
- const o = e.symmetricRange;
120
- if (o >= d && o <= p) {
121
- const y = Math.max(o - d, p - o);
122
- d = o - y, p = o + y;
119
+ const r = e.symmetricRange;
120
+ if (r >= d && r <= p) {
121
+ const y = Math.max(r - d, p - r);
122
+ d = r - y, p = r + y;
123
123
  }
124
124
  }
125
- const f = [0, this.chartSizes.chartWidth], v = n.copy().domain([a, u]).range([E.LEFT, this.chartSizes.chartWidth - E.RIGHT]);
126
- n.domain([v.invert(0), v.invert(this.chartSizes.chartWidth)]).range(f).nice(), this.scales.x = n, this.scales.xOriginal = n.copy();
127
- const c = e.scale === "log" ? _() : T(), r = [this.chartSizes.chartHeight, 0], g = c.copy().domain([d, p]).range([this.chartSizes.chartHeight - E.BOTTOM, E.TOP]);
128
- c.domain([g.invert(this.chartSizes.chartHeight), g.invert(0)]).range(r).nice(), this.scales.y = c, this.scales.yOriginal = c.copy();
125
+ const f = [0, this.chartSizes.chartWidth], S = n.copy().domain([a, u]).range([A.LEFT, this.chartSizes.chartWidth - A.RIGHT]);
126
+ n.domain([S.invert(0), S.invert(this.chartSizes.chartWidth)]).range(f).nice(), this.scales.x = n, this.scales.xOriginal = n.copy();
127
+ const c = e.scale === "log" ? O() : T(), o = [this.chartSizes.chartHeight, 0], g = c.copy().domain([d, p]).range([this.chartSizes.chartHeight - A.BOTTOM, A.TOP]);
128
+ c.domain([g.invert(this.chartSizes.chartHeight), g.invert(0)]).range(o).nice(), this.scales.y = c, this.scales.yOriginal = c.copy();
129
129
  }
130
130
  updateCaptionsSize() {
131
131
  const t = new G("600 14px Arial");
132
132
  function e(d) {
133
133
  return Math.max(...d.map((u) => t.getTextWidth(u)));
134
134
  }
135
- const { ticks: s, format: n } = tt(this.scales.y, !1), a = e(s.map(n));
135
+ const { ticks: s, format: n } = et(this.scales.y, !1), a = e(s.map(n));
136
136
  this.captionsSizes = {
137
137
  xAxisCaptionsWidth: 20,
138
138
  yAxisCaptionsWidth: a
139
139
  };
140
140
  }
141
141
  createMainTitle(t) {
142
- this.mainTitle = Z(
142
+ this.mainTitle = tt(
143
143
  t.name,
144
144
  this.chartSizes.totalWidth - this.margins.left - this.margins.right,
145
145
  20
146
146
  );
147
147
  }
148
148
  updateMargins() {
149
- const t = Q * this.mainTitle.length, e = t > 0 ? t + J * 2 : 0;
149
+ const t = Y * this.mainTitle.length, e = t > 0 ? t + Z * 2 : 0;
150
150
  this.margins = {
151
151
  top: Math.max(e, L),
152
- bottom: L + this.captionsSizes.xAxisCaptionsWidth + I,
153
- left: L + this.captionsSizes.yAxisCaptionsWidth + I,
152
+ bottom: L + this.captionsSizes.xAxisCaptionsWidth + _,
153
+ left: L + this.captionsSizes.yAxisCaptionsWidth + _,
154
154
  right: this.legend.width + L
155
155
  }, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartHeight, this.legend.height) + this.margins.bottom, N(this.canvasNode).style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
156
156
  }
@@ -161,57 +161,61 @@ class oe {
161
161
  }
162
162
  const a = [], d = { width: 0, height: 0, left: 0, top: 0 };
163
163
  if (s.forEach((c) => {
164
- const r = e[c.value];
165
- if (r.usedAes.length === 0 || !r.aesMap)
164
+ const o = e[c.value];
165
+ if (o.usedAes.length === 0 || !o.aesMap)
166
166
  return;
167
+ if (o.values.length > J) {
168
+ console.warn(`Too many values for discrete legend (${o.values.length})`);
169
+ return;
170
+ }
167
171
  const g = {};
168
- r.values.forEach((m) => {
169
- g[m] || (g[m] = { ...H }), r.usedAes.forEach((i) => {
170
- i === "dotFill" && (g[m].color = r.aesMap(m, i) ?? M), i === "dotSize" && (g[m].size = Number(r.aesMap(m, i) ?? 3));
172
+ o.values.forEach((m) => {
173
+ g[m] || (g[m] = { ...H }), o.usedAes.forEach((i) => {
174
+ i === "dotFill" && (g[m].color = o.aesMap(m, i) ?? M), i === "dotSize" && (g[m].size = Number(o.aesMap(m, i) ?? 3));
171
175
  });
172
176
  });
173
- const o = c.label ?? c.value, y = ct().domain(r.values).range(r.values.map((m) => g[m]));
174
- a.push({ ...d, id: c.value, type: "dots", title: o, scale: y, values: r.values, labels: r.labels });
177
+ const r = c.label ?? c.value, y = mt().domain(o.values).range(o.values.map((m) => g[m]));
178
+ a.push({ ...d, id: c.value, type: "dots", title: r, scale: y, values: o.values, labels: o.labels });
175
179
  }), n.forEach((c) => {
176
180
  if (c.type === "dots" && $(c.aes.dotFill)) {
177
- const { domain: r, range: g, columnName: o, type: y = "linear" } = c.aes.dotFill, m = o.label ?? o.value, i = st(g, r, "linear"), l = (y === "log" ? mt() : T()).domain(r).range([this.chartSizes.chartHeight, 0]), x = it(l, r);
181
+ const { domain: o, range: g, columnName: r, type: y = "linear" } = c.aes.dotFill, m = r.label ?? r.value, i = it(g, o, "linear"), l = (y === "log" ? pt() : T()).domain(o).range([this.chartSizes.chartHeight, 0]), x = at(l, o);
178
182
  a.push({ ...d, id: "dotFill", type: "continuous", title: m, scale: i, tickPositionScale: l, values: x });
179
183
  }
180
184
  if (c.type === "dots" && $(c.aes.dotSize)) {
181
- const { columnName: r, domain: g, range: o } = c.aes.dotSize, y = r.label ?? r.value, m = pt(g, o), i = m.ticks(3), l = m.tickFormat(3), x = i.reduce((z, C) => (z[String(C)] = l(C), z), {});
182
- a.push({ ...d, id: r.value, type: "size", title: y, scale: m, values: i, labels: x });
185
+ const { columnName: o, domain: g, range: r } = c.aes.dotSize, y = o.label ?? o.value, m = ut(g, r), i = m.ticks(3), l = m.tickFormat(3), x = i.reduce((z, C) => (z[String(C)] = l(C), z), {});
186
+ a.push({ ...d, id: o.value, type: "size", title: y, scale: m, values: i, labels: x });
183
187
  }
184
188
  }), !a.length) {
185
189
  this.legend = { width: 0, height: 0, items: [] };
186
190
  return;
187
191
  }
188
- const u = dt(a, this.chartSizes.chartHeight), p = u[u.length - 1], f = p.left + p.width + ot, v = this.chartSizes.chartHeight;
192
+ const u = ct(a, this.chartSizes.chartHeight), p = u[u.length - 1], f = p.left + p.width + rt, S = this.chartSizes.chartHeight;
189
193
  this.legend = {
190
194
  width: f,
191
- height: v,
195
+ height: S,
192
196
  items: u
193
197
  };
194
198
  }
195
199
  initSettings(t, e, s, n, a, d) {
196
- const { xAxis: u, yAxis: p, size: f, title: v, legend: c } = e;
197
- this.updateChartSizes(f), this.updateViewport(u, p, s), this.updateCaptionsSize(), this.updateLegendSize(c, n, d, a), this.createMainTitle(v), this.updateMargins(), this.aesGetters = k(this.dataFrame, n, a);
198
- const r = U().data(t).value((i) => {
199
- const l = P(this.aesGetters.dotFill(i.idx));
200
- return l[3] = !i.dimmed && A(i.x, i.y, this.polygons) ? 1 : 0.4, W(l, l);
201
- }), g = V().equals((i, l) => i === l).size((i) => R(this.aesGetters.dotSize(i.idx))).crossValue((i) => i.x).mainValue((i) => i.y).decorate((i) => r(i)), o = q().scaleExtent([0.1, 1e3]).filter((i) => i.type === "wheel" || i.metaKey || i.ctrlKey).on("start", () => {
200
+ const { xAxis: u, yAxis: p, size: f, title: S, legend: c } = e;
201
+ this.updateChartSizes(f), this.updateViewport(u, p, s), this.updateCaptionsSize(), this.updateLegendSize(c, n, d, a), this.createMainTitle(S), this.updateMargins(), this.aesGetters = B(this.dataFrame, n, a);
202
+ const o = V().data(t).value((i) => {
203
+ const l = F(this.aesGetters.dotFill(i.idx));
204
+ return l[3] = !i.dimmed && D(i.x, i.y, this.polygons) ? 1 : 0.4, P(l, l);
205
+ }), g = k().equals((i, l) => i === l).size((i) => U(this.aesGetters.dotSize(i.idx))).crossValue((i) => i.x).mainValue((i) => i.y).decorate((i) => o(i)), r = X().scaleExtent([0.1, 1e3]).filter((i) => i.type === "wheel" || i.metaKey || i.ctrlKey).on("start", () => {
202
206
  this.selectedDot = null;
203
207
  }).on("zoom", (i) => {
204
208
  const l = i.transform, x = l.rescaleX(this.scales.xOriginal), z = l.rescaleY(this.scales.yOriginal);
205
209
  this.scales.x.domain(x.domain()), this.scales.y.domain(z.domain()), this.zoomTransform = l, this.zoomStateKey = `${l.x}_${l.y}_${l.k}`, this.updateLabelsPosition(this.visibleLabels), this.renderSvgLayer(), this.renderWebglLayer();
206
210
  }).on("end", () => {
207
211
  this.visibleLabels = this.computeLabels(this.allDots), this.renderSvgLayer();
208
- }), y = rt().on("point", ([i]) => {
212
+ }), y = lt().on("point", ([i]) => {
209
213
  var l;
210
214
  let x;
211
215
  i && (x = this.getClosestDot(i.x, i.y));
212
216
  const z = this.selectedDot && !x || !this.selectedDot && x || ((l = this.selectedDot) == null ? void 0 : l.idx) !== (x == null ? void 0 : x.idx);
213
217
  this.selectedDot = x ?? null, z && this.renderSvgLayer();
214
- }), m = B({
218
+ }), m = R({
215
219
  xScale: this.scales.x,
216
220
  yScale: this.scales.y
217
221
  }).xAxisHeight(() => "0").yAxisWidth(() => "0").svgPlotArea(K()).webglPlotArea(
@@ -219,33 +223,33 @@ class oe {
219
223
  j().series([g]).mapping((i) => i)
220
224
  ).decorate((i) => {
221
225
  const l = i.enter();
222
- l && !this.svgLayerElement && (l.style("grid-template-columns", "0 auto 1fr auto 0"), l.style("grid-template-rows", "0 auto 1fr auto 0"), this.svgLayerElement = l.select(".svg-plot-area.plot-area svg").node()), l.select(".svg-plot-area.plot-area").attr("class", "svg-plot-area plot-area miplots-scatterplot-plot-area").call(o).call(y);
226
+ l && !this.svgLayerElement && (l.style("grid-template-columns", "0 auto 1fr auto 0"), l.style("grid-template-rows", "0 auto 1fr auto 0"), this.svgLayerElement = l.select(".svg-plot-area.plot-area svg").node()), l.select(".svg-plot-area.plot-area").attr("class", "svg-plot-area plot-area miplots-scatterplot-plot-area").call(r).call(y);
223
227
  });
224
228
  this.tools = {
225
229
  webglChart: m,
226
- zoom: o,
227
- fillColor: r,
230
+ zoom: r,
231
+ fillColor: o,
228
232
  pointSeries: g
229
233
  }, N(this.canvasNode).datum(t).style("position", "absolute").style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
230
234
  }
231
235
  updateAes(t, e) {
232
- this.tools !== null && (this.aesGetters = k(this.dataFrame, t, e), this.tools.fillColor.value((s) => {
233
- const n = this.aesGetters.dotFill ?? O, a = P(n(s.idx));
234
- return a[3] = !s.dimmed && A(s.x, s.y, this.polygons) ? 1 : 0.4, W(a, a);
236
+ this.tools !== null && (this.aesGetters = B(this.dataFrame, t, e), this.tools.fillColor.value((s) => {
237
+ const n = this.aesGetters.dotFill ?? I, a = F(n(s.idx));
238
+ return a[3] = !s.dimmed && D(s.x, s.y, this.polygons) ? 1 : 0.4, P(a, a);
235
239
  }));
236
240
  }
237
241
  updatePointSize() {
238
- this.tools !== null && (N(this.canvasNode).datum([...this.allDots]), this.tools.pointSeries.size((t) => R(this.aesGetters.dotSize(t.data))));
242
+ this.tools !== null && (N(this.canvasNode).datum([...this.allDots]), this.tools.pointSeries.size((t) => U(this.aesGetters.dotSize(t.data))));
239
243
  }
240
244
  updateByLasso() {
241
245
  var t;
242
246
  this.tools !== null && ((t = this.tools) == null || t.fillColor.value((e) => {
243
- const s = this.aesGetters.dotFill ?? O, n = P(s(e.idx));
244
- return n[3] = !e.dimmed && A(e.x, e.y, this.polygons) ? 1 : 0.4, W(n, n);
247
+ const s = this.aesGetters.dotFill ?? I, n = F(s(e.idx));
248
+ return n[3] = !e.dimmed && D(e.x, e.y, this.polygons) ? 1 : 0.4, P(n, n);
245
249
  }), this.renderWebglLayer());
246
250
  }
247
251
  createQuadtree(t) {
248
- const e = new lt(t.length, 512);
252
+ const e = new nt(t.length, 512);
249
253
  for (let s = 0; s < t.length; s++)
250
254
  e.add(t[s].x, t[s].y);
251
255
  return e.finish();
@@ -254,19 +258,19 @@ class oe {
254
258
  var s, n;
255
259
  const a = (s = this.tools) == null ? void 0 : s.qt;
256
260
  if (!a) return null;
257
- const d = this.allDots, u = this.scales.x.invert(t), p = this.scales.y.invert(e), f = 1 / (((n = this.zoomTransform) == null ? void 0 : n.k) || 1), v = u - f, c = u + f, r = p - f, g = p + f, o = a.range(v, r, c, g), y = o.reduce((m, i) => {
261
+ const d = this.allDots, u = this.scales.x.invert(t), p = this.scales.y.invert(e), f = 1 / (((n = this.zoomTransform) == null ? void 0 : n.k) || 1), S = u - f, c = u + f, o = p - f, g = p + f, r = a.range(S, o, c, g), y = r.reduce((m, i) => {
258
262
  const l = d[i], x = this.scales.x(l.x) - t, z = this.scales.y(l.y) - e, C = Math.hypot(x, z);
259
263
  return (m === null || C < m.distance) && (m.index = i, m.distance = C), m;
260
264
  }, {
261
265
  index: -1,
262
266
  distance: 1 / 0
263
267
  });
264
- return o.length === 0 || y.index === -1 ? null : d[y.index];
268
+ return r.length === 0 || y.index === -1 ? null : d[y.index];
265
269
  }
266
270
  updateDots(t) {
267
271
  this.tools !== null && (N(this.canvasNode).datum(t), this.tools.fillColor.data(t), this.tools.qt = this.createQuadtree(t), this.allDots = t);
268
272
  }
269
- render(t, e, s, n, a, d, u, p, f, v, c, r, g) {
273
+ render(t, e, s, n, a, d, u, p, f, S, c, o, g) {
270
274
  if (this.dataFrame = t, this.tools === null)
271
275
  this.initSettings(
272
276
  a,
@@ -274,13 +278,13 @@ class oe {
274
278
  d,
275
279
  f,
276
280
  p,
277
- v
281
+ S
278
282
  );
279
283
  else {
280
- const { title: o, legend: y, size: m } = s;
281
- this.updateChartSizes(m), this.updateLegendSize(y, f, v, p), this.createMainTitle(o), this.updateMargins(), this.updateAes(f, p);
284
+ const { title: r, legend: y, size: m } = s;
285
+ this.updateChartSizes(m), this.updateLegendSize(y, f, S, p), this.createMainTitle(r), this.updateMargins(), this.updateAes(f, p);
282
286
  }
283
- this.onPolygonUpdateOutside = c, this.onTooltipHintSwitch = r, this.onLassoControlsStateUpdate = g, this.allDots !== a && (this.updateDots(a), this.visibleLabels = this.computeLabels(a)), this.notCalculatedProps = {
287
+ this.onPolygonUpdateOutside = c, this.onTooltipHintSwitch = o, this.onLassoControlsStateUpdate = g, this.allDots !== a && (this.updateDots(a), this.visibleLabels = this.computeLabels(a)), this.notCalculatedProps = {
284
288
  settingsId: e,
285
289
  chartSettings: s,
286
290
  keyColumn: n,
@@ -316,29 +320,29 @@ class oe {
316
320
  onTooltipHintSwitch: this.onTooltipHintSwitch,
317
321
  onLassoControlsStateUpdate: this.onLassoControlsStateUpdate
318
322
  };
319
- this.svgLayerComponent = /* @__PURE__ */ b.jsx(nt, { dataFrame: this.dataFrame, children: /* @__PURE__ */ b.jsx(at, { ...e }) }), (t = this.reactRoot) == null || t.render(this.svgLayerComponent);
323
+ this.svgLayerComponent = /* @__PURE__ */ b.jsx(ht, { dataFrame: this.dataFrame, children: /* @__PURE__ */ b.jsx(ot, { ...e }) }), (t = this.reactRoot) == null || t.render(this.svgLayerComponent);
320
324
  }
321
325
  renderError(t) {
322
326
  var e;
323
- (e = this.reactRoot) == null || e.render(/* @__PURE__ */ b.jsx(Y, { message: t }));
327
+ (e = this.reactRoot) == null || e.render(/* @__PURE__ */ b.jsx(Q, { message: t }));
324
328
  }
325
329
  computeLabels(t) {
326
- const e = new G("16px Manrope"), s = et(this.chartSizes.chartWidth, this.chartSizes.chartHeight), n = [];
330
+ const e = new G("16px Manrope"), s = st(this.chartSizes.chartWidth, this.chartSizes.chartHeight), n = [];
327
331
  for (let a = 0; a < t.length; a++) {
328
332
  const d = t[a];
329
333
  if (d.label == null)
330
334
  continue;
331
- const u = String(d.label), p = e.getTextMetrics(u), f = this.scales.x(d.x), v = this.scales.y(d.y), c = p.width, r = p.actualBoundingBoxAscent + p.actualBoundingBoxDescent, g = 10, o = s(f, v, c, r, g);
332
- o && n.push({
335
+ const u = String(d.label), p = e.getTextMetrics(u), f = this.scales.x(d.x), S = this.scales.y(d.y), c = p.width, o = p.actualBoundingBoxAscent + p.actualBoundingBoxDescent, g = 10, r = s(f, S, c, o, g);
336
+ r && n.push({
333
337
  x: f,
334
- y: v,
338
+ y: S,
335
339
  dot: d,
336
340
  name: u,
337
341
  width: c,
338
- height: r,
342
+ height: o,
339
343
  padding: g,
340
- xPosition: o[0],
341
- yPosition: o[1]
344
+ xPosition: r[0],
345
+ yPosition: r[1]
342
346
  });
343
347
  }
344
348
  return n;
@@ -351,6 +355,6 @@ class oe {
351
355
  }
352
356
  }
353
357
  export {
354
- oe as default
358
+ re as default
355
359
  };
356
360
  //# sourceMappingURL=ChartRenderer.js.map