@kitware/vtk.js 20.1.2 → 20.2.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 (309) hide show
  1. package/Common/Core/Base64.d.ts +14 -2
  2. package/Common/Core/Base64.js +31 -2
  3. package/Common/Core/Math/index.js +3 -3
  4. package/Common/Core/Math.d.ts +128 -128
  5. package/Common/Core/Math.js +1 -1
  6. package/Common/Core/MatrixBuilder.js +39 -41
  7. package/Common/DataModel/ImageData.js +12 -14
  8. package/Common/Transform/LandmarkTransform.js +6 -7
  9. package/Filters/General/PaintFilter/PaintFilter.worker.js +8 -8
  10. package/Filters/General/PaintFilter.js +11 -11
  11. package/Filters/Sources/PlaneSource.js +12 -13
  12. package/IO/Core/BinaryHelper.js +2 -4
  13. package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +1 -1
  14. package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +1 -1
  15. package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +2 -2
  16. package/IO/Core/ZipMultiDataSetReader.js +1 -1
  17. package/IO/Core/ZipMultiDataSetWriter.js +1 -1
  18. package/IO/Geometry/STLWriter.js +4 -4
  19. package/IO/Misc/SkyboxReader.js +1 -1
  20. package/IO/XML/XMLReader.js +3 -4
  21. package/IO/XML/XMLWriter.js +5 -6
  22. package/Imaging/Core/ImageReslice.js +18 -19
  23. package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +27 -28
  24. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +8 -9
  25. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +14 -15
  26. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +12 -13
  27. package/Interaction/Widgets/ImageCroppingRegionsWidget.js +5 -6
  28. package/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +1 -1
  29. package/Interaction/Widgets/PiecewiseGaussianWidget.js +2 -2
  30. package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +8 -9
  31. package/Rendering/Core/Actor.js +3 -4
  32. package/Rendering/Core/Camera.js +81 -84
  33. package/Rendering/Core/CellPicker.js +2 -2
  34. package/Rendering/Core/CubeAxesActor.js +32 -33
  35. package/Rendering/Core/Follower.js +20 -21
  36. package/Rendering/Core/Glyph3DMapper.js +30 -32
  37. package/Rendering/Core/ImageMapper.js +2 -2
  38. package/Rendering/Core/ImageSlice.js +5 -6
  39. package/Rendering/Core/Picker.js +5 -6
  40. package/Rendering/Core/PixelSpaceCallbackMapper.js +3 -4
  41. package/Rendering/Core/Prop3D.js +24 -25
  42. package/Rendering/Core/Renderer.js +11 -12
  43. package/Rendering/Core/ScalarBarActor.js +32 -33
  44. package/Rendering/Core/Volume.js +3 -4
  45. package/Rendering/OpenGL/Actor.js +9 -10
  46. package/Rendering/OpenGL/Camera.js +8 -9
  47. package/Rendering/OpenGL/CellArrayBufferObject.js +6 -8
  48. package/Rendering/OpenGL/Glyph3DMapper.js +8 -9
  49. package/Rendering/OpenGL/ImageMapper.js +7 -7
  50. package/Rendering/OpenGL/ImageSlice.js +4 -4
  51. package/Rendering/OpenGL/PolyDataMapper.js +11 -13
  52. package/Rendering/OpenGL/RenderWindow.d.ts +37 -1
  53. package/Rendering/OpenGL/ShaderCache.js +1 -1
  54. package/Rendering/OpenGL/Skybox.js +4 -5
  55. package/Rendering/OpenGL/SphereMapper.js +2 -2
  56. package/Rendering/OpenGL/StickMapper.js +3 -4
  57. package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +1 -1
  58. package/Rendering/OpenGL/Volume.js +6 -7
  59. package/Rendering/OpenGL/VolumeMapper.js +47 -49
  60. package/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl.js +1 -1
  61. package/Rendering/WebGPU/Actor.js +8 -8
  62. package/Rendering/WebGPU/Camera.js +8 -8
  63. package/Rendering/WebGPU/ImageMapper.js +18 -19
  64. package/Rendering/WebGPU/ImageSlice.js +9 -9
  65. package/Rendering/WebGPU/PolyDataMapper.js +3 -4
  66. package/Rendering/WebGPU/Renderer.js +6 -7
  67. package/Rendering/WebGPU/Texture.js +10 -9
  68. package/Rendering/WebGPU/Volume.js +3 -3
  69. package/Rendering/WebGPU/VolumePassFSQ.js +10 -10
  70. package/ThirdParty/index.js +2 -2
  71. package/Widgets/Manipulators/TrackballManipulator.js +5 -6
  72. package/Widgets/Representations/ArrowHandleRepresentation.js +10 -12
  73. package/Widgets/Representations/CircleContextRepresentation.js +4 -5
  74. package/Widgets/Representations/RectangleContextRepresentation.js +3 -3
  75. package/Widgets/Widgets3D/EllipseWidget/behavior.js +5 -5
  76. package/Widgets/Widgets3D/ImageCroppingWidget/helpers.js +6 -8
  77. package/Widgets/Widgets3D/PaintWidget/behavior.js +2 -2
  78. package/Widgets/Widgets3D/ResliceCursorWidget.js +6 -7
  79. package/Widgets/Widgets3D/ShapeWidget/behavior.js +10 -10
  80. package/Widgets/Widgets3D/SplineWidget/behavior.js +5 -5
  81. package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +1 -1
  82. package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +1 -1
  83. package/package.json +2 -2
  84. package/vtk.js +2 -2
  85. package/_vendor/base64-js/index.js_commonjs-exports.js +0 -1
  86. package/_vendor/blueimp-md5/js/md5.js_commonjs-module.js +0 -3
  87. package/_vendor/define-properties/index.js_commonjs-proxy.js +0 -1
  88. package/_vendor/globalthis/implementation.browser.js_commonjs-module.js +0 -3
  89. package/_vendor/globalthis/implementation.browser.js_commonjs-proxy.js +0 -1
  90. package/_vendor/globalthis/polyfill.js_commonjs-proxy.js +0 -1
  91. package/_vendor/globalthis/shim.js_commonjs-proxy.js +0 -2
  92. package/_vendor/jszip/dist/jszip.min.js_commonjs-module.js +0 -3
  93. package/_vendor/object-keys/implementation.js_commonjs-proxy.js +0 -1
  94. package/_vendor/object-keys/index.js_commonjs-proxy.js +0 -1
  95. package/_vendor/object-keys/isArguments.js_commonjs-proxy.js +0 -1
  96. package/_vendor/seedrandom/lib/alea.js_commonjs-module.js +0 -3
  97. package/_vendor/seedrandom/lib/alea.js_commonjs-proxy.js +0 -1
  98. package/_vendor/seedrandom/lib/tychei.js_commonjs-module.js +0 -3
  99. package/_vendor/seedrandom/lib/tychei.js_commonjs-proxy.js +0 -1
  100. package/_vendor/seedrandom/lib/xor128.js_commonjs-module.js +0 -3
  101. package/_vendor/seedrandom/lib/xor128.js_commonjs-proxy.js +0 -1
  102. package/_vendor/seedrandom/lib/xor4096.js_commonjs-module.js +0 -3
  103. package/_vendor/seedrandom/lib/xor4096.js_commonjs-proxy.js +0 -1
  104. package/_vendor/seedrandom/lib/xorshift7.js_commonjs-module.js +0 -3
  105. package/_vendor/seedrandom/lib/xorshift7.js_commonjs-proxy.js +0 -1
  106. package/_vendor/seedrandom/lib/xorwow.js_commonjs-module.js +0 -3
  107. package/_vendor/seedrandom/lib/xorwow.js_commonjs-proxy.js +0 -1
  108. package/_vendor/seedrandom/seedrandom.js_commonjs-module.js +0 -3
  109. package/_vendor/seedrandom/seedrandom.js_commonjs-proxy.js +0 -1
  110. package/_vendor/webworker-promise/lib/register.js_commonjs-module.js +0 -3
  111. package/_vendor/webworker-promise/lib/tiny-emitter.js_commonjs-proxy.js +0 -1
  112. package/_vendor/webworker-promise/src/tiny-emitter.js_commonjs-proxy.js +0 -1
  113. package/_vendor/xmlbuilder2/lib/xmlbuilder2.min.js_commonjs-module.js +0 -3
  114. package/_virtual/_rollup_plugin_ignore_empty_module_placeholder_commonjs-proxy.js +0 -6
  115. package/_virtual/commonjsHelpers.js +0 -22
  116. package/_virtual/polyfill-node.buffer.js +0 -1971
  117. package/_virtual/polyfill-node.global.js +0 -5
  118. package/_virtual/rollup_plugin_ignore_empty_module_placeholder.js +0 -8
  119. package/vendor/base64-js/index.js +0 -72
  120. package/vendor/blueimp-md5/js/md5.js +0 -402
  121. package/vendor/d3-array/src/array.js +0 -1
  122. package/vendor/d3-array/src/ascending.js +0 -5
  123. package/vendor/d3-array/src/bin.js +0 -1
  124. package/vendor/d3-array/src/bisect.js +0 -10
  125. package/vendor/d3-array/src/bisector.js +0 -46
  126. package/vendor/d3-array/src/constant.js +0 -1
  127. package/vendor/d3-array/src/count.js +0 -1
  128. package/vendor/d3-array/src/cross.js +0 -1
  129. package/vendor/d3-array/src/cumsum.js +0 -1
  130. package/vendor/d3-array/src/descending.js +0 -1
  131. package/vendor/d3-array/src/deviation.js +0 -1
  132. package/vendor/d3-array/src/difference.js +0 -1
  133. package/vendor/d3-array/src/disjoint.js +0 -1
  134. package/vendor/d3-array/src/every.js +0 -1
  135. package/vendor/d3-array/src/extent.js +0 -1
  136. package/vendor/d3-array/src/filter.js +0 -1
  137. package/vendor/d3-array/src/fsum.js +0 -1
  138. package/vendor/d3-array/src/greatest.js +0 -1
  139. package/vendor/d3-array/src/greatestIndex.js +0 -1
  140. package/vendor/d3-array/src/group.js +0 -1
  141. package/vendor/d3-array/src/groupSort.js +0 -1
  142. package/vendor/d3-array/src/identity.js +0 -1
  143. package/vendor/d3-array/src/index.js +0 -1
  144. package/vendor/d3-array/src/intersection.js +0 -1
  145. package/vendor/d3-array/src/least.js +0 -1
  146. package/vendor/d3-array/src/leastIndex.js +0 -1
  147. package/vendor/d3-array/src/map.js +0 -1
  148. package/vendor/d3-array/src/max.js +0 -1
  149. package/vendor/d3-array/src/maxIndex.js +0 -1
  150. package/vendor/d3-array/src/mean.js +0 -1
  151. package/vendor/d3-array/src/median.js +0 -1
  152. package/vendor/d3-array/src/merge.js +0 -1
  153. package/vendor/d3-array/src/min.js +0 -1
  154. package/vendor/d3-array/src/minIndex.js +0 -1
  155. package/vendor/d3-array/src/mode.js +0 -1
  156. package/vendor/d3-array/src/nice.js +0 -1
  157. package/vendor/d3-array/src/number.js +0 -5
  158. package/vendor/d3-array/src/pairs.js +0 -1
  159. package/vendor/d3-array/src/permute.js +0 -1
  160. package/vendor/d3-array/src/quantile.js +0 -1
  161. package/vendor/d3-array/src/quickselect.js +0 -1
  162. package/vendor/d3-array/src/range.js +0 -1
  163. package/vendor/d3-array/src/reduce.js +0 -1
  164. package/vendor/d3-array/src/reverse.js +0 -1
  165. package/vendor/d3-array/src/scan.js +0 -1
  166. package/vendor/d3-array/src/set.js +0 -1
  167. package/vendor/d3-array/src/shuffle.js +0 -1
  168. package/vendor/d3-array/src/some.js +0 -1
  169. package/vendor/d3-array/src/sort.js +0 -1
  170. package/vendor/d3-array/src/subset.js +0 -1
  171. package/vendor/d3-array/src/sum.js +0 -1
  172. package/vendor/d3-array/src/superset.js +0 -1
  173. package/vendor/d3-array/src/threshold/freedmanDiaconis.js +0 -1
  174. package/vendor/d3-array/src/threshold/scott.js +0 -1
  175. package/vendor/d3-array/src/threshold/sturges.js +0 -1
  176. package/vendor/d3-array/src/ticks.js +0 -56
  177. package/vendor/d3-array/src/transpose.js +0 -1
  178. package/vendor/d3-array/src/union.js +0 -1
  179. package/vendor/d3-array/src/variance.js +0 -1
  180. package/vendor/d3-array/src/zip.js +0 -1
  181. package/vendor/d3-color/src/color.js +0 -373
  182. package/vendor/d3-color/src/cubehelix.js +0 -1
  183. package/vendor/d3-color/src/define.js +0 -12
  184. package/vendor/d3-color/src/index.js +0 -1
  185. package/vendor/d3-color/src/lab.js +0 -1
  186. package/vendor/d3-color/src/math.js +0 -1
  187. package/vendor/d3-format/src/defaultLocale.js +0 -20
  188. package/vendor/d3-format/src/exponent.js +0 -7
  189. package/vendor/d3-format/src/formatDecimal.js +0 -22
  190. package/vendor/d3-format/src/formatGroup.js +0 -20
  191. package/vendor/d3-format/src/formatNumerals.js +0 -9
  192. package/vendor/d3-format/src/formatPrefixAuto.js +0 -18
  193. package/vendor/d3-format/src/formatRounded.js +0 -13
  194. package/vendor/d3-format/src/formatSpecifier.js +0 -49
  195. package/vendor/d3-format/src/formatTrim.js +0 -13
  196. package/vendor/d3-format/src/formatTypes.js +0 -21
  197. package/vendor/d3-format/src/identity.js +0 -5
  198. package/vendor/d3-format/src/index.js +0 -1
  199. package/vendor/d3-format/src/locale.js +0 -150
  200. package/vendor/d3-format/src/precisionFixed.js +0 -7
  201. package/vendor/d3-format/src/precisionPrefix.js +0 -7
  202. package/vendor/d3-format/src/precisionRound.js +0 -8
  203. package/vendor/d3-interpolate/src/array.js +0 -19
  204. package/vendor/d3-interpolate/src/basis.js +0 -1
  205. package/vendor/d3-interpolate/src/basisClosed.js +0 -1
  206. package/vendor/d3-interpolate/src/color.js +0 -26
  207. package/vendor/d3-interpolate/src/constant.js +0 -3
  208. package/vendor/d3-interpolate/src/cubehelix.js +0 -1
  209. package/vendor/d3-interpolate/src/date.js +0 -8
  210. package/vendor/d3-interpolate/src/discrete.js +0 -1
  211. package/vendor/d3-interpolate/src/hcl.js +0 -1
  212. package/vendor/d3-interpolate/src/hsl.js +0 -1
  213. package/vendor/d3-interpolate/src/hue.js +0 -1
  214. package/vendor/d3-interpolate/src/index.js +0 -1
  215. package/vendor/d3-interpolate/src/lab.js +0 -1
  216. package/vendor/d3-interpolate/src/number.js +0 -7
  217. package/vendor/d3-interpolate/src/numberArray.js +0 -16
  218. package/vendor/d3-interpolate/src/object.js +0 -25
  219. package/vendor/d3-interpolate/src/piecewise.js +0 -1
  220. package/vendor/d3-interpolate/src/quantize.js +0 -1
  221. package/vendor/d3-interpolate/src/rgb.js +0 -26
  222. package/vendor/d3-interpolate/src/round.js +0 -7
  223. package/vendor/d3-interpolate/src/string.js +0 -66
  224. package/vendor/d3-interpolate/src/transform/decompose.js +0 -1
  225. package/vendor/d3-interpolate/src/transform/index.js +0 -1
  226. package/vendor/d3-interpolate/src/transform/parse.js +0 -1
  227. package/vendor/d3-interpolate/src/value.js +0 -24
  228. package/vendor/d3-interpolate/src/zoom.js +0 -1
  229. package/vendor/d3-scale/src/band.js +0 -1
  230. package/vendor/d3-scale/src/constant.js +0 -7
  231. package/vendor/d3-scale/src/continuous.js +0 -129
  232. package/vendor/d3-scale/src/diverging.js +0 -1
  233. package/vendor/d3-scale/src/identity.js +0 -1
  234. package/vendor/d3-scale/src/index.js +0 -1
  235. package/vendor/d3-scale/src/init.js +0 -10
  236. package/vendor/d3-scale/src/linear.js +0 -72
  237. package/vendor/d3-scale/src/log.js +0 -1
  238. package/vendor/d3-scale/src/nice.js +0 -1
  239. package/vendor/d3-scale/src/number.js +0 -5
  240. package/vendor/d3-scale/src/ordinal.js +0 -1
  241. package/vendor/d3-scale/src/pow.js +0 -1
  242. package/vendor/d3-scale/src/quantile.js +0 -1
  243. package/vendor/d3-scale/src/quantize.js +0 -1
  244. package/vendor/d3-scale/src/radial.js +0 -1
  245. package/vendor/d3-scale/src/sequential.js +0 -1
  246. package/vendor/d3-scale/src/sequentialQuantile.js +0 -1
  247. package/vendor/d3-scale/src/symlog.js +0 -1
  248. package/vendor/d3-scale/src/threshold.js +0 -1
  249. package/vendor/d3-scale/src/tickFormat.js +0 -35
  250. package/vendor/d3-scale/src/time.js +0 -1
  251. package/vendor/d3-scale/src/utcTime.js +0 -1
  252. package/vendor/d3-time/src/day.js +0 -1
  253. package/vendor/d3-time/src/duration.js +0 -1
  254. package/vendor/d3-time/src/hour.js +0 -1
  255. package/vendor/d3-time/src/index.js +0 -1
  256. package/vendor/d3-time/src/interval.js +0 -1
  257. package/vendor/d3-time/src/millisecond.js +0 -1
  258. package/vendor/d3-time/src/minute.js +0 -1
  259. package/vendor/d3-time/src/month.js +0 -1
  260. package/vendor/d3-time/src/second.js +0 -1
  261. package/vendor/d3-time/src/ticks.js +0 -1
  262. package/vendor/d3-time/src/utcDay.js +0 -1
  263. package/vendor/d3-time/src/utcHour.js +0 -1
  264. package/vendor/d3-time/src/utcMinute.js +0 -1
  265. package/vendor/d3-time/src/utcMonth.js +0 -1
  266. package/vendor/d3-time/src/utcWeek.js +0 -1
  267. package/vendor/d3-time/src/utcYear.js +0 -1
  268. package/vendor/d3-time/src/week.js +0 -1
  269. package/vendor/d3-time/src/year.js +0 -1
  270. package/vendor/d3-time-format/src/defaultLocale.js +0 -1
  271. package/vendor/d3-time-format/src/index.js +0 -1
  272. package/vendor/d3-time-format/src/isoFormat.js +0 -1
  273. package/vendor/d3-time-format/src/isoParse.js +0 -1
  274. package/vendor/d3-time-format/src/locale.js +0 -1
  275. package/vendor/define-properties/index.js +0 -60
  276. package/vendor/gl-matrix/esm/common.js +0 -30
  277. package/vendor/gl-matrix/esm/index.js +0 -1
  278. package/vendor/gl-matrix/esm/mat2.js +0 -1
  279. package/vendor/gl-matrix/esm/mat2d.js +0 -1
  280. package/vendor/gl-matrix/esm/mat3.js +0 -817
  281. package/vendor/gl-matrix/esm/mat4.js +0 -1868
  282. package/vendor/gl-matrix/esm/quat.js +0 -330
  283. package/vendor/gl-matrix/esm/quat2.js +0 -1
  284. package/vendor/gl-matrix/esm/vec2.js +0 -1
  285. package/vendor/gl-matrix/esm/vec3.js +0 -842
  286. package/vendor/gl-matrix/esm/vec4.js +0 -153
  287. package/vendor/globalthis/implementation.browser.js +0 -11
  288. package/vendor/globalthis/index.js +0 -25
  289. package/vendor/globalthis/polyfill.js +0 -14
  290. package/vendor/globalthis/shim.js +0 -25
  291. package/vendor/internmap/src/index.js +0 -1
  292. package/vendor/jszip/dist/jszip.min.js +0 -11
  293. package/vendor/object-keys/implementation.js +0 -124
  294. package/vendor/object-keys/index.js +0 -35
  295. package/vendor/object-keys/isArguments.js +0 -17
  296. package/vendor/pako/dist/pako.esm.mjs.js +0 -6707
  297. package/vendor/seedrandom/index.js +0 -77
  298. package/vendor/seedrandom/lib/alea.js +0 -117
  299. package/vendor/seedrandom/lib/tychei.js +0 -105
  300. package/vendor/seedrandom/lib/xor128.js +0 -84
  301. package/vendor/seedrandom/lib/xor4096.js +0 -150
  302. package/vendor/seedrandom/lib/xorshift7.js +0 -101
  303. package/vendor/seedrandom/lib/xorwow.js +0 -89
  304. package/vendor/seedrandom/seedrandom.js +0 -256
  305. package/vendor/webworker-promise/lib/register.js +0 -158
  306. package/vendor/webworker-promise/lib/tiny-emitter.js +0 -89
  307. package/vendor/webworker-promise/src/index.js +0 -110
  308. package/vendor/webworker-promise/src/tiny-emitter.js +0 -51
  309. package/vendor/xmlbuilder2/lib/xmlbuilder2.min.js +0 -13
