@milaboratories/miplots4 1.0.169 → 1.0.171
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 +11 -6
- package/dist/_virtual/client.js +1 -1
- package/dist/_virtual/client2.js +2 -2
- package/dist/_virtual/index.js +1 -1
- package/dist/_virtual/index2.js +1 -1
- package/dist/_virtual/jsx-runtime.js +1 -1
- package/dist/_virtual/react-dom-client.development.js +5 -0
- package/dist/_virtual/react-dom-client.development.js.map +1 -0
- package/dist/_virtual/react-dom-client.production.js +5 -0
- package/dist/_virtual/react-dom-client.production.js.map +1 -0
- package/dist/_virtual/{react-dom-server-legacy.browser.production.min.js → react-dom-server-legacy.browser.production.js} +1 -1
- package/dist/_virtual/react-dom-server-legacy.browser.production.js.map +1 -0
- package/dist/_virtual/react-dom-server.browser.production.js +5 -0
- package/dist/_virtual/react-dom-server.browser.production.js.map +1 -0
- package/dist/_virtual/react-dom.production.js +5 -0
- package/dist/_virtual/react-dom.production.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.production.js +5 -0
- package/dist/_virtual/react-jsx-runtime.production.js.map +1 -0
- package/dist/_virtual/react.production.js +5 -0
- package/dist/_virtual/react.production.js.map +1 -0
- package/dist/_virtual/scheduler.production.js +5 -0
- package/dist/_virtual/scheduler.production.js.map +1 -0
- package/dist/_virtual/server.browser.js +1 -1
- package/dist/bubble/ChartRenderer.js +86 -86
- package/dist/bubble/ChartRenderer.js.map +1 -1
- package/dist/bubble/index.js.map +1 -1
- package/dist/common/ErrorBoundary.d.ts +1 -1
- package/dist/dendro/index.js.map +1 -1
- package/dist/discrete/ChartRenderer.js +102 -102
- package/dist/discrete/ChartRenderer.js.map +1 -1
- package/dist/discrete/index.js.map +1 -1
- package/dist/heatmap/ChartRenderer.js +121 -121
- package/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/heatmap/index.js.map +1 -1
- package/dist/histogram/ChartRenderer.js +73 -73
- package/dist/histogram/ChartRenderer.js.map +1 -1
- package/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +17062 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +9790 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6245 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4106 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6763 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4655 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.production.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.development.js +228 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.production.js +148 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.production.js.map +1 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +24 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js.map +1 -0
- package/dist/node_modules/.pnpm/{react-dom@18.3.1_react@18.3.1 → react-dom@19.2.4_react@19.2.4}/node_modules/react-dom/index.js +1 -1
- package/dist/node_modules/.pnpm/{react-dom@18.3.1_react@18.3.1 → react-dom@19.2.4_react@19.2.4}/node_modules/react-dom/index.js.map +1 -1
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/server.browser.js +16 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/server.browser.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js +246 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js +36 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js +865 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js +373 -0
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js.map +1 -0
- package/dist/node_modules/.pnpm/{react@18.3.1 → react@19.2.4}/node_modules/react/index.js +1 -1
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{react@18.3.1 → react@19.2.4}/node_modules/react/jsx-runtime.js +3 -3
- package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js.map +1 -0
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +237 -0
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js.map +1 -0
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +234 -0
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js.map +1 -0
- package/dist/node_modules/.pnpm/{scheduler@0.23.2 → scheduler@0.27.0}/node_modules/scheduler/index.js +1 -1
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js.map +1 -0
- package/dist/scatterplot/ChartRenderer.js +96 -96
- package/dist/scatterplot/ChartRenderer.js.map +1 -1
- package/dist/scatterplot/index.js.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.js +99 -99
- package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/package.json +7 -5
- package/dist/_virtual/react-dom-server-legacy.browser.production.min.js.map +0 -1
- package/dist/_virtual/react-dom-server.browser.production.min.js +0 -5
- package/dist/_virtual/react-dom-server.browser.production.min.js.map +0 -1
- package/dist/_virtual/react-dom.production.min.js +0 -5
- package/dist/_virtual/react-dom.production.min.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.min.js +0 -5
- package/dist/_virtual/react-jsx-runtime.production.min.js.map +0 -1
- package/dist/_virtual/react.production.min.js +0 -5
- package/dist/_virtual/react.production.min.js.map +0 -1
- package/dist/_virtual/scheduler.production.min.js +0 -5
- package/dist/_virtual/scheduler.production.min.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -3622
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0 -1235
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -3601
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.development.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -1256
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js +0 -13457
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js +0 -5177
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js +0 -33
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js.map +0 -1
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/server.browser.js +0 -16
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/server.browser.js.map +0 -1
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +0 -605
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js.map +0 -1
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -29
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js.map +0 -1
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js +0 -1274
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js.map +0 -1
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js +0 -209
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js.map +0 -1
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js.map +0 -1
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js.map +0 -1
- package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.development.js +0 -278
- package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.development.js.map +0 -1
- package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js +0 -214
- package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js.map +0 -1
- package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/index.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var st = Object.defineProperty;
|
|
2
2
|
var ot = (a, t, i) => t in a ? st(a, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[t] = i;
|
|
3
|
-
var
|
|
3
|
+
var S = (a, t, i) => ot(a, typeof t != "symbol" ? t + "" : t, i);
|
|
4
4
|
import { j as v } from "../_virtual/jsx-runtime.js";
|
|
5
5
|
import { c as nt } from "../_virtual/client.js";
|
|
6
6
|
import { Error as at } from "../common/Error.js";
|
|
@@ -20,17 +20,17 @@ import { getContinuousColorScale as gt } from "../utils/getContinuousColorScale.
|
|
|
20
20
|
import { getContinuousLegendTicks as ft } from "../utils/getContinuousLegendTicks.js";
|
|
21
21
|
import { TextMeasurer as Tt } from "../utils/TextMeasurer/TextMeasurer.js";
|
|
22
22
|
import { ChartsGroup as Ct } from "./components/ChartsGroup.js";
|
|
23
|
-
import { MIN_MARGIN as D, PADDINGS as P, DEFAULT_DOT_AES as A, LEGEND_OFFSET as
|
|
23
|
+
import { MIN_MARGIN as D, PADDINGS as P, DEFAULT_DOT_AES as A, LEGEND_OFFSET as Et, TICK_OFFSET as F, DEFAULT_TICKS_SIZE as Q, MIN_PADDING as U, FACET_TITLE_OFFSET as Mt, TITLE_LINE as O, FACET_AXIS_OFFSET as Z } from "./constants.js";
|
|
24
24
|
import { createAesGetter as Y } from "./utils/createAesGetter.js";
|
|
25
|
-
import { getTicksAndFormat as
|
|
25
|
+
import { getTicksAndFormat as xt } from "./utils/getTicksAndFormat.js";
|
|
26
26
|
import { isContinuousAxis as $ } from "./utils/isNumericScale.js";
|
|
27
27
|
import { createMultilineDiscreteLabels as J } from "../utils/createMultilineDiscreteLabels.js";
|
|
28
28
|
import { measureMultilineDiscreteLabels as k } from "../utils/measureMultilineDiscreteLabels.js";
|
|
29
29
|
import B from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js";
|
|
30
30
|
import { point as y } from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js";
|
|
31
31
|
import K from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/log.js";
|
|
32
|
-
import
|
|
33
|
-
import
|
|
32
|
+
import St from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js";
|
|
33
|
+
import bt from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/symlog.js";
|
|
34
34
|
import { sqrt as Nt } from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/pow.js";
|
|
35
35
|
function tt(a, t) {
|
|
36
36
|
if (a === void 0)
|
|
@@ -46,13 +46,13 @@ function zt(a, t, i, s) {
|
|
|
46
46
|
const e = [];
|
|
47
47
|
return a % i === i - 1 && e.push("right"), a % i === 0 && e.push("left"), a < i && e.push("top"), (Math.ceil((a + 1) / i) === s || Math.ceil((a + 1) / i) === s - 1 && a % i > (t - 1) % i) && e.push("bottom"), e;
|
|
48
48
|
}
|
|
49
|
-
function wt(a, t, i, s, e, o, f, T,
|
|
50
|
-
const
|
|
49
|
+
function wt(a, t, i, s, e, o, f, T, x, d) {
|
|
50
|
+
const I = a.scale === "discrete", w = t.scale === "discrete", h = o.includes("left") || !(d != null && d.sharedY), n = o.includes("left") && t.title !== "", r = o.includes("bottom") || !(d != null && d.sharedX), g = o.includes("bottom") && a.title !== "", E = t.hiddenLabels ? 0 : w ? i.leftAxisCaptionsWidthByColumns[T] + 2 * F : i.yAxisCaptionsWidth + 2 * F, l = (t.showTicks ? Q : 0) + F, m = n ? O : 0, C = a.hiddenLabels ? 0 : I ? i.bottomAxisCaptionsWidthByRows[f] + 2 * F : i.xAxisCaptionsWidth + 2 * F, M = a.showTicks ? Q : 0, H = g ? O : 0, p = E + l + m + Z, c = C + M + H + Z, W = Math.max(...s.map((u) => e[u].length));
|
|
51
51
|
return {
|
|
52
52
|
left: h ? p : U,
|
|
53
|
-
top:
|
|
53
|
+
top: W === 0 ? 0 : Mt * 2 + W * pt,
|
|
54
54
|
bottom: r ? c + 8 : U,
|
|
55
|
-
right:
|
|
55
|
+
right: x ? 0 : U
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
function Wt(a, t, i) {
|
|
@@ -76,24 +76,24 @@ function Lt(a, t, i, s) {
|
|
|
76
76
|
trendColor: Y(a, t, (s == null ? void 0 : s.color) ?? A.color, "fillColor")
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const Rt = Math.cos(Math.PI / 4), _t = 5;
|
|
80
80
|
function it(a, t) {
|
|
81
|
-
return t.scale === "discrete" ? t.labelsPosition === "90deg" ? a : t.labelsPosition === "45deg" ? a *
|
|
81
|
+
return t.scale === "discrete" ? t.labelsPosition === "90deg" ? a : t.labelsPosition === "45deg" ? a * Rt + (a > 0 ? 2 * _t : 0) : O : Math.max(a, O);
|
|
82
82
|
}
|
|
83
83
|
class ci {
|
|
84
84
|
constructor() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
S(this, "reactRoot", null);
|
|
86
|
+
S(this, "parentNode", null);
|
|
87
|
+
S(this, "rootNode", null);
|
|
88
|
+
S(this, "component", /* @__PURE__ */ v.jsx(v.Fragment, {}));
|
|
89
|
+
S(this, "margins", {
|
|
90
90
|
top: D,
|
|
91
91
|
bottom: D,
|
|
92
92
|
left: D,
|
|
93
93
|
right: D
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
S(this, "chartsDimensions", {});
|
|
96
|
+
S(this, "chartSizes", {
|
|
97
97
|
chartWidth: G,
|
|
98
98
|
// width of single chart
|
|
99
99
|
chartHeight: X,
|
|
@@ -107,13 +107,13 @@ class ci {
|
|
|
107
107
|
totalHeight: X
|
|
108
108
|
// width of all charts in charts height, plus bottom axis, plus top title
|
|
109
109
|
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
S(this, "columnsCount", 1);
|
|
111
|
+
S(this, "rowsCount", 1);
|
|
112
|
+
S(this, "scales", {
|
|
113
113
|
x: { null: B().domain([0, 1]).range([0, G]) },
|
|
114
114
|
y: { null: B().domain([0, 1]).range([X, 0]) }
|
|
115
115
|
});
|
|
116
|
-
|
|
116
|
+
S(this, "captionsSizes", {
|
|
117
117
|
xAxisCaptionsWidth: 30,
|
|
118
118
|
yAxisCaptionsWidth: 100,
|
|
119
119
|
bottomAxisCaptionsWidthByRows: [],
|
|
@@ -121,13 +121,13 @@ class ci {
|
|
|
121
121
|
bottomCaptionsTail: 0,
|
|
122
122
|
leftCaptionsTail: 0
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
S(this, "facetTitles", {});
|
|
125
125
|
// can be multiline
|
|
126
|
-
|
|
126
|
+
S(this, "mainTitle", []);
|
|
127
127
|
// can be multiline
|
|
128
|
-
|
|
128
|
+
S(this, "discreteAxesLabels", { x: {}, y: {} });
|
|
129
129
|
// only for discrete axes, by facets, can be multiline
|
|
130
|
-
|
|
130
|
+
S(this, "legend", { width: 0, height: 0, items: [] });
|
|
131
131
|
}
|
|
132
132
|
clear() {
|
|
133
133
|
var t;
|
|
@@ -144,10 +144,10 @@ class ci {
|
|
|
144
144
|
}
|
|
145
145
|
updateChartDimensions(t, i, s, e) {
|
|
146
146
|
const { chartWidth: o, chartHeight: f } = this.chartSizes;
|
|
147
|
-
let T = 0,
|
|
147
|
+
let T = 0, x = 0;
|
|
148
148
|
const d = Wt(t, this.rowsCount, this.columnsCount);
|
|
149
149
|
this.chartsDimensions = t.reduce((h, n, r) => {
|
|
150
|
-
const [g,
|
|
150
|
+
const [g, E] = It(r, this.columnsCount), l = zt(r, t.length, this.columnsCount, this.rowsCount), m = wt(
|
|
151
151
|
s,
|
|
152
152
|
e,
|
|
153
153
|
this.captionsSizes,
|
|
@@ -155,62 +155,62 @@ class ci {
|
|
|
155
155
|
this.facetTitles,
|
|
156
156
|
l,
|
|
157
157
|
g,
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
E,
|
|
159
|
+
E === this.columnsCount - 1,
|
|
160
160
|
i
|
|
161
|
-
), C = o + m.left + m.right,
|
|
161
|
+
), C = o + m.left + m.right, M = f + m.top + m.bottom;
|
|
162
162
|
return h[n] = {
|
|
163
163
|
left: T,
|
|
164
|
-
top:
|
|
164
|
+
top: x,
|
|
165
165
|
chartEdgeSides: l,
|
|
166
166
|
padding: m,
|
|
167
167
|
inner: { width: o, height: f },
|
|
168
|
-
outer: { width: C, height:
|
|
169
|
-
}, T += C,
|
|
168
|
+
outer: { width: C, height: M }
|
|
169
|
+
}, T += C, E === this.columnsCount - 1 && (T = 0, x += M), h;
|
|
170
170
|
}, {});
|
|
171
|
-
const
|
|
171
|
+
const I = Math.max(
|
|
172
172
|
...t.map((h) => this.chartsDimensions[h].outer.width + this.chartsDimensions[h].left)
|
|
173
|
-
),
|
|
173
|
+
), w = Math.max(
|
|
174
174
|
...t.map((h) => this.chartsDimensions[h].outer.height + this.chartsDimensions[h].top)
|
|
175
175
|
);
|
|
176
|
-
this.chartSizes.chartsWidth =
|
|
176
|
+
this.chartSizes.chartsWidth = I, this.chartSizes.chartsHeight = w;
|
|
177
177
|
}
|
|
178
|
-
updateViewport(t, i, s, e, o, f, T,
|
|
179
|
-
const d = t.length,
|
|
180
|
-
this.columnsCount = i.nRows ? Math.ceil(d /
|
|
178
|
+
updateViewport(t, i, s, e, o, f, T, x) {
|
|
179
|
+
const d = t.length, I = Math.min(i.nRows ?? d, d), w = Math.min(i.nCols ?? d, d);
|
|
180
|
+
this.columnsCount = i.nRows ? Math.ceil(d / I) : w, this.rowsCount = Math.ceil(d / this.columnsCount);
|
|
181
181
|
let [h, n] = [1 / 0, -1 / 0], [r, g] = [1 / 0, -1 / 0];
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
return h = Math.min(h, u), r = Math.min(r,
|
|
182
|
+
const E = t.reduce((p, c) => {
|
|
183
|
+
const W = T[c], { minX: u, minY: b, maxX: N, maxY: z } = W;
|
|
184
|
+
return h = Math.min(h, u), r = Math.min(r, b), n = Math.max(n, N), g = Math.max(g, z), p[c] = { minX: u, maxX: N, minY: b, maxY: z }, p;
|
|
185
185
|
}, {}), l = {}, m = {};
|
|
186
|
-
let C = !1,
|
|
186
|
+
let C = !1, M = !1;
|
|
187
187
|
t.forEach((p) => {
|
|
188
188
|
let c;
|
|
189
189
|
if (!$(s))
|
|
190
190
|
c = y().range([0, this.chartSizes.chartWidth]).domain(o.keys ?? []).padding(0.5);
|
|
191
191
|
else {
|
|
192
192
|
c = s.scale === "log" ? K() : B();
|
|
193
|
-
const u =
|
|
194
|
-
let
|
|
193
|
+
const u = E[p];
|
|
194
|
+
let b = s.lowerValue ? Number(s.lowerValue) : i.sharedX ? h : u.minX, N = s.upperValue ? Number(s.upperValue) : i.sharedX ? n : u.maxX;
|
|
195
195
|
if (typeof s.symmetricRange < "u") {
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
const
|
|
199
|
-
|
|
196
|
+
const R = s.symmetricRange;
|
|
197
|
+
if (R >= b && R <= N) {
|
|
198
|
+
const _ = Math.max(R - b, N - R);
|
|
199
|
+
b = R - _, N = R + _;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
const
|
|
203
|
-
c.domain([L.invert(0), L.invert(this.chartSizes.chartWidth)]).range(
|
|
202
|
+
const z = [0, this.chartSizes.chartWidth], L = c.copy().domain([b, N]).range([P.LEFT, this.chartSizes.chartWidth - P.RIGHT]);
|
|
203
|
+
c.domain([L.invert(0), L.invert(this.chartSizes.chartWidth)]).range(z).nice();
|
|
204
204
|
}
|
|
205
|
-
const
|
|
206
|
-
l[p] = c, C = C || tt(
|
|
205
|
+
const W = this.scales.x[p];
|
|
206
|
+
l[p] = c, C = C || tt(W, c);
|
|
207
207
|
});
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
return p[c] =
|
|
211
|
-
(u,
|
|
212
|
-
const N =
|
|
213
|
-
return u.minY = Math.min(u.minY, isNaN(
|
|
208
|
+
const H = t.reduce((p, c) => {
|
|
209
|
+
const W = x ? x[c] : [];
|
|
210
|
+
return p[c] = W.reduce(
|
|
211
|
+
(u, b) => {
|
|
212
|
+
const N = b.bounded ? b.xBounds : this.scales.x[c].domain(), z = b.getInterval(N[0]), L = b.getInterval(N[1]);
|
|
213
|
+
return u.minY = Math.min(u.minY, isNaN(z.left) ? u.minY : z.left, isNaN(L.left) ? u.minY : L.left), u.maxY = Math.max(u.maxY, isNaN(z.right) ? u.maxY : z.right, isNaN(L.right) ? u.maxY : L.right), u;
|
|
214
214
|
},
|
|
215
215
|
{ minY: 1 / 0, maxY: -1 / 0 }
|
|
216
216
|
), r = Math.min(r, p[c].minY), g = Math.max(g, p[c].maxY), p;
|
|
@@ -221,28 +221,28 @@ class ci {
|
|
|
221
221
|
c = y().range([this.chartSizes.chartHeight, 0]).domain(f.keys ?? []).padding(0.5);
|
|
222
222
|
else {
|
|
223
223
|
c = e.scale === "log" ? K() : B();
|
|
224
|
-
const u =
|
|
225
|
-
let N = e.lowerValue ? Number(e.lowerValue) : i.sharedY ? r : Math.min(u.minY,
|
|
224
|
+
const u = E[p], b = H[p];
|
|
225
|
+
let N = e.lowerValue ? Number(e.lowerValue) : i.sharedY ? r : Math.min(u.minY, b.minY), z = e.upperValue ? Number(e.upperValue) : i.sharedY ? g : Math.max(u.maxY, b.maxY);
|
|
226
226
|
if (typeof e.symmetricRange < "u") {
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
229
|
-
const j = Math.max(
|
|
230
|
-
N =
|
|
227
|
+
const _ = e.symmetricRange;
|
|
228
|
+
if (_ >= N && _ <= z) {
|
|
229
|
+
const j = Math.max(_ - N, z - _);
|
|
230
|
+
N = _ - j, z = _ + j;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
const L = [this.chartSizes.chartHeight, 0],
|
|
234
|
-
c.domain([
|
|
233
|
+
const L = [this.chartSizes.chartHeight, 0], R = c.copy().domain([N, z]).range([this.chartSizes.chartHeight - P.BOTTOM, P.TOP]);
|
|
234
|
+
c.domain([R.invert(this.chartSizes.chartHeight), R.invert(0)]).range(L).nice();
|
|
235
235
|
}
|
|
236
|
-
const
|
|
237
|
-
m[p] = c,
|
|
238
|
-
}), C && (this.scales.x = l),
|
|
236
|
+
const W = this.scales.y[p];
|
|
237
|
+
m[p] = c, M = M || tt(W, c);
|
|
238
|
+
}), C && (this.scales.x = l), M && (this.scales.y = m);
|
|
239
239
|
}
|
|
240
240
|
updateCaptionsSize(t, i, s, e) {
|
|
241
241
|
const o = new Tt("600 14px Manrope");
|
|
242
242
|
function f(n) {
|
|
243
243
|
return Math.max(...n.map((r) => o.getTextWidth(r)));
|
|
244
244
|
}
|
|
245
|
-
let T = 0,
|
|
245
|
+
let T = 0, x = 0, d = [], I = [], w = 0, h = 0;
|
|
246
246
|
if (i.scale === "discrete") {
|
|
247
247
|
const n = k(
|
|
248
248
|
t,
|
|
@@ -255,7 +255,7 @@ class ci {
|
|
|
255
255
|
);
|
|
256
256
|
T = n.xTail, d = n.axisCaptionsWidthByRows;
|
|
257
257
|
} else
|
|
258
|
-
|
|
258
|
+
w = 20;
|
|
259
259
|
if (s.scale === "discrete") {
|
|
260
260
|
const n = k(
|
|
261
261
|
t,
|
|
@@ -266,19 +266,19 @@ class ci {
|
|
|
266
266
|
"horizontal",
|
|
267
267
|
this.scales.y
|
|
268
268
|
);
|
|
269
|
-
|
|
269
|
+
x = n.yTail, I = n.axisCaptionsWidthByColumns;
|
|
270
270
|
} else
|
|
271
271
|
Object.values(this.scales.y).forEach((n) => {
|
|
272
|
-
const { ticks: r, format: g } =
|
|
272
|
+
const { ticks: r, format: g } = xt(n, e);
|
|
273
273
|
h = Math.max(h, f(r.map(g)));
|
|
274
274
|
});
|
|
275
275
|
this.captionsSizes = {
|
|
276
|
-
xAxisCaptionsWidth: i.hiddenLabels ? 0 : it(
|
|
276
|
+
xAxisCaptionsWidth: i.hiddenLabels ? 0 : it(w, i),
|
|
277
277
|
yAxisCaptionsWidth: s.hiddenLabels ? 0 : it(h, s),
|
|
278
278
|
bottomAxisCaptionsWidthByRows: d,
|
|
279
|
-
leftAxisCaptionsWidthByColumns:
|
|
279
|
+
leftAxisCaptionsWidthByColumns: I,
|
|
280
280
|
bottomCaptionsTail: T,
|
|
281
|
-
leftCaptionsTail:
|
|
281
|
+
leftCaptionsTail: x
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
createMainTitle(t, i) {
|
|
@@ -329,7 +329,7 @@ class ci {
|
|
|
329
329
|
const o = [], f = { width: 0, height: 0, left: 0, top: 0 }, T = Math.min(
|
|
330
330
|
Math.max(this.chartSizes.chartHeight, lt),
|
|
331
331
|
ct
|
|
332
|
-
),
|
|
332
|
+
), x = Math.max(this.chartSizes.chartHeight, T);
|
|
333
333
|
if (s.forEach((h) => {
|
|
334
334
|
const n = i[h.value];
|
|
335
335
|
if (n.usedAes.length === 0 || !n.aesMap)
|
|
@@ -344,33 +344,33 @@ class ci {
|
|
|
344
344
|
(m === "dotFill" || m === "lineColor") && (r[l].color = n.aesMap(l, m) ?? et), m === "dotShape" && (r[l].shape = n.aesMap(l, m) ?? "21"), m === "dotSize" && (r[l].size = n.aesMap(l, m) ?? 3);
|
|
345
345
|
});
|
|
346
346
|
});
|
|
347
|
-
const g = h.label ?? h.value,
|
|
348
|
-
o.push({ ...f, id: h.value, type: "dots", title: g, scale:
|
|
347
|
+
const g = h.label ?? h.value, E = St().domain(n.values).range(n.values.map((l) => r[l])).unknown(A);
|
|
348
|
+
o.push({ ...f, id: h.value, type: "dots", title: g, scale: E, values: n.values, labels: n.labels });
|
|
349
349
|
}), e.forEach((h) => {
|
|
350
350
|
if (h.type === "dots" && q(h.aes.dotFill)) {
|
|
351
|
-
const { domain: n, range: r, columnName: g, type:
|
|
352
|
-
o.push({ ...f, id: "dotFill", type: "continuous", title: l, scale: m, tickPositionScale: C, values:
|
|
351
|
+
const { domain: n, range: r, columnName: g, type: E = "linear" } = h.aes.dotFill, l = g.label ?? g.value, m = gt(r, n, "linear"), C = (E === "log" ? bt() : B()).domain(n).range([T, 0]), M = ft(C, n);
|
|
352
|
+
o.push({ ...f, id: "dotFill", type: "continuous", title: l, scale: m, tickPositionScale: C, values: M });
|
|
353
353
|
}
|
|
354
354
|
if (h.type === "dots" && q(h.aes.dotSize)) {
|
|
355
|
-
const { columnName: n, domain: r, range: g } = h.aes.dotSize,
|
|
356
|
-
o.push({ ...f, id: n.value, type: "size", title:
|
|
355
|
+
const { columnName: n, domain: r, range: g } = h.aes.dotSize, E = n.label ?? n.value, l = Nt(r, g), m = l.ticks(3), C = l.tickFormat(3), M = m.reduce((H, p) => (H[String(p)] = C(p), H), {});
|
|
356
|
+
o.push({ ...f, id: n.value, type: "size", title: E, scale: l, values: m, labels: M });
|
|
357
357
|
}
|
|
358
358
|
}), !o.length) {
|
|
359
359
|
this.legend = { width: 0, height: 0, items: [] };
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
362
|
-
const d = ut(o,
|
|
362
|
+
const d = ut(o, x, T), w = d.reduce((h, n) => Math.max(h, n.left + n.width), 0) + Et;
|
|
363
363
|
this.legend = {
|
|
364
|
-
width:
|
|
365
|
-
height:
|
|
364
|
+
width: w,
|
|
365
|
+
height: x,
|
|
366
366
|
items: d
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
|
-
render(t, i, s, e, o, f, T,
|
|
369
|
+
render(t, i, s, e, o, f, T, x, d, I, w, h, n, r, g, E, l, m) {
|
|
370
370
|
var u;
|
|
371
|
-
const { xAxis: C, yAxis:
|
|
372
|
-
this.updateChartSizes(
|
|
373
|
-
const
|
|
371
|
+
const { xAxis: C, yAxis: M, size: H, title: p, legend: c } = s;
|
|
372
|
+
this.updateChartSizes(H), this.updateViewport(o, e, C, M, E, l, T, x), this.createAxisLabels(o, C, M, E, l), this.updateCaptionsSize(o, C, M, I.y), this.createFacetTitles(o, f), this.updateChartDimensions(o, e, C, M), this.updateLegendSize(c, w, n, r), this.createMainTitle(o, p), this.updateMargins(o);
|
|
373
|
+
const W = /* @__PURE__ */ v.jsx(ht, { dataFrame: t, children: /* @__PURE__ */ v.jsx(
|
|
374
374
|
Ct,
|
|
375
375
|
{
|
|
376
376
|
settingsId: i,
|
|
@@ -381,7 +381,7 @@ class ci {
|
|
|
381
381
|
chartsDimensions: this.chartsDimensions,
|
|
382
382
|
scales: this.scales,
|
|
383
383
|
groupedDots: T,
|
|
384
|
-
trendsData:
|
|
384
|
+
trendsData: x,
|
|
385
385
|
legendData: this.legend,
|
|
386
386
|
columnsCount: this.columnsCount,
|
|
387
387
|
margins: this.margins,
|
|
@@ -389,14 +389,14 @@ class ci {
|
|
|
389
389
|
mainTitle: this.mainTitle,
|
|
390
390
|
facetTitles: this.facetTitles,
|
|
391
391
|
captionsSizes: this.captionsSizes,
|
|
392
|
-
onlyPositive:
|
|
392
|
+
onlyPositive: I,
|
|
393
393
|
layersData: h,
|
|
394
|
-
aesGetters: Lt(t,
|
|
394
|
+
aesGetters: Lt(t, w, r, g),
|
|
395
395
|
onTooltipHintSwitch: m,
|
|
396
396
|
discreteAxesLabels: this.discreteAxesLabels
|
|
397
397
|
}
|
|
398
398
|
) });
|
|
399
|
-
this.component =
|
|
399
|
+
this.component = W, (u = this.reactRoot) == null || u.render(W);
|
|
400
400
|
}
|
|
401
401
|
renderError(t) {
|
|
402
402
|
var i;
|