@mui/x-charts-vendor 8.14.0 → 8.14.1

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 (43) hide show
  1. package/README.md +2 -7
  2. package/package.json +2 -6
  3. package/d3-delaunay.d.ts +0 -5
  4. package/d3-delaunay.js +0 -7
  5. package/delaunator.d.ts +0 -5
  6. package/delaunator.js +0 -7
  7. package/es/d3-delaunay.mjs +0 -6
  8. package/es/delaunator.mjs +0 -6
  9. package/es/robust-predicates.mjs +0 -6
  10. package/lib/d3-delaunay.js +0 -6
  11. package/lib/delaunator.js +0 -6
  12. package/lib/robust-predicates.js +0 -6
  13. package/lib-vendor/d3-delaunay/LICENSE +0 -14
  14. package/lib-vendor/d3-delaunay/dist/d3-delaunay.js +0 -1398
  15. package/lib-vendor/d3-delaunay/dist/d3-delaunay.min.js +0 -853
  16. package/lib-vendor/d3-delaunay/src/delaunay.js +0 -282
  17. package/lib-vendor/d3-delaunay/src/index.js +0 -20
  18. package/lib-vendor/d3-delaunay/src/path.js +0 -43
  19. package/lib-vendor/d3-delaunay/src/polygon.js +0 -24
  20. package/lib-vendor/d3-delaunay/src/voronoi.js +0 -390
  21. package/lib-vendor/delaunator/LICENSE +0 -15
  22. package/lib-vendor/delaunator/delaunator.js +0 -688
  23. package/lib-vendor/delaunator/delaunator.min.js +0 -316
  24. package/lib-vendor/delaunator/index.js +0 -440
  25. package/lib-vendor/robust-predicates/LICENSE +0 -24
  26. package/lib-vendor/robust-predicates/esm/incircle.js +0 -667
  27. package/lib-vendor/robust-predicates/esm/insphere.js +0 -693
  28. package/lib-vendor/robust-predicates/esm/orient2d.js +0 -174
  29. package/lib-vendor/robust-predicates/esm/orient3d.js +0 -422
  30. package/lib-vendor/robust-predicates/esm/util.js +0 -147
  31. package/lib-vendor/robust-predicates/index.js +0 -57
  32. package/lib-vendor/robust-predicates/umd/incircle.js +0 -798
  33. package/lib-vendor/robust-predicates/umd/incircle.min.js +0 -170
  34. package/lib-vendor/robust-predicates/umd/insphere.js +0 -828
  35. package/lib-vendor/robust-predicates/umd/insphere.min.js +0 -223
  36. package/lib-vendor/robust-predicates/umd/orient2d.js +0 -260
  37. package/lib-vendor/robust-predicates/umd/orient2d.min.js +0 -69
  38. package/lib-vendor/robust-predicates/umd/orient3d.js +0 -550
  39. package/lib-vendor/robust-predicates/umd/orient3d.min.js +0 -133
  40. package/lib-vendor/robust-predicates/umd/predicates.js +0 -2073
  41. package/lib-vendor/robust-predicates/umd/predicates.min.js +0 -468
  42. package/robust-predicates.d.ts +0 -5
  43. package/robust-predicates.js +0 -7
@@ -1,440 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _index = require("../../lib-vendor/robust-predicates/index.js");
8
- const EPSILON = Math.pow(2, -52);
9
- const EDGE_STACK = new Uint32Array(512);
10
- class Delaunator {
11
- static from(points, getX = defaultGetX, getY = defaultGetY) {
12
- const n = points.length;
13
- const coords = new Float64Array(n * 2);
14
- for (let i = 0; i < n; i++) {
15
- const p = points[i];
16
- coords[2 * i] = getX(p);
17
- coords[2 * i + 1] = getY(p);
18
- }
19
- return new Delaunator(coords);
20
- }
21
- constructor(coords) {
22
- const n = coords.length >> 1;
23
- if (n > 0 && typeof coords[0] !== 'number') throw new Error('Expected coords to contain numbers.');
24
- this.coords = coords;
25
-
26
- // arrays that will store the triangulation graph
27
- const maxTriangles = Math.max(2 * n - 5, 0);
28
- this._triangles = new Uint32Array(maxTriangles * 3);
29
- this._halfedges = new Int32Array(maxTriangles * 3);
30
-
31
- // temporary arrays for tracking the edges of the advancing convex hull
32
- this._hashSize = Math.ceil(Math.sqrt(n));
33
- this._hullPrev = new Uint32Array(n); // edge to prev edge
34
- this._hullNext = new Uint32Array(n); // edge to next edge
35
- this._hullTri = new Uint32Array(n); // edge to adjacent triangle
36
- this._hullHash = new Int32Array(this._hashSize); // angular edge hash
37
-
38
- // temporary arrays for sorting points
39
- this._ids = new Uint32Array(n);
40
- this._dists = new Float64Array(n);
41
- this.update();
42
- }
43
- update() {
44
- const {
45
- coords,
46
- _hullPrev: hullPrev,
47
- _hullNext: hullNext,
48
- _hullTri: hullTri,
49
- _hullHash: hullHash
50
- } = this;
51
- const n = coords.length >> 1;
52
-
53
- // populate an array of point indices; calculate input data bbox
54
- let minX = Infinity;
55
- let minY = Infinity;
56
- let maxX = -Infinity;
57
- let maxY = -Infinity;
58
- for (let i = 0; i < n; i++) {
59
- const x = coords[2 * i];
60
- const y = coords[2 * i + 1];
61
- if (x < minX) minX = x;
62
- if (y < minY) minY = y;
63
- if (x > maxX) maxX = x;
64
- if (y > maxY) maxY = y;
65
- this._ids[i] = i;
66
- }
67
- const cx = (minX + maxX) / 2;
68
- const cy = (minY + maxY) / 2;
69
- let i0, i1, i2;
70
-
71
- // pick a seed point close to the center
72
- for (let i = 0, minDist = Infinity; i < n; i++) {
73
- const d = dist(cx, cy, coords[2 * i], coords[2 * i + 1]);
74
- if (d < minDist) {
75
- i0 = i;
76
- minDist = d;
77
- }
78
- }
79
- const i0x = coords[2 * i0];
80
- const i0y = coords[2 * i0 + 1];
81
-
82
- // find the point closest to the seed
83
- for (let i = 0, minDist = Infinity; i < n; i++) {
84
- if (i === i0) continue;
85
- const d = dist(i0x, i0y, coords[2 * i], coords[2 * i + 1]);
86
- if (d < minDist && d > 0) {
87
- i1 = i;
88
- minDist = d;
89
- }
90
- }
91
- let i1x = coords[2 * i1];
92
- let i1y = coords[2 * i1 + 1];
93
- let minRadius = Infinity;
94
-
95
- // find the third point which forms the smallest circumcircle with the first two
96
- for (let i = 0; i < n; i++) {
97
- if (i === i0 || i === i1) continue;
98
- const r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i], coords[2 * i + 1]);
99
- if (r < minRadius) {
100
- i2 = i;
101
- minRadius = r;
102
- }
103
- }
104
- let i2x = coords[2 * i2];
105
- let i2y = coords[2 * i2 + 1];
106
- if (minRadius === Infinity) {
107
- // order collinear points by dx (or dy if all x are identical)
108
- // and return the list as a hull
109
- for (let i = 0; i < n; i++) {
110
- this._dists[i] = coords[2 * i] - coords[0] || coords[2 * i + 1] - coords[1];
111
- }
112
- quicksort(this._ids, this._dists, 0, n - 1);
113
- const hull = new Uint32Array(n);
114
- let j = 0;
115
- for (let i = 0, d0 = -Infinity; i < n; i++) {
116
- const id = this._ids[i];
117
- const d = this._dists[id];
118
- if (d > d0) {
119
- hull[j++] = id;
120
- d0 = d;
121
- }
122
- }
123
- this.hull = hull.subarray(0, j);
124
- this.triangles = new Uint32Array(0);
125
- this.halfedges = new Uint32Array(0);
126
- return;
127
- }
128
-
129
- // swap the order of the seed points for counter-clockwise orientation
130
- if ((0, _index.orient2d)(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {
131
- const i = i1;
132
- const x = i1x;
133
- const y = i1y;
134
- i1 = i2;
135
- i1x = i2x;
136
- i1y = i2y;
137
- i2 = i;
138
- i2x = x;
139
- i2y = y;
140
- }
141
- const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);
142
- this._cx = center.x;
143
- this._cy = center.y;
144
- for (let i = 0; i < n; i++) {
145
- this._dists[i] = dist(coords[2 * i], coords[2 * i + 1], center.x, center.y);
146
- }
147
-
148
- // sort the points by distance from the seed triangle circumcenter
149
- quicksort(this._ids, this._dists, 0, n - 1);
150
-
151
- // set up the seed triangle as the starting hull
152
- this._hullStart = i0;
153
- let hullSize = 3;
154
- hullNext[i0] = hullPrev[i2] = i1;
155
- hullNext[i1] = hullPrev[i0] = i2;
156
- hullNext[i2] = hullPrev[i1] = i0;
157
- hullTri[i0] = 0;
158
- hullTri[i1] = 1;
159
- hullTri[i2] = 2;
160
- hullHash.fill(-1);
161
- hullHash[this._hashKey(i0x, i0y)] = i0;
162
- hullHash[this._hashKey(i1x, i1y)] = i1;
163
- hullHash[this._hashKey(i2x, i2y)] = i2;
164
- this.trianglesLen = 0;
165
- this._addTriangle(i0, i1, i2, -1, -1, -1);
166
- for (let k = 0, xp, yp; k < this._ids.length; k++) {
167
- const i = this._ids[k];
168
- const x = coords[2 * i];
169
- const y = coords[2 * i + 1];
170
-
171
- // skip near-duplicate points
172
- if (k > 0 && Math.abs(x - xp) <= EPSILON && Math.abs(y - yp) <= EPSILON) continue;
173
- xp = x;
174
- yp = y;
175
-
176
- // skip seed triangle points
177
- if (i === i0 || i === i1 || i === i2) continue;
178
-
179
- // find a visible edge on the convex hull using edge hash
180
- let start = 0;
181
- for (let j = 0, key = this._hashKey(x, y); j < this._hashSize; j++) {
182
- start = hullHash[(key + j) % this._hashSize];
183
- if (start !== -1 && start !== hullNext[start]) break;
184
- }
185
- start = hullPrev[start];
186
- let e = start,
187
- q;
188
- while (q = hullNext[e], (0, _index.orient2d)(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]) >= 0) {
189
- e = q;
190
- if (e === start) {
191
- e = -1;
192
- break;
193
- }
194
- }
195
- if (e === -1) continue; // likely a near-duplicate point; skip it
196
-
197
- // add the first triangle from the point
198
- let t = this._addTriangle(e, i, hullNext[e], -1, -1, hullTri[e]);
199
-
200
- // recursively flip triangles from the point until they satisfy the Delaunay condition
201
- hullTri[i] = this._legalize(t + 2);
202
- hullTri[e] = t; // keep track of boundary triangles on the hull
203
- hullSize++;
204
-
205
- // walk forward through the hull, adding more triangles and flipping recursively
206
- let n = hullNext[e];
207
- while (q = hullNext[n], (0, _index.orient2d)(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1]) < 0) {
208
- t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);
209
- hullTri[i] = this._legalize(t + 2);
210
- hullNext[n] = n; // mark as removed
211
- hullSize--;
212
- n = q;
213
- }
214
-
215
- // walk backward from the other side, adding more triangles and flipping
216
- if (e === start) {
217
- while (q = hullPrev[e], (0, _index.orient2d)(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1]) < 0) {
218
- t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);
219
- this._legalize(t + 2);
220
- hullTri[q] = t;
221
- hullNext[e] = e; // mark as removed
222
- hullSize--;
223
- e = q;
224
- }
225
- }
226
-
227
- // update the hull indices
228
- this._hullStart = hullPrev[i] = e;
229
- hullNext[e] = hullPrev[n] = i;
230
- hullNext[i] = n;
231
-
232
- // save the two new edges in the hash table
233
- hullHash[this._hashKey(x, y)] = i;
234
- hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;
235
- }
236
- this.hull = new Uint32Array(hullSize);
237
- for (let i = 0, e = this._hullStart; i < hullSize; i++) {
238
- this.hull[i] = e;
239
- e = hullNext[e];
240
- }
241
-
242
- // trim typed triangle mesh arrays
243
- this.triangles = this._triangles.subarray(0, this.trianglesLen);
244
- this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
245
- }
246
- _hashKey(x, y) {
247
- return Math.floor(pseudoAngle(x - this._cx, y - this._cy) * this._hashSize) % this._hashSize;
248
- }
249
- _legalize(a) {
250
- const {
251
- _triangles: triangles,
252
- _halfedges: halfedges,
253
- coords
254
- } = this;
255
- let i = 0;
256
- let ar = 0;
257
-
258
- // recursion eliminated with a fixed-size stack
259
- while (true) {
260
- const b = halfedges[a];
261
-
262
- /* if the pair of triangles doesn't satisfy the Delaunay condition
263
- * (p1 is inside the circumcircle of [p0, pl, pr]), flip them,
264
- * then do the same check/flip recursively for the new pair of triangles
265
- *
266
- * pl pl
267
- * /||\ / \
268
- * al/ || \bl al/ \a
269
- * / || \ / \
270
- * / a||b \ flip /___ar___\
271
- * p0\ || /p1 => p0\---bl---/p1
272
- * \ || / \ /
273
- * ar\ || /br b\ /br
274
- * \||/ \ /
275
- * pr pr
276
- */
277
- const a0 = a - a % 3;
278
- ar = a0 + (a + 2) % 3;
279
- if (b === -1) {
280
- // convex hull edge
281
- if (i === 0) break;
282
- a = EDGE_STACK[--i];
283
- continue;
284
- }
285
- const b0 = b - b % 3;
286
- const al = a0 + (a + 1) % 3;
287
- const bl = b0 + (b + 2) % 3;
288
- const p0 = triangles[ar];
289
- const pr = triangles[a];
290
- const pl = triangles[al];
291
- const p1 = triangles[bl];
292
- const illegal = inCircle(coords[2 * p0], coords[2 * p0 + 1], coords[2 * pr], coords[2 * pr + 1], coords[2 * pl], coords[2 * pl + 1], coords[2 * p1], coords[2 * p1 + 1]);
293
- if (illegal) {
294
- triangles[a] = p1;
295
- triangles[b] = p0;
296
- const hbl = halfedges[bl];
297
-
298
- // edge swapped on the other side of the hull (rare); fix the halfedge reference
299
- if (hbl === -1) {
300
- let e = this._hullStart;
301
- do {
302
- if (this._hullTri[e] === bl) {
303
- this._hullTri[e] = a;
304
- break;
305
- }
306
- e = this._hullPrev[e];
307
- } while (e !== this._hullStart);
308
- }
309
- this._link(a, hbl);
310
- this._link(b, halfedges[ar]);
311
- this._link(ar, bl);
312
- const br = b0 + (b + 1) % 3;
313
-
314
- // don't worry about hitting the cap: it can only happen on extremely degenerate input
315
- if (i < EDGE_STACK.length) {
316
- EDGE_STACK[i++] = br;
317
- }
318
- } else {
319
- if (i === 0) break;
320
- a = EDGE_STACK[--i];
321
- }
322
- }
323
- return ar;
324
- }
325
- _link(a, b) {
326
- this._halfedges[a] = b;
327
- if (b !== -1) this._halfedges[b] = a;
328
- }
329
-
330
- // add a new triangle given vertex indices and adjacent half-edge ids
331
- _addTriangle(i0, i1, i2, a, b, c) {
332
- const t = this.trianglesLen;
333
- this._triangles[t] = i0;
334
- this._triangles[t + 1] = i1;
335
- this._triangles[t + 2] = i2;
336
- this._link(t, a);
337
- this._link(t + 1, b);
338
- this._link(t + 2, c);
339
- this.trianglesLen += 3;
340
- return t;
341
- }
342
- }
343
-
344
- // monotonically increases with real angle, but doesn't need expensive trigonometry
345
- exports.default = Delaunator;
346
- function pseudoAngle(dx, dy) {
347
- const p = dx / (Math.abs(dx) + Math.abs(dy));
348
- return (dy > 0 ? 3 - p : 1 + p) / 4; // [0..1]
349
- }
350
- function dist(ax, ay, bx, by) {
351
- const dx = ax - bx;
352
- const dy = ay - by;
353
- return dx * dx + dy * dy;
354
- }
355
- function inCircle(ax, ay, bx, by, cx, cy, px, py) {
356
- const dx = ax - px;
357
- const dy = ay - py;
358
- const ex = bx - px;
359
- const ey = by - py;
360
- const fx = cx - px;
361
- const fy = cy - py;
362
- const ap = dx * dx + dy * dy;
363
- const bp = ex * ex + ey * ey;
364
- const cp = fx * fx + fy * fy;
365
- return dx * (ey * cp - bp * fy) - dy * (ex * cp - bp * fx) + ap * (ex * fy - ey * fx) < 0;
366
- }
367
- function circumradius(ax, ay, bx, by, cx, cy) {
368
- const dx = bx - ax;
369
- const dy = by - ay;
370
- const ex = cx - ax;
371
- const ey = cy - ay;
372
- const bl = dx * dx + dy * dy;
373
- const cl = ex * ex + ey * ey;
374
- const d = 0.5 / (dx * ey - dy * ex);
375
- const x = (ey * bl - dy * cl) * d;
376
- const y = (dx * cl - ex * bl) * d;
377
- return x * x + y * y;
378
- }
379
- function circumcenter(ax, ay, bx, by, cx, cy) {
380
- const dx = bx - ax;
381
- const dy = by - ay;
382
- const ex = cx - ax;
383
- const ey = cy - ay;
384
- const bl = dx * dx + dy * dy;
385
- const cl = ex * ex + ey * ey;
386
- const d = 0.5 / (dx * ey - dy * ex);
387
- const x = ax + (ey * bl - dy * cl) * d;
388
- const y = ay + (dx * cl - ex * bl) * d;
389
- return {
390
- x,
391
- y
392
- };
393
- }
394
- function quicksort(ids, dists, left, right) {
395
- if (right - left <= 20) {
396
- for (let i = left + 1; i <= right; i++) {
397
- const temp = ids[i];
398
- const tempDist = dists[temp];
399
- let j = i - 1;
400
- while (j >= left && dists[ids[j]] > tempDist) ids[j + 1] = ids[j--];
401
- ids[j + 1] = temp;
402
- }
403
- } else {
404
- const median = left + right >> 1;
405
- let i = left + 1;
406
- let j = right;
407
- swap(ids, median, i);
408
- if (dists[ids[left]] > dists[ids[right]]) swap(ids, left, right);
409
- if (dists[ids[i]] > dists[ids[right]]) swap(ids, i, right);
410
- if (dists[ids[left]] > dists[ids[i]]) swap(ids, left, i);
411
- const temp = ids[i];
412
- const tempDist = dists[temp];
413
- while (true) {
414
- do i++; while (dists[ids[i]] < tempDist);
415
- do j--; while (dists[ids[j]] > tempDist);
416
- if (j < i) break;
417
- swap(ids, i, j);
418
- }
419
- ids[left + 1] = ids[j];
420
- ids[j] = temp;
421
- if (right - i + 1 >= j - left) {
422
- quicksort(ids, dists, i, right);
423
- quicksort(ids, dists, left, j - 1);
424
- } else {
425
- quicksort(ids, dists, left, j - 1);
426
- quicksort(ids, dists, i, right);
427
- }
428
- }
429
- }
430
- function swap(arr, i, j) {
431
- const tmp = arr[i];
432
- arr[i] = arr[j];
433
- arr[j] = tmp;
434
- }
435
- function defaultGetX(p) {
436
- return p[0];
437
- }
438
- function defaultGetY(p) {
439
- return p[1];
440
- }
@@ -1,24 +0,0 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <http://unlicense.org>