@@ -1,13 +0,0 @@
1
- // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
2
- function formatTrim(s) {
3
- out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
4
- switch (s[i]) {
5
- case ".": i0 = i1 = i; break;
6
- case "0": if (i0 === 0) i0 = i; i1 = i; break;
7
- default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;
8
- }
9
- }
10
- return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
11
- }
12
-
13
- export { formatTrim as f };
@@ -1,21 +0,0 @@
1
- import { a as formatDecimal } from './formatDecimal.js';
2
- import { f as formatPrefixAuto } from './formatPrefixAuto.js';
3
- import { f as formatRounded } from './formatRounded.js';
4
-
5
- var formatTypes = {
6
- "%": (x, p) => (x * 100).toFixed(p),
7
- "b": (x) => Math.round(x).toString(2),
8
- "c": (x) => x + "",
9
- "d": formatDecimal,
10
- "e": (x, p) => x.toExponential(p),
11
- "f": (x, p) => x.toFixed(p),
12
- "g": (x, p) => x.toPrecision(p),
13
- "o": (x) => Math.round(x).toString(8),
14
- "p": (x, p) => formatRounded(x * 100, p),
15
- "r": formatRounded,
16
- "s": formatPrefixAuto,
17
- "X": (x) => Math.round(x).toString(16).toUpperCase(),
18
- "x": (x) => Math.round(x).toString(16)
19
- };
20
-
21
- export { formatTypes as f };
@@ -1,5 +0,0 @@
1
- function identity(x) {
2
- return x;
3
- }
4
-
5
- export { identity as i };
@@ -1 +0,0 @@
1
- import './defaultLocale.js';
@@ -1,150 +0,0 @@
1
- import { e as exponent } from './exponent.js';
2
- import { f as formatGroup } from './formatGroup.js';
3
- import { f as formatNumerals } from './formatNumerals.js';
4
- import { f as formatSpecifier } from './formatSpecifier.js';
5
- import { f as formatTrim } from './formatTrim.js';
6
- import { f as formatTypes } from './formatTypes.js';
7
- import { p as prefixExponent } from './formatPrefixAuto.js';
8
- import { i as identity } from './identity.js';
9
-
10
- var map = Array.prototype.map,
11
- prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
12
-
13
- function formatLocale(locale) {
14
- var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
15
- currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
16
- currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
17
- decimal = locale.decimal === undefined ? "." : locale.decimal + "",
18
- numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),
19
- percent = locale.percent === undefined ? "%" : locale.percent + "",
20
- minus = locale.minus === undefined ? "−" : locale.minus + "",
21
- nan = locale.nan === undefined ? "NaN" : locale.nan + "";
22
-
23
- function newFormat(specifier) {
24
- specifier = formatSpecifier(specifier);
25
-
26
- var fill = specifier.fill,
27
- align = specifier.align,
28
- sign = specifier.sign,
29
- symbol = specifier.symbol,
30
- zero = specifier.zero,
31
- width = specifier.width,
32
- comma = specifier.comma,
33
- precision = specifier.precision,
34
- trim = specifier.trim,
35
- type = specifier.type;
36
-
37
- // The "n" type is an alias for ",g".
38
- if (type === "n") comma = true, type = "g";
39
-
40
- // The "" type, and any invalid type, is an alias for ".12~g".
41
- else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
42
-
43
- // If zero fill is specified, padding goes after sign and before digits.
44
- if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
45
-
46
- // Compute the prefix and suffix.
47
- // For SI-prefix, the suffix is lazily computed.
48
- var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
49
- suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
50
-
51
- // What format function should we use?
52
- // Is this an integer type?
53
- // Can this type generate exponential notation?
54
- var formatType = formatTypes[type],
55
- maybeSuffix = /[defgprs%]/.test(type);
56
-
57
- // Set the default precision if not specified,
58
- // or clamp the specified precision to the supported range.
59
- // For significant precision, it must be in [1, 21].
60
- // For fixed precision, it must be in [0, 20].
61
- precision = precision === undefined ? 6
62
- : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
63
- : Math.max(0, Math.min(20, precision));
64
-
65
- function format(value) {
66
- var valuePrefix = prefix,
67
- valueSuffix = suffix,
68
- i, n, c;
69
-
70
- if (type === "c") {
71
- valueSuffix = formatType(value) + valueSuffix;
72
- value = "";
73
- } else {
74
- value = +value;
75
-
76
- // Determine the sign. -0 is not less than 0, but 1 / -0 is!
77
- var valueNegative = value < 0 || 1 / value < 0;
78
-
79
- // Perform the initial formatting.
80
- value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
81
-
82
- // Trim insignificant zeros.
83
- if (trim) value = formatTrim(value);
84
-
85
- // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
86
- if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
87
-
88
- // Compute the prefix and suffix.
89
- valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
90
- valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
91
-
92
- // Break the formatted value into the integer “value” part that can be
93
- // grouped, and fractional or exponential “suffix” part that is not.
94
- if (maybeSuffix) {
95
- i = -1, n = value.length;
96
- while (++i < n) {
97
- if (c = value.charCodeAt(i), 48 > c || c > 57) {
98
- valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
99
- value = value.slice(0, i);
100
- break;
101
- }
102
- }
103
- }
104
- }
105
-
106
- // If the fill character is not "0", grouping is applied before padding.
107
- if (comma && !zero) value = group(value, Infinity);
108
-
109
- // Compute the padding.
110
- var length = valuePrefix.length + value.length + valueSuffix.length,
111
- padding = length < width ? new Array(width - length + 1).join(fill) : "";
112
-
113
- // If the fill character is "0", grouping is applied after padding.
114
- if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
115
-
116
- // Reconstruct the final output based on the desired alignment.
117
- switch (align) {
118
- case "<": value = valuePrefix + value + valueSuffix + padding; break;
119
- case "=": value = valuePrefix + padding + value + valueSuffix; break;
120
- case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
121
- default: value = padding + valuePrefix + value + valueSuffix; break;
122
- }
123
-
124
- return numerals(value);
125
- }
126
-
127
- format.toString = function() {
128
- return specifier + "";
129
- };
130
-
131
- return format;
132
- }
133
-
134
- function formatPrefix(specifier, value) {
135
- var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
136
- e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
137
- k = Math.pow(10, -e),
138
- prefix = prefixes[8 + e / 3];
139
- return function(value) {
140
- return f(k * value) + prefix;
141
- };
142
- }
143
-
144
- return {
145
- format: newFormat,
146
- formatPrefix: formatPrefix
147
- };
148
- }
149
-
150
- export { formatLocale as f };
@@ -1,7 +0,0 @@
1
- import { e as exponent } from './exponent.js';
2
-
3
- function precisionFixed(step) {
4
- return Math.max(0, -exponent(Math.abs(step)));
5
- }
6
-
7
- export { precisionFixed as p };
@@ -1,7 +0,0 @@
1
- import { e as exponent } from './exponent.js';
2
-
3
- function precisionPrefix(step, value) {
4
- return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
5
- }
6
-
7
- export { precisionPrefix as p };
@@ -1,8 +0,0 @@
1
- import { e as exponent } from './exponent.js';
2
-
3
- function precisionRound(step, max) {
4
- step = Math.abs(step), max = Math.abs(max) - step;
5
- return Math.max(0, exponent(max) - exponent(step)) + 1;
6
- }
7
-
8
- export { precisionRound as p };
@@ -1,19 +0,0 @@
1
- import { i as interpolate } from './value.js';
2
-
3
- function genericArray(a, b) {
4
- var nb = b ? b.length : 0,
5
- na = a ? Math.min(nb, a.length) : 0,
6
- x = new Array(na),
7
- c = new Array(nb),
8
- i;
9
-
10
- for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
11
- for (; i < nb; ++i) c[i] = b[i];
12
-
13
- return function(t) {
14
- for (i = 0; i < na; ++i) c[i] = x[i](t);
15
- return c;
16
- };
17
- }
18
-
19
- export { genericArray as g };
@@ -1 +0,0 @@
1
-
@@ -1,26 +0,0 @@
1
- import { c as constant } from './constant.js';
2
-
3
- function linear(a, d) {
4
- return function(t) {
5
- return a + t * d;
6
- };
7
- }
8
-
9
- function exponential(a, b, y) {
10
- return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
11
- return Math.pow(a + t * b, y);
12
- };
13
- }
14
-
15
- function gamma(y) {
16
- return (y = +y) === 1 ? nogamma : function(a, b) {
17
- return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
18
- };
19
- }
20
-
21
- function nogamma(a, b) {
22
- var d = b - a;
23
- return d ? linear(a, d) : constant(isNaN(a) ? b : a);
24
- }
25
-
26
- export { gamma as g, nogamma as n };
@@ -1,3 +0,0 @@
1
- var constant = x => () => x;
2
-
3
- export { constant as c };
@@ -1,8 +0,0 @@
1
- function date(a, b) {
2
- var d = new Date;
3
- return a = +a, b = +b, function(t) {
4
- return d.setTime(a * (1 - t) + b * t), d;
5
- };
6
- }
7
-
8
- export { date as d };
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1,7 +0,0 @@
1
- function interpolateNumber(a, b) {
2
- return a = +a, b = +b, function(t) {
3
- return a * (1 - t) + b * t;
4
- };
5
- }
6
-
7
- export { interpolateNumber as i };
@@ -1,16 +0,0 @@
1
- function numberArray(a, b) {
2
- if (!b) b = [];
3
- var n = a ? Math.min(b.length, a.length) : 0,
4
- c = b.slice(),
5
- i;
6
- return function(t) {
7
- for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
8
- return c;
9
- };
10
- }
11
-
12
- function isNumberArray(x) {
13
- return ArrayBuffer.isView(x) && !(x instanceof DataView);
14
- }
15
-
16
- export { isNumberArray as i, numberArray as n };
@@ -1,25 +0,0 @@
1
- import { i as interpolate } from './value.js';
2
-
3
- function object(a, b) {
4
- var i = {},
5
- c = {},
6
- k;
7
-
8
- if (a === null || typeof a !== "object") a = {};
9
- if (b === null || typeof b !== "object") b = {};
10
-
11
- for (k in b) {
12
- if (k in a) {
13
- i[k] = interpolate(a[k], b[k]);
14
- } else {
15
- c[k] = b[k];
16
- }
17
- }
18
-
19
- return function(t) {
20
- for (k in i) c[k] = i[k](t);
21
- return c;
22
- };
23
- }
24
-
25
- export { object as o };
@@ -1 +0,0 @@
1
-
@@ -1,26 +0,0 @@
1
- import { n as nogamma, g as gamma } from './color.js';
2
- import { r as rgb$1 } from '../../d3-color/src/color.js';
3
-
4
- var rgb = (function rgbGamma(y) {
5
- var color = gamma(y);
6
-
7
- function rgb(start, end) {
8
- var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
9
- g = color(start.g, end.g),
10
- b = color(start.b, end.b),
11
- opacity = nogamma(start.opacity, end.opacity);
12
- return function(t) {
13
- start.r = r(t);
14
- start.g = g(t);
15
- start.b = b(t);
16
- start.opacity = opacity(t);
17
- return start + "";
18
- };
19
- }
20
-
21
- rgb.gamma = rgbGamma;
22
-
23
- return rgb;
24
- })(1);
25
-
26
- export { rgb as r };
@@ -1,7 +0,0 @@
1
- function interpolateRound(a, b) {
2
- return a = +a, b = +b, function(t) {
3
- return Math.round(a * (1 - t) + b * t);
4
- };
5
- }
6
-
7
- export { interpolateRound as i };
@@ -1,66 +0,0 @@
1
- import { i as interpolateNumber } from './number.js';
2
-
3
- var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
4
- reB = new RegExp(reA.source, "g");
5
-
6
- function zero(b) {
7
- return function() {
8
- return b;
9
- };
10
- }
11
-
12
- function one(b) {
13
- return function(t) {
14
- return b(t) + "";
15
- };
16
- }
17
-
18
- function string(a, b) {
19
- var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
20
- am, // current match in a
21
- bm, // current match in b
22
- bs, // string preceding current number in b, if any
23
- i = -1, // index in s
24
- s = [], // string constants and placeholders
25
- q = []; // number interpolators
26
-
27
- // Coerce inputs to strings.
28
- a = a + "", b = b + "";
29
-
30
- // Interpolate pairs of numbers in a & b.
31
- while ((am = reA.exec(a))
32
- && (bm = reB.exec(b))) {
33
- if ((bs = bm.index) > bi) { // a string precedes the next number in b
34
- bs = b.slice(bi, bs);
35
- if (s[i]) s[i] += bs; // coalesce with previous string
36
- else s[++i] = bs;
37
- }
38
- if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
39
- if (s[i]) s[i] += bm; // coalesce with previous string
40
- else s[++i] = bm;
41
- } else { // interpolate non-matching numbers
42
- s[++i] = null;
43
- q.push({i: i, x: interpolateNumber(am, bm)});
44
- }
45
- bi = reB.lastIndex;
46
- }
47
-
48
- // Add remains of b.
49
- if (bi < b.length) {
50
- bs = b.slice(bi);
51
- if (s[i]) s[i] += bs; // coalesce with previous string
52
- else s[++i] = bs;
53
- }
54
-
55
- // Special optimization for only a single match.
56
- // Otherwise, interpolate each of the numbers and rejoin the string.
57
- return s.length < 2 ? (q[0]
58
- ? one(q[0].x)
59
- : zero(b))
60
- : (b = q.length, function(t) {
61
- for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
62
- return s.join("");
63
- });
64
- }
65
-
66
- export { string as s };
@@ -1,24 +0,0 @@
1
- import { r as rgb } from './rgb.js';
2
- import { g as genericArray } from './array.js';
3
- import { d as date } from './date.js';
4
- import { i as interpolateNumber } from './number.js';
5
- import { o as object } from './object.js';
6
- import { s as string } from './string.js';
7
- import { c as constant } from './constant.js';
8
- import { i as isNumberArray, n as numberArray } from './numberArray.js';
9
- import { c as color } from '../../d3-color/src/color.js';
10
-
11
- function interpolate(a, b) {
12
- var t = typeof b, c;
13
- return b == null || t === "boolean" ? constant(b)
14
- : (t === "number" ? interpolateNumber
15
- : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
16
- : b instanceof color ? rgb
17
- : b instanceof Date ? date
18
- : isNumberArray(b) ? numberArray
19
- : Array.isArray(b) ? genericArray
20
- : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
21
- : interpolateNumber)(a, b);
22
- }
23
-
24
- export { interpolate as i };
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1,7 +0,0 @@
1
- function constants(x) {
2
- return function() {
3
- return x;
4
- };
5
- }
6
-
7
- export { constants as c };
@@ -1,129 +0,0 @@
1
- import { c as constants } from './constant.js';
2
- import { n as number } from './number.js';
3
- import { i as interpolateNumber } from '../../d3-interpolate/src/number.js';
4
- import { i as interpolateRound } from '../../d3-interpolate/src/round.js';
5
- import { i as interpolate } from '../../d3-interpolate/src/value.js';
6
- import { b as bisect } from '../../d3-array/src/bisect.js';
7
-
8
- var unit = [0, 1];
9
-
10
- function identity(x) {
11
- return x;
12
- }
13
-
14
- function normalize(a, b) {
15
- return (b -= (a = +a))
16
- ? function(x) { return (x - a) / b; }
17
- : constants(isNaN(b) ? NaN : 0.5);
18
- }
19
-
20
- function clamper(a, b) {
21
- var t;
22
- if (a > b) t = a, a = b, b = t;
23
- return function(x) { return Math.max(a, Math.min(b, x)); };
24
- }
25
-
26
- // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
27
- // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
28
- function bimap(domain, range, interpolate) {
29
- var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
30
- if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
31
- else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
32
- return function(x) { return r0(d0(x)); };
33
- }
34
-
35
- function polymap(domain, range, interpolate) {
36
- var j = Math.min(domain.length, range.length) - 1,
37
- d = new Array(j),
38
- r = new Array(j),
39
- i = -1;
40
-
41
- // Reverse descending domains.
42
- if (domain[j] < domain[0]) {
43
- domain = domain.slice().reverse();
44
- range = range.slice().reverse();
45
- }
46
-
47
- while (++i < j) {
48
- d[i] = normalize(domain[i], domain[i + 1]);
49
- r[i] = interpolate(range[i], range[i + 1]);
50
- }
51
-
52
- return function(x) {
53
- var i = bisect(domain, x, 1, j) - 1;
54
- return r[i](d[i](x));
55
- };
56
- }
57
-
58
- function copy(source, target) {
59
- return target
60
- .domain(source.domain())
61
- .range(source.range())
62
- .interpolate(source.interpolate())
63
- .clamp(source.clamp())
64
- .unknown(source.unknown());
65
- }
66
-
67
- function transformer() {
68
- var domain = unit,
69
- range = unit,
70
- interpolate$1 = interpolate,
71
- transform,
72
- untransform,
73
- unknown,
74
- clamp = identity,
75
- piecewise,
76
- output,
77
- input;
78
-
79
- function rescale() {
80
- var n = Math.min(domain.length, range.length);
81
- if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
82
- piecewise = n > 2 ? polymap : bimap;
83
- output = input = null;
84
- return scale;
85
- }
86
-
87
- function scale(x) {
88
- return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
89
- }
90
-
91
- scale.invert = function(y) {
92
- return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
93
- };
94
-
95
- scale.domain = function(_) {
96
- return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
97
- };
98
-
99
- scale.range = function(_) {
100
- return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
101
- };
102
-
103
- scale.rangeRound = function(_) {
104
- return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
105
- };
106
-
107
- scale.clamp = function(_) {
108
- return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
109
- };
110
-
111
- scale.interpolate = function(_) {
112
- return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
113
- };
114
-
115
- scale.unknown = function(_) {
116
- return arguments.length ? (unknown = _, scale) : unknown;
117
- };
118
-
119
- return function(t, u) {
120
- transform = t, untransform = u;
121
- return rescale();
122
- };
123
- }
124
-
125
- function continuous() {
126
- return transformer()(identity, identity);
127
- }
128
-
129
- export { copy as a, continuous as c };
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-