@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
package/README.md
CHANGED
|
@@ -4,14 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
### Install ###
|
|
6
6
|
|
|
7
|
-
`
|
|
7
|
+
`pnpm install`
|
|
8
8
|
|
|
9
9
|
### Build and install locally ###
|
|
10
10
|
|
|
11
|
-
`
|
|
11
|
+
`pnpm run build && pnpm do-pack`
|
|
12
12
|
|
|
13
|
-
This command will generate a .tgz file at the directory's root
|
|
13
|
+
This command will generate a .tgz file at the directory's root: ./package.tgz
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
It can be installed in another project using 'overrides' in package.json:
|
|
16
|
+
```
|
|
17
|
+
"pnpm": {
|
|
18
|
+
"overrides": {
|
|
19
|
+
"@milaboratories/miplots4": "/path/to/folder/visualizations/packages/miplots4/package.tgz"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
package/dist/_virtual/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __require as r } from "../node_modules/.pnpm/react-dom@
|
|
1
|
+
import { __require as r } from "../node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js";
|
|
2
2
|
var i = r();
|
|
3
3
|
export {
|
|
4
4
|
i as c
|
package/dist/_virtual/client2.js
CHANGED
package/dist/_virtual/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as t } from "../node_modules/.pnpm/react@
|
|
2
|
+
import { __require as t } from "../node_modules/.pnpm/react@19.2.4/node_modules/react/index.js";
|
|
3
3
|
var e = t();
|
|
4
4
|
const s = /* @__PURE__ */ r(e);
|
|
5
5
|
export {
|
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __require as r } from "../node_modules/.pnpm/react-dom@
|
|
1
|
+
import { __require as r } from "../node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/index.js";
|
|
2
2
|
var o = r();
|
|
3
3
|
export {
|
|
4
4
|
o as r
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-client.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-client.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-server-legacy.browser.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-server.browser.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-jsx-runtime.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __require as r } from "../node_modules/.pnpm/react-dom@
|
|
1
|
+
import { __require as r } from "../node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/server.browser.js";
|
|
2
2
|
var s = r();
|
|
3
3
|
export {
|
|
4
4
|
s
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var W = Object.defineProperty;
|
|
2
|
-
var K = (
|
|
3
|
-
var
|
|
2
|
+
var K = (c, t, e) => t in c ? W(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
3
|
+
var p = (c, t, e) => K(c, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { j as N } from "../_virtual/jsx-runtime.js";
|
|
5
5
|
import { c as P } from "../_virtual/client.js";
|
|
6
6
|
import { Error as v } from "../common/Error.js";
|
|
@@ -11,40 +11,40 @@ import { getChartEdgeSides as U } from "../utils/getChartEdgeSides.js";
|
|
|
11
11
|
import { getContinuousLegendTicks as Y } from "../utils/getContinuousLegendTicks.js";
|
|
12
12
|
import { TextMeasurer as q } from "../utils/TextMeasurer/TextMeasurer.js";
|
|
13
13
|
import { ChartsGroup as J } from "./components/ChartsGroup.js";
|
|
14
|
-
import { MIN_MARGIN as L,
|
|
14
|
+
import { MIN_MARGIN as L, TITLE_LINE as G, LEGEND_OFFSET as O, CHART_SIDE_ELEMENTS as Q, MIN_PADDING as Z } from "./constants.js";
|
|
15
15
|
import { calculateChartSideElementSizes as $ } from "./utils/calculateChartSideElementSizes.js";
|
|
16
16
|
import { calculateSideElementsBBoxes as tt } from "./utils/calculateSideElementsBBoxes.js";
|
|
17
17
|
import { calculateCaptionTails as et } from "./utils/calculateCaptionTails.js";
|
|
18
18
|
import M from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js";
|
|
19
19
|
import w from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js";
|
|
20
|
-
import { sqrt as
|
|
21
|
-
const st = (
|
|
20
|
+
import { sqrt as I } from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/pow.js";
|
|
21
|
+
const st = (c, t) => {
|
|
22
22
|
const e = Math.min(...t), s = Math.max(...t);
|
|
23
23
|
if (e === s) {
|
|
24
|
-
const
|
|
25
|
-
for (let d = 1; d <
|
|
26
|
-
|
|
27
|
-
return
|
|
24
|
+
const r = c % 2 === 0 ? [] : [e];
|
|
25
|
+
for (let d = 1; d < c / 2 + 1; d++)
|
|
26
|
+
r.push(e + d), r.unshift(e - d);
|
|
27
|
+
return r;
|
|
28
28
|
}
|
|
29
|
-
if (
|
|
29
|
+
if (c < 2)
|
|
30
30
|
return [e, s];
|
|
31
|
-
const
|
|
32
|
-
for (let
|
|
33
|
-
i.push(e +
|
|
31
|
+
const l = (s - e) / (c - 1), i = [];
|
|
32
|
+
for (let r = 0; r < c - 1; r++)
|
|
33
|
+
i.push(e + l * r);
|
|
34
34
|
return i.push(s), i;
|
|
35
35
|
};
|
|
36
|
-
function it(
|
|
36
|
+
function it(c, t, e) {
|
|
37
37
|
let s = e;
|
|
38
|
-
return
|
|
38
|
+
return c && (c.colorRange && (s = c.colorRange), c.method === "standardScaling" && (s = [-2, 2]), c.method === "meanNormalization" && (s = [-0.75, 0.75])), st(t, s);
|
|
39
39
|
}
|
|
40
40
|
class At {
|
|
41
41
|
constructor() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
p(this, "reactRoot", null);
|
|
43
|
+
p(this, "parentNode", null);
|
|
44
|
+
p(this, "rootNode", null);
|
|
45
|
+
p(this, "component", /* @__PURE__ */ N.jsx(N.Fragment, {}));
|
|
46
|
+
p(this, "chartsDimensions", {});
|
|
47
|
+
p(this, "chartSizes", {
|
|
48
48
|
chartWidth: b,
|
|
49
49
|
// width of single chart
|
|
50
50
|
chartHeight: H,
|
|
@@ -58,32 +58,32 @@ class At {
|
|
|
58
58
|
totalHeight: H
|
|
59
59
|
// width of all charts in charts height, plus bottom axis, plus top title
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
p(this, "margins", {
|
|
62
62
|
top: L,
|
|
63
63
|
bottom: L,
|
|
64
64
|
left: L,
|
|
65
65
|
right: L
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
p(this, "captionsSizes", {
|
|
68
68
|
xAxisCaptions: 100,
|
|
69
69
|
yAxisCaptions: 100,
|
|
70
70
|
xCaptionTail: 0,
|
|
71
71
|
yCaptionTail: 0
|
|
72
72
|
});
|
|
73
|
-
|
|
73
|
+
p(this, "labelAngles", {
|
|
74
74
|
xAxisLabels: 0,
|
|
75
75
|
yAxisLabels: 0
|
|
76
76
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
p(this, "columnsCount", 1);
|
|
78
|
+
p(this, "rowsCount", 1);
|
|
79
|
+
p(this, "scales", {
|
|
80
80
|
x: M().domain(["null"]).range([1]),
|
|
81
81
|
y: M().domain(["null"]).range([1])
|
|
82
82
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
p(this, "step", { x: 10, y: 10 });
|
|
84
|
+
p(this, "colorScale", w().domain([0, 1]).range(["white", "black"]));
|
|
85
|
+
p(this, "sizeScale", I().domain([0, 1]).range([3, 20]));
|
|
86
|
+
p(this, "legend", {
|
|
87
87
|
width: 0,
|
|
88
88
|
height: 0,
|
|
89
89
|
items: []
|
|
@@ -107,18 +107,18 @@ class At {
|
|
|
107
107
|
right: this.legend.width
|
|
108
108
|
}, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartsHeight, this.legend.height) + this.margins.bottom;
|
|
109
109
|
}
|
|
110
|
-
updateLegendSize(t, e, s,
|
|
110
|
+
updateLegendSize(t, e, s, l) {
|
|
111
111
|
if (!t.show) {
|
|
112
112
|
this.legend = { width: 0, height: 0, items: [] };
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
const i = [],
|
|
115
|
+
const i = [], r = Math.min(
|
|
116
116
|
Math.max(this.chartSizes.chartHeight, B),
|
|
117
117
|
V
|
|
118
|
-
), d = Math.max(this.chartSizes.chartHeight,
|
|
118
|
+
), d = Math.max(this.chartSizes.chartHeight, r), x = { width: 0, height: 0, left: 0, top: 0 }, h = this.colorScale.domain(), g = Y(this.colorScale, [
|
|
119
119
|
h[0],
|
|
120
120
|
h[h.length - 1]
|
|
121
|
-
]), C = e.label ?? e.value, S = w([g[0], g[g.length - 1]], [
|
|
121
|
+
]), C = e.label ?? e.value, S = w([g[0], g[g.length - 1]], [r, 0]);
|
|
122
122
|
i.push({
|
|
123
123
|
id: "colorValue",
|
|
124
124
|
type: "continuous",
|
|
@@ -128,123 +128,123 @@ class At {
|
|
|
128
128
|
title: C,
|
|
129
129
|
...x
|
|
130
130
|
});
|
|
131
|
-
const
|
|
131
|
+
const u = s.label ?? s.value, A = this.sizeScale.ticks(3), f = this.sizeScale.tickFormat(3), m = A.reduce((n, a) => (n[String(a)] = f(a), n), {});
|
|
132
132
|
if (i.push({
|
|
133
133
|
id: "sizeValue",
|
|
134
134
|
type: "size",
|
|
135
|
-
title:
|
|
135
|
+
title: u,
|
|
136
136
|
scale: this.sizeScale,
|
|
137
137
|
values: A,
|
|
138
|
-
labels:
|
|
138
|
+
labels: m,
|
|
139
139
|
...x
|
|
140
140
|
}), !i.length) {
|
|
141
141
|
this.legend = { width: 0, height: 0, items: [] };
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
const y = X(i, d,
|
|
144
|
+
const y = X(i, d, r), E = y.reduce((n, a) => Math.max(n, a.left + a.width), 0) + 2 * O, o = this.chartsDimensions[l[0]].padding;
|
|
145
145
|
this.legend = {
|
|
146
|
-
width:
|
|
146
|
+
width: E,
|
|
147
147
|
height: d + o.top,
|
|
148
148
|
items: y
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
updateCaptionsSize(t, e, s) {
|
|
152
|
-
const
|
|
152
|
+
const l = new q("bold 14px Arial"), { xKeys: i, yKeys: r, xLabels: d, yLabels: x } = t.meta;
|
|
153
153
|
this.labelAngles = {
|
|
154
154
|
xAxisLabels: e.axisLabelsAngle,
|
|
155
155
|
yAxisLabels: s.axisLabelsAngle
|
|
156
156
|
};
|
|
157
157
|
let h = 0, g = 0;
|
|
158
158
|
for (const f of i) {
|
|
159
|
-
const
|
|
160
|
-
|
|
159
|
+
const m = l.getTextWidth(d[f]);
|
|
160
|
+
m > h && (h = m);
|
|
161
161
|
}
|
|
162
|
-
for (const f of
|
|
163
|
-
const
|
|
164
|
-
|
|
162
|
+
for (const f of r) {
|
|
163
|
+
const m = l.getTextWidth(x[f]);
|
|
164
|
+
m > g && (g = m);
|
|
165
165
|
}
|
|
166
166
|
const { xCaptionTail: C, yCaptionTail: S } = et(
|
|
167
167
|
this.labelAngles,
|
|
168
168
|
this.step,
|
|
169
169
|
t,
|
|
170
|
-
|
|
171
|
-
),
|
|
170
|
+
l
|
|
171
|
+
), u = this.labelAngles.xAxisLabels / 180 * Math.PI, A = this.labelAngles.yAxisLabels / 180 * Math.PI;
|
|
172
172
|
this.captionsSizes = {
|
|
173
173
|
xCaptionTail: C,
|
|
174
174
|
yCaptionTail: S,
|
|
175
|
-
xAxisCaptions: h * Math.sin(
|
|
176
|
-
yAxisCaptions: g * Math.sin(A) ||
|
|
175
|
+
xAxisCaptions: h * Math.sin(u) || G,
|
|
176
|
+
yAxisCaptions: g * Math.sin(A) || G
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
updateChartDimensions(t, e, s,
|
|
180
|
-
const i = t.length,
|
|
181
|
-
this.columnsCount = e.nRows ? Math.ceil(i /
|
|
179
|
+
updateChartDimensions(t, e, s, l) {
|
|
180
|
+
const i = t.length, r = Math.min(e.nRows ?? i, i), d = Math.min(e.nCols ?? i, i);
|
|
181
|
+
this.columnsCount = e.nRows ? Math.ceil(i / r) : d, this.rowsCount = Math.ceil(i / this.columnsCount), this.chartsDimensions = {};
|
|
182
182
|
let x = 0, h = 0;
|
|
183
|
-
t.forEach((S,
|
|
184
|
-
const A =
|
|
183
|
+
t.forEach((S, u) => {
|
|
184
|
+
const A = u % this.columnsCount + 1, f = U(u, t.length, this.columnsCount, this.rowsCount), m = this.chartSizes.chartWidth, y = this.chartSizes.chartHeight, T = $(
|
|
185
185
|
s,
|
|
186
|
-
|
|
186
|
+
l,
|
|
187
187
|
this.captionsSizes,
|
|
188
188
|
f,
|
|
189
189
|
t,
|
|
190
190
|
this.step.x,
|
|
191
191
|
this.step.y
|
|
192
192
|
);
|
|
193
|
-
function
|
|
193
|
+
function E(R) {
|
|
194
194
|
return Math.max(
|
|
195
|
-
Q[
|
|
195
|
+
Q[R].reduce((_, D) => _ + T[R][D], 0),
|
|
196
196
|
Z
|
|
197
197
|
);
|
|
198
198
|
}
|
|
199
199
|
const o = {
|
|
200
|
-
left:
|
|
201
|
-
right:
|
|
202
|
-
top:
|
|
203
|
-
bottom:
|
|
200
|
+
left: E("left"),
|
|
201
|
+
right: E("right"),
|
|
202
|
+
top: E("top"),
|
|
203
|
+
bottom: E("bottom")
|
|
204
204
|
};
|
|
205
205
|
o.left < this.captionsSizes.xCaptionTail && (o.left = this.captionsSizes.xCaptionTail), o.bottom < this.captionsSizes.yCaptionTail && (o.bottom = this.captionsSizes.yCaptionTail);
|
|
206
|
-
const n = tt(
|
|
206
|
+
const n = tt(T, m, y), a = m + o.left + o.right, z = y + o.top + o.bottom;
|
|
207
207
|
this.chartsDimensions[S] = {
|
|
208
208
|
left: x,
|
|
209
209
|
top: h,
|
|
210
|
-
inner: { width:
|
|
211
|
-
outer: { width:
|
|
210
|
+
inner: { width: m, height: y },
|
|
211
|
+
outer: { width: a, height: z },
|
|
212
212
|
padding: o,
|
|
213
213
|
sideElementBBoxes: n,
|
|
214
214
|
chartEdgeSides: f
|
|
215
|
-
}, x +=
|
|
215
|
+
}, x += a, A === this.columnsCount && (x = 0, h += z);
|
|
216
216
|
});
|
|
217
|
-
const g = t.slice(0, this.columnsCount).reduce((S,
|
|
217
|
+
const g = t.slice(0, this.columnsCount).reduce((S, u) => S + this.chartsDimensions[u].outer.width, 0), C = t.filter((S, u) => u % this.columnsCount === 0).reduce((S, u) => S + this.chartsDimensions[u].outer.height, 0);
|
|
218
218
|
this.chartSizes.chartsWidth = g, this.chartSizes.chartsHeight = C;
|
|
219
219
|
}
|
|
220
220
|
updateChartsSizes(t, e) {
|
|
221
|
-
const { width: s, height:
|
|
222
|
-
i && (this.chartSizes.chartWidth = t.meta.xKeys.length * i, this.chartSizes.chartHeight = t.meta.yKeys.length * i), s &&
|
|
221
|
+
const { width: s, height: l, cellSize: i } = e;
|
|
222
|
+
i && (this.chartSizes.chartWidth = t.meta.xKeys.length * i, this.chartSizes.chartHeight = t.meta.yKeys.length * i), s && l && (this.chartSizes.chartWidth = s, this.chartSizes.chartHeight = l);
|
|
223
223
|
}
|
|
224
224
|
// update scales for cell positions, x and y for each facet
|
|
225
|
-
updateScales(t, e, s,
|
|
226
|
-
const { width:
|
|
227
|
-
(
|
|
225
|
+
updateScales(t, e, s, l, i) {
|
|
226
|
+
const { width: r, height: d, cellSize: x } = e, { meta: h } = t, g = (o, n = {}) => [...o].sort(
|
|
227
|
+
(a, z) => s.sorting === "asc" ? (n[a] ?? a).localeCompare(n[z] ?? z, "en", { numeric: !0 }) : (n[z] ?? z).localeCompare(n[a] ?? a, "en", { numeric: !0 })
|
|
228
228
|
), C = (o, n = {}) => [...o].sort(
|
|
229
|
-
(
|
|
230
|
-
), S = i.xGroup ? h.xGroupKeys : g(h.xGroupKeys),
|
|
231
|
-
x ? (this.step.x = x, this.step.y = x) :
|
|
232
|
-
const
|
|
233
|
-
this.scales.x = M().domain(
|
|
229
|
+
(a, z) => l.sorting === "asc" ? (n[a] ?? a).localeCompare(n[z] ?? z, "en", { numeric: !0 }) : (n[z] ?? z).localeCompare(n[a] ?? a, "en", { numeric: !0 })
|
|
230
|
+
), S = i.xGroup ? h.xGroupKeys : g(h.xGroupKeys), u = i.yGroup ? h.yGroupKeys : C(h.yGroupKeys), { xKeysByGroups: A, yKeysByGroups: f } = h, m = S.reduce((o, n) => (o = o.concat(g(A[n], h.xLabels)), o), []), y = u.reduce((o, n) => (o = o.concat(C(f[n], h.yLabels)), o), []);
|
|
231
|
+
x ? (this.step.x = x, this.step.y = x) : r && d && (this.step.x = r / m.length, this.step.y = d / y.length);
|
|
232
|
+
const T = new Array(m.length).fill(null).map((o, n) => n * this.step.x), E = new Array(y.length).fill(null).map((o, n) => n * this.step.y);
|
|
233
|
+
this.scales.x = M().domain(m).range(T), this.scales.y = M().domain(y).range(E);
|
|
234
234
|
}
|
|
235
|
-
updateAesScale(t, e, s,
|
|
236
|
-
this.colorScale = w().domain(it(
|
|
235
|
+
updateAesScale(t, e, s, l) {
|
|
236
|
+
this.colorScale = w().domain(it(l, t.colorsList.length, s)).range(t.colorsList), this.sizeScale = I(e, [t.minRadius, t.maxRadius]);
|
|
237
237
|
}
|
|
238
|
-
render(t, e, s,
|
|
239
|
-
var
|
|
240
|
-
const { meta:
|
|
241
|
-
this.updateChartsSizes(i, o), this.updateAesScale(h,
|
|
238
|
+
render(t, e, s, l, i, r, d, x, h, g, C, S) {
|
|
239
|
+
var a;
|
|
240
|
+
const { meta: u, facets: A, meta: { facetKeys: f } } = i, { valueExtent: m } = u, { xAxis: y, yAxis: T, title: E, size: o } = s;
|
|
241
|
+
this.updateChartsSizes(i, o), this.updateAesScale(h, m.sizeValue, m.colorValue, x), this.updateScales(i, o, s.xAxis, s.yAxis, S), this.updateCaptionsSize(i, y, T), this.updateChartDimensions(f, l, y, T), this.updateLegendSize(s.legend, r, d, f), this.updateMargins(E);
|
|
242
242
|
const n = /* @__PURE__ */ N.jsx(F, { dataFrame: t, children: /* @__PURE__ */ N.jsx(
|
|
243
243
|
J,
|
|
244
244
|
{
|
|
245
245
|
aes: h,
|
|
246
246
|
captionsSizes: this.captionsSizes,
|
|
247
|
-
cellsMeta:
|
|
247
|
+
cellsMeta: u,
|
|
248
248
|
columnsCount: this.columnsCount,
|
|
249
249
|
chartsDimensions: this.chartsDimensions,
|
|
250
250
|
chartSettings: s,
|
|
@@ -252,7 +252,7 @@ class At {
|
|
|
252
252
|
sizeScale: this.sizeScale,
|
|
253
253
|
colorScale: this.colorScale,
|
|
254
254
|
facetKeys: f,
|
|
255
|
-
facetSettings:
|
|
255
|
+
facetSettings: l,
|
|
256
256
|
groupedCells: A,
|
|
257
257
|
labelAngles: this.labelAngles,
|
|
258
258
|
legend: this.legend,
|
|
@@ -264,7 +264,7 @@ class At {
|
|
|
264
264
|
onTooltipHintSwitch: C
|
|
265
265
|
}
|
|
266
266
|
) });
|
|
267
|
-
this.component = n, (
|
|
267
|
+
this.component = n, (a = this.reactRoot) == null || a.render(n);
|
|
268
268
|
}
|
|
269
269
|
renderError(t) {
|
|
270
270
|
var e;
|