@pie-lib/graphing-solution-set 4.1.0-beta.9 → 5.0.0-next.20261002100925

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +20 -0
  2. package/dist/autosize-input.d.ts +10 -0
  3. package/dist/autosize-input.js +66 -0
  4. package/dist/axis/arrow.d.ts +13 -0
  5. package/dist/axis/arrow.js +34 -0
  6. package/dist/axis/axes.d.ts +132 -0
  7. package/dist/axis/axes.js +214 -0
  8. package/dist/axis/index.d.ts +10 -0
  9. package/dist/bg.d.ts +51 -0
  10. package/dist/bg.js +44 -0
  11. package/dist/container/actions.d.ts +15 -0
  12. package/dist/container/actions.js +7 -0
  13. package/dist/container/index.d.ts +58 -0
  14. package/dist/container/index.js +48 -0
  15. package/dist/container/marks.d.ts +10 -0
  16. package/dist/container/marks.js +11 -0
  17. package/dist/container/middleware.d.ts +10 -0
  18. package/dist/container/middleware.js +4 -0
  19. package/dist/container/reducer.d.ts +14 -0
  20. package/dist/container/reducer.js +7 -0
  21. package/dist/coordinates-label.d.ts +50 -0
  22. package/dist/coordinates-label.js +46 -0
  23. package/dist/graph-with-controls.d.ts +85 -0
  24. package/dist/graph-with-controls.js +155 -0
  25. package/dist/graph.d.ts +119 -0
  26. package/dist/graph.js +221 -0
  27. package/dist/grid-setup.d.ts +27 -0
  28. package/dist/grid-setup.js +307 -0
  29. package/dist/grid.d.ts +43 -0
  30. package/dist/grid.js +59 -0
  31. package/dist/index.d.ts +14 -0
  32. package/dist/index.js +6 -0
  33. package/dist/labels.d.ts +73 -0
  34. package/dist/labels.js +134 -0
  35. package/dist/mark-label.d.ts +50 -0
  36. package/dist/mark-label.js +84 -0
  37. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Axis.js +67 -0
  38. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisRenderer.js +66 -0
  39. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/axis/Ticks.js +39 -0
  40. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/constants/orientation.js +9 -0
  41. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/createPoint.js +14 -0
  42. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js +13 -0
  43. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getLabelTransform.js +16 -0
  44. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickFormatter.js +8 -0
  45. package/dist/node_modules/.bun/@visx_axis@4.0.0_d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickPosition.js +14 -0
  46. package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/Grid.js +43 -0
  47. package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridColumns.js +46 -0
  48. package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/grids/GridRows.js +46 -0
  49. package/dist/node_modules/.bun/@visx_grid@4.0.0_d84c32d47042070f/node_modules/@visx/grid/esm/utils/getScaleBandwidth.js +6 -0
  50. package/dist/node_modules/.bun/@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js +17 -0
  51. package/dist/node_modules/.bun/@visx_point@4.0.0/node_modules/@visx/point/esm/Point.js +20 -0
  52. package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/coerceNumber.js +10 -0
  53. package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/getTicks.js +7 -0
  54. package/dist/node_modules/.bun/@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/toString.js +6 -0
  55. package/dist/node_modules/.bun/@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Line.js +27 -0
  56. package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/Text.js +27 -0
  57. package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/hooks/useText.js +68 -0
  58. package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/getStringWidth.js +19 -0
  59. package/dist/node_modules/.bun/@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/util/memoize.js +13 -0
  60. package/dist/node_modules/.bun/balanced-match@0.4.2/node_modules/balanced-match/index.js +32 -0
  61. package/dist/node_modules/.bun/balanced-match@1.0.2/node_modules/balanced-match/index.js +33 -0
  62. package/dist/node_modules/.bun/classnames@2.5.1/node_modules/classnames/index.js +32 -0
  63. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  64. package/dist/node_modules/.bun/invariant@2.2.4/node_modules/invariant/browser.js +28 -0
  65. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/formula_evaluator.js +37 -0
  66. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/lexer.js +509 -0
  67. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/math_function.js +108 -0
  68. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix.js +31 -0
  69. package/dist/node_modules/.bun/math-expression-evaluator@1.4.0/node_modules/math-expression-evaluator/src/postfix_evaluator.js +45 -0
  70. package/dist/node_modules/.bun/reduce-css-calc@1.3.0/node_modules/reduce-css-calc/index.js +49 -0
  71. package/dist/node_modules/.bun/reduce-function-call@1.0.3/node_modules/reduce-function-call/index.js +34 -0
  72. package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +185 -0
  73. package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +198 -0
  74. package/dist/tool-menu.d.ts +21 -0
  75. package/dist/tool-menu.js +188 -0
  76. package/dist/tools/index.d.ts +17 -0
  77. package/dist/tools/index.js +12 -0
  78. package/dist/tools/line/component.d.ts +113 -0
  79. package/dist/tools/line/component.js +58 -0
  80. package/dist/tools/line/index.d.ts +13 -0
  81. package/dist/tools/line/index.js +6 -0
  82. package/dist/tools/polygon/component.d.ts +117 -0
  83. package/dist/tools/polygon/component.js +194 -0
  84. package/dist/tools/polygon/index.d.ts +19 -0
  85. package/dist/tools/polygon/index.js +55 -0
  86. package/dist/tools/polygon/polygon.d.ts +122 -0
  87. package/dist/tools/polygon/polygon.js +62 -0
  88. package/dist/tools/shared/arrow-head.d.ts +43 -0
  89. package/dist/tools/shared/arrow-head.js +37 -0
  90. package/dist/tools/shared/line/index.d.ts +240 -0
  91. package/dist/tools/shared/line/index.js +320 -0
  92. package/dist/tools/shared/point/arrow-point.d.ts +57 -0
  93. package/dist/tools/shared/point/arrow-point.js +47 -0
  94. package/dist/tools/shared/point/arrow.d.ts +46 -0
  95. package/dist/tools/shared/point/arrow.js +36 -0
  96. package/dist/tools/shared/point/base-point.d.ts +50 -0
  97. package/dist/tools/shared/point/base-point.js +88 -0
  98. package/dist/tools/shared/point/index.d.ts +217 -0
  99. package/dist/tools/shared/point/index.js +51 -0
  100. package/dist/tools/shared/styles.d.ts +24 -0
  101. package/dist/tools/shared/styles.js +17 -0
  102. package/dist/tools/shared/types.d.ts +15 -0
  103. package/dist/tools/shared/types.js +10 -0
  104. package/dist/undo-redo.d.ts +20 -0
  105. package/dist/undo-redo.js +33 -0
  106. package/dist/use-debounce.d.ts +9 -0
  107. package/dist/use-debounce.js +13 -0
  108. package/dist/utils.d.ts +58 -0
  109. package/dist/utils.js +72 -0
  110. package/package.json +52 -42
  111. package/CHANGELOG.json +0 -1
  112. package/CHANGELOG.md +0 -449
  113. package/lib/axis/arrow.js +0 -79
  114. package/lib/axis/arrow.js.map +0 -1
  115. package/lib/axis/axes.js +0 -327
  116. package/lib/axis/axes.js.map +0 -1
  117. package/lib/axis/index.js +0 -21
  118. package/lib/axis/index.js.map +0 -1
  119. package/lib/bg.js +0 -114
  120. package/lib/bg.js.map +0 -1
  121. package/lib/container/actions.js +0 -18
  122. package/lib/container/actions.js.map +0 -1
  123. package/lib/container/index.js +0 -129
  124. package/lib/container/index.js.map +0 -1
  125. package/lib/container/marks.js +0 -22
  126. package/lib/container/marks.js.map +0 -1
  127. package/lib/container/middleware.js +0 -19
  128. package/lib/container/middleware.js.map +0 -1
  129. package/lib/container/reducer.js +0 -18
  130. package/lib/container/reducer.js.map +0 -1
  131. package/lib/coordinates-label.js +0 -77
  132. package/lib/coordinates-label.js.map +0 -1
  133. package/lib/graph-with-controls.js +0 -297
  134. package/lib/graph-with-controls.js.map +0 -1
  135. package/lib/graph.js +0 -353
  136. package/lib/graph.js.map +0 -1
  137. package/lib/grid-setup.js +0 -414
  138. package/lib/grid-setup.js.map +0 -1
  139. package/lib/grid.js +0 -131
  140. package/lib/grid.js.map +0 -1
  141. package/lib/index.js +0 -40
  142. package/lib/index.js.map +0 -1
  143. package/lib/labels.js +0 -199
  144. package/lib/labels.js.map +0 -1
  145. package/lib/mark-label.js +0 -159
  146. package/lib/mark-label.js.map +0 -1
  147. package/lib/toggle-bar.js +0 -248
  148. package/lib/toggle-bar.js.map +0 -1
  149. package/lib/tool-menu.js +0 -218
  150. package/lib/tool-menu.js.map +0 -1
  151. package/lib/tools/index.js +0 -24
  152. package/lib/tools/index.js.map +0 -1
  153. package/lib/tools/line/component.js +0 -92
  154. package/lib/tools/line/component.js.map +0 -1
  155. package/lib/tools/line/index.js +0 -11
  156. package/lib/tools/line/index.js.map +0 -1
  157. package/lib/tools/polygon/component.js +0 -358
  158. package/lib/tools/polygon/component.js.map +0 -1
  159. package/lib/tools/polygon/index.js +0 -89
  160. package/lib/tools/polygon/index.js.map +0 -1
  161. package/lib/tools/polygon/line.js +0 -114
  162. package/lib/tools/polygon/line.js.map +0 -1
  163. package/lib/tools/polygon/polygon.js +0 -128
  164. package/lib/tools/polygon/polygon.js.map +0 -1
  165. package/lib/tools/shared/arrow-head.js +0 -62
  166. package/lib/tools/shared/arrow-head.js.map +0 -1
  167. package/lib/tools/shared/line/index.js +0 -539
  168. package/lib/tools/shared/line/index.js.map +0 -1
  169. package/lib/tools/shared/line/line-path.js +0 -121
  170. package/lib/tools/shared/line/line-path.js.map +0 -1
  171. package/lib/tools/shared/line/with-root-edge.js +0 -121
  172. package/lib/tools/shared/line/with-root-edge.js.map +0 -1
  173. package/lib/tools/shared/point/arrow-point.js +0 -86
  174. package/lib/tools/shared/point/arrow-point.js.map +0 -1
  175. package/lib/tools/shared/point/arrow.js +0 -70
  176. package/lib/tools/shared/point/arrow.js.map +0 -1
  177. package/lib/tools/shared/point/base-point.js +0 -137
  178. package/lib/tools/shared/point/base-point.js.map +0 -1
  179. package/lib/tools/shared/point/index.js +0 -80
  180. package/lib/tools/shared/point/index.js.map +0 -1
  181. package/lib/tools/shared/styles.js +0 -26
  182. package/lib/tools/shared/styles.js.map +0 -1
  183. package/lib/tools/shared/types.js +0 -15
  184. package/lib/tools/shared/types.js.map +0 -1
  185. package/lib/undo-redo.js +0 -67
  186. package/lib/undo-redo.js.map +0 -1
  187. package/lib/use-debounce.js +0 -25
  188. package/lib/use-debounce.js.map +0 -1
  189. package/lib/utils.js +0 -235
  190. package/lib/utils.js.map +0 -1
  191. package/src/axis/arrow.jsx +0 -57
  192. package/src/axis/axes.jsx +0 -284
  193. package/src/axis/index.js +0 -3
  194. package/src/bg.jsx +0 -96
  195. package/src/container/actions.js +0 -8
  196. package/src/container/index.jsx +0 -93
  197. package/src/container/marks.js +0 -14
  198. package/src/container/middleware.js +0 -7
  199. package/src/container/reducer.js +0 -5
  200. package/src/coordinates-label.jsx +0 -62
  201. package/src/graph-with-controls.jsx +0 -242
  202. package/src/graph.jsx +0 -333
  203. package/src/grid-setup.jsx +0 -432
  204. package/src/grid.jsx +0 -133
  205. package/src/index.js +0 -7
  206. package/src/labels.jsx +0 -173
  207. package/src/mark-label.jsx +0 -125
  208. package/src/toggle-bar.jsx +0 -221
  209. package/src/tool-menu.jsx +0 -235
  210. package/src/tools/index.js +0 -8
  211. package/src/tools/line/component.jsx +0 -77
  212. package/src/tools/line/index.js +0 -4
  213. package/src/tools/polygon/component.jsx +0 -324
  214. package/src/tools/polygon/index.js +0 -52
  215. package/src/tools/polygon/line.jsx +0 -80
  216. package/src/tools/polygon/polygon.jsx +0 -93
  217. package/src/tools/shared/arrow-head.jsx +0 -46
  218. package/src/tools/shared/line/index.jsx +0 -471
  219. package/src/tools/shared/line/line-path.jsx +0 -85
  220. package/src/tools/shared/line/with-root-edge.jsx +0 -97
  221. package/src/tools/shared/point/arrow-point.jsx +0 -60
  222. package/src/tools/shared/point/arrow.jsx +0 -40
  223. package/src/tools/shared/point/base-point.jsx +0 -113
  224. package/src/tools/shared/point/index.jsx +0 -58
  225. package/src/tools/shared/styles.js +0 -20
  226. package/src/tools/shared/types.js +0 -8
  227. package/src/undo-redo.jsx +0 -37
  228. package/src/use-debounce.js +0 -13
  229. package/src/utils.js +0 -230
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/graphing-solution-set/src/labels.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare const getTransform: (side: any, width: any, height: any) => string | undefined;
12
+ declare class RawLabel extends React.Component {
13
+ static propTypes: {
14
+ text: PropTypes.Requireable<string>;
15
+ side: PropTypes.Requireable<string>;
16
+ disabledLabel: PropTypes.Requireable<boolean>;
17
+ placeholder: PropTypes.Requireable<string>;
18
+ graphProps: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
19
+ scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
20
+ x: PropTypes.Validator<(...args: any[]) => any>;
21
+ y: PropTypes.Validator<(...args: any[]) => any>;
22
+ }>>>;
23
+ snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
24
+ x: PropTypes.Validator<(...args: any[]) => any>;
25
+ y: PropTypes.Validator<(...args: any[]) => any>;
26
+ }>>>;
27
+ domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
28
+ min: PropTypes.Validator<number>;
29
+ max: PropTypes.Validator<number>;
30
+ step: PropTypes.Requireable<number>;
31
+ }>>>;
32
+ range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
33
+ min: PropTypes.Validator<number>;
34
+ max: PropTypes.Validator<number>;
35
+ step: PropTypes.Requireable<number>;
36
+ }>>>;
37
+ size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
38
+ width: PropTypes.Validator<number>;
39
+ height: PropTypes.Validator<number>;
40
+ }>>>;
41
+ }>>>;
42
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
43
+ mathMlOptions: PropTypes.Requireable<object>;
44
+ };
45
+ static defaultProps: {
46
+ onChange: () => void;
47
+ };
48
+ render(): React.JSX.Element;
49
+ }
50
+ export declare const LabelType: {
51
+ left: PropTypes.Requireable<string>;
52
+ top: PropTypes.Requireable<string>;
53
+ bottom: PropTypes.Requireable<string>;
54
+ right: PropTypes.Requireable<string>;
55
+ };
56
+ export declare class Labels extends React.Component {
57
+ static propTypes: {
58
+ disabledLabels: PropTypes.Requireable<boolean>;
59
+ placeholders: PropTypes.Requireable<object>;
60
+ value: PropTypes.Requireable<PropTypes.InferProps<{
61
+ left: PropTypes.Requireable<string>;
62
+ top: PropTypes.Requireable<string>;
63
+ bottom: PropTypes.Requireable<string>;
64
+ right: PropTypes.Requireable<string>;
65
+ }>>;
66
+ graphProps: PropTypes.Requireable<object>;
67
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
68
+ mathMlOptions: PropTypes.Requireable<object>;
69
+ };
70
+ onChangeLabel: any;
71
+ render(): React.JSX.Element;
72
+ }
73
+ export default RawLabel;
package/dist/labels.js ADDED
@@ -0,0 +1,134 @@
1
+ import { clsx as e } from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { types as r } from "@pie-lib/plot";
5
+ import { Fragment as i, jsx as a } from "react/jsx-runtime";
6
+ import { styled as o } from "@mui/material/styles";
7
+ import * as s from "@pie-lib/render-ui";
8
+ import { Readable as c, color as l } from "@pie-lib/render-ui";
9
+ import u from "@pie-lib/editable-html-tip-tap";
10
+ //#region src/labels.tsx
11
+ function d(e) {
12
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
13
+ }
14
+ function f(e, t) {
15
+ return !e || d(e) ? e : d(e.default) ? e.default : t && d(e[t]) ? e[t] : t && d(e[t]?.default) ? e[t].default : e;
16
+ }
17
+ var p = f(c, "Readable") || f(g.Readable, "Readable"), m = s, h = m.default, g = h && typeof h == "object" ? h : m, _ = {
18
+ left: -90,
19
+ top: 0,
20
+ bottom: 0,
21
+ right: 90
22
+ }, v = (e, t, n) => {
23
+ let r = (e, t, n) => `translate(${e}, ${t}), rotate(${n})`;
24
+ if (e === "left") return r(-20, n / 2, _[e]);
25
+ if (e === "right") return r(t + 30, n / 2, _[e]);
26
+ if (e === "top") return r(t / 2, -20, _[e]);
27
+ if (e === "bottom") return r(t / 2, n + 30, _[e]);
28
+ }, y = (e, t) => {
29
+ switch (e) {
30
+ case "left":
31
+ case "top": return -t;
32
+ case "right": return -t - 10;
33
+ default: return -t + 10;
34
+ }
35
+ }, b = "Label", x = {
36
+ label: `${b}-label`,
37
+ axisLabel: `${b}-axisLabel`,
38
+ disabledAxisLabel: `${b}-disabledAxisLabel`,
39
+ bottomLabel: `${b}-bottomLabel`
40
+ }, S = o("div")(({ theme: e }) => ({
41
+ [`& .${x.label}`]: { fill: l.defaults.SECONDARY },
42
+ [`& .${x.axisLabel}`]: {
43
+ fontSize: e.typography.fontSize - 2,
44
+ textAlign: "center",
45
+ padding: "0 4px"
46
+ },
47
+ [`& .${x.disabledAxisLabel}`]: { pointerEvents: "none" },
48
+ [`& .${x.bottomLabel}`]: { marginTop: "44px" }
49
+ })), C = class extends t.Component {
50
+ static propTypes = {
51
+ text: n.string,
52
+ side: n.string,
53
+ disabledLabel: n.bool,
54
+ placeholder: n.string,
55
+ graphProps: r.GraphPropsType.isRequired,
56
+ onChange: n.func,
57
+ mathMlOptions: n.object
58
+ };
59
+ static defaultProps = { onChange: () => {} };
60
+ render() {
61
+ let { disabledLabel: t, placeholder: n, text: r, side: i, graphProps: o, onChange: s, mathMlOptions: c = {} } = this.props, { size: l, domain: d, range: f } = o, m = (l.height || 500) + (f.padding || 0) * 2, h = (l.width || 500) + (d.padding || 0) * 2, g = v(i, h, m), _ = i === "left" || i === "right" ? m : h, b = y(i, 36), C = i === "bottom" ? 58 : 54, w = [
62
+ "bold",
63
+ "italic",
64
+ "underline",
65
+ "strikethrough",
66
+ "math"
67
+ ];
68
+ return /* @__PURE__ */ a(S, { children: /* @__PURE__ */ a("foreignObject", {
69
+ x: -(_ / 2),
70
+ y: b,
71
+ width: _,
72
+ height: C,
73
+ transform: g,
74
+ textAnchor: "middle",
75
+ children: /* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(u, {
76
+ className: e({
77
+ [x.bottomLabel]: i === "bottom",
78
+ [x.disabledAxisLabel]: t
79
+ }, x.axisLabel),
80
+ markup: r || "",
81
+ onChange: s,
82
+ placeholder: !t && n,
83
+ toolbarOpts: {
84
+ position: i === "bottom" ? "top" : "bottom",
85
+ noPadding: !0,
86
+ noBorder: !0
87
+ },
88
+ activePlugins: w,
89
+ mathMlOptions: c
90
+ }) })
91
+ }) });
92
+ }
93
+ }, w = {
94
+ left: n.string,
95
+ top: n.string,
96
+ bottom: n.string,
97
+ right: n.string
98
+ };
99
+ (class extends t.Component {
100
+ static propTypes = {
101
+ disabledLabels: n.bool,
102
+ placeholders: n.object,
103
+ value: n.shape(w),
104
+ graphProps: n.object,
105
+ onChange: n.func,
106
+ mathMlOptions: n.object
107
+ };
108
+ onChangeLabel = (e, t) => {
109
+ let { value: n, onChange: r } = this.props;
110
+ r({
111
+ ...n,
112
+ [t]: e
113
+ });
114
+ };
115
+ render() {
116
+ let { disabledLabels: e, placeholders: t = {}, value: n = {}, graphProps: r, mathMlOptions: o = {} } = this.props;
117
+ return /* @__PURE__ */ a(i, { children: [
118
+ "left",
119
+ "top",
120
+ "bottom",
121
+ "right"
122
+ ].map((i) => /* @__PURE__ */ a(C, {
123
+ side: i,
124
+ text: n[i],
125
+ disabledLabel: e,
126
+ placeholder: t[i],
127
+ graphProps: r,
128
+ onChange: (e) => this.onChangeLabel(e, i),
129
+ mathMlOptions: o
130
+ }, i)) });
131
+ }
132
+ });
133
+ //#endregion
134
+ export { w as LabelType, C as default, v as getTransform };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/graphing-solution-set/src/mark-label.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare const position: (graphProps: any, mark: any, rect: any) => string;
12
+ export declare const coordinates: (graphProps: any, mark: any, rect: any, position: any) => {
13
+ left: any;
14
+ top: any;
15
+ } | undefined;
16
+ export declare const MarkLabel: {
17
+ (props: any): React.JSX.Element;
18
+ propTypes: {
19
+ disabled: PropTypes.Requireable<boolean>;
20
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
21
+ graphProps: PropTypes.Requireable<PropTypes.InferProps<{
22
+ scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
23
+ x: PropTypes.Validator<(...args: any[]) => any>;
24
+ y: PropTypes.Validator<(...args: any[]) => any>;
25
+ }>>>;
26
+ snap: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
27
+ x: PropTypes.Validator<(...args: any[]) => any>;
28
+ y: PropTypes.Validator<(...args: any[]) => any>;
29
+ }>>>;
30
+ domain: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
31
+ min: PropTypes.Validator<number>;
32
+ max: PropTypes.Validator<number>;
33
+ step: PropTypes.Requireable<number>;
34
+ }>>>;
35
+ range: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
36
+ min: PropTypes.Validator<number>;
37
+ max: PropTypes.Validator<number>;
38
+ step: PropTypes.Requireable<number>;
39
+ }>>>;
40
+ size: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
41
+ width: PropTypes.Validator<number>;
42
+ height: PropTypes.Validator<number>;
43
+ }>>>;
44
+ }>>;
45
+ inputRef: PropTypes.Requireable<(...args: any[]) => any>;
46
+ mark: PropTypes.Requireable<object>;
47
+ theme: PropTypes.Requireable<object>;
48
+ };
49
+ };
50
+ export default MarkLabel;
@@ -0,0 +1,84 @@
1
+ import { AutosizeInput as e } from "./autosize-input.js";
2
+ import { useDebounce as t } from "./use-debounce.js";
3
+ import { useCallback as n, useEffect as r, useState as i } from "react";
4
+ import a from "prop-types";
5
+ import { types as o } from "@pie-lib/plot";
6
+ import { jsx as s } from "react/jsx-runtime";
7
+ import { styled as c } from "@mui/material/styles";
8
+ import { color as l } from "@pie-lib/render-ui";
9
+ //#region src/mark-label.tsx
10
+ var u = c(e, { shouldForwardProp: (e) => !["disabled", "markDisabled"].includes(e) })(({ theme: e, disabled: t, markDisabled: n }) => ({ "& input": {
11
+ float: "right",
12
+ padding: e.spacing(.5),
13
+ fontFamily: e.typography.fontFamily,
14
+ fontSize: e.typography.fontSize,
15
+ border: `solid 1px ${t ? l.defaults.PRIMARY_DARK : n ? l.disabled() : l.defaults.SECONDARY}`,
16
+ borderRadius: "3px",
17
+ color: n ? l.disabled() : l.defaults.PRIMARY_DARK,
18
+ background: t || n ? e.palette.background.paper : "transparent"
19
+ } })), d = (e, t, n) => {
20
+ n ||= {
21
+ width: 0,
22
+ height: 0
23
+ };
24
+ let { scale: r, domain: i, range: a } = e, o = r.x(t.x) + n.width + 10, s = r.y(t.y) + n.height + 10, c = o >= r.x(i.max) ? "left" : "right";
25
+ return `${s >= r.y(a.min) ? "top" : "bottom"}-${c}`;
26
+ }, f = (e, t, n, r) => {
27
+ let { scale: i } = e;
28
+ switch (n ||= {
29
+ width: 0,
30
+ height: 0
31
+ }, r) {
32
+ case "bottom-right": return {
33
+ left: i.x(t.x) + 10,
34
+ top: i.y(t.y) + 10
35
+ };
36
+ case "bottom-left": return {
37
+ left: i.x(t.x) - 10 - n.width,
38
+ top: i.y(t.y) + 10
39
+ };
40
+ case "top-left": return {
41
+ left: i.x(t.x) - 10 - n.width,
42
+ top: i.y(t.y) - 10 - n.height
43
+ };
44
+ case "top-right": return {
45
+ left: i.x(t.x) + 10,
46
+ top: i.y(t.y) - 10 - n.height
47
+ };
48
+ }
49
+ }, p = (e) => {
50
+ let [a, o] = i(null), c = n((e) => o(e)), { mark: l, graphProps: p, disabled: m, inputRef: h } = e, [g, _] = i(l.label), v = (e) => _(e.target.value), y = t(g, 200);
51
+ r(() => {
52
+ _(l.label);
53
+ }, [l.label]), r(() => {
54
+ typeof y == "string" && y !== l.label && e.onChange(y);
55
+ }, [y]);
56
+ let b = a ? a.getBoundingClientRect() : {
57
+ width: 0,
58
+ height: 0
59
+ }, x = {
60
+ position: "fixed",
61
+ pointerEvents: "auto",
62
+ ...f(p, l, b, d(p, l, b))
63
+ };
64
+ return /* @__PURE__ */ s(u, {
65
+ inputRef: (e) => {
66
+ c(e), h(e);
67
+ },
68
+ disabled: m || l.disabled,
69
+ markDisabled: l.disabled,
70
+ value: g,
71
+ style: x,
72
+ onChange: v
73
+ });
74
+ };
75
+ p.propTypes = {
76
+ disabled: a.bool,
77
+ onChange: a.func,
78
+ graphProps: o.GraphPropsType,
79
+ inputRef: a.func,
80
+ mark: a.object,
81
+ theme: a.object
82
+ };
83
+ //#endregion
84
+ export { p as MarkLabel, p as default, f as coordinates, d as position };
@@ -0,0 +1,67 @@
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 n from "../../../../../../@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
4
+ import r from "../../../../../../@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/coerceNumber.js";
5
+ import i from "../../../../../../@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/getTicks.js";
6
+ import a from "../constants/orientation.js";
7
+ import o from "./AxisRenderer.js";
8
+ import s from "../utils/getTickPosition.js";
9
+ import c from "../utils/getTickFormatter.js";
10
+ import l from "../utils/createPoint.js";
11
+ import u from "../utils/getAxisRangePaddingConfig.js";
12
+ import { jsx as d } from "react/jsx-runtime";
13
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/axis/Axis.js
14
+ var f = /* @__PURE__ */ e(t());
15
+ function p(e) {
16
+ let { children: t = o, axisClassName: p, hideAxisLine: m = !1, hideTicks: h = !1, hideZero: g = !1, innerRef: _, left: v = 0, numTicks: y = 10, orientation: b = a.bottom, rangePadding: x = 0, scale: S, tickFormat: C, tickLength: w = 8, tickValues: T, top: E = 0, ...D } = e, O = C ?? c(S), k = b === a.left, A = b === a.top, j = A || b === a.bottom, M = s(S), N = k || A ? -1 : 1, P = S.range(), F = u(x), I = l({
17
+ x: Number(P[0]) + .5 - F.start,
18
+ y: 0
19
+ }, j), L = l({
20
+ x: Number(P[P.length - 1]) + .5 + F.end,
21
+ y: 0
22
+ }, j), R = (T ?? i(S, y)).filter((e) => !g || e !== 0 && e !== "0").map((e, t) => ({
23
+ value: e,
24
+ index: t
25
+ })), z = R.map((e) => {
26
+ let { value: t, index: n } = e, i = r(M(t));
27
+ return {
28
+ value: t,
29
+ index: n,
30
+ from: l({
31
+ x: i,
32
+ y: 0
33
+ }, j),
34
+ to: l({
35
+ x: i,
36
+ y: w * N
37
+ }, j),
38
+ formattedValue: O(t, n, R)
39
+ };
40
+ });
41
+ return /*#__PURE__*/ d(n, {
42
+ className: (0, f.default)("visx-axis", p),
43
+ innerRef: _,
44
+ top: E,
45
+ left: v,
46
+ children: t({
47
+ ...D,
48
+ axisFromPoint: I,
49
+ axisToPoint: L,
50
+ hideAxisLine: m,
51
+ hideTicks: h,
52
+ hideZero: g,
53
+ horizontal: j,
54
+ numTicks: y,
55
+ orientation: b,
56
+ rangePadding: x,
57
+ scale: S,
58
+ tickFormat: O,
59
+ tickLength: w,
60
+ tickPosition: M,
61
+ tickSign: N,
62
+ ticks: z
63
+ })
64
+ });
65
+ }
66
+ //#endregion
67
+ export { p as default };
@@ -0,0 +1,66 @@
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 n from "../../../../../../@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Line.js";
4
+ import r from "../../../../../../@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/Text.js";
5
+ import i from "../constants/orientation.js";
6
+ import a from "../utils/getLabelTransform.js";
7
+ import o from "./Ticks.js";
8
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/axis/AxisRenderer.js
10
+ var u = /* @__PURE__ */ e(t()), d = {
11
+ textAnchor: "middle",
12
+ fontFamily: "Arial",
13
+ fontSize: 10,
14
+ fill: "#222"
15
+ };
16
+ function f(e) {
17
+ let { axisFromPoint: t, axisLineClassName: f, axisToPoint: p, hideAxisLine: m, hideTicks: h, horizontal: g, label: _ = "", labelClassName: v, labelOffset: y = 14, labelProps: b, orientation: x = i.bottom, scale: S, stroke: C = "#222", strokeDasharray: w, strokeWidth: T = 1, tickClassName: E, tickComponent: D, tickLineProps: O, tickLabelProps: k, tickLength: A = 8, tickStroke: j = "#222", tickTransform: M, ticks: N, ticksComponent: P = o } = e, F = {
18
+ ...d,
19
+ ...b
20
+ }, I = {
21
+ ...d,
22
+ ...typeof k == "object" ? k : null
23
+ }, L = N.map((e) => {
24
+ let { value: t, index: n } = e;
25
+ return typeof k == "function" ? k(t, n, N) : I;
26
+ }), R = Math.max(10, ...L.map((e) => typeof e.fontSize == "number" ? e.fontSize : 0));
27
+ return /*#__PURE__*/ l(s, { children: [
28
+ P({
29
+ hideTicks: h,
30
+ horizontal: g,
31
+ orientation: x,
32
+ scale: S,
33
+ tickClassName: E,
34
+ tickComponent: D,
35
+ tickLabelProps: L,
36
+ tickStroke: j,
37
+ tickTransform: M,
38
+ ticks: N,
39
+ strokeWidth: T,
40
+ tickLineProps: O
41
+ }),
42
+ !m && /*#__PURE__*/ c(n, {
43
+ className: (0, u.default)("visx-axis-line", f),
44
+ from: t,
45
+ to: p,
46
+ stroke: C,
47
+ strokeWidth: T,
48
+ strokeDasharray: w
49
+ }),
50
+ _ && /*#__PURE__*/ c(r, {
51
+ className: (0, u.default)("visx-axis-label", v),
52
+ ...a({
53
+ labelOffset: y,
54
+ labelProps: F,
55
+ orientation: x,
56
+ range: S.range(),
57
+ tickLabelFontSize: R,
58
+ tickLength: A
59
+ }),
60
+ ...F,
61
+ children: _
62
+ })
63
+ ] });
64
+ }
65
+ //#endregion
66
+ export { f as default };
@@ -0,0 +1,39 @@
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 n from "../../../../../../@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
4
+ import r from "../../../../../../@visx_shape@4.0.0_d84c32d47042070f/node_modules/@visx/shape/esm/shapes/Line.js";
5
+ import i from "../../../../../../@visx_text@4.0.0_d84c32d47042070f/node_modules/@visx/text/esm/Text.js";
6
+ import a from "../constants/orientation.js";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/axis/Ticks.js
9
+ var c = /* @__PURE__ */ e(t());
10
+ function l(e) {
11
+ let { hideTicks: t, horizontal: l, orientation: u, tickClassName: d, tickComponent: f, tickLabelProps: p, tickStroke: m = "#222", tickTransform: h, ticks: g, strokeWidth: _, tickLineProps: v } = e;
12
+ return g.map((e) => {
13
+ let { value: g, index: y, from: b, to: x, formattedValue: S } = e, C = p[y] ?? {}, w = Math.max(10, typeof C.fontSize == "number" && C.fontSize || 0), T = x.y + (l && u !== a.top ? w : 0);
14
+ return /*#__PURE__*/ s(n, {
15
+ className: (0, c.default)("visx-axis-tick", d),
16
+ transform: h,
17
+ children: [!t && /*#__PURE__*/ o(r, {
18
+ from: b,
19
+ to: x,
20
+ stroke: m,
21
+ strokeWidth: _,
22
+ strokeLinecap: "square",
23
+ ...v
24
+ }), f ? f({
25
+ ...C,
26
+ x: x.x,
27
+ y: T,
28
+ formattedValue: S
29
+ }) : /*#__PURE__*/ o(i, {
30
+ x: x.x,
31
+ y: T,
32
+ ...C,
33
+ children: S
34
+ })]
35
+ }, `visx-tick-${g}-${y}`);
36
+ });
37
+ }
38
+ //#endregion
39
+ export { l as default };
@@ -0,0 +1,9 @@
1
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/constants/orientation.js
2
+ var e = {
3
+ top: "top",
4
+ left: "left",
5
+ right: "right",
6
+ bottom: "bottom"
7
+ };
8
+ //#endregion
9
+ export { e as default };
@@ -0,0 +1,14 @@
1
+ import e from "../../../../../../@visx_point@4.0.0/node_modules/@visx/point/esm/Point.js";
2
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/utils/createPoint.js
3
+ function t(t, n) {
4
+ let { x: r, y: i } = t;
5
+ return new e(n ? {
6
+ x: r,
7
+ y: i
8
+ } : {
9
+ x: i,
10
+ y: r
11
+ });
12
+ }
13
+ //#endregion
14
+ export { t as default };
@@ -0,0 +1,13 @@
1
+ function e() {
2
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
3
+ return typeof e == "number" ? {
4
+ start: e,
5
+ end: e
6
+ } : {
7
+ start: 0,
8
+ end: 0,
9
+ ...e
10
+ };
11
+ }
12
+ //#endregion
13
+ export { e as default };
@@ -0,0 +1,16 @@
1
+ import e from "../constants/orientation.js";
2
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/utils/getLabelTransform.js
3
+ function t(t) {
4
+ let { labelOffset: n, labelProps: r, orientation: i, range: a, tickLabelFontSize: o, tickLength: s } = t, c = i === e.left || i === e.top ? -1 : 1, l, u, d;
5
+ if (i === e.top || i === e.bottom) {
6
+ let t = i === e.bottom && typeof r.fontSize == "number" ? r.fontSize : 0;
7
+ l = (Number(a[0]) + Number(a[a.length - 1])) / 2, u = c * (s + n + o + t);
8
+ } else l = c * ((Number(a[0]) + Number(a[a.length - 1])) / 2), u = -(s + n), d = `rotate(${c * 90})`;
9
+ return {
10
+ x: l,
11
+ y: u,
12
+ transform: d
13
+ };
14
+ }
15
+ //#endregion
16
+ export { t as default };
@@ -0,0 +1,8 @@
1
+ import e from "../../../../../../@visx_scale@4.0.0/node_modules/@visx/scale/esm/utils/toString.js";
2
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickFormatter.js
3
+ function t(t) {
4
+ let n = t;
5
+ return "tickFormat" in n ? n.tickFormat() : e;
6
+ }
7
+ //#endregion
8
+ export { t as default };
@@ -0,0 +1,14 @@
1
+ //#region ../../../node_modules/.bun/@visx+axis@4.0.0+d84c32d47042070f/node_modules/@visx/axis/esm/utils/getTickPosition.js
2
+ function e(e) {
3
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "center", n = e;
4
+ if (t !== "start" && "bandwidth" in n) {
5
+ let e = n.bandwidth();
6
+ return t === "center" && (e /= 2), n.round() && (e = Math.round(e)), (t) => {
7
+ let r = n(t);
8
+ return typeof r == "number" ? r + e : r;
9
+ };
10
+ }
11
+ return e;
12
+ }
13
+ //#endregion
14
+ export { e as default };
@@ -0,0 +1,43 @@
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 n from "../../../../../../@visx_group@4.0.0_d84c32d47042070f/node_modules/@visx/group/esm/Group.js";
4
+ import r from "./GridRows.js";
5
+ import i from "./GridColumns.js";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ //#region ../../../node_modules/.bun/@visx+grid@4.0.0+d84c32d47042070f/node_modules/@visx/grid/esm/grids/Grid.js
8
+ var s = /* @__PURE__ */ e(t());
9
+ function c(e) {
10
+ let { top: t, left: c, xScale: l, yScale: u, width: d, height: f, className: p, stroke: m, strokeWidth: h, strokeDasharray: g, numTicksRows: _, numTicksColumns: v, rowLineStyle: y, columnLineStyle: b, xOffset: x, yOffset: S, rowTickValues: C, columnTickValues: w, ...T } = e;
11
+ return /*#__PURE__*/ o(n, {
12
+ className: (0, s.default)("visx-grid", p),
13
+ top: t,
14
+ left: c,
15
+ children: [/*#__PURE__*/ a(r, {
16
+ className: p,
17
+ scale: u,
18
+ width: d,
19
+ stroke: m,
20
+ strokeWidth: h,
21
+ strokeDasharray: g,
22
+ numTicks: _,
23
+ lineStyle: y,
24
+ offset: S,
25
+ tickValues: C,
26
+ ...T
27
+ }), /*#__PURE__*/ a(i, {
28
+ className: p,
29
+ scale: l,
30
+ height: f,
31
+ stroke: m,
32
+ strokeWidth: h,
33
+ strokeDasharray: g,
34
+ numTicks: v,
35
+ lineStyle: b,
36
+ offset: x,
37
+ tickValues: w,
38
+ ...T
39
+ })]
40
+ });
41
+ }
42
+ //#endregion
43
+ export { c as default };