@pie-lib/plot 5.0.1-next.20261004003105 → 5.0.1-next.20261004011201
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/__tests__/root-name.test.d.ts +1 -0
- package/dist/root.d.ts +2 -0
- package/dist/root.js +37 -25
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/root.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ export declare class Root extends React.Component {
|
|
|
45
45
|
titlePlaceholder: PropTypes.Requireable<string>;
|
|
46
46
|
mathMlOptions: PropTypes.Requireable<object>;
|
|
47
47
|
labelsCharactersLimit: PropTypes.Requireable<number>;
|
|
48
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
49
|
+
ariaDescription: PropTypes.Requireable<string>;
|
|
48
50
|
};
|
|
49
51
|
mouseMove: any;
|
|
50
52
|
componentDidMount(): void;
|
package/dist/root.js
CHANGED
|
@@ -82,7 +82,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
82
82
|
"&:not(:last-child)": { marginBottom: "80px" }
|
|
83
83
|
}), F = class extends o.Component {
|
|
84
84
|
constructor(e) {
|
|
85
|
-
super(e), this.state = { titleHeight: 0 }, this.resizeObserver = null
|
|
85
|
+
super(e), this.state = { titleHeight: 0 }, this.resizeObserver = null, this.descriptionId = `plot-description-${Math.random().toString(36).slice(2, 10)}`;
|
|
86
86
|
}
|
|
87
87
|
static propTypes = {
|
|
88
88
|
title: c.string,
|
|
@@ -103,7 +103,9 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
103
103
|
onChangeLabels: c.func,
|
|
104
104
|
titlePlaceholder: c.string,
|
|
105
105
|
mathMlOptions: c.object,
|
|
106
|
-
labelsCharactersLimit: c.number
|
|
106
|
+
labelsCharactersLimit: c.number,
|
|
107
|
+
ariaLabel: c.string,
|
|
108
|
+
ariaDescription: c.string
|
|
107
109
|
};
|
|
108
110
|
mouseMove = (e, t) => {
|
|
109
111
|
let { graphProps: n, onMouseMove: r } = this.props;
|
|
@@ -169,7 +171,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
169
171
|
this.resizeObserver &&= (this.resizeObserver.disconnect(), null);
|
|
170
172
|
};
|
|
171
173
|
render() {
|
|
172
|
-
let { disabledTitle: e, disabledLabels: t, labels: o, labelsPlaceholders: s, titlePlaceholder: c, graphProps: l, children: u, defineChart: d, onChangeTitle: f, isChart: p, showLabels: _, showPixelGuides: v, showTitle: b, title: x, rootRef: S, mathMlOptions: C = {}, labelsCharactersLimit: F } = this.props, { size: { width:
|
|
174
|
+
let { disabledTitle: e, disabledLabels: t, labels: o, labelsPlaceholders: s, titlePlaceholder: c, graphProps: l, children: u, defineChart: d, onChangeTitle: f, isChart: p, showLabels: _, showPixelGuides: v, showTitle: b, title: x, rootRef: S, mathMlOptions: C = {}, labelsCharactersLimit: F, ariaLabel: I, ariaDescription: L } = this.props, { size: { width: R = 500, height: z = 500 }, domain: B, range: V } = l, H = i(n(o?.left)) && r(s) ? 48 : 70, U = i(n(o?.right)) && r(s) ? 48 : 70, W = R + H + U + (B.padding || 0) * 2, G = z + 80 + (V.padding || 0) * 2, K = [
|
|
173
175
|
"bold",
|
|
174
176
|
"italic",
|
|
175
177
|
"underline",
|
|
@@ -177,11 +179,20 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
177
179
|
"subscript",
|
|
178
180
|
"strikethrough",
|
|
179
181
|
"math"
|
|
180
|
-
],
|
|
182
|
+
], q = d && v ? z - 160 : z, J = parseInt(R / 100), Y = parseInt(q / 100), X = parseInt(q % 100), { titleHeight: Z } = this.state, Q = {
|
|
183
|
+
...I && {
|
|
184
|
+
role: "group",
|
|
185
|
+
"aria-label": I
|
|
186
|
+
},
|
|
187
|
+
...L && { "aria-describedby": this.descriptionId }
|
|
188
|
+
}, $ = L ? /* @__PURE__ */ m("desc", {
|
|
189
|
+
id: this.descriptionId,
|
|
190
|
+
children: L
|
|
191
|
+
}) : null;
|
|
181
192
|
return /* @__PURE__ */ h(w, { children: [
|
|
182
193
|
v && /* @__PURE__ */ m(j, {
|
|
183
194
|
style: { marginLeft: p ? 80 : _ ? 30 : 10 },
|
|
184
|
-
children: [...Array(
|
|
195
|
+
children: [...Array(J + 1).keys()].map((e) => /* @__PURE__ */ m(y, {
|
|
185
196
|
false: !0,
|
|
186
197
|
children: /* @__PURE__ */ h(M, { children: [/* @__PURE__ */ h("div", { children: [e * 100, "px"] }), /* @__PURE__ */ m("div", { children: "|" })] })
|
|
187
198
|
}, `top-guide-${e}`))
|
|
@@ -189,7 +200,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
189
200
|
b && (e ? /* @__PURE__ */ m("div", {
|
|
190
201
|
ref: (e) => this.titleRef = e,
|
|
191
202
|
style: {
|
|
192
|
-
...p && { width:
|
|
203
|
+
...p && { width: W },
|
|
193
204
|
...i(n(x)) && { display: "none" }
|
|
194
205
|
},
|
|
195
206
|
children: m(p ? A : k, {
|
|
@@ -201,7 +212,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
201
212
|
children: m(p ? A : k, {
|
|
202
213
|
className: v ? "rightMargin" : "",
|
|
203
214
|
children: /* @__PURE__ */ m(g, {
|
|
204
|
-
...p && { width:
|
|
215
|
+
...p && { width: W },
|
|
205
216
|
markup: x || "",
|
|
206
217
|
onChange: f,
|
|
207
218
|
placeholder: d && c || !e && "Click here to add a title for this graph",
|
|
@@ -209,7 +220,7 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
209
220
|
noPadding: !0,
|
|
210
221
|
noBorder: !0
|
|
211
222
|
},
|
|
212
|
-
activePlugins:
|
|
223
|
+
activePlugins: K,
|
|
213
224
|
disableScrollbar: !0,
|
|
214
225
|
onKeyDown: this.handleKeyDown
|
|
215
226
|
})
|
|
@@ -220,8 +231,8 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
220
231
|
text: o.top,
|
|
221
232
|
disabledLabel: t,
|
|
222
233
|
placeholder: s?.top,
|
|
223
|
-
graphHeight:
|
|
224
|
-
graphWidth:
|
|
234
|
+
graphHeight: G,
|
|
235
|
+
graphWidth: W,
|
|
225
236
|
onChange: (e) => this.onChangeLabel(e, "top"),
|
|
226
237
|
mathMlOptions: C,
|
|
227
238
|
preventNewLines: !0,
|
|
@@ -233,8 +244,8 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
233
244
|
text: o.left,
|
|
234
245
|
disabledLabel: t,
|
|
235
246
|
placeholder: s?.left,
|
|
236
|
-
graphHeight:
|
|
237
|
-
graphWidth:
|
|
247
|
+
graphHeight: G,
|
|
248
|
+
graphWidth: W,
|
|
238
249
|
isChartLeftLabel: p && !d,
|
|
239
250
|
isDefineChartLeftLabel: p && d,
|
|
240
251
|
onChange: (e) => this.onChangeLabel(e, "left"),
|
|
@@ -242,24 +253,25 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
242
253
|
preventNewLines: !0,
|
|
243
254
|
charactersLimit: F
|
|
244
255
|
}),
|
|
245
|
-
|
|
246
|
-
width:
|
|
247
|
-
height:
|
|
248
|
-
|
|
256
|
+
h(d ? E : D, {
|
|
257
|
+
width: W,
|
|
258
|
+
height: G,
|
|
259
|
+
...Q,
|
|
260
|
+
children: [$, /* @__PURE__ */ m(O, {
|
|
249
261
|
ref: (e) => {
|
|
250
262
|
this.g = e, S && S(e);
|
|
251
263
|
},
|
|
252
|
-
transform: `translate(${
|
|
264
|
+
transform: `translate(${H + (B.padding || 0)}, ${40 + (V.padding || 0)})`,
|
|
253
265
|
children: u
|
|
254
|
-
})
|
|
266
|
+
})]
|
|
255
267
|
}),
|
|
256
268
|
_ && !p && /* @__PURE__ */ m(a, {
|
|
257
269
|
side: "right",
|
|
258
270
|
text: o.right,
|
|
259
271
|
disabledLabel: t,
|
|
260
272
|
placeholder: s?.right,
|
|
261
|
-
graphHeight:
|
|
262
|
-
graphWidth:
|
|
273
|
+
graphHeight: G,
|
|
274
|
+
graphWidth: W,
|
|
263
275
|
onChange: (e) => this.onChangeLabel(e, "right"),
|
|
264
276
|
mathMlOptions: C,
|
|
265
277
|
preventNewLines: !0,
|
|
@@ -267,10 +279,10 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
267
279
|
}),
|
|
268
280
|
v && /* @__PURE__ */ m(N, {
|
|
269
281
|
style: {
|
|
270
|
-
paddingTop:
|
|
282
|
+
paddingTop: X,
|
|
271
283
|
marginTop: 31
|
|
272
284
|
},
|
|
273
|
-
children: [...Array(
|
|
285
|
+
children: [...Array(Y + 1).keys()].reverse().map((e) => /* @__PURE__ */ m(y, {
|
|
274
286
|
false: !0,
|
|
275
287
|
children: /* @__PURE__ */ h(P, { children: [
|
|
276
288
|
"━ ",
|
|
@@ -285,9 +297,9 @@ var y = v(f, "Readable") || v(S.Readable, "Readable"), b = d, x = b.default, S =
|
|
|
285
297
|
text: o.bottom,
|
|
286
298
|
disabledLabel: t,
|
|
287
299
|
placeholder: s?.bottom,
|
|
288
|
-
graphHeight:
|
|
289
|
-
graphWidth:
|
|
290
|
-
titleHeight:
|
|
300
|
+
graphHeight: G,
|
|
301
|
+
graphWidth: W,
|
|
302
|
+
titleHeight: Z,
|
|
291
303
|
isChartBottomLabel: p && !d,
|
|
292
304
|
isDefineChartBottomLabel: p && d,
|
|
293
305
|
onChange: (e) => this.onChangeLabel(e, "bottom"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/plot",
|
|
3
|
-
"version": "5.0.1-next.
|
|
3
|
+
"version": "5.0.1-next.20261004011201",
|
|
4
4
|
"description": "Some underlying components for building charts/graphs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@mapbox/point-geometry": "^1.1.0",
|
|
14
14
|
"@mui/icons-material": "^7.3.4",
|
|
15
15
|
"@mui/material": "^7.3.4",
|
|
16
|
-
"@pie-lib/editable-html-tip-tap": "3.0.1-next.
|
|
16
|
+
"@pie-lib/editable-html-tip-tap": "3.0.1-next.20261004011201",
|
|
17
17
|
"@pie-lib/render-ui": "8.0.1-next.20261003161149",
|
|
18
18
|
"assert": "^1.4.1",
|
|
19
19
|
"d3-scale": "^4.0.2",
|