@pie-lib/graphing-solution-set 4.0.4-next.31 → 4.0.4-next.33
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/dist/_virtual/_rolldown/runtime.js +2 -5
- package/dist/axis/arrow.js +6 -6
- package/dist/axis/axes.js +34 -34
- package/dist/container/index.js +34 -34
- package/dist/container/reducer.js +1 -1
- package/dist/coordinates-label.js +7 -7
- package/dist/graph-with-controls.js +25 -25
- package/dist/graph.js +2 -2
- package/dist/grid-setup.js +64 -64
- package/dist/grid.js +4 -4
- package/dist/index.js +2 -2
- package/dist/labels.js +17 -17
- package/dist/mark-label.js +7 -7
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Axis.js +67 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +66 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Ticks.js +39 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +13 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
- package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickPosition.js +14 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/Grid.js +43 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridColumns.js +46 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridRows.js +46 -0
- package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
- package/dist/node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js +17 -0
- package/dist/node_modules/.bun/@visx_point@4.0.0/node_modules/@visx/point/esm/Point.js +20 -0
- package/dist/node_modules/.bun/{@visx_scale@3.12.0 → @visx_scale@4.0.0}/node_modules/@visx/scale/esm/utils/coerceNumber.js +2 -2
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/getTicks.js +7 -0
- package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Line.js +27 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/Text.js +27 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/hooks/useText.js +68 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/getStringWidth.js +19 -0
- package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/memoize.js +13 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +1 -1
- package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +1 -1
- package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +2 -2
- package/dist/tool-menu.js +23 -23
- package/dist/tools/index.js +1 -1
- package/dist/tools/line/component.js +9 -9
- package/dist/tools/polygon/component.js +4 -4
- package/dist/tools/polygon/index.js +1 -1
- package/dist/tools/polygon/polygon.js +8 -8
- package/dist/tools/shared/line/index.js +1 -1
- package/dist/tools/shared/point/arrow-point.js +1 -1
- package/dist/tools/shared/point/arrow.js +1 -1
- package/dist/tools/shared/point/base-point.js +10 -10
- package/dist/tools/shared/point/index.js +5 -5
- package/dist/undo-redo.js +8 -8
- package/package.json +23 -18
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +0 -101
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +0 -63
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Ticks.js +0 -44
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/constants/orientation.js +0 -9
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +0 -14
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +0 -21
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +0 -16
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +0 -8
- package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/getTickPosition.js +0 -15
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/Grid.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +0 -79
- package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +0 -6
- package/dist/node_modules/.bun/@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js +0 -50
- package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +0 -18
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js +0 -9
- package/dist/node_modules/.bun/@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/toString.js +0 -6
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/shapes/Line.js +0 -47
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js +0 -53
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/Text.js +0 -57
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +0 -91
- package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +0 -21
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js +0 -21
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js +0 -10
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js +0 -9
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +0 -15
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +0 -16
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js +0 -9
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +0 -8
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js +0 -15
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js +0 -19
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js +0 -11
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js +0 -18
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js +0 -16
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +0 -11
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +0 -19
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +0 -9
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js +0 -10
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js +0 -20
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js +0 -11
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js +0 -16
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js +0 -12
- package/dist/node_modules/.bun/lodash@4.17.21/node_modules/lodash/memoize.js +0 -20
- package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +0 -471
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +0 -53
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +0 -51
- package/dist/node_modules/.bun/use-sync-external-store@1.6.0_f4eacebf2041cd4f/node_modules/use-sync-external-store/with-selector.js +0 -10
|
@@ -15,9 +15,6 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
15
15
|
}, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
16
|
value: n,
|
|
17
17
|
enumerable: !0
|
|
18
|
-
}) : a, n))
|
|
19
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
-
});
|
|
18
|
+
}) : a, n));
|
|
22
19
|
//#endregion
|
|
23
|
-
export { o as __commonJSMin, s as __exportAll,
|
|
20
|
+
export { o as __commonJSMin, s as __exportAll, l as __toESM };
|
package/dist/axis/arrow.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import t from "prop-types";
|
|
3
3
|
import { types as n } from "@pie-lib/plot";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
6
|
//#region src/axis/arrow.tsx
|
|
7
|
-
var a =
|
|
7
|
+
var a = i("path")(({ theme: e }) => ({ fill: `var(--arrow-color, ${e.palette.common.black})` })), o = class extends e.Component {
|
|
8
8
|
render() {
|
|
9
|
-
let { x: e, y: t, className: n, scale:
|
|
10
|
-
return o === "left" && (l = u(s - 15, c, 0)), o === "right" && (l = u(s + 15, c, 180)), o === "up" && (l = u(s, c - 15, 90)), o === "down" && (l = u(s, c + 15, 270)), /* @__PURE__ */
|
|
9
|
+
let { x: e, y: t, className: n, scale: i } = this.props, o = this.props.direction || "left", s = i.x(e), c = i.y(t), l = "", u = (e, t, n) => `translate(${e}, ${t}) rotate(${n})`;
|
|
10
|
+
return o === "left" && (l = u(s - 15, c, 0)), o === "right" && (l = u(s + 15, c, 180)), o === "up" && (l = u(s, c - 15, 90)), o === "down" && (l = u(s, c + 15, 270)), /* @__PURE__ */ r(a, {
|
|
11
11
|
d: "m 0,0 8,-5 0,10 -8,-5",
|
|
12
12
|
transform: l,
|
|
13
13
|
className: n
|
|
@@ -31,4 +31,4 @@ o.propTypes = {
|
|
|
31
31
|
direction: "left"
|
|
32
32
|
};
|
|
33
33
|
//#endregion
|
|
34
|
-
export { o as default };
|
|
34
|
+
export { o as Arrow, o as default };
|
package/dist/axis/axes.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/@visx_axis@
|
|
2
|
-
import t from "./arrow.js";
|
|
1
|
+
import e from "../node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Axis.js";
|
|
2
|
+
import { Arrow as t } from "./arrow.js";
|
|
3
3
|
import { amountToIncreaseWidth as n, countWords as r, findLongestWord as i, getTickValues as a } from "../utils.js";
|
|
4
4
|
import o from "react";
|
|
5
5
|
import s from "prop-types";
|
|
6
6
|
import { types as c } from "@pie-lib/plot";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { styled as d } from "@mui/material/styles";
|
|
9
9
|
import * as f from "@pie-lib/render-ui";
|
|
10
10
|
import { Readable as p, color as m } from "@pie-lib/render-ui";
|
|
11
11
|
//#region src/axis/axes.tsx
|
|
@@ -23,7 +23,7 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
23
23
|
right: !0,
|
|
24
24
|
up: !0,
|
|
25
25
|
down: !0
|
|
26
|
-
} }, C =
|
|
26
|
+
} }, C = d("g")(() => ({
|
|
27
27
|
"& .visx-axis-line": {
|
|
28
28
|
stroke: "#8a92c0",
|
|
29
29
|
strokeWidth: 4
|
|
@@ -32,7 +32,7 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
32
32
|
fill: m.defaults.BLACK,
|
|
33
33
|
"& > line": { stroke: "#8a92c0" }
|
|
34
34
|
}
|
|
35
|
-
})), w =
|
|
35
|
+
})), w = d("div")(({ theme: e, centered: t }) => ({
|
|
36
36
|
padding: 0,
|
|
37
37
|
margin: 0,
|
|
38
38
|
"* > *": {
|
|
@@ -42,7 +42,7 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
42
42
|
"& p": { margin: 0 },
|
|
43
43
|
fontSize: e.typography.fontSize,
|
|
44
44
|
...t && { textAlign: "center" }
|
|
45
|
-
})), T =
|
|
45
|
+
})), T = d(t)({ fill: "#8a92c0" }), E = {
|
|
46
46
|
fontFamily: "Roboto",
|
|
47
47
|
fontSize: "14px",
|
|
48
48
|
cursor: "inherit"
|
|
@@ -56,8 +56,8 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
56
56
|
};
|
|
57
57
|
static defaultProps = S;
|
|
58
58
|
render() {
|
|
59
|
-
let { includeArrows: t, graphProps: a, columnTicksValues: o, skipValues: s, distanceFromOriginToFirstNegativeY: c, dy:
|
|
60
|
-
let t = s && s[0] === e ? c + 4 :
|
|
59
|
+
let { includeArrows: t, graphProps: a, columnTicksValues: o, skipValues: s, distanceFromOriginToFirstNegativeY: c, dy: d } = this.props, { scale: f, domain: p, size: m, range: h } = a || {}, g = (e) => {
|
|
60
|
+
let t = s && s[0] === e ? c + 4 : d;
|
|
61
61
|
return {
|
|
62
62
|
...E,
|
|
63
63
|
textAnchor: "middle",
|
|
@@ -66,8 +66,8 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
66
66
|
dy: e === 0 ? -7 : 0
|
|
67
67
|
};
|
|
68
68
|
}, v = r(p.axisLabel), y = n(i(p.axisLabel)) + 2;
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ u(C, { children: [
|
|
70
|
+
/* @__PURE__ */ l(e, {
|
|
71
71
|
scale: f.x,
|
|
72
72
|
top: f.y(0),
|
|
73
73
|
left: 0,
|
|
@@ -78,40 +78,40 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
78
78
|
tickValues: o,
|
|
79
79
|
hideZero: !(p.labelStep || h.labelStep) && p.min <= 0
|
|
80
80
|
}),
|
|
81
|
-
t && t.left && /* @__PURE__ */
|
|
81
|
+
t && t.left && /* @__PURE__ */ l(T, {
|
|
82
82
|
direction: "left",
|
|
83
83
|
x: p.min,
|
|
84
84
|
y: 0,
|
|
85
85
|
scale: f
|
|
86
86
|
}),
|
|
87
|
-
t && t.right && /* @__PURE__ */
|
|
87
|
+
t && t.right && /* @__PURE__ */ l(T, {
|
|
88
88
|
direction: "right",
|
|
89
89
|
x: p.max,
|
|
90
90
|
y: 0,
|
|
91
91
|
scale: f
|
|
92
92
|
}),
|
|
93
|
-
p.axisLabel && /* @__PURE__ */
|
|
93
|
+
p.axisLabel && /* @__PURE__ */ l("foreignObject", {
|
|
94
94
|
x: m.width + 17,
|
|
95
95
|
y: f.y(0) - 9,
|
|
96
96
|
width: y,
|
|
97
97
|
height: 20 * v,
|
|
98
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ l(_, {
|
|
99
99
|
false: !0,
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ l(w, { dangerouslySetInnerHTML: { __html: p.axisLabel } })
|
|
101
101
|
})
|
|
102
102
|
})
|
|
103
103
|
] });
|
|
104
104
|
}
|
|
105
|
-
}, A = class extends o.Component {
|
|
105
|
+
}, A = k, j = class extends o.Component {
|
|
106
106
|
static propTypes = {
|
|
107
107
|
...x,
|
|
108
108
|
graphProps: c.GraphPropsType.isRequired
|
|
109
109
|
};
|
|
110
110
|
static defaultProps = S;
|
|
111
111
|
render() {
|
|
112
|
-
let { includeArrows: t, graphProps: r, skipValues: i, rowTickValues: a } = this.props, { scale: o, range: s, size: c } = r || {},
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
112
|
+
let { includeArrows: t, graphProps: r, skipValues: i, rowTickValues: a } = this.props, { scale: o, range: s, size: c } = r || {}, d = s.axisLabel ? n(s.axisLabel.length) : 0;
|
|
113
|
+
return /* @__PURE__ */ u(C, { children: [
|
|
114
|
+
/* @__PURE__ */ l(e, {
|
|
115
115
|
orientation: "left",
|
|
116
116
|
scale: o.y,
|
|
117
117
|
top: 0,
|
|
@@ -135,26 +135,26 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
135
135
|
tickTextAnchor: "bottom",
|
|
136
136
|
tickValues: a
|
|
137
137
|
}),
|
|
138
|
-
t && t.down && /* @__PURE__ */
|
|
138
|
+
t && t.down && /* @__PURE__ */ l(T, {
|
|
139
139
|
direction: "down",
|
|
140
140
|
x: 0,
|
|
141
141
|
y: s.min,
|
|
142
142
|
scale: o
|
|
143
143
|
}),
|
|
144
|
-
t && t.up && /* @__PURE__ */
|
|
144
|
+
t && t.up && /* @__PURE__ */ l(T, {
|
|
145
145
|
direction: "up",
|
|
146
146
|
x: 0,
|
|
147
147
|
y: s.max,
|
|
148
148
|
scale: o
|
|
149
149
|
}),
|
|
150
|
-
s.axisLabel && /* @__PURE__ */
|
|
151
|
-
x: o.x(0) -
|
|
150
|
+
s.axisLabel && /* @__PURE__ */ l("foreignObject", {
|
|
151
|
+
x: o.x(0) - d / 2,
|
|
152
152
|
y: -33,
|
|
153
|
-
width:
|
|
153
|
+
width: d,
|
|
154
154
|
height: "20",
|
|
155
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ l(_, {
|
|
156
156
|
false: !0,
|
|
157
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ l(w, {
|
|
158
158
|
centered: !0,
|
|
159
159
|
dangerouslySetInnerHTML: { __html: s.axisLabel }
|
|
160
160
|
})
|
|
@@ -162,7 +162,7 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
162
162
|
})
|
|
163
163
|
] });
|
|
164
164
|
}
|
|
165
|
-
}, j = class extends o.Component {
|
|
165
|
+
}, M = j, N = class extends o.Component {
|
|
166
166
|
static propTypes = {
|
|
167
167
|
...x,
|
|
168
168
|
graphProps: c.GraphPropsType.isRequired
|
|
@@ -195,20 +195,20 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
|
|
|
195
195
|
};
|
|
196
196
|
};
|
|
197
197
|
render() {
|
|
198
|
-
let { graphProps: e } = this.props, { domain: t, range: n } = e || {}, { columnTicksValues: r, firstNegativeX: i, distanceFromOriginToFirstNegativeX: a } = this.xValues(), { rowTickValues: o, firstNegativeY: s, distanceFromOriginToFirstNegativeY: c } = this.yValues(),
|
|
199
|
-
return /* @__PURE__ */
|
|
198
|
+
let { graphProps: e } = this.props, { domain: t, range: n } = e || {}, { columnTicksValues: r, firstNegativeX: i, distanceFromOriginToFirstNegativeX: a } = this.xValues(), { rowTickValues: o, firstNegativeY: s, distanceFromOriginToFirstNegativeY: c } = this.yValues(), d = D(i, s, a, c, 6, 25);
|
|
199
|
+
return /* @__PURE__ */ u(C, { children: [n.min <= 0 ? /* @__PURE__ */ l(A, {
|
|
200
200
|
...this.props,
|
|
201
|
-
skipValues:
|
|
201
|
+
skipValues: d,
|
|
202
202
|
columnTicksValues: r,
|
|
203
203
|
distanceFromOriginToFirstNegativeY: c,
|
|
204
204
|
dy: 25
|
|
205
|
-
}) : null, t.min <= 0 ? /* @__PURE__ */
|
|
205
|
+
}) : null, t.min <= 0 ? /* @__PURE__ */ l(M, {
|
|
206
206
|
...this.props,
|
|
207
|
-
skipValues:
|
|
207
|
+
skipValues: d,
|
|
208
208
|
rowTickValues: o,
|
|
209
209
|
distanceFromOriginToFirstNegativeX: a
|
|
210
210
|
}) : null] });
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
213
|
//#endregion
|
|
214
|
-
export { x as AxisPropTypes, j as default };
|
|
214
|
+
export { x as AxisPropTypes, k as RawXAxis, j as RawYAxis, N as default, O as firstNegativeValue, D as sharedValues };
|
package/dist/container/index.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import s from "
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
var m =
|
|
13
|
-
onChangeMarks: (t) => e(
|
|
14
|
-
onUndo: () => e(
|
|
15
|
-
onRedo: () => e(
|
|
16
|
-
onReset: () => e(
|
|
17
|
-
}))(
|
|
1
|
+
import { applyMiddleware as e, createStore as t } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
|
|
2
|
+
import { ActionCreators as n } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
|
|
3
|
+
import r from "./reducer.js";
|
|
4
|
+
import { changeMarks as i } from "./actions.js";
|
|
5
|
+
import { GraphWithControls as a } from "../graph-with-controls.js";
|
|
6
|
+
import { getLastAction as o, lastActionMiddleware as s } from "./middleware.js";
|
|
7
|
+
import c from "react";
|
|
8
|
+
import l from "prop-types";
|
|
9
|
+
import { isEqual as u } from "@pie-element/shared-lodash";
|
|
10
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
11
|
+
import { Provider as f, connect as p } from "react-redux";
|
|
12
|
+
var m = p((e) => ({ marks: e.marks.present }), (e) => ({
|
|
13
|
+
onChangeMarks: (t) => e(i(t)),
|
|
14
|
+
onUndo: () => e(n.undo()),
|
|
15
|
+
onRedo: () => e(n.redo()),
|
|
16
|
+
onReset: () => e(i([]))
|
|
17
|
+
}))(a), h = class extends c.Component {
|
|
18
18
|
static propTypes = {
|
|
19
|
-
onChangeMarks:
|
|
20
|
-
marks:
|
|
19
|
+
onChangeMarks: l.func,
|
|
20
|
+
marks: l.array
|
|
21
21
|
};
|
|
22
|
-
constructor(
|
|
23
|
-
super(
|
|
24
|
-
let
|
|
25
|
-
this.store =
|
|
22
|
+
constructor(n) {
|
|
23
|
+
super(n);
|
|
24
|
+
let i = r();
|
|
25
|
+
this.store = t(i, { marks: n.marks }, e(s)), this.store.subscribe(this.onStoreChange);
|
|
26
26
|
}
|
|
27
27
|
componentDidUpdate(e) {
|
|
28
28
|
let { marks: t } = this.props;
|
|
29
|
-
|
|
29
|
+
u(this.store.getState().marks.present, t) || u(e.marks, t) || t && t.find((e) => e.correctness) || this.store.dispatch(i(t));
|
|
30
30
|
}
|
|
31
31
|
onStoreChange = () => {
|
|
32
|
-
let { marks: e, onChangeMarks: t } = this.props, n = this.store.getState(), r =
|
|
33
|
-
|
|
32
|
+
let { marks: e, onChangeMarks: t } = this.props, n = this.store.getState(), r = o(), i = r.type.includes("UNDO") || r.type.includes("REDO");
|
|
33
|
+
u(n.marks.present, e) || t(n.marks.present, i);
|
|
34
34
|
};
|
|
35
35
|
render() {
|
|
36
|
-
let { onChangeMarks:
|
|
37
|
-
return
|
|
38
|
-
...
|
|
39
|
-
marks:
|
|
40
|
-
disabled:
|
|
41
|
-
}) : /* @__PURE__ */
|
|
36
|
+
let { onChangeMarks: e, marks: t, ...n } = this.props, r = t && t.find((e) => e.correctness);
|
|
37
|
+
return r ? /* @__PURE__ */ d(a, {
|
|
38
|
+
...n,
|
|
39
|
+
marks: t,
|
|
40
|
+
disabled: r
|
|
41
|
+
}) : /* @__PURE__ */ d(f, {
|
|
42
42
|
store: this.store,
|
|
43
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ d(m, { ...n })
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
//#endregion
|
|
48
|
-
export { h as default };
|
|
48
|
+
export { m as GraphContainer, h as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { combineReducers as e } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
|
|
2
2
|
import t from "./marks.js";
|
|
3
|
-
import
|
|
3
|
+
import n from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
|
|
4
4
|
//#region src/container/reducer.ts
|
|
5
5
|
var r = () => e({ marks: n(t, { debug: !1 }) });
|
|
6
6
|
//#endregion
|
|
@@ -2,12 +2,12 @@ import { roundNumber as e } from "./utils.js";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import t from "prop-types";
|
|
4
4
|
import { types as n } from "@pie-lib/plot";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { styled as i } from "@mui/material/styles";
|
|
7
7
|
import { color as a } from "@pie-lib/render-ui";
|
|
8
8
|
import o from "@mui/material/InputBase";
|
|
9
9
|
//#region src/coordinates-label.tsx
|
|
10
|
-
var s =
|
|
10
|
+
var s = i(o)(({ theme: e }) => ({
|
|
11
11
|
fontFamily: e.typography.fontFamily,
|
|
12
12
|
fontSize: e.typography.fontSize,
|
|
13
13
|
borderRadius: "8px",
|
|
@@ -23,15 +23,15 @@ var s = r(o)(({ theme: e }) => ({
|
|
|
23
23
|
left: i.x(t) + 10,
|
|
24
24
|
top: i.y(n) - s
|
|
25
25
|
};
|
|
26
|
-
}, l = ({ x: t, y: n, graphProps:
|
|
26
|
+
}, l = ({ x: t, y: n, graphProps: i }) => {
|
|
27
27
|
let a = `(${e(t)}, ${e(n)})`, o = (a.length || 0) * 6;
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ r(s, {
|
|
29
29
|
style: {
|
|
30
30
|
position: "absolute",
|
|
31
31
|
pointerEvents: "auto",
|
|
32
32
|
width: o,
|
|
33
33
|
padding: 0,
|
|
34
|
-
...c(
|
|
34
|
+
...c(i, t, n, o)
|
|
35
35
|
},
|
|
36
36
|
value: a,
|
|
37
37
|
inputProps: { ariaLabel: "naked" }
|
|
@@ -43,4 +43,4 @@ l.propTypes = {
|
|
|
43
43
|
y: t.number
|
|
44
44
|
};
|
|
45
45
|
//#endregion
|
|
46
|
-
export { l as default };
|
|
46
|
+
export { l as CoordinatesLabel, l as default, c as getLabelPosition };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import e from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
|
-
import t,
|
|
3
|
-
import r from "./tool-menu.js";
|
|
4
|
-
import i from "./undo-redo.js";
|
|
1
|
+
import { clsx as e } from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
|
+
import { Graph as t, graphPropTypes as n } from "./graph.js";
|
|
3
|
+
import { ToolMenu as r } from "./tool-menu.js";
|
|
4
|
+
import { UndoRedo as i } from "./undo-redo.js";
|
|
5
5
|
import { allTools as a, toolsArr as o } from "./tools/index.js";
|
|
6
6
|
import s from "react";
|
|
7
7
|
import c from "prop-types";
|
|
8
8
|
import { isString as l, uniq as u } from "@pie-element/shared-lodash";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import { styled as m } from "@mui/material/styles";
|
|
11
11
|
import { color as h } from "@pie-lib/render-ui";
|
|
12
12
|
import { Accordion as g, AccordionDetails as _, AccordionSummary as v, Typography as y } from "@mui/material";
|
|
13
13
|
import b from "@mui/icons-material/ExpandMore";
|
|
@@ -15,11 +15,11 @@ import b from "@mui/icons-material/ExpandMore";
|
|
|
15
15
|
var x = (e) => o.map((t) => ({
|
|
16
16
|
...t,
|
|
17
17
|
toolbar: !!e.find((e) => e === t.type)
|
|
18
|
-
})) || [], S = (e, t) => t && e && (e.find((e) => e.type === t.type) || {}).toolbar, C = (e) => e.find((e) => e.toolbar), w = (e) => e.filter((e) => !!a.find((t) => t === e.type)), T = (e, t) => t.filter((t) => !!e.find((e) => e === t.type)), E = (e) => o.find((t) => t.type === e) || null, D =
|
|
18
|
+
})) || [], S = (e, t) => t && e && (e.find((e) => e.type === t.type) || {}).toolbar, C = (e) => e.find((e) => e.toolbar), w = (e) => e.filter((e) => !!a.find((t) => t === e.type)), T = (e, t) => t.filter((t) => !!e.find((e) => e === t.type)), E = (e) => o.find((t) => t.type === e) || null, D = m("div")(() => ({
|
|
19
19
|
display: "flex",
|
|
20
20
|
flexDirection: "column",
|
|
21
21
|
width: "min-content"
|
|
22
|
-
})), O =
|
|
22
|
+
})), O = m("div")(() => ({
|
|
23
23
|
display: "flex",
|
|
24
24
|
justifyContent: "space-between",
|
|
25
25
|
padding: "calc(1.25rem - 12px) calc(1.25rem - 12px) 1.25rem",
|
|
@@ -30,33 +30,33 @@ var x = (e) => o.map((t) => ({
|
|
|
30
30
|
padding: "0.25rem .3rem",
|
|
31
31
|
width: "5rem"
|
|
32
32
|
}
|
|
33
|
-
})), k =
|
|
33
|
+
})), k = m(g)(() => ({
|
|
34
34
|
backgroundColor: h.primaryLight(),
|
|
35
35
|
width: "100%",
|
|
36
36
|
boxShadow: "none"
|
|
37
|
-
})), A =
|
|
37
|
+
})), A = m(v)(({ theme: e }) => ({
|
|
38
38
|
padding: `0 ${e.spacing(1)}`,
|
|
39
39
|
minHeight: "32px !important",
|
|
40
40
|
"& .MuiAccordionSummary-content": { margin: "4px 0 !important" }
|
|
41
|
-
})), j =
|
|
41
|
+
})), j = m(_)(({ theme: e }) => ({
|
|
42
42
|
padding: 0,
|
|
43
43
|
marginTop: e.spacing(1),
|
|
44
44
|
display: "flex",
|
|
45
45
|
justifyContent: "space-between"
|
|
46
|
-
})), M =
|
|
46
|
+
})), M = m("div")(() => ({
|
|
47
47
|
display: "flex",
|
|
48
48
|
flexDirection: "column",
|
|
49
49
|
marginTop: ".5rem"
|
|
50
|
-
})), N = ({ children: e, title: t }) => /* @__PURE__ */
|
|
50
|
+
})), N = ({ children: e, title: t }) => /* @__PURE__ */ p(k, {
|
|
51
51
|
square: !0,
|
|
52
52
|
disableGutters: !0,
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
-
expandIcon: /* @__PURE__ */
|
|
55
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ f(A, {
|
|
54
|
+
expandIcon: /* @__PURE__ */ f(b, {}),
|
|
55
|
+
children: /* @__PURE__ */ f(y, {
|
|
56
56
|
variant: "subtitle1",
|
|
57
57
|
children: t
|
|
58
58
|
})
|
|
59
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ f(j, { children: e })]
|
|
60
60
|
});
|
|
61
61
|
N.propTypes = {
|
|
62
62
|
children: c.node,
|
|
@@ -96,31 +96,31 @@ var P = class extends s.Component {
|
|
|
96
96
|
changeCurrentTool = (e, t) => this.setState({ currentTool: t.find((t) => t.type === e) });
|
|
97
97
|
toggleLabelMode = () => this.setState((e) => ({ labelModeEnabled: !e.labelModeEnabled }));
|
|
98
98
|
render() {
|
|
99
|
-
let { currentTool: n, labelModeEnabled: a } = this.state, { axesSettings: o, className: s, coordinatesOnHover: c, collapsibleToolbar:
|
|
99
|
+
let { currentTool: n, labelModeEnabled: a } = this.state, { axesSettings: o, className: s, coordinatesOnHover: c, collapsibleToolbar: m, collapsibleToolbarTitle: h, disabled: g, disabledLabels: _, disabledTitle: v, domain: y, labels: b, labelsPlaceholders: E, onChangeLabels: k, onChangeMarks: A, onChangeTitle: j, onUndo: P, onRedo: F, range: I, size: L, showLabels: R, showPixelGuides: z, showTitle: B, title: V, titlePlaceholder: H, language: U, disableToolbar: W = !1, gssLineData: G, onChangeGssLineData: K, onSolutionSetSelected: q, onCustomReset: J } = this.props, { backgroundMarks: Y, marks: X, toolbarTools: Z } = this.props;
|
|
100
100
|
Z = u(Z || []).filter((e) => !!l(e)) || [], Y = w(Y || []), X = T(Z, X || []), G && G.lineA && X[0] && X[0].type === "line" && (X[0].fill = G.lineA.lineType), G && G.lineB && X[1] && X[1].type === "line" && (X[1].fill = G.lineB.lineType);
|
|
101
101
|
let Q = x(Z);
|
|
102
102
|
(!n || !S(Q, n)) && (n = C(Q));
|
|
103
|
-
let $ = G && /* @__PURE__ */
|
|
103
|
+
let $ = G && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(r, {
|
|
104
104
|
numberOfLines: G.numberOfLines,
|
|
105
105
|
gssLineData: G,
|
|
106
106
|
onChange: K,
|
|
107
107
|
disabled: !!g,
|
|
108
108
|
language: U
|
|
109
|
-
}), !g && /* @__PURE__ */
|
|
109
|
+
}), !g && /* @__PURE__ */ f(M, { children: /* @__PURE__ */ f(i, {
|
|
110
110
|
onUndo: P,
|
|
111
111
|
onRedo: F,
|
|
112
112
|
onReset: J,
|
|
113
113
|
language: U
|
|
114
114
|
}) })] });
|
|
115
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ p(D, {
|
|
116
116
|
className: e(s),
|
|
117
117
|
children: [
|
|
118
|
-
!W && /* @__PURE__ */
|
|
118
|
+
!W && /* @__PURE__ */ f(O, { children: m ? /* @__PURE__ */ f(N, {
|
|
119
119
|
title: h,
|
|
120
120
|
children: $
|
|
121
121
|
}) : $ }),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ f("div", { ref: (e) => this.labelNode = e }),
|
|
123
|
+
/* @__PURE__ */ f(t, {
|
|
124
124
|
axesSettings: o,
|
|
125
125
|
backgroundMarks: Y,
|
|
126
126
|
coordinatesOnHover: c,
|
|
@@ -152,4 +152,4 @@ var P = class extends s.Component {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
//#endregion
|
|
155
|
-
export { P as default };
|
|
155
|
+
export { P as GraphWithControls, P as default, w as filterByValidToolTypes, T as filterByVisibleToolTypes, C as getAvailableTool, x as setToolbarAvailability, S as toolIsAvailable };
|
package/dist/graph.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { areArraysOfObjectsEqual as e, isDuplicatedMark as t } from "./utils.js";
|
|
2
2
|
import n, { AxisPropTypes as r } from "./axis/axes.js";
|
|
3
|
-
import i from "./grid.js";
|
|
3
|
+
import { Grid as i } from "./grid.js";
|
|
4
4
|
import { LabelType as a } from "./labels.js";
|
|
5
5
|
import o from "./bg.js";
|
|
6
6
|
import s from "react";
|
|
@@ -218,4 +218,4 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
|
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
//#endregion
|
|
221
|
-
export { x as default, v as graphPropTypes };
|
|
221
|
+
export { x as Graph, x as default, v as graphPropTypes, b as removeBuildingToolIfCurrentToolDiffers };
|