@pie-element/number-line 13.1.2-next.7 → 13.1.2-next.8

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.
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import * as math from 'mathjs';
10
10
  export declare const getMinorLimits: (domain: any, width: any) => {
11
- min: number & (number | math.MathCollection<math.MathNumericType>);
11
+ min: number & (number | math.MathCollection);
12
12
  max: number;
13
13
  };
14
14
  export declare const generateMinorValues: (minorLimits: any) => {
@@ -228,7 +228,7 @@ var i = [
228
228
  let i = {
229
229
  decimal: [],
230
230
  fraction: []
231
- }, a = e.fraction(e.number(e.number(t))), s = a.n, c = a.d;
231
+ }, a = e.fraction(e.number(e.number(t))), s = Number(a.n), c = Number(a.d);
232
232
  if (s >= 1 && c === 1) for (let a = 1; a <= 10; a++) {
233
233
  let o = e.number(e.multiply(s, a));
234
234
  S(n, r, {
@@ -241,7 +241,7 @@ var i = [
241
241
  S(n, r, {
242
242
  minor: t,
243
243
  major: e.number(l)
244
- }, { fraction: void 0 }).filter((e) => e.type === "major").length > 1 && (l.d === 1 ? i.fraction.push(l.n.toString()) : i.fraction.push(l.n + "/" + l.d), i.decimal.push(e.number(l)));
244
+ }, { fraction: void 0 }).filter((e) => e.type === "major").length > 1 && (Number(l.d) === 1 ? i.fraction.push(Number(l.n).toString()) : i.fraction.push(Number(l.n) + "/" + Number(l.d)), i.decimal.push(e.number(l)));
245
245
  }
246
246
  return i;
247
247
  }, S = (t, n, r, i) => y(t, n, r, i).map((t) => i.fraction ? t : {
@@ -42,10 +42,10 @@ export declare const zeroBasedRange: (start: any, end: any, interval: any) => an
42
42
  export declare const simpleRange: (start: any, end: any, interval: any) => (string | math.MathType)[];
43
43
  export declare const closeTo: (a: any, b: any, precision: any) => boolean;
44
44
  export declare const getMinorLimits: (domain: any, width: any) => {
45
- min: number & (number | math.MathCollection<math.MathNumericType>);
45
+ min: number & (number | math.MathCollection);
46
46
  max: number;
47
47
  };
48
- export declare const isMultiple: (multiple: any, src: any) => boolean | math.MathCollection<math.MathNumericType>;
48
+ export declare const isMultiple: (multiple: any, src: any) => boolean | math.MathCollection;
49
49
  /**
50
50
  * Accepts a fraction object {n,d,s} or number.
51
51
  * @param {*} v
@@ -251,7 +251,7 @@ var a = /* @__PURE__ */ e({
251
251
  let i = {
252
252
  decimal: [],
253
253
  fraction: []
254
- }, a = t.fraction(t.number(t.number(e))), o = a.n, s = a.d;
254
+ }, a = t.fraction(t.number(t.number(e))), o = Number(a.n), s = Number(a.d);
255
255
  if (o >= 1 && s === 1) for (let a = 1; a <= 10; a++) {
256
256
  let s = t.number(t.multiply(o, a));
257
257
  w(n, r, {
@@ -264,7 +264,7 @@ var a = /* @__PURE__ */ e({
264
264
  w(n, r, {
265
265
  minor: e,
266
266
  major: t.number(l)
267
- }, { fraction: void 0 }).filter((e) => e.type === "major").length > 1 && (l.d === 1 ? i.fraction.push(l.n.toString()) : i.fraction.push(l.n + "/" + l.d), i.decimal.push(t.number(l)));
267
+ }, { fraction: void 0 }).filter((e) => e.type === "major").length > 1 && (Number(l.d) === 1 ? i.fraction.push(Number(l.n).toString()) : i.fraction.push(Number(l.n) + "/" + Number(l.d)), i.decimal.push(t.number(l)));
268
268
  }
269
269
  return i;
270
270
  }, w = (e, n, r, i) => x(e, n, r, i).map((e) => i.fraction ? e : {
@@ -52,38 +52,38 @@ var s = n("text")({
52
52
  this.resizeObserver && this.resizeObserver.disconnect();
53
53
  }
54
54
  render() {
55
- let { x: e, y: n, type: r, xScale: o, fraction: l } = this.props, u = l && e.n !== e.d && e.n !== 0 && e.d !== 1, d = r === "major", f = d ? 20 : 10, { width: p = 0, height: m = 0, x: h = 0, y: g = 0 } = this.state.textBox, _ = l ? u ? /* @__PURE__ */ a(t.Fragment, { children: [/* @__PURE__ */ i("tspan", {
55
+ let { x: e, y: n, type: r, xScale: o, fraction: l } = this.props, u = l ? Number(e.n) : e.n, d = l ? Number(e.d) : e.d, f = l ? Number(e.s) : e.s, p = l && u !== d && u !== 0 && d !== 1, m = r === "major", h = m ? 20 : 10, { width: g = 0, height: _ = 0, x: v = 0, y = 0 } = this.state.textBox, b = l ? p ? /* @__PURE__ */ a(t.Fragment, { children: [/* @__PURE__ */ i("tspan", {
56
56
  x: "0",
57
57
  dy: "0.71em",
58
- children: e.n * e.s
58
+ children: u * f
59
59
  }), /* @__PURE__ */ i("tspan", {
60
60
  x: "0",
61
61
  dy: "1.11em",
62
- children: e.d
63
- })] }) : e.n * e.s : Number(e.toFixed(3));
62
+ children: d
63
+ })] }) : u * f : Number(e.toFixed(3));
64
64
  return /* @__PURE__ */ a("g", {
65
65
  opacity: "1",
66
66
  transform: `translate(${o(e)}, ${n})`,
67
67
  children: [
68
68
  /* @__PURE__ */ i(c, {
69
- y1: f / 2 * -1,
70
- y2: f / 2,
69
+ y1: h / 2 * -1,
70
+ y2: h / 2,
71
71
  x1: "0.5",
72
72
  x2: "0.5"
73
73
  }),
74
- u && /* @__PURE__ */ i(c, {
75
- x1: h,
76
- x2: h + p,
77
- y1: g + m / 2,
78
- y2: g + m / 2
74
+ p && /* @__PURE__ */ i(c, {
75
+ x1: v,
76
+ x2: v + g,
77
+ y1: y + _ / 2,
78
+ y2: y + _ / 2
79
79
  }),
80
- d && /* @__PURE__ */ i(s, {
80
+ m && /* @__PURE__ */ i(s, {
81
81
  ref: (e) => this.text = e,
82
82
  y: "14",
83
83
  width: "10",
84
84
  dy: "0.71em",
85
- textAnchor: u && "middle",
86
- children: _
85
+ textAnchor: p && "middle",
86
+ children: b
87
87
  })
88
88
  ]
89
89
  });