@pie-lib/graphing 4.0.5-next.33 → 4.0.5-next.35
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 +5 -5
- package/dist/axis/axes.js +29 -29
- package/dist/container/index.js +32 -32
- package/dist/coordinates-label.js +6 -6
- package/dist/graph-with-controls.js +25 -23
- package/dist/grid-setup.js +63 -63
- package/dist/grid.js +3 -3
- package/dist/key-legend.js +38 -38
- package/dist/labels.js +19 -19
- package/dist/mark-label.js +19 -19
- 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_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/LinePath.js +24 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +9 -0
- package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +6 -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/toggle-bar.js +19 -19
- package/dist/tools/circle/bg-circle.js +4 -4
- package/dist/tools/circle/component.js +18 -18
- package/dist/tools/line/component.js +9 -9
- package/dist/tools/polygon/line.js +9 -9
- package/dist/tools/polygon/polygon.js +7 -7
- package/dist/tools/ray/component.js +9 -9
- package/dist/tools/segment/component.js +6 -6
- package/dist/tools/shared/arrow-head.js +17 -17
- package/dist/tools/shared/line/index.d.ts +1 -1
- package/dist/tools/shared/line/index.js +13 -13
- package/dist/tools/shared/line/line-path.js +9 -9
- package/dist/tools/shared/line/with-root-edge.js +5 -5
- package/dist/tools/shared/point/base-point.js +10 -10
- package/dist/tools/shared/point/index.js +10 -10
- package/dist/tools/shared/styles.d.ts +2 -2
- package/dist/tools/shared/styles.js +2 -2
- package/dist/tools/vector/component.js +7 -7
- package/dist/undo-redo.js +9 -9
- package/package.json +14 -14
- 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/esm/shapes/LinePath.js +0 -50
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js +0 -9
- package/dist/node_modules/.bun/@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js +0 -6
- 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.18.1/node_modules/lodash/_Hash.js +0 -21
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_ListCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Map.js +0 -10
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_MapCache.js +0 -21
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Symbol.js +0 -9
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +0 -15
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +0 -16
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_coreJsData.js +0 -9
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +0 -8
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getMapData.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getNative.js +0 -15
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getRawTag.js +0 -19
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_getValue.js +0 -11
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashClear.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashDelete.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashGet.js +0 -18
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashHas.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_hashSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isKeyable.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_isMasked.js +0 -16
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +0 -11
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +0 -19
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +0 -13
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +0 -14
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +0 -9
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_objectToString.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_root.js +0 -10
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/_toSource.js +0 -20
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/eq.js +0 -11
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isFunction.js +0 -16
- package/dist/node_modules/.bun/lodash@4.18.1/node_modules/lodash/isObject.js +0 -12
- package/dist/node_modules/.bun/lodash@4.18.1/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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//#region ../../../node_modules/.bun/@visx+scale@
|
|
1
|
+
//#region ../../../node_modules/.bun/@visx+scale@4.0.0/node_modules/@visx/scale/esm/utils/coerceNumber.js
|
|
2
2
|
function e(e) {
|
|
3
3
|
if ((typeof e == "function" || typeof e == "object" && e) && "valueOf" in e) {
|
|
4
|
-
|
|
4
|
+
let t = e.valueOf();
|
|
5
5
|
if (typeof t == "number") return t;
|
|
6
6
|
}
|
|
7
7
|
return e;
|
package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/getTicks.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region ../../../node_modules/.bun/@visx+scale@4.0.0/node_modules/@visx/scale/esm/utils/getTicks.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = e;
|
|
4
|
+
return "ticks" in n ? n.ticks(t) : n.domain().filter((e, n, r) => t == null || r.length <= t || n % Math.round((r.length - 1) / t) === 0);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __toESM as e } from "../../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_classnames as t } from "../../../../../../classnames@2.5.1/node_modules/classnames/index.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region ../../../node_modules/.bun/@visx+shape@4.0.0+d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Line.js
|
|
5
|
+
var r = /* @__PURE__ */ e(t());
|
|
6
|
+
function i(e) {
|
|
7
|
+
let { from: t = {
|
|
8
|
+
x: 0,
|
|
9
|
+
y: 0
|
|
10
|
+
}, to: i = {
|
|
11
|
+
x: 1,
|
|
12
|
+
y: 1
|
|
13
|
+
}, fill: a = "transparent", className: o, innerRef: s, ...c } = e, l = t.x === i.x || t.y === i.y;
|
|
14
|
+
return /*#__PURE__*/ n("line", {
|
|
15
|
+
ref: s,
|
|
16
|
+
className: (0, r.default)("visx-line", o),
|
|
17
|
+
x1: t.x,
|
|
18
|
+
y1: t.y,
|
|
19
|
+
x2: i.x,
|
|
20
|
+
y2: i.y,
|
|
21
|
+
fill: a,
|
|
22
|
+
shapeRendering: l ? "crispEdges" : "auto",
|
|
23
|
+
...c
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __toESM as e } from "../../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_classnames as t } from "../../../../../../classnames@2.5.1/node_modules/classnames/index.js";
|
|
3
|
+
import { line as n } from "../util/D3ShapeFactories.js";
|
|
4
|
+
import { Fragment as r, jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region ../../../node_modules/.bun/@visx+shape@4.0.0+d84c32d47042070f/node_modules/@visx/shape/esm/shapes/LinePath.js
|
|
6
|
+
var a = /* @__PURE__ */ e(t());
|
|
7
|
+
function o(e) {
|
|
8
|
+
let { children: t, data: o = [], x: s, y: c, fill: l = "transparent", className: u, curve: d, innerRef: f, defined: p = () => !0, ...m } = e, h = n({
|
|
9
|
+
x: s,
|
|
10
|
+
y: c,
|
|
11
|
+
defined: p,
|
|
12
|
+
curve: d
|
|
13
|
+
});
|
|
14
|
+
return t ? /*#__PURE__*/ i(r, { children: t({ path: h }) }) : /*#__PURE__*/ i("path", {
|
|
15
|
+
ref: f,
|
|
16
|
+
className: (0, a.default)("visx-linepath", u),
|
|
17
|
+
d: h(o) || "",
|
|
18
|
+
fill: l,
|
|
19
|
+
strokeLinecap: "round",
|
|
20
|
+
...m
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { o as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { d3_shape_exports as e } from "../../../../../../@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-shape.js";
|
|
2
|
+
import t from "./setNumberOrNumberAccessor.js";
|
|
3
|
+
//#region ../../../node_modules/.bun/@visx+shape@4.0.0+d84c32d47042070f/node_modules/@visx/shape/esm/util/D3ShapeFactories.js
|
|
4
|
+
function n() {
|
|
5
|
+
let { x: n, y: r, defined: i, curve: a } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = (0, e.line)();
|
|
6
|
+
return n && t(o.x, n), r && t(o.y, r), i && o.defined(i), a && o.curve(a), o;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as line };
|
package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/Text.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import e from "./hooks/useText.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region ../../../node_modules/.bun/@visx+text@4.0.0+d84c32d47042070f/node_modules/@visx/text/esm/Text.js
|
|
4
|
+
var n = { overflow: "visible" };
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { dx: i = 0, dy: a = 0, textAnchor: o = "start", innerRef: s, innerTextRef: c, verticalAnchor: l, angle: u, lineHeight: d = "1em", scaleToFit: f = !1, capHeight: p, width: m, ...h } = r, { x: g = 0, fontSize: _ } = h, { wordsByLines: v, startDy: y, transform: b } = e(r);
|
|
7
|
+
return /*#__PURE__*/ t("svg", {
|
|
8
|
+
ref: s,
|
|
9
|
+
x: i,
|
|
10
|
+
y: a,
|
|
11
|
+
fontSize: _,
|
|
12
|
+
style: n,
|
|
13
|
+
children: v.length > 0 ? /*#__PURE__*/ t("text", {
|
|
14
|
+
ref: c,
|
|
15
|
+
transform: b,
|
|
16
|
+
...h,
|
|
17
|
+
textAnchor: o,
|
|
18
|
+
children: v.map((e, n) => /*#__PURE__*/ t("tspan", {
|
|
19
|
+
x: g,
|
|
20
|
+
dy: n === 0 ? y : d,
|
|
21
|
+
children: e.words.join(" ")
|
|
22
|
+
}, n))
|
|
23
|
+
}) : null
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { r as default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __toESM as e } from "../../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_reduce_css_calc as t } from "../../../../../../reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js";
|
|
3
|
+
import n from "../util/getStringWidth.js";
|
|
4
|
+
import { useMemo as r } from "react";
|
|
5
|
+
//#region ../../../node_modules/.bun/@visx+text@4.0.0+d84c32d47042070f/node_modules/@visx/text/esm/hooks/useText.js
|
|
6
|
+
var i = /* @__PURE__ */ e(t());
|
|
7
|
+
function a(e) {
|
|
8
|
+
return typeof e == "number";
|
|
9
|
+
}
|
|
10
|
+
function o(e) {
|
|
11
|
+
return typeof e == "number" && Number.isFinite(e) || typeof e == "string";
|
|
12
|
+
}
|
|
13
|
+
function s(e) {
|
|
14
|
+
let { verticalAnchor: t = "end", scaleToFit: s = !1, angle: c, width: l, lineHeight: u = "1em", capHeight: d = "0.71em", children: f, style: p, ...m } = e, { x: h = 0, y: g = 0 } = m, _ = !o(h) || !o(g), { wordsWithWidth: v, spaceWidth: y } = r(() => ({
|
|
15
|
+
wordsWithWidth: (f == null ? [] : f.toString().split(/(?:(?!\u00A0+)\s+)/)).map((e) => ({
|
|
16
|
+
word: e,
|
|
17
|
+
wordWidth: n(e, p) || 0
|
|
18
|
+
})),
|
|
19
|
+
spaceWidth: n("\xA0", p) || 0
|
|
20
|
+
}), [f, p]), b = r(() => _ ? [] : l || s ? v.reduce((e, t) => {
|
|
21
|
+
let { word: n, wordWidth: r } = t, i = e[e.length - 1];
|
|
22
|
+
if (i && (l == null || s || (i.width || 0) + r + y < l)) i.words.push(n), i.width = i.width || 0, i.width += r + y;
|
|
23
|
+
else {
|
|
24
|
+
let t = {
|
|
25
|
+
words: [n],
|
|
26
|
+
width: r
|
|
27
|
+
};
|
|
28
|
+
e.push(t);
|
|
29
|
+
}
|
|
30
|
+
return e;
|
|
31
|
+
}, []) : [{ words: f == null ? [] : f.toString().split(/(?:(?!\u00A0+)\s+)/) }], [
|
|
32
|
+
_,
|
|
33
|
+
l,
|
|
34
|
+
s,
|
|
35
|
+
f,
|
|
36
|
+
v,
|
|
37
|
+
y
|
|
38
|
+
]);
|
|
39
|
+
return {
|
|
40
|
+
wordsByLines: b,
|
|
41
|
+
startDy: r(() => _ ? "" : t === "start" ? (0, i.default)(`calc(${d})`) : t === "middle" ? (0, i.default)(`calc(${(b.length - 1) / 2} * -${u} + (${d} / 2))`) : (0, i.default)(`calc(${b.length - 1} * -${u})`), [
|
|
42
|
+
_,
|
|
43
|
+
t,
|
|
44
|
+
d,
|
|
45
|
+
b.length,
|
|
46
|
+
u
|
|
47
|
+
]),
|
|
48
|
+
transform: r(() => {
|
|
49
|
+
let e = [];
|
|
50
|
+
if (_) return "";
|
|
51
|
+
if (a(h) && a(g) && a(l) && s && b.length > 0) {
|
|
52
|
+
let t = b[0].width || 1, n = s === "shrink-only" ? Math.min(l / t, 1) : l / t, r = n, i = h - n * h, a = g - r * g;
|
|
53
|
+
e.push(`matrix(${n}, 0, 0, ${r}, ${i}, ${a})`);
|
|
54
|
+
}
|
|
55
|
+
return c && e.push(`rotate(${c}, ${h}, ${g})`), e.length > 0 ? e.join(" ") : "";
|
|
56
|
+
}, [
|
|
57
|
+
_,
|
|
58
|
+
h,
|
|
59
|
+
g,
|
|
60
|
+
l,
|
|
61
|
+
s,
|
|
62
|
+
b,
|
|
63
|
+
c
|
|
64
|
+
])
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { s as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import e from "./memoize.js";
|
|
2
|
+
//#region ../../../node_modules/.bun/@visx+text@4.0.0+d84c32d47042070f/node_modules/@visx/text/esm/util/getStringWidth.js
|
|
3
|
+
var t = "__react_svg_text_measurement_id";
|
|
4
|
+
function n(e, n) {
|
|
5
|
+
if (typeof document > "u") return null;
|
|
6
|
+
try {
|
|
7
|
+
let r = document.getElementById(t);
|
|
8
|
+
if (!r) {
|
|
9
|
+
let e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
10
|
+
e.setAttribute("aria-hidden", "true"), e.style.width = "0", e.style.height = "0", e.style.position = "absolute", e.style.top = "-100%", e.style.left = "-100%", r = document.createElementNS("http://www.w3.org/2000/svg", "text"), r.setAttribute("id", t), e.appendChild(r), document.body.appendChild(e);
|
|
11
|
+
}
|
|
12
|
+
return Object.assign(r.style, n), r.textContent = e, r.getComputedTextLength();
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
var r = e(n, (e, t) => `${e}_${JSON.stringify(t)}`);
|
|
18
|
+
//#endregion
|
|
19
|
+
export { r as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region ../../../node_modules/.bun/@visx+text@4.0.0+d84c32d47042070f/node_modules/@visx/text/esm/util/memoize.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = /* @__PURE__ */ new Map();
|
|
4
|
+
return function() {
|
|
5
|
+
var r = [...arguments];
|
|
6
|
+
let i = t(...r);
|
|
7
|
+
if (n.has(i)) return n.get(i);
|
|
8
|
+
let a = e.apply(this, r);
|
|
9
|
+
return n.set(i, a), a;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as default };
|
package/dist/toggle-bar.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { allTools as e } from "./tools/index.js";
|
|
2
2
|
import t from "react";
|
|
3
3
|
import n from "prop-types";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
6
|
import { color as a } from "@pie-lib/render-ui";
|
|
7
7
|
import o from "@mui/material/Button";
|
|
8
8
|
import { DragProvider as s } from "@pie-lib/drag";
|
|
@@ -11,7 +11,7 @@ import { CSS as u } from "@dnd-kit/utilities";
|
|
|
11
11
|
import { arrayMove as d } from "@dnd-kit/sortable";
|
|
12
12
|
import f from "@pie-lib/translator";
|
|
13
13
|
//#region src/toggle-bar.tsx
|
|
14
|
-
var { translator: p } = f, m =
|
|
14
|
+
var { translator: p } = f, m = i(o, { shouldForwardProp: (e) => !["selected"].includes(e) })(({ selected: e, disabled: t }) => ({
|
|
15
15
|
color: a.text(),
|
|
16
16
|
backgroundColor: a.background(),
|
|
17
17
|
border: `1px solid ${a.buttonBorder()}`,
|
|
@@ -23,12 +23,12 @@ var { translator: p } = f, m = r(o, { shouldForwardProp: (e) => !["selected"].in
|
|
|
23
23
|
backgroundColor: a.disabled()
|
|
24
24
|
}
|
|
25
25
|
})), h = (e) => {
|
|
26
|
-
let { disabled: t, className: n, selected:
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
let { disabled: t, className: n, selected: i, value: a, onClick: o, language: s } = e, c = a.toLowerCase();
|
|
27
|
+
return /* @__PURE__ */ r(m, {
|
|
28
28
|
size: "small",
|
|
29
29
|
disabled: t,
|
|
30
30
|
className: n,
|
|
31
|
-
selected:
|
|
31
|
+
selected: i,
|
|
32
32
|
value: a,
|
|
33
33
|
variant: "outlined",
|
|
34
34
|
onClick: (e) => o({
|
|
@@ -47,14 +47,14 @@ h.propTypes = {
|
|
|
47
47
|
onClick: n.func,
|
|
48
48
|
language: n.string
|
|
49
49
|
};
|
|
50
|
-
var g =
|
|
50
|
+
var g = i("div")(() => ({
|
|
51
51
|
display: "flex",
|
|
52
52
|
flexWrap: "wrap"
|
|
53
|
-
})), _ =
|
|
53
|
+
})), _ = i(h)(({ theme: e }) => ({
|
|
54
54
|
marginRight: e.spacing(.5),
|
|
55
55
|
marginBottom: e.spacing(.5),
|
|
56
56
|
color: a.text()
|
|
57
|
-
})), v =
|
|
57
|
+
})), v = i("div")({ position: "relative" }), y = class extends t.Component {
|
|
58
58
|
static propTypes = {
|
|
59
59
|
className: n.string,
|
|
60
60
|
options: n.arrayOf(n.string),
|
|
@@ -81,22 +81,22 @@ var g = r("div")(() => ({
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
render() {
|
|
84
|
-
let { className: n, disabled:
|
|
85
|
-
return /* @__PURE__ */
|
|
84
|
+
let { className: n, disabled: i, options: a, selectedToolType: o, draggableTools: c, language: l } = this.props;
|
|
85
|
+
return /* @__PURE__ */ r(s, {
|
|
86
86
|
onDragEnd: this.handleDragEnd,
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ r(g, {
|
|
88
88
|
className: n,
|
|
89
89
|
children: (a || []).map((n, a) => {
|
|
90
90
|
if ((e || []).includes(n)) {
|
|
91
91
|
let e = n === o, s = t.createRef();
|
|
92
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ r(b, {
|
|
93
93
|
index: a,
|
|
94
94
|
value: n,
|
|
95
95
|
draggable: c,
|
|
96
96
|
moveTool: this.moveTool,
|
|
97
97
|
toolRef: s,
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
-
disabled:
|
|
98
|
+
children: /* @__PURE__ */ r(_, {
|
|
99
|
+
disabled: i,
|
|
100
100
|
disableRipple: !0,
|
|
101
101
|
onClick: this.select,
|
|
102
102
|
value: n,
|
|
@@ -110,7 +110,7 @@ var g = r("div")(() => ({
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
function b({ children: e, index: t, draggable: n, toolRef:
|
|
113
|
+
function b({ children: e, index: t, draggable: n, toolRef: i, value: a }) {
|
|
114
114
|
let { attributes: o, listeners: s, setNodeRef: d, transform: f, transition: p, isDragging: m } = c({
|
|
115
115
|
id: `tool-${a}-${t}`,
|
|
116
116
|
disabled: !n,
|
|
@@ -127,16 +127,16 @@ function b({ children: e, index: t, draggable: n, toolRef: r, value: a }) {
|
|
|
127
127
|
accepts: ["tool"]
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
-
return /* @__PURE__ */
|
|
130
|
+
return /* @__PURE__ */ r(v, {
|
|
131
131
|
ref: (e) => {
|
|
132
|
-
d(e), h(e),
|
|
132
|
+
d(e), h(e), i?.current && (i.current = e);
|
|
133
133
|
},
|
|
134
134
|
style: {
|
|
135
135
|
transform: u.Transform.toString(f),
|
|
136
136
|
transition: p,
|
|
137
137
|
opacity: m ? .5 : 1
|
|
138
138
|
},
|
|
139
|
-
children: /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */ r("div", {
|
|
140
140
|
...o,
|
|
141
141
|
...s,
|
|
142
142
|
children: e
|
|
@@ -4,8 +4,8 @@ import { correct as r, disabled as i, disabledSecondary as a, incorrect as o, mi
|
|
|
4
4
|
import c from "react";
|
|
5
5
|
import l from "prop-types";
|
|
6
6
|
import { gridDraggable as u, types as d } from "@pie-lib/plot";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
8
|
+
import { styled as p } from "@mui/material/styles";
|
|
9
9
|
import { color as m } from "@pie-lib/render-ui";
|
|
10
10
|
//#region src/tools/circle/bg-circle.tsx
|
|
11
11
|
var h = class extends c.Component {
|
|
@@ -20,7 +20,7 @@ var h = class extends c.Component {
|
|
|
20
20
|
};
|
|
21
21
|
render() {
|
|
22
22
|
let { disabled: e, className: t, correctness: r, x: i, y: a, radius: o, graphProps: s, ...c } = this.props, { scale: l } = s, u = Math.abs(l.x(i + o) - l.x(i)), d = Math.abs(l.y(a + o) - l.y(a));
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ f(_, {
|
|
24
24
|
className: n(t, e && "disabledSecondary", r),
|
|
25
25
|
cx: l.x(i),
|
|
26
26
|
cy: l.y(a),
|
|
@@ -35,7 +35,7 @@ var h = class extends c.Component {
|
|
|
35
35
|
strokeWidth: 3,
|
|
36
36
|
...e("stroke")
|
|
37
37
|
}
|
|
38
|
-
}), _ =
|
|
38
|
+
}), _ = p("ellipse")(() => ({
|
|
39
39
|
fill: "transparent",
|
|
40
40
|
stroke: m.defaults.BLACK,
|
|
41
41
|
strokeWidth: 3,
|
|
@@ -8,12 +8,12 @@ import l from "react";
|
|
|
8
8
|
import u from "prop-types";
|
|
9
9
|
import { isEmpty as d } from "@pie-element/shared-lodash";
|
|
10
10
|
import { types as f } from "@pie-lib/plot";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
import { keyframes as h, styled as g } from "@mui/material/styles";
|
|
13
13
|
import { color as _ } from "@pie-lib/render-ui";
|
|
14
14
|
import v from "react-dom";
|
|
15
15
|
//#region src/tools/circle/component.tsx
|
|
16
|
-
var y = (e) =>
|
|
16
|
+
var y = (e) => h({
|
|
17
17
|
"0%": { opacity: "0.0" },
|
|
18
18
|
"50%": { opacity: e },
|
|
19
19
|
"100%": { opacity: "0.0" }
|
|
@@ -107,49 +107,49 @@ var y = (e) => p({
|
|
|
107
107
|
};
|
|
108
108
|
input = {};
|
|
109
109
|
render() {
|
|
110
|
-
let { from: e, to: t, middle: n, disabled: r, building: s, coordinatesOnHover: c, onDragStart: l, onDragStop: u, onClick: d, correctness: f, graphProps:
|
|
110
|
+
let { from: e, to: t, middle: n, disabled: r, building: s, coordinatesOnHover: c, onDragStart: l, onDragStop: u, onClick: d, correctness: f, graphProps: h, labelNode: g, labelModeEnabled: _ } = this.props, { editingLabel: y } = this.state, x = {
|
|
111
111
|
onDragStart: l,
|
|
112
112
|
onDragStop: u,
|
|
113
|
-
graphProps:
|
|
113
|
+
graphProps: h,
|
|
114
114
|
onClick: d
|
|
115
115
|
};
|
|
116
116
|
t ||= e;
|
|
117
117
|
let C = b(e, t), w = null, T = null, E = null;
|
|
118
|
-
return
|
|
118
|
+
return g && (e?.label !== void 0 && (w = v.createPortal(/* @__PURE__ */ p(o, {
|
|
119
119
|
inputRef: (e) => this.input.from = e,
|
|
120
120
|
autoFocus: y === "from",
|
|
121
121
|
disabled: !_,
|
|
122
122
|
mark: e,
|
|
123
|
-
graphProps:
|
|
123
|
+
graphProps: h,
|
|
124
124
|
onBlur: this.stopEditingLabel,
|
|
125
125
|
onChange: (t) => this.labelChange({
|
|
126
126
|
...e,
|
|
127
127
|
label: t
|
|
128
128
|
}, "from")
|
|
129
|
-
}),
|
|
129
|
+
}), g)), t?.label !== void 0 && (T = v.createPortal(/* @__PURE__ */ p(o, {
|
|
130
130
|
inputRef: (e) => this.input.to = e,
|
|
131
131
|
autoFocus: y === "to",
|
|
132
132
|
disabled: !_,
|
|
133
133
|
mark: t,
|
|
134
|
-
graphProps:
|
|
134
|
+
graphProps: h,
|
|
135
135
|
onBlur: this.stopEditingLabel,
|
|
136
136
|
onChange: (e) => this.labelChange({
|
|
137
137
|
...t,
|
|
138
138
|
label: e
|
|
139
139
|
}, "to")
|
|
140
|
-
}),
|
|
140
|
+
}), g)), n?.label !== void 0 && (E = v.createPortal(/* @__PURE__ */ p(o, {
|
|
141
141
|
inputRef: (e) => this.input.middle = e,
|
|
142
142
|
autoFocus: y === "middle",
|
|
143
143
|
disabled: !_,
|
|
144
144
|
mark: n,
|
|
145
|
-
graphProps:
|
|
145
|
+
graphProps: h,
|
|
146
146
|
onBlur: this.stopEditingLabel,
|
|
147
147
|
onChange: (e) => this.labelChange({
|
|
148
148
|
...n,
|
|
149
149
|
label: e
|
|
150
150
|
}, "middle")
|
|
151
|
-
}),
|
|
152
|
-
/* @__PURE__ */
|
|
151
|
+
}), g))), /* @__PURE__ */ m("g", { children: [
|
|
152
|
+
/* @__PURE__ */ p(S, {
|
|
153
153
|
disabled: s || r,
|
|
154
154
|
correctness: f,
|
|
155
155
|
className: i(s && "bgCircleBuilding"),
|
|
@@ -161,11 +161,11 @@ var y = (e) => p({
|
|
|
161
161
|
onClick: (e) => this.clickPoint(n, "middle", e)
|
|
162
162
|
}),
|
|
163
163
|
E,
|
|
164
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ p(a, {
|
|
165
165
|
disabled: s || r,
|
|
166
166
|
coordinatesOnHover: c,
|
|
167
167
|
correctness: f,
|
|
168
|
-
labelNode:
|
|
168
|
+
labelNode: g,
|
|
169
169
|
x: t.x,
|
|
170
170
|
y: t.y,
|
|
171
171
|
onDrag: this.dragTo,
|
|
@@ -173,11 +173,11 @@ var y = (e) => p({
|
|
|
173
173
|
onClick: (e) => this.clickPoint(t, "to", e)
|
|
174
174
|
}),
|
|
175
175
|
T,
|
|
176
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ p(a, {
|
|
177
177
|
disabled: s || r,
|
|
178
178
|
coordinatesOnHover: c,
|
|
179
179
|
correctness: f,
|
|
180
|
-
labelNode:
|
|
180
|
+
labelNode: g,
|
|
181
181
|
x: e.x,
|
|
182
182
|
y: e.y,
|
|
183
183
|
className: "from",
|
|
@@ -188,7 +188,7 @@ var y = (e) => p({
|
|
|
188
188
|
w
|
|
189
189
|
] });
|
|
190
190
|
}
|
|
191
|
-
}, S =
|
|
191
|
+
}, S = g(s)(() => ({
|
|
192
192
|
"&.outerLine": {
|
|
193
193
|
fill: _.transparent(),
|
|
194
194
|
stroke: _.defaults.BLACK,
|
|
@@ -5,10 +5,10 @@ import { lineBase as a, lineToolComponent as o, styles as s } from "../shared/li
|
|
|
5
5
|
import "react";
|
|
6
6
|
import c from "prop-types";
|
|
7
7
|
import { trig as l, types as u } from "@pie-lib/plot";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import { styled as p } from "@mui/material/styles";
|
|
10
10
|
//#region src/tools/line/component.tsx
|
|
11
|
-
var m =
|
|
11
|
+
var m = p("g")(({ theme: e, disabled: t, correctness: n }) => ({
|
|
12
12
|
"& line:not(.hit-area)": {
|
|
13
13
|
...s.line(e),
|
|
14
14
|
...t && s.disabledSecondary(e),
|
|
@@ -22,17 +22,17 @@ var m = d("g")(({ theme: e, disabled: t, correctness: n }) => ({
|
|
|
22
22
|
"& .incorrectArrow": { ...s.incorrect(e) },
|
|
23
23
|
"& .missingArrow": { ...s.missing(e) }
|
|
24
24
|
})), h = (a) => {
|
|
25
|
-
let o = i(), { className: s, correctness: c, disabled: u, graphProps:
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
let o = i(), { className: s, correctness: c, disabled: u, graphProps: p, from: h, to: g, markerId: _, ...v } = a, { scale: y } = p, { domain: b, range: x } = e(p), [S, C] = l.edges(b, x)(h, g), w = c || u && "disabled" || "enabled", T = _ || o;
|
|
26
|
+
return /* @__PURE__ */ f(m, {
|
|
27
27
|
disabled: u,
|
|
28
28
|
correctness: c,
|
|
29
29
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
size: t(
|
|
30
|
+
/* @__PURE__ */ d("defs", { children: /* @__PURE__ */ d(r, {
|
|
31
|
+
size: t(p) ? 4 : 5,
|
|
32
32
|
id: `${T}-${w}`,
|
|
33
33
|
className: n(w === "enabled" ? "enabledArrow" : w === "disabled" ? "disabledArrow" : `${w}Arrow`)
|
|
34
34
|
}) }),
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ d("line", {
|
|
36
36
|
x1: y.x(S.x),
|
|
37
37
|
y1: y.y(S.y),
|
|
38
38
|
x2: y.x(C.x),
|
|
@@ -45,7 +45,7 @@ var m = d("g")(({ theme: e, disabled: t, correctness: n }) => ({
|
|
|
45
45
|
pointerEvents: "stroke"
|
|
46
46
|
}
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ d("line", {
|
|
49
49
|
x1: y.x(S.x),
|
|
50
50
|
y1: y.y(S.y),
|
|
51
51
|
x2: y.x(C.x),
|
|
@@ -2,11 +2,11 @@ import { bounds as e, lineToArea as t, point as n } from "../../utils.js";
|
|
|
2
2
|
import r from "react";
|
|
3
3
|
import i from "prop-types";
|
|
4
4
|
import { gridDraggable as a, types as o } from "@pie-lib/plot";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
6
|
+
import { styled as c } from "@mui/material/styles";
|
|
7
7
|
import { color as l } from "@pie-lib/render-ui";
|
|
8
8
|
//#region src/tools/polygon/line.tsx
|
|
9
|
-
var u =
|
|
9
|
+
var u = c("line")(({ disabled: e, correctness: t }) => ({
|
|
10
10
|
strokeWidth: 7,
|
|
11
11
|
transition: "stroke-width 200ms ease-in, stroke 200ms ease-in",
|
|
12
12
|
stroke: "transparent",
|
|
@@ -30,12 +30,12 @@ var u = s("line")(({ disabled: e, correctness: t }) => ({
|
|
|
30
30
|
to: {}
|
|
31
31
|
};
|
|
32
32
|
render() {
|
|
33
|
-
let { graphProps: e, from: t, to: n, className: r, disabled: i, correctness: a, ...o } = this.props, { scale:
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
x1:
|
|
36
|
-
y1:
|
|
37
|
-
x2:
|
|
38
|
-
y2:
|
|
33
|
+
let { graphProps: e, from: t, to: n, className: r, disabled: i, correctness: a, ...o } = this.props, { scale: c } = e;
|
|
34
|
+
return /* @__PURE__ */ s(u, {
|
|
35
|
+
x1: c.x(t.x),
|
|
36
|
+
y1: c.y(t.y),
|
|
37
|
+
x2: c.x(n.x),
|
|
38
|
+
y2: c.y(n.y),
|
|
39
39
|
className: r,
|
|
40
40
|
disabled: i,
|
|
41
41
|
correctness: a,
|
|
@@ -3,12 +3,12 @@ import { correct as r, disabledSecondary as i, graphingShapeFill as a, incorrect
|
|
|
3
3
|
import c from "react";
|
|
4
4
|
import l from "prop-types";
|
|
5
5
|
import { gridDraggable as u, types as d } from "@pie-lib/plot";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
7
|
+
import { alpha as p, styled as m } from "@mui/material/styles";
|
|
8
8
|
import { color as h } from "@pie-lib/render-ui";
|
|
9
9
|
//#region src/tools/polygon/polygon.tsx
|
|
10
|
-
var g =
|
|
11
|
-
fill:
|
|
10
|
+
var g = m("polygon")(({ disabled: e, correctness: t }) => ({
|
|
11
|
+
fill: p(a(), .2),
|
|
12
12
|
strokeWidth: 3,
|
|
13
13
|
stroke: h.defaults.BLACK,
|
|
14
14
|
...e && i("stroke"),
|
|
@@ -18,8 +18,8 @@ var g = p("polygon")(({ disabled: e, correctness: t }) => ({
|
|
|
18
18
|
...s("stroke"),
|
|
19
19
|
stroke: "inherit"
|
|
20
20
|
}
|
|
21
|
-
})), _ =
|
|
22
|
-
fill:
|
|
21
|
+
})), _ = m("polyline")(({ disabled: e, correctness: t }) => ({
|
|
22
|
+
fill: p(a(), 0),
|
|
23
23
|
strokeWidth: 3,
|
|
24
24
|
stroke: h.defaults.BLACK,
|
|
25
25
|
pointerEvents: "none",
|
|
@@ -48,7 +48,7 @@ var g = p("polygon")(({ disabled: e, correctness: t }) => ({
|
|
|
48
48
|
static defaultProps = { points: [] };
|
|
49
49
|
render() {
|
|
50
50
|
let { points: e, className: t, disabled: n, correctness: r, graphProps: i, closed: a, ...o } = this.props, { scale: s } = i, c = v(e, s);
|
|
51
|
-
return
|
|
51
|
+
return f(a ? g : _, {
|
|
52
52
|
points: c,
|
|
53
53
|
className: t,
|
|
54
54
|
disabled: n,
|
|
@@ -5,10 +5,10 @@ import { lineBase as a, lineToolComponent as o, styles as s } from "../shared/li
|
|
|
5
5
|
import "react";
|
|
6
6
|
import c from "prop-types";
|
|
7
7
|
import { trig as l, types as u } from "@pie-lib/plot";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import { styled as p } from "@mui/material/styles";
|
|
10
10
|
//#region src/tools/ray/component.tsx
|
|
11
|
-
var m =
|
|
11
|
+
var m = p("g")(({ theme: e, disabled: t, correctness: n }) => ({
|
|
12
12
|
"& line:not(.hit-area)": {
|
|
13
13
|
...s.line(e),
|
|
14
14
|
...t && s.disabledSecondary(e),
|
|
@@ -22,17 +22,17 @@ var m = d("g")(({ theme: e, disabled: t, correctness: n }) => ({
|
|
|
22
22
|
"& .incorrectArrow": { ...s.incorrect(e) },
|
|
23
23
|
"& .missingArrow": { ...s.missing(e) }
|
|
24
24
|
})), h = (a) => {
|
|
25
|
-
let o = i(), { graphProps: s, from: c, to: u, disabled:
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
disabled:
|
|
25
|
+
let o = i(), { graphProps: s, from: c, to: u, disabled: p, correctness: h, className: g, markerId: _, ...v } = a, { scale: y } = s, { domain: b, range: x } = e(s), [S] = l.edges(b, x)(c, u), C = h || p && "disabled" || "enabled", w = _ || o;
|
|
26
|
+
return /* @__PURE__ */ f(m, {
|
|
27
|
+
disabled: p,
|
|
28
28
|
correctness: h,
|
|
29
29
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ d("defs", { children: /* @__PURE__ */ d(r, {
|
|
31
31
|
size: t(s) ? 4 : 5,
|
|
32
32
|
id: `${w}-${C}`,
|
|
33
33
|
className: n(C === "enabled" ? "enabledArrow" : C === "disabled" ? "disabledArrow" : `${C}Arrow`)
|
|
34
34
|
}) }),
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ d("line", {
|
|
36
36
|
x1: y.x(c.x),
|
|
37
37
|
y1: y.y(c.y),
|
|
38
38
|
x2: y.x(S.x),
|
|
@@ -45,7 +45,7 @@ var m = d("g")(({ theme: e, disabled: t, correctness: n }) => ({
|
|
|
45
45
|
pointerEvents: "stroke"
|
|
46
46
|
}
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ d("line", {
|
|
49
49
|
x1: y.x(c.x),
|
|
50
50
|
y1: y.y(c.y),
|
|
51
51
|
x2: y.x(S.x),
|