deepbox 0.1.0 → 0.2.0

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 (165) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +39 -37
  3. package/dist/{CSRMatrix-KzNt6QpS.d.ts → CSRMatrix-B7XtUAZO.d.cts} +3 -3
  4. package/dist/{CSRMatrix-CwGwQRea.d.cts → CSRMatrix-CtD23fRM.d.ts} +3 -3
  5. package/dist/{Tensor-BQLk1ltW.d.cts → Tensor-BORFp_zt.d.ts} +27 -7
  6. package/dist/{Tensor-g8mUClel.d.ts → Tensor-fxBg-TFZ.d.cts} +27 -7
  7. package/dist/{chunk-FJYLIGJX.js → chunk-3AX37GPK.js} +33 -7
  8. package/dist/chunk-3AX37GPK.js.map +1 -0
  9. package/dist/{chunk-PR647I7R.js → chunk-3YFEYDHN.js} +21 -4
  10. package/dist/chunk-3YFEYDHN.js.map +1 -0
  11. package/dist/{chunk-XMWVME2W.js → chunk-6SX26MAJ.js} +4 -4
  12. package/dist/{chunk-XMWVME2W.js.map → chunk-6SX26MAJ.js.map} +1 -1
  13. package/dist/{chunk-C4PKXY74.cjs → chunk-6X7XFNDO.cjs} +94 -77
  14. package/dist/chunk-6X7XFNDO.cjs.map +1 -0
  15. package/dist/{chunk-6AE5FKKQ.cjs → chunk-724CXHFH.cjs} +1211 -919
  16. package/dist/chunk-724CXHFH.cjs.map +1 -0
  17. package/dist/{chunk-AU7XHGKJ.js → chunk-AJTKVBY5.js} +4 -4
  18. package/dist/{chunk-AU7XHGKJ.js.map → chunk-AJTKVBY5.js.map} +1 -1
  19. package/dist/{chunk-ZB75FESB.cjs → chunk-AV6WGSYX.cjs} +130 -104
  20. package/dist/chunk-AV6WGSYX.cjs.map +1 -0
  21. package/dist/{chunk-ZLW62TJG.cjs → chunk-BWOSU234.cjs} +142 -141
  22. package/dist/chunk-BWOSU234.cjs.map +1 -0
  23. package/dist/{chunk-4S73VUBD.js → chunk-CZOMBUI7.js} +3 -3
  24. package/dist/chunk-CZOMBUI7.js.map +1 -0
  25. package/dist/{chunk-QERHVCHC.cjs → chunk-EUZHJDZ6.cjs} +419 -364
  26. package/dist/chunk-EUZHJDZ6.cjs.map +1 -0
  27. package/dist/{chunk-AD436M45.js → chunk-G2G55ATL.js} +120 -58
  28. package/dist/chunk-G2G55ATL.js.map +1 -0
  29. package/dist/{chunk-5R4S63PF.js → chunk-G3WNLNYS.js} +119 -64
  30. package/dist/chunk-G3WNLNYS.js.map +1 -0
  31. package/dist/{chunk-XEG44RF6.cjs → chunk-G7KXZHG6.cjs} +105 -95
  32. package/dist/chunk-G7KXZHG6.cjs.map +1 -0
  33. package/dist/{chunk-MLBMYKCG.js → chunk-H3JR7SV2.js} +255 -113
  34. package/dist/chunk-H3JR7SV2.js.map +1 -0
  35. package/dist/{chunk-PHV2DKRS.cjs → chunk-HDKMIG6E.cjs} +107 -107
  36. package/dist/{chunk-PHV2DKRS.cjs.map → chunk-HDKMIG6E.cjs.map} +1 -1
  37. package/dist/{chunk-ALS7ETWZ.cjs → chunk-HI2EZHCJ.cjs} +111 -102
  38. package/dist/chunk-HI2EZHCJ.cjs.map +1 -0
  39. package/dist/{chunk-OX6QXFMV.cjs → chunk-IT4BZUYE.cjs} +490 -428
  40. package/dist/chunk-IT4BZUYE.cjs.map +1 -0
  41. package/dist/{chunk-E3EU5FZO.cjs → chunk-JTZPRV6E.cjs} +123 -123
  42. package/dist/{chunk-E3EU5FZO.cjs.map → chunk-JTZPRV6E.cjs.map} +1 -1
  43. package/dist/{chunk-PL7TAYKI.js → chunk-K2L5C5YH.js} +8 -7
  44. package/dist/chunk-K2L5C5YH.js.map +1 -0
  45. package/dist/{chunk-BCR7G3A6.js → chunk-KCF6P34A.js} +356 -64
  46. package/dist/chunk-KCF6P34A.js.map +1 -0
  47. package/dist/{chunk-ZXKBDFP3.js → chunk-LZHVHD62.js} +15 -6
  48. package/dist/chunk-LZHVHD62.js.map +1 -0
  49. package/dist/{chunk-LWECRCW2.cjs → chunk-MTJF52AJ.cjs} +141 -141
  50. package/dist/{chunk-LWECRCW2.cjs.map → chunk-MTJF52AJ.cjs.map} +1 -1
  51. package/dist/{chunk-B5TNKUEY.js → chunk-NDDTUFKK.js} +16 -6
  52. package/dist/chunk-NDDTUFKK.js.map +1 -0
  53. package/dist/{chunk-DWZY6PIP.cjs → chunk-NOQI6OFL.cjs} +615 -473
  54. package/dist/chunk-NOQI6OFL.cjs.map +1 -0
  55. package/dist/{chunk-F3JWBINJ.js → chunk-OEXDJFHA.js} +4 -4
  56. package/dist/{chunk-F3JWBINJ.js.map → chunk-OEXDJFHA.js.map} +1 -1
  57. package/dist/{chunk-JSCDE774.cjs → chunk-Z6BGACIH.cjs} +3 -3
  58. package/dist/chunk-Z6BGACIH.cjs.map +1 -0
  59. package/dist/core/index.cjs +50 -50
  60. package/dist/core/index.d.cts +2 -2
  61. package/dist/core/index.d.ts +2 -2
  62. package/dist/core/index.js +1 -1
  63. package/dist/dataframe/index.cjs +6 -6
  64. package/dist/dataframe/index.d.cts +3 -3
  65. package/dist/dataframe/index.d.ts +3 -3
  66. package/dist/dataframe/index.js +3 -3
  67. package/dist/datasets/index.cjs +34 -34
  68. package/dist/datasets/index.d.cts +3 -3
  69. package/dist/datasets/index.d.ts +3 -3
  70. package/dist/datasets/index.js +3 -3
  71. package/dist/{index-C1mfVYoo.d.ts → index-B18dHc8q.d.ts} +81 -46
  72. package/dist/{index-GFAVyOWO.d.ts → index-BHHX0qTY.d.cts} +14 -12
  73. package/dist/{index-tk4lSYod.d.ts → index-BI6QOUvV.d.ts} +106 -80
  74. package/dist/{index-DIp_RrRt.d.ts → index-BKvK21lf.d.ts} +13 -35
  75. package/dist/{index-BJY2SI4i.d.ts → index-BL8jLf3K.d.cts} +12 -11
  76. package/dist/{index-Cn3SdB0O.d.ts → index-BNbX167d.d.cts} +16 -10
  77. package/dist/{index-BWGhrDlr.d.ts → index-BT2ofL7Z.d.cts} +35 -35
  78. package/dist/{index-BbA2Gxfl.d.ts → index-BqcfIcL4.d.ts} +15 -15
  79. package/dist/{index-ZtI1Iy4L.d.ts → index-BrgrECM2.d.ts} +41 -38
  80. package/dist/{index-CDw5CnOU.d.ts → index-BtYKI9yJ.d.ts} +10 -8
  81. package/dist/{index-DIT_OO9C.d.cts → index-C7nLsAOC.d.cts} +10 -8
  82. package/dist/{index-D9Loo1_A.d.cts → index-CNj2Mxwf.d.cts} +81 -46
  83. package/dist/{index-DmEg_LCm.d.cts → index-CYlxeNW1.d.cts} +5 -3
  84. package/dist/{index-D61yaSMY.d.cts → index-CiTd61a5.d.ts} +12 -11
  85. package/dist/{index-BndMbqsM.d.ts → index-Cjnn0KeN.d.cts} +35 -21
  86. package/dist/{index-9oQx1HgV.d.cts → index-CkGGAn69.d.cts} +41 -38
  87. package/dist/{index-74AB8Cyh.d.cts → index-D4URSgqA.d.ts} +16 -10
  88. package/dist/{index-DoPWVxPo.d.cts → index-D4pn5zLT.d.ts} +35 -21
  89. package/dist/{index-DuCxd-8d.d.ts → index-D9ztTlDr.d.ts} +60 -42
  90. package/dist/{index-BgHYAoSS.d.cts → index-DF28ZPB5.d.cts} +60 -42
  91. package/dist/{index-eJgeni9c.d.cts → index-DLdiQzf0.d.cts} +106 -80
  92. package/dist/{index-WHQLn0e8.d.cts → index-DN4omPQw.d.ts} +35 -35
  93. package/dist/{index-CrqLlS-a.d.ts → index-DUnFq1WV.d.ts} +5 -3
  94. package/dist/{index-DbultU6X.d.cts → index-DgaYshkF.d.ts} +14 -12
  95. package/dist/{index-B_DK4FKY.d.cts → index-GUHYEhxs.d.cts} +13 -35
  96. package/dist/{index-CCvlwAmL.d.cts → index-TP--4irE.d.cts} +16 -14
  97. package/dist/{index-Dx42TZaY.d.ts → index-x0z_sanT.d.ts} +16 -14
  98. package/dist/{index-DyZ4QQf5.d.cts → index-xWH7ujWa.d.cts} +15 -15
  99. package/dist/index.cjs +26 -26
  100. package/dist/index.d.cts +17 -17
  101. package/dist/index.d.ts +17 -17
  102. package/dist/index.js +13 -13
  103. package/dist/linalg/index.cjs +22 -22
  104. package/dist/linalg/index.d.cts +3 -3
  105. package/dist/linalg/index.d.ts +3 -3
  106. package/dist/linalg/index.js +3 -3
  107. package/dist/metrics/index.cjs +40 -40
  108. package/dist/metrics/index.d.cts +3 -3
  109. package/dist/metrics/index.d.ts +3 -3
  110. package/dist/metrics/index.js +3 -3
  111. package/dist/ml/index.cjs +23 -23
  112. package/dist/ml/index.d.cts +3 -3
  113. package/dist/ml/index.d.ts +3 -3
  114. package/dist/ml/index.js +4 -4
  115. package/dist/ndarray/index.cjs +125 -125
  116. package/dist/ndarray/index.d.cts +5 -5
  117. package/dist/ndarray/index.d.ts +5 -5
  118. package/dist/ndarray/index.js +2 -2
  119. package/dist/nn/index.cjs +36 -36
  120. package/dist/nn/index.d.cts +6 -6
  121. package/dist/nn/index.d.ts +6 -6
  122. package/dist/nn/index.js +3 -3
  123. package/dist/optim/index.cjs +19 -19
  124. package/dist/optim/index.d.cts +4 -4
  125. package/dist/optim/index.d.ts +4 -4
  126. package/dist/optim/index.js +2 -2
  127. package/dist/plot/index.cjs +29 -29
  128. package/dist/plot/index.d.cts +6 -6
  129. package/dist/plot/index.d.ts +6 -6
  130. package/dist/plot/index.js +3 -3
  131. package/dist/preprocess/index.cjs +21 -21
  132. package/dist/preprocess/index.d.cts +4 -4
  133. package/dist/preprocess/index.d.ts +4 -4
  134. package/dist/preprocess/index.js +3 -3
  135. package/dist/random/index.cjs +19 -19
  136. package/dist/random/index.d.cts +3 -3
  137. package/dist/random/index.d.ts +3 -3
  138. package/dist/random/index.js +3 -3
  139. package/dist/stats/index.cjs +36 -36
  140. package/dist/stats/index.d.cts +3 -3
  141. package/dist/stats/index.d.ts +3 -3
  142. package/dist/stats/index.js +3 -3
  143. package/dist/{tensor-B96jjJLQ.d.cts → tensor-IlVTF0bz.d.cts} +16 -3
  144. package/dist/{tensor-B96jjJLQ.d.ts → tensor-IlVTF0bz.d.ts} +16 -3
  145. package/package.json +3 -2
  146. package/dist/chunk-4S73VUBD.js.map +0 -1
  147. package/dist/chunk-5R4S63PF.js.map +0 -1
  148. package/dist/chunk-6AE5FKKQ.cjs.map +0 -1
  149. package/dist/chunk-AD436M45.js.map +0 -1
  150. package/dist/chunk-ALS7ETWZ.cjs.map +0 -1
  151. package/dist/chunk-B5TNKUEY.js.map +0 -1
  152. package/dist/chunk-BCR7G3A6.js.map +0 -1
  153. package/dist/chunk-C4PKXY74.cjs.map +0 -1
  154. package/dist/chunk-DWZY6PIP.cjs.map +0 -1
  155. package/dist/chunk-FJYLIGJX.js.map +0 -1
  156. package/dist/chunk-JSCDE774.cjs.map +0 -1
  157. package/dist/chunk-MLBMYKCG.js.map +0 -1
  158. package/dist/chunk-OX6QXFMV.cjs.map +0 -1
  159. package/dist/chunk-PL7TAYKI.js.map +0 -1
  160. package/dist/chunk-PR647I7R.js.map +0 -1
  161. package/dist/chunk-QERHVCHC.cjs.map +0 -1
  162. package/dist/chunk-XEG44RF6.cjs.map +0 -1
  163. package/dist/chunk-ZB75FESB.cjs.map +0 -1
  164. package/dist/chunk-ZLW62TJG.cjs.map +0 -1
  165. package/dist/chunk-ZXKBDFP3.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunk6AE5FKKQ_cjs = require('./chunk-6AE5FKKQ.cjs');
4
- var chunkJSCDE774_cjs = require('./chunk-JSCDE774.cjs');
3
+ var chunk724CXHFH_cjs = require('./chunk-724CXHFH.cjs');
4
+ var chunkZ6BGACIH_cjs = require('./chunk-Z6BGACIH.cjs');
5
5
 
6
6
  // src/plot/index.ts
7
7
  var plot_exports = {};
8
- chunkJSCDE774_cjs.__export(plot_exports, {
8
+ chunkZ6BGACIH_cjs.__export(plot_exports, {
9
9
  Axes: () => Axes,
10
10
  Figure: () => Figure,
11
11
  bar: () => bar,
@@ -333,13 +333,13 @@ function buildLegendEntry(label, entry) {
333
333
  // src/plot/utils/validation.ts
334
334
  function assertPositiveInt(name, v) {
335
335
  if (!Number.isFinite(v)) {
336
- throw new chunkJSCDE774_cjs.InvalidParameterError(`${name} must be a positive integer; received ${v}`, name, v);
336
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(`${name} must be a positive integer; received ${v}`, name, v);
337
337
  }
338
338
  if (v <= 0) {
339
- throw new chunkJSCDE774_cjs.InvalidParameterError(`${name} must be a positive integer; received ${v}`, name, v);
339
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(`${name} must be a positive integer; received ${v}`, name, v);
340
340
  }
341
341
  if (Math.trunc(v) !== v) {
342
- throw new chunkJSCDE774_cjs.InvalidParameterError(`${name} must be a positive integer; received ${v}`, name, v);
342
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(`${name} must be a positive integer; received ${v}`, name, v);
343
343
  }
344
344
  }
345
345
  function isFiniteNumber(x) {
@@ -367,7 +367,7 @@ var Bar2D = class {
367
367
  barWidth;
368
368
  label;
369
369
  constructor(x, height, options) {
370
- if (x.length !== height.length) throw new chunkJSCDE774_cjs.ShapeError("x and height must have the same length");
370
+ if (x.length !== height.length) throw new chunkZ6BGACIH_cjs.ShapeError("x and height must have the same length");
371
371
  this.x = x;
372
372
  this.height = height;
373
373
  this.color = normalizeColor(options.color, "#2ca02c");
@@ -572,7 +572,7 @@ var Boxplot = class {
572
572
  const n = sorted.length;
573
573
  if (n === 0) {
574
574
  if (data.length > 0) {
575
- throw new chunkJSCDE774_cjs.InvalidParameterError(
575
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
576
576
  "boxplot data must contain at least one finite value",
577
577
  "data",
578
578
  data
@@ -788,7 +788,7 @@ function resolveLevels(min, max, levels) {
788
788
  if (Array.isArray(levels)) {
789
789
  const filtered = levels.filter((v) => Number.isFinite(v));
790
790
  if (filtered.length === 0) {
791
- throw new chunkJSCDE774_cjs.InvalidParameterError(
791
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
792
792
  "levels must contain at least one finite value",
793
793
  "levels",
794
794
  levels
@@ -800,7 +800,7 @@ function resolveLevels(min, max, levels) {
800
800
  }
801
801
  const numLevels = typeof levels === "number" ? levels : 10;
802
802
  if (!Number.isFinite(numLevels) || Math.trunc(numLevels) !== numLevels || numLevels <= 0) {
803
- throw new chunkJSCDE774_cjs.InvalidParameterError(
803
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
804
804
  `levels must be a positive integer; received ${numLevels}`,
805
805
  "levels",
806
806
  numLevels
@@ -829,7 +829,7 @@ function resolveLevelColors(levels, options) {
829
829
  for (let i = 0; i < count; i++) colors.push(normalized);
830
830
  } else if (options.colormap) {
831
831
  if (!["viridis", "plasma", "inferno", "magma", "grayscale"].includes(options.colormap)) {
832
- throw new chunkJSCDE774_cjs.InvalidParameterError(
832
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
833
833
  `colormap must be one of viridis, plasma, inferno, magma, grayscale; received ${options.colormap}`,
834
834
  "colormap",
835
835
  options.colormap
@@ -868,14 +868,14 @@ var Contour2D = class {
868
868
  label;
869
869
  constructor(grid, options = {}) {
870
870
  if (options.vmin !== void 0 && !Number.isFinite(options.vmin)) {
871
- throw new chunkJSCDE774_cjs.InvalidParameterError(
871
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
872
872
  `vmin must be finite; received ${options.vmin}`,
873
873
  "vmin",
874
874
  options.vmin
875
875
  );
876
876
  }
877
877
  if (options.vmax !== void 0 && !Number.isFinite(options.vmax)) {
878
- throw new chunkJSCDE774_cjs.InvalidParameterError(
878
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
879
879
  `vmax must be finite; received ${options.vmax}`,
880
880
  "vmax",
881
881
  options.vmax
@@ -884,7 +884,7 @@ var Contour2D = class {
884
884
  const min = options.vmin ?? grid.dataMin;
885
885
  const max = options.vmax ?? grid.dataMax;
886
886
  if (Number.isFinite(min) && Number.isFinite(max) && min > max) {
887
- throw new chunkJSCDE774_cjs.InvalidParameterError(
887
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
888
888
  `vmin must be <= vmax; received vmin=${min} vmax=${max}`,
889
889
  "vmin/vmax",
890
890
  { vmin: min, vmax: max }
@@ -897,7 +897,7 @@ var Contour2D = class {
897
897
  this.label = normalizeLegendLabel(options.label);
898
898
  const lw = options.linewidth ?? 1;
899
899
  if (!Number.isFinite(lw) || lw <= 0) {
900
- throw new chunkJSCDE774_cjs.InvalidParameterError(
900
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
901
901
  `linewidth must be a positive number; received ${lw}`,
902
902
  "linewidth",
903
903
  lw
@@ -1203,7 +1203,7 @@ function resolveFillLevels(min, max, levels) {
1203
1203
  const unique = Array.from(new Set(filtered));
1204
1204
  unique.sort((a, b) => a - b);
1205
1205
  if (unique.length < 2) {
1206
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1206
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1207
1207
  "levels must contain at least two finite values",
1208
1208
  "levels",
1209
1209
  levels
@@ -1213,7 +1213,7 @@ function resolveFillLevels(min, max, levels) {
1213
1213
  }
1214
1214
  const numLevels = typeof levels === "number" ? levels : 10;
1215
1215
  if (!Number.isFinite(numLevels) || Math.trunc(numLevels) !== numLevels || numLevels <= 0) {
1216
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1216
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1217
1217
  `levels must be a positive integer; received ${numLevels}`,
1218
1218
  "levels",
1219
1219
  numLevels
@@ -1244,7 +1244,7 @@ function resolveBandColors(bandCount, options) {
1244
1244
  for (let i = 0; i < bandCount; i++) colors.push(normalized);
1245
1245
  } else if (options.colormap) {
1246
1246
  if (!["viridis", "plasma", "inferno", "magma", "grayscale"].includes(options.colormap)) {
1247
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1247
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1248
1248
  `colormap must be one of viridis, plasma, inferno, magma, grayscale; received ${options.colormap}`,
1249
1249
  "colormap",
1250
1250
  options.colormap
@@ -1289,14 +1289,14 @@ var ContourF2D = class {
1289
1289
  this.xCoords = grid.xCoords;
1290
1290
  this.yCoords = grid.yCoords;
1291
1291
  if (options.vmin !== void 0 && !Number.isFinite(options.vmin)) {
1292
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1292
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1293
1293
  `vmin must be finite; received ${options.vmin}`,
1294
1294
  "vmin",
1295
1295
  options.vmin
1296
1296
  );
1297
1297
  }
1298
1298
  if (options.vmax !== void 0 && !Number.isFinite(options.vmax)) {
1299
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1299
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1300
1300
  `vmax must be finite; received ${options.vmax}`,
1301
1301
  "vmax",
1302
1302
  options.vmax
@@ -1305,7 +1305,7 @@ var ContourF2D = class {
1305
1305
  const min = options.vmin ?? grid.dataMin;
1306
1306
  const max = options.vmax ?? grid.dataMax;
1307
1307
  if (Number.isFinite(min) && Number.isFinite(max) && min > max) {
1308
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1308
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1309
1309
  `vmin must be <= vmax; received vmin=${min} vmax=${max}`,
1310
1310
  "vmin/vmax",
1311
1311
  { vmin: min, vmax: max }
@@ -1314,7 +1314,7 @@ var ContourF2D = class {
1314
1314
  this.levels = resolveFillLevels(min, max, options.levels);
1315
1315
  const bandCount = this.levels.length - 1;
1316
1316
  if (bandCount <= 0) {
1317
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1317
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1318
1318
  "levels must define at least one fill band",
1319
1319
  "levels",
1320
1320
  this.levels
@@ -1445,7 +1445,7 @@ var Heatmap2D = class {
1445
1445
  this.cols = cols;
1446
1446
  const colormap = options.colormap ?? "viridis";
1447
1447
  if (!["viridis", "plasma", "inferno", "magma", "grayscale"].includes(colormap)) {
1448
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1448
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1449
1449
  `colormap must be one of viridis, plasma, inferno, magma, grayscale; received ${colormap}`,
1450
1450
  "colormap",
1451
1451
  colormap
@@ -1457,10 +1457,10 @@ var Heatmap2D = class {
1457
1457
  if (extent) {
1458
1458
  const { xmin, xmax, ymin, ymax } = extent;
1459
1459
  if (!Number.isFinite(xmin) || !Number.isFinite(xmax) || !Number.isFinite(ymin) || !Number.isFinite(ymax)) {
1460
- throw new chunkJSCDE774_cjs.InvalidParameterError("extent values must be finite", "extent", extent);
1460
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("extent values must be finite", "extent", extent);
1461
1461
  }
1462
1462
  if (xmax <= xmin || ymax <= ymin) {
1463
- throw new chunkJSCDE774_cjs.InvalidParameterError("extent ranges must be positive", "extent", extent);
1463
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("extent ranges must be positive", "extent", extent);
1464
1464
  }
1465
1465
  this.xMin = xmin;
1466
1466
  this.xMax = xmax;
@@ -1482,21 +1482,21 @@ var Heatmap2D = class {
1482
1482
  }
1483
1483
  }
1484
1484
  if (!Number.isFinite(min) || !Number.isFinite(max)) {
1485
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1485
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1486
1486
  "heatmap data must contain at least one finite value",
1487
1487
  "data",
1488
1488
  data
1489
1489
  );
1490
1490
  }
1491
1491
  if (options.vmin !== void 0 && !Number.isFinite(options.vmin)) {
1492
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1492
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1493
1493
  `vmin must be finite; received ${options.vmin}`,
1494
1494
  "vmin",
1495
1495
  options.vmin
1496
1496
  );
1497
1497
  }
1498
1498
  if (options.vmax !== void 0 && !Number.isFinite(options.vmax)) {
1499
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1499
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1500
1500
  `vmax must be finite; received ${options.vmax}`,
1501
1501
  "vmax",
1502
1502
  options.vmax
@@ -1505,7 +1505,7 @@ var Heatmap2D = class {
1505
1505
  const vmin = options.vmin ?? min;
1506
1506
  const vmax = options.vmax ?? max;
1507
1507
  if (Number.isFinite(vmin) && Number.isFinite(vmax) && vmin > vmax) {
1508
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1508
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1509
1509
  `vmin must be <= vmax; received vmin=${vmin} vmax=${vmax}`,
1510
1510
  "vmin/vmax",
1511
1511
  { vmin, vmax }
@@ -1588,7 +1588,7 @@ var Histogram = class {
1588
1588
  label;
1589
1589
  constructor(data, numBins, options) {
1590
1590
  if (!Number.isFinite(numBins) || Math.trunc(numBins) !== numBins || numBins <= 0) {
1591
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1591
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1592
1592
  `bins must be a positive integer; received ${numBins}`,
1593
1593
  "bins",
1594
1594
  numBins
@@ -1613,7 +1613,7 @@ var Histogram = class {
1613
1613
  }
1614
1614
  if (!hasFinite) {
1615
1615
  if (hasInfinity) {
1616
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1616
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1617
1617
  "histogram data must contain at least one finite value",
1618
1618
  "data",
1619
1619
  data
@@ -1724,7 +1724,7 @@ var HorizontalBar2D = class {
1724
1724
  barHeight;
1725
1725
  label;
1726
1726
  constructor(y, width, options) {
1727
- if (y.length !== width.length) throw new chunkJSCDE774_cjs.ShapeError("y and width must have the same length");
1727
+ if (y.length !== width.length) throw new chunkZ6BGACIH_cjs.ShapeError("y and width must have the same length");
1728
1728
  this.y = y;
1729
1729
  this.width = width;
1730
1730
  this.color = normalizeColor(options.color, "#9467bd");
@@ -1812,13 +1812,13 @@ var Line2D = class {
1812
1812
  linewidth;
1813
1813
  label;
1814
1814
  constructor(x, y, options) {
1815
- if (x.length !== y.length) throw new chunkJSCDE774_cjs.ShapeError("x and y must have the same length");
1815
+ if (x.length !== y.length) throw new chunkZ6BGACIH_cjs.ShapeError("x and y must have the same length");
1816
1816
  this.x = x;
1817
1817
  this.y = y;
1818
1818
  this.color = normalizeColor(options.color, "#1f77b4");
1819
1819
  const lw = options.linewidth ?? 2;
1820
1820
  if (!Number.isFinite(lw) || lw <= 0) {
1821
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1821
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1822
1822
  `linewidth must be a positive number; received ${lw}`,
1823
1823
  "linewidth",
1824
1824
  lw
@@ -1903,10 +1903,10 @@ var Pie = class {
1903
1903
  label;
1904
1904
  constructor(centerX, centerY, radius, values, labels, options = {}, rangeOverride) {
1905
1905
  if (!Number.isFinite(centerX) || !Number.isFinite(centerY)) {
1906
- throw new chunkJSCDE774_cjs.InvalidParameterError("pie center must be finite", "center", { centerX, centerY });
1906
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("pie center must be finite", "center", { centerX, centerY });
1907
1907
  }
1908
1908
  if (!Number.isFinite(radius) || radius <= 0) {
1909
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1909
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1910
1910
  `pie radius must be positive; received ${radius}`,
1911
1911
  "radius",
1912
1912
  radius
@@ -1916,10 +1916,10 @@ var Pie = class {
1916
1916
  this.centerY = centerY;
1917
1917
  this.radius = radius;
1918
1918
  if (values.length === 0) {
1919
- throw new chunkJSCDE774_cjs.InvalidParameterError("pie requires at least one value", "values", values.length);
1919
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("pie requires at least one value", "values", values.length);
1920
1920
  }
1921
1921
  if (labels && labels.length !== values.length) {
1922
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1922
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1923
1923
  `labels length (${labels.length}) must match values length (${values.length})`,
1924
1924
  "labels",
1925
1925
  labels
@@ -1932,16 +1932,16 @@ var Pie = class {
1932
1932
  for (let i = 0; i < values.length; i++) {
1933
1933
  const v = values[i] ?? 0;
1934
1934
  if (!isFiniteNumber(v)) {
1935
- throw new chunkJSCDE774_cjs.InvalidParameterError("pie values must be finite", "values", v);
1935
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("pie values must be finite", "values", v);
1936
1936
  }
1937
1937
  if (v < 0) {
1938
- throw new chunkJSCDE774_cjs.InvalidParameterError("pie values must be non-negative", "values", v);
1938
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("pie values must be non-negative", "values", v);
1939
1939
  }
1940
1940
  validValues.push(v);
1941
1941
  }
1942
1942
  const total = validValues.reduce((sum, val) => sum + val, 0);
1943
1943
  if (!Number.isFinite(total) || total <= 0) {
1944
- throw new chunkJSCDE774_cjs.InvalidParameterError(
1944
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
1945
1945
  "pie values must sum to a positive number",
1946
1946
  "values",
1947
1947
  validValues
@@ -2106,13 +2106,13 @@ var Scatter2D = class {
2106
2106
  size;
2107
2107
  label;
2108
2108
  constructor(x, y, options) {
2109
- if (x.length !== y.length) throw new chunkJSCDE774_cjs.ShapeError("x and y must have the same length");
2109
+ if (x.length !== y.length) throw new chunkZ6BGACIH_cjs.ShapeError("x and y must have the same length");
2110
2110
  this.x = x;
2111
2111
  this.y = y;
2112
2112
  this.color = normalizeColor(options.color, "#ff7f0e");
2113
2113
  const size = options.size ?? 5;
2114
2114
  if (!Number.isFinite(size) || size <= 0) {
2115
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2115
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2116
2116
  `size must be a positive number; received ${size}`,
2117
2117
  "size",
2118
2118
  size
@@ -2197,7 +2197,7 @@ var Violinplot = class {
2197
2197
  const n = sorted.length;
2198
2198
  if (n === 0) {
2199
2199
  if (data.length > 0) {
2200
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2200
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2201
2201
  "violinplot data must contain at least one finite value",
2202
2202
  "data",
2203
2203
  data
@@ -2369,8 +2369,8 @@ var Violinplot = class {
2369
2369
  // src/plot/utils/tensor.ts
2370
2370
  function tensorToFloat64Vector1D(t) {
2371
2371
  const tensor2 = "tensor" in t ? t.tensor : t;
2372
- if (tensor2.ndim !== 1) throw new chunkJSCDE774_cjs.ShapeError("Expected a 1D tensor");
2373
- if (tensor2.dtype === "string") throw new chunkJSCDE774_cjs.DTypeError("Plotting does not support string tensors");
2372
+ if (tensor2.ndim !== 1) throw new chunkZ6BGACIH_cjs.ShapeError("Expected a 1D tensor");
2373
+ if (tensor2.dtype === "string") throw new chunkZ6BGACIH_cjs.DTypeError("Plotting does not support string tensors");
2374
2374
  const n = tensor2.shape[0] ?? 0;
2375
2375
  const stride = tensor2.strides[0] ?? 0;
2376
2376
  const out = new Float64Array(n);
@@ -2383,8 +2383,8 @@ function tensorToFloat64Vector1D(t) {
2383
2383
  }
2384
2384
  function tensorToFloat64Matrix2D(t) {
2385
2385
  const tensor2 = "tensor" in t ? t.tensor : t;
2386
- if (tensor2.ndim !== 2) throw new chunkJSCDE774_cjs.ShapeError("Expected a 2D tensor");
2387
- if (tensor2.dtype === "string") throw new chunkJSCDE774_cjs.DTypeError("Plotting does not support string tensors");
2386
+ if (tensor2.ndim !== 2) throw new chunkZ6BGACIH_cjs.ShapeError("Expected a 2D tensor");
2387
+ if (tensor2.dtype === "string") throw new chunkZ6BGACIH_cjs.DTypeError("Plotting does not support string tensors");
2388
2388
  const rows = tensor2.shape[0] ?? 0;
2389
2389
  const cols = tensor2.shape[1] ?? 0;
2390
2390
  const strideRow = tensor2.strides[0] ?? 0;
@@ -2416,7 +2416,7 @@ function safeConvertToNumber(value) {
2416
2416
  if (typeof value === "bigint") {
2417
2417
  return Number(value);
2418
2418
  }
2419
- throw new chunkJSCDE774_cjs.DTypeError(`Cannot convert ${typeof value} to number for plotting`);
2419
+ throw new chunkZ6BGACIH_cjs.DTypeError(`Cannot convert ${typeof value} to number for plotting`);
2420
2420
  }
2421
2421
 
2422
2422
  // src/plot/utils/contours.ts
@@ -2435,7 +2435,7 @@ function assertFiniteCoords(values, name) {
2435
2435
  for (let i = 0; i < values.length; i++) {
2436
2436
  const v = values[i] ?? 0;
2437
2437
  if (!isFiniteNumber(v)) {
2438
- throw new chunkJSCDE774_cjs.InvalidParameterError(`${name} coordinates must be finite`, name, v);
2438
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(`${name} coordinates must be finite`, name, v);
2439
2439
  }
2440
2440
  }
2441
2441
  }
@@ -2455,7 +2455,7 @@ function computeDataRange(data) {
2455
2455
  if (v > max) max = v;
2456
2456
  }
2457
2457
  if (!Number.isFinite(min) || !Number.isFinite(max)) {
2458
- throw new chunkJSCDE774_cjs.InvalidParameterError("Contour requires at least one finite Z value", "Z", data);
2458
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("Contour requires at least one finite Z value", "Z", data);
2459
2459
  }
2460
2460
  return { min, max, hasNaN };
2461
2461
  }
@@ -2463,10 +2463,10 @@ function meshgridToCoords(X, Y, rows, cols) {
2463
2463
  const xMat = tensorToFloat64Matrix2D(X);
2464
2464
  const yMat = tensorToFloat64Matrix2D(Y);
2465
2465
  if (xMat.rows !== rows || xMat.cols !== cols) {
2466
- throw new chunkJSCDE774_cjs.ShapeError("X must match Z shape for meshgrid input");
2466
+ throw new chunkZ6BGACIH_cjs.ShapeError("X must match Z shape for meshgrid input");
2467
2467
  }
2468
2468
  if (yMat.rows !== rows || yMat.cols !== cols) {
2469
- throw new chunkJSCDE774_cjs.ShapeError("Y must match Z shape for meshgrid input");
2469
+ throw new chunkZ6BGACIH_cjs.ShapeError("Y must match Z shape for meshgrid input");
2470
2470
  }
2471
2471
  const xCoords = new Float64Array(cols);
2472
2472
  const yCoords = new Float64Array(rows);
@@ -2485,13 +2485,13 @@ function meshgridToCoords(X, Y, rows, cols) {
2485
2485
  const xv = xMat.data[rowOffset + j] ?? 0;
2486
2486
  const yv = yMat.data[rowOffset + j] ?? 0;
2487
2487
  if (!isFiniteNumber(xv) || !isFiniteNumber(yv)) {
2488
- throw new chunkJSCDE774_cjs.InvalidParameterError("X/Y meshgrid values must be finite", "X/Y", {
2488
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("X/Y meshgrid values must be finite", "X/Y", {
2489
2489
  x: xv,
2490
2490
  y: yv
2491
2491
  });
2492
2492
  }
2493
2493
  if (Math.abs(xv - expectedX) > tol || Math.abs(yv - expectedY) > tol) {
2494
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2494
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2495
2495
  "Contour supports only rectilinear grids (use 1D X/Y or meshgrid)",
2496
2496
  "X/Y",
2497
2497
  { x: xv, y: yv }
@@ -2517,10 +2517,10 @@ function buildContourGrid(X, Y, Z, extent) {
2517
2517
  if (extent) {
2518
2518
  const { xmin, xmax, ymin, ymax } = extent;
2519
2519
  if (!Number.isFinite(xmin) || !Number.isFinite(xmax) || !Number.isFinite(ymin) || !Number.isFinite(ymax)) {
2520
- throw new chunkJSCDE774_cjs.InvalidParameterError("extent values must be finite", "extent", extent);
2520
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("extent values must be finite", "extent", extent);
2521
2521
  }
2522
2522
  if (xmax <= xmin || ymax <= ymin) {
2523
- throw new chunkJSCDE774_cjs.InvalidParameterError("extent ranges must be positive", "extent", extent);
2523
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("extent ranges must be positive", "extent", extent);
2524
2524
  }
2525
2525
  const xDenom = Math.max(1, cols - 1);
2526
2526
  const yDenom = Math.max(1, rows - 1);
@@ -2536,7 +2536,7 @@ function buildContourGrid(X, Y, Z, extent) {
2536
2536
  }
2537
2537
  } else if (xSize > 0 && ySize > 0) {
2538
2538
  if (extent) {
2539
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2539
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2540
2540
  "extent cannot be combined with explicit X/Y coordinates",
2541
2541
  "extent",
2542
2542
  extent
@@ -2548,20 +2548,20 @@ function buildContourGrid(X, Y, Z, extent) {
2548
2548
  xCoords = tensorToFloat64Vector1D(X);
2549
2549
  yCoords = tensorToFloat64Vector1D(Y);
2550
2550
  if (xCoords.length !== cols) {
2551
- throw new chunkJSCDE774_cjs.ShapeError(`X must have length ${cols}; received ${xCoords.length}`);
2551
+ throw new chunkZ6BGACIH_cjs.ShapeError(`X must have length ${cols}; received ${xCoords.length}`);
2552
2552
  }
2553
2553
  if (yCoords.length !== rows) {
2554
- throw new chunkJSCDE774_cjs.ShapeError(`Y must have length ${rows}; received ${yCoords.length}`);
2554
+ throw new chunkZ6BGACIH_cjs.ShapeError(`Y must have length ${rows}; received ${yCoords.length}`);
2555
2555
  }
2556
2556
  assertFiniteCoords(xCoords, "X");
2557
2557
  assertFiniteCoords(yCoords, "Y");
2558
2558
  } else if (rawX.ndim === 2 && rawY.ndim === 2) {
2559
2559
  ({ xCoords, yCoords } = meshgridToCoords(X, Y, rows, cols));
2560
2560
  } else {
2561
- throw new chunkJSCDE774_cjs.ShapeError("X and Y must be 1D vectors or 2D meshgrids matching Z");
2561
+ throw new chunkZ6BGACIH_cjs.ShapeError("X and Y must be 1D vectors or 2D meshgrids matching Z");
2562
2562
  }
2563
2563
  } else {
2564
- throw new chunkJSCDE774_cjs.InvalidParameterError("Both X and Y must be provided or both empty", "X/Y", {
2564
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("Both X and Y must be provided or both empty", "X/Y", {
2565
2565
  xSize,
2566
2566
  ySize
2567
2567
  });
@@ -2719,7 +2719,7 @@ var Axes = class {
2719
2719
  height: this.fig.height
2720
2720
  };
2721
2721
  if (!Number.isFinite(base.x) || !Number.isFinite(base.y) || !Number.isFinite(base.width) || !Number.isFinite(base.height) || base.width <= 0 || base.height <= 0) {
2722
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2722
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2723
2723
  "viewport must have positive finite width/height",
2724
2724
  "viewport",
2725
2725
  base
@@ -2727,11 +2727,11 @@ var Axes = class {
2727
2727
  }
2728
2728
  const p = options.padding ?? Math.min(50, Math.max(0, Math.floor(Math.min(base.width, base.height) / 4)));
2729
2729
  if (!Number.isFinite(p) || p < 0) {
2730
- throw new chunkJSCDE774_cjs.InvalidParameterError(`padding must be non-negative; received ${p}`, "padding", p);
2730
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(`padding must be non-negative; received ${p}`, "padding", p);
2731
2731
  }
2732
2732
  if (2 * p >= base.width || 2 * p >= base.height) {
2733
2733
  if (this.paddingProvided) {
2734
- throw new chunkJSCDE774_cjs.InvalidParameterError("padding is too large", "padding", p);
2734
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("padding is too large", "padding", p);
2735
2735
  }
2736
2736
  const maxSafe = Math.max(0, Math.floor((Math.min(base.width, base.height) - 1) / 2));
2737
2737
  this.padding = maxSafe;
@@ -2782,7 +2782,7 @@ var Axes = class {
2782
2782
  */
2783
2783
  legend(options = {}) {
2784
2784
  if (options.location !== void 0 && !["upper-right", "upper-left", "lower-right", "lower-left"].includes(options.location)) {
2785
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2785
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2786
2786
  `legend location must be one of upper-right, upper-left, lower-right, lower-left; received ${options.location}`,
2787
2787
  "location",
2788
2788
  options.location
@@ -2790,7 +2790,7 @@ var Axes = class {
2790
2790
  }
2791
2791
  if (options.fontSize !== void 0) {
2792
2792
  if (!Number.isFinite(options.fontSize) || options.fontSize <= 0) {
2793
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2793
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2794
2794
  `legend fontSize must be positive; received ${options.fontSize}`,
2795
2795
  "fontSize",
2796
2796
  options.fontSize
@@ -2799,7 +2799,7 @@ var Axes = class {
2799
2799
  }
2800
2800
  if (options.padding !== void 0) {
2801
2801
  if (!Number.isFinite(options.padding) || options.padding < 0) {
2802
- throw new chunkJSCDE774_cjs.InvalidParameterError(
2802
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
2803
2803
  `legend padding must be non-negative; received ${options.padding}`,
2804
2804
  "padding",
2805
2805
  options.padding
@@ -3001,7 +3001,7 @@ var Axes = class {
3001
3001
  buildTickOverride(values, labels, name) {
3002
3002
  if (values.length === 0) return null;
3003
3003
  if (labels && labels.length !== values.length) {
3004
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3004
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3005
3005
  `${name} labels length must match values length (${values.length}); received ${labels.length}`,
3006
3006
  name,
3007
3007
  labels
@@ -3010,7 +3010,7 @@ var Axes = class {
3010
3010
  const ticks = [];
3011
3011
  for (const [i, value] of values.entries()) {
3012
3012
  if (!Number.isFinite(value)) {
3013
- throw new chunkJSCDE774_cjs.InvalidParameterError(`${name} values must be finite`, name, value);
3013
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(`${name} values must be finite`, name, value);
3014
3014
  }
3015
3015
  const label = labels ? labels[i] ?? "" : String(value);
3016
3016
  ticks.push({ value, label: label.trim() });
@@ -3680,7 +3680,7 @@ async function pngEncodeRGBA(width, height, rgba) {
3680
3680
  assertPositiveInt("width", width);
3681
3681
  assertPositiveInt("height", height);
3682
3682
  if (rgba.length !== width * height * 4)
3683
- throw new chunkJSCDE774_cjs.InvalidParameterError("RGBA buffer has incorrect length", "rgba", rgba.length);
3683
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("RGBA buffer has incorrect length", "rgba", rgba.length);
3684
3684
  const signature = Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10);
3685
3685
  const ihdrData = concatBytes([u32be(width), u32be(height), Uint8Array.of(8, 6, 0, 0, 0)]);
3686
3686
  const ihdr = pngChunk("IHDR", ihdrData);
@@ -3722,7 +3722,7 @@ var Figure = class {
3722
3722
  assertPositiveInt("Figure.width", this.width);
3723
3723
  assertPositiveInt("Figure.height", this.height);
3724
3724
  if (this.width > 32768 || this.height > 32768) {
3725
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3725
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3726
3726
  "Figure dimensions too large. Maximum is 32,768 pixels.",
3727
3727
  "width/height",
3728
3728
  { width: this.width, height: this.height }
@@ -3763,7 +3763,7 @@ ${elements.join("\n")}
3763
3763
  */
3764
3764
  async renderPNG() {
3765
3765
  if (!isNodeEnvironment_export()) {
3766
- throw new chunkJSCDE774_cjs.NotImplementedError(
3766
+ throw new chunkZ6BGACIH_cjs.NotImplementedError(
3767
3767
  "PNG rendering is only available in Node.js environments. Use renderSVG() for browser compatibility, or run in Node.js to generate PNG files."
3768
3768
  );
3769
3769
  }
@@ -3811,14 +3811,14 @@ function figure(options = {}) {
3811
3811
  }
3812
3812
  function subplot(rows, cols, index, options = {}) {
3813
3813
  if (!Number.isFinite(rows) || Math.trunc(rows) !== rows || rows <= 0) {
3814
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3814
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3815
3815
  `rows must be a positive integer; received ${rows}`,
3816
3816
  "rows",
3817
3817
  rows
3818
3818
  );
3819
3819
  }
3820
3820
  if (!Number.isFinite(cols) || Math.trunc(cols) !== cols || cols <= 0) {
3821
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3821
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3822
3822
  `cols must be a positive integer; received ${cols}`,
3823
3823
  "cols",
3824
3824
  cols
@@ -3826,14 +3826,14 @@ function subplot(rows, cols, index, options = {}) {
3826
3826
  }
3827
3827
  const total = rows * cols;
3828
3828
  if (total > 1e4) {
3829
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3829
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3830
3830
  `Subplot grid too large (${rows}\xD7${cols}=${total}). Maximum is 10,000 subplots.`,
3831
3831
  "rows*cols",
3832
3832
  total
3833
3833
  );
3834
3834
  }
3835
3835
  if (!Number.isFinite(index) || Math.trunc(index) !== index || index < 1 || index > total) {
3836
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3836
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3837
3837
  `index must be in [1, ${total}]; received ${index}`,
3838
3838
  "index",
3839
3839
  index
@@ -3864,13 +3864,13 @@ function show(options = {}) {
3864
3864
  }
3865
3865
  async function saveFig(path, options = {}) {
3866
3866
  if (!path || path.trim().length === 0) {
3867
- throw new chunkJSCDE774_cjs.InvalidParameterError("path must be a non-empty string", "path", path);
3867
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("path must be a non-empty string", "path", path);
3868
3868
  }
3869
3869
  const dotIndex = path.lastIndexOf(".");
3870
3870
  const ext = dotIndex > 0 ? path.slice(dotIndex + 1).toLowerCase() : void 0;
3871
3871
  const fmt = options.format ?? (ext === "png" ? "png" : "svg");
3872
3872
  if (ext && ext !== fmt) {
3873
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3873
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3874
3874
  `File extension .${ext} does not match format ${fmt}`,
3875
3875
  "path",
3876
3876
  path
@@ -3899,8 +3899,17 @@ function bar(x, height, options = {}) {
3899
3899
  function barh(y, width, options = {}) {
3900
3900
  gca().barh(y, width, options);
3901
3901
  }
3902
- function hist(x, bins = 10, options = {}) {
3903
- gca().hist(x, bins, options);
3902
+ function hist(x, bins, options = {}) {
3903
+ let resolvedBins = 10;
3904
+ let resolvedOptions = options;
3905
+ if (typeof bins === "object" && bins !== null) {
3906
+ resolvedBins = bins.bins ?? 10;
3907
+ const { bins: _b, ...rest } = bins;
3908
+ resolvedOptions = rest;
3909
+ } else if (typeof bins === "number") {
3910
+ resolvedBins = bins;
3911
+ }
3912
+ gca().hist(x, resolvedBins, resolvedOptions);
3904
3913
  }
3905
3914
  function boxplot(data, options = {}) {
3906
3915
  gca().boxplot(data, options);
@@ -3936,7 +3945,7 @@ function plotConfusionMatrix(cm, labels, options = {}) {
3936
3945
  ax.setXLabel("Predicted");
3937
3946
  ax.setYLabel("Actual");
3938
3947
  if (labels && labels.length < Math.max(rows, cols)) {
3939
- throw new chunkJSCDE774_cjs.InvalidParameterError(
3948
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
3940
3949
  `labels length must be >= ${Math.max(rows, cols)}; received ${labels.length}`,
3941
3950
  "labels",
3942
3951
  labels
@@ -3959,7 +3968,7 @@ function plotRocCurve(fpr, tpr, auc, options = {}) {
3959
3968
  color: options.color ?? "#1f77b4",
3960
3969
  label: options.label ?? "ROC"
3961
3970
  });
3962
- ax.plot(chunk6AE5FKKQ_cjs.tensor([0, 1]), chunk6AE5FKKQ_cjs.tensor([0, 1]), {
3971
+ ax.plot(chunk724CXHFH_cjs.tensor([0, 1]), chunk724CXHFH_cjs.tensor([0, 1]), {
3963
3972
  color: "#999999",
3964
3973
  linewidth: 1,
3965
3974
  label: "Chance"
@@ -4021,17 +4030,17 @@ function plotValidationCurve(paramRange, trainScores, valScores, options = {}) {
4021
4030
  }
4022
4031
  function plotDecisionBoundary(X, y, model, options = {}) {
4023
4032
  if (X.dtype === "string") {
4024
- throw new chunkJSCDE774_cjs.InvalidParameterError("plotDecisionBoundary: X must be numeric", "X", X.dtype);
4033
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("plotDecisionBoundary: X must be numeric", "X", X.dtype);
4025
4034
  }
4026
4035
  if (X.ndim !== 2 || (X.shape[1] ?? 0) !== 2) {
4027
- throw new chunkJSCDE774_cjs.ShapeError("plotDecisionBoundary: X must be shape [n, 2]");
4036
+ throw new chunkZ6BGACIH_cjs.ShapeError("plotDecisionBoundary: X must be shape [n, 2]");
4028
4037
  }
4029
4038
  const n = X.shape[0] ?? 0;
4030
4039
  if (n === 0) {
4031
- throw new chunkJSCDE774_cjs.InvalidParameterError("plotDecisionBoundary: X must have at least one row", "X", n);
4040
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("plotDecisionBoundary: X must have at least one row", "X", n);
4032
4041
  }
4033
4042
  if (y.ndim !== 1 || (y.shape[0] ?? -1) !== n) {
4034
- throw new chunkJSCDE774_cjs.ShapeError("plotDecisionBoundary: y must be shape [n]");
4043
+ throw new chunkZ6BGACIH_cjs.ShapeError("plotDecisionBoundary: y must be shape [n]");
4035
4044
  }
4036
4045
  const { data: xData } = tensorToFloat64Matrix2D(X);
4037
4046
  const x0 = new Float64Array(n);
@@ -4040,7 +4049,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4040
4049
  const vx = xData[i * 2] ?? NaN;
4041
4050
  const vy = xData[i * 2 + 1] ?? NaN;
4042
4051
  if (!Number.isFinite(vx) || !Number.isFinite(vy)) {
4043
- throw new chunkJSCDE774_cjs.InvalidParameterError("plotDecisionBoundary: X must be finite", "X", {
4052
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("plotDecisionBoundary: X must be finite", "X", {
4044
4053
  index: i,
4045
4054
  x: vx,
4046
4055
  y: vy
@@ -4054,17 +4063,17 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4054
4063
  if (typeof value === "string") return value;
4055
4064
  if (typeof value === "number") {
4056
4065
  if (!Number.isFinite(value)) {
4057
- throw new chunkJSCDE774_cjs.InvalidParameterError("plotDecisionBoundary: invalid label value", "y", value);
4066
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("plotDecisionBoundary: invalid label value", "y", value);
4058
4067
  }
4059
4068
  return value;
4060
4069
  }
4061
4070
  if (typeof value === "bigint") return value;
4062
- throw new chunkJSCDE774_cjs.InvalidParameterError("plotDecisionBoundary: invalid label value", "y", value);
4071
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("plotDecisionBoundary: invalid label value", "y", value);
4063
4072
  };
4064
4073
  const toFiniteNumber = (value) => {
4065
4074
  if (typeof value === "number") {
4066
4075
  if (!Number.isFinite(value)) {
4067
- throw new chunkJSCDE774_cjs.InvalidParameterError(
4076
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
4068
4077
  "plotDecisionBoundary: model.predict must return finite numeric scores",
4069
4078
  "predict",
4070
4079
  value
@@ -4075,7 +4084,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4075
4084
  if (typeof value === "bigint") {
4076
4085
  const n2 = Number(value);
4077
4086
  if (!Number.isFinite(n2)) {
4078
- throw new chunkJSCDE774_cjs.InvalidParameterError(
4087
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
4079
4088
  "plotDecisionBoundary: model.predict must return finite numeric scores",
4080
4089
  "predict",
4081
4090
  value
@@ -4083,7 +4092,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4083
4092
  }
4084
4093
  return n2;
4085
4094
  }
4086
- throw new chunkJSCDE774_cjs.InvalidParameterError(
4095
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError(
4087
4096
  "plotDecisionBoundary: model.predict must return numeric scores",
4088
4097
  "predict",
4089
4098
  value
@@ -4120,12 +4129,12 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4120
4129
  gridFlat[idx + 1] = fy;
4121
4130
  }
4122
4131
  }
4123
- const gridTensor = chunk6AE5FKKQ_cjs.tensor(gridFlat).reshape([gridCount, 2]);
4132
+ const gridTensor = chunk724CXHFH_cjs.tensor(gridFlat).reshape([gridCount, 2]);
4124
4133
  const predictions = model.predict(gridTensor);
4125
4134
  const predictedLabels = new Array(gridCount);
4126
4135
  if (predictions.ndim === 1) {
4127
4136
  if ((predictions.shape[0] ?? -1) !== gridCount) {
4128
- throw new chunkJSCDE774_cjs.ShapeError("plotDecisionBoundary: model.predict must return [gridSize] labels");
4137
+ throw new chunkZ6BGACIH_cjs.ShapeError("plotDecisionBoundary: model.predict must return [gridSize] labels");
4129
4138
  }
4130
4139
  for (let i = 0; i < gridCount; i++) {
4131
4140
  predictedLabels[i] = readLabel(predictions, i);
@@ -4134,7 +4143,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4134
4143
  const rows = predictions.shape[0] ?? -1;
4135
4144
  const cols = predictions.shape[1] ?? -1;
4136
4145
  if (rows !== gridCount || cols <= 0) {
4137
- throw new chunkJSCDE774_cjs.ShapeError("plotDecisionBoundary: model.predict must return [gridSize, k]");
4146
+ throw new chunkZ6BGACIH_cjs.ShapeError("plotDecisionBoundary: model.predict must return [gridSize, k]");
4138
4147
  }
4139
4148
  for (let i = 0; i < rows; i++) {
4140
4149
  let bestCol = 0;
@@ -4149,7 +4158,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4149
4158
  predictedLabels[i] = bestCol;
4150
4159
  }
4151
4160
  } else {
4152
- throw new chunkJSCDE774_cjs.ShapeError("plotDecisionBoundary: model.predict output must be 1D or 2D");
4161
+ throw new chunkZ6BGACIH_cjs.ShapeError("plotDecisionBoundary: model.predict output must be 1D or 2D");
4153
4162
  }
4154
4163
  const classIndex = /* @__PURE__ */ new Map();
4155
4164
  const classValues = [];
@@ -4175,7 +4184,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4175
4184
  for (let gy = 0; gy < gridResolution; gy++) {
4176
4185
  const row = boundaryMatrix[gy];
4177
4186
  if (!row) {
4178
- throw new chunkJSCDE774_cjs.InvalidParameterError("plotDecisionBoundary: grid row access failed", "gy", gy);
4187
+ throw new chunkZ6BGACIH_cjs.InvalidParameterError("plotDecisionBoundary: grid row access failed", "gy", gy);
4179
4188
  }
4180
4189
  for (let gx = 0; gx < gridResolution; gx++) {
4181
4190
  const label = predictedLabels[gy * gridResolution + gx];
@@ -4184,7 +4193,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4184
4193
  }
4185
4194
  }
4186
4195
  const ax = gca();
4187
- ax.imshow(chunk6AE5FKKQ_cjs.tensor(boundaryMatrix), {
4196
+ ax.imshow(chunk724CXHFH_cjs.tensor(boundaryMatrix), {
4188
4197
  colormap: options.colormap ?? "grayscale",
4189
4198
  vmin: options.vmin ?? 0,
4190
4199
  vmax: options.vmax ?? Math.max(1, classValues.length - 1),
@@ -4221,7 +4230,7 @@ function plotDecisionBoundary(X, y, model, options = {}) {
4221
4230
  }
4222
4231
  for (const group of byClass.values()) {
4223
4232
  const color = classColors[group.index % classColors.length] ?? "#000000";
4224
- ax.scatter(chunk6AE5FKKQ_cjs.tensor(group.x), chunk6AE5FKKQ_cjs.tensor(group.y), {
4233
+ ax.scatter(chunk724CXHFH_cjs.tensor(group.x), chunk724CXHFH_cjs.tensor(group.y), {
4225
4234
  color,
4226
4235
  size: options.size ?? 4,
4227
4236
  label: group.label
@@ -4259,5 +4268,5 @@ exports.scatter = scatter;
4259
4268
  exports.show = show;
4260
4269
  exports.subplot = subplot;
4261
4270
  exports.violinplot = violinplot;
4262
- //# sourceMappingURL=chunk-ALS7ETWZ.cjs.map
4263
- //# sourceMappingURL=chunk-ALS7ETWZ.cjs.map
4271
+ //# sourceMappingURL=chunk-HI2EZHCJ.cjs.map
4272
+ //# sourceMappingURL=chunk-HI2EZHCJ.cjs.map