numbl 0.4.21 → 0.4.22

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 (281) hide show
  1. package/binding.gyp +12 -6
  2. package/dist-browser/browser/index.d.ts +1 -1
  3. package/dist-browser/browser/mip.d.ts +7 -0
  4. package/dist-browser/browser/protocol.d.ts +1 -1
  5. package/dist-browser/browser.js +1 -1
  6. package/dist-browser/db/operations.d.ts +0 -1
  7. package/dist-browser/gpuHelper.d.ts +29 -0
  8. package/dist-browser/hooks/projectFilesState.d.ts +37 -0
  9. package/dist-browser/numbl-core/execSession.d.ts +39 -0
  10. package/dist-browser/numbl-core/executeCode.d.ts +10 -1
  11. package/dist-browser/numbl-core/executors/classification.d.ts +2 -10
  12. package/dist-browser/numbl-core/executors/jit/backend.d.ts +65 -0
  13. package/dist-browser/numbl-core/executors/jit/cBackend.d.ts +22 -0
  14. package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +13 -44
  15. package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
  16. package/dist-browser/numbl-core/executors/jit/jsBackend.d.ts +15 -0
  17. package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
  18. package/dist-browser/numbl-core/executors/jit/session.d.ts +1 -1
  19. package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
  20. package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
  21. package/dist-browser/numbl-core/executors/lowering.d.ts +38 -96
  22. package/dist-browser/numbl-core/executors/plugins.d.ts +14 -28
  23. package/dist-browser/numbl-core/executors/registry.d.ts +32 -133
  24. package/dist-browser/numbl-core/executors/types.d.ts +30 -92
  25. package/dist-browser/numbl-core/functionResolve.d.ts +3 -13
  26. package/dist-browser/numbl-core/helpers/check-helpers.d.ts +0 -5
  27. package/dist-browser/numbl-core/helpers/glob.d.ts +14 -0
  28. package/dist-browser/numbl-core/helpers/linsolve.d.ts +3 -13
  29. package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +2 -4
  30. package/dist-browser/numbl-core/helpers/shape-utils.d.ts +10 -0
  31. package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +3 -1
  32. package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
  33. package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +7 -7
  34. package/dist-browser/numbl-core/interpreter/interpreter.d.ts +6 -6
  35. package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
  36. package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
  37. package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
  38. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
  39. package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
  40. package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
  41. package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
  42. package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
  43. package/dist-browser/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
  44. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
  45. package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
  46. package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
  47. package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
  48. package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
  49. package/dist-browser/numbl-core/jit/builtins/registry.d.ts +15 -30
  50. package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
  51. package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
  52. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
  53. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
  54. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
  55. package/dist-browser/numbl-core/jit/codegen/emit.d.ts +9 -30
  56. package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +9 -27
  57. package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
  58. package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
  59. package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
  60. package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
  61. package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +7 -28
  62. package/dist-browser/numbl-core/jit/compileSpec.d.ts +3 -6
  63. package/dist-browser/numbl-core/jit/compileSpecC.d.ts +5 -0
  64. package/dist-browser/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
  65. package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
  66. package/dist-browser/numbl-core/jit/lowering/errors.d.ts +3 -15
  67. package/dist-browser/numbl-core/jit/lowering/ir.d.ts +0 -2
  68. package/dist-browser/numbl-core/jit/lowering/lower.d.ts +4 -12
  69. package/dist-browser/numbl-core/jit/lowering/types.d.ts +2 -7
  70. package/dist-browser/numbl-core/jit/numbl/index.d.ts +5 -14
  71. package/dist-browser/numbl-core/jit/parser/index.d.ts +4 -9
  72. package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +32 -136
  73. package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
  74. package/dist-browser/numbl-core/jsUserFunctions.d.ts +10 -12
  75. package/dist-browser/numbl-core/lowering/classInfo.d.ts +4 -1
  76. package/dist-browser/numbl-core/lowering/loweringContext.d.ts +15 -23
  77. package/dist-browser/numbl-core/native/lapack-bridge.d.ts +111 -130
  78. package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
  79. package/dist-browser/numbl-core/native/ts-lapack-complex.d.ts +23 -0
  80. package/dist-browser/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
  81. package/dist-browser/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
  82. package/dist-browser/numbl-core/ops/dispatch.d.ts +4 -5
  83. package/dist-browser/numbl-core/parser/types.d.ts +1 -21
  84. package/{dist-lib/numbl-core/runtime → dist-browser/numbl-core/plotting}/axisCommand.d.ts +2 -2
  85. package/dist-browser/{graphics → numbl-core/plotting}/axisLimits.d.ts +14 -2
  86. package/dist-browser/numbl-core/plotting/builtins.d.ts +8 -0
  87. package/dist-browser/numbl-core/plotting/colormaps.d.ts +10 -0
  88. package/dist-browser/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
  89. package/dist-browser/numbl-core/plotting/imagescExtent.d.ts +19 -0
  90. package/dist-browser/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
  91. package/dist-browser/numbl-core/plotting/parseArgsChart.d.ts +94 -0
  92. package/dist-browser/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
  93. package/dist-browser/numbl-core/plotting/parseArgsLine.d.ts +103 -0
  94. package/dist-browser/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
  95. package/dist-browser/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
  96. package/dist-browser/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
  97. package/dist-browser/numbl-core/plotting/streamline.d.ts +16 -0
  98. package/{dist-graphics/graphics → dist-browser/numbl-core/plotting}/types.d.ts +9 -7
  99. package/dist-browser/numbl-core/runtime/cow.d.ts +0 -8
  100. package/dist-browser/numbl-core/runtime/refcount.d.ts +0 -3
  101. package/dist-browser/numbl-core/runtime/registerSpecial.d.ts +15 -0
  102. package/dist-browser/numbl-core/runtime/runtime.d.ts +11 -35
  103. package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
  104. package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +3 -9
  105. package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +5 -13
  106. package/dist-browser/numbl-core/runtime/utils.d.ts +4 -1
  107. package/dist-browser/numbl-core/version.d.ts +1 -1
  108. package/dist-browser/numbl-core/workspace/workspace.d.ts +64 -0
  109. package/dist-browser/vfs/syncVfsChanges.d.ts +2 -2
  110. package/dist-cli/cli.js +74244 -80566
  111. package/dist-graphics/graphics/FigureView.d.ts +1 -1
  112. package/dist-graphics/graphics/SurfView.d.ts +3 -2
  113. package/dist-graphics/graphics/drawPlot.d.ts +1 -1
  114. package/dist-graphics/graphics/exportFigureHdf5.d.ts +1 -1
  115. package/dist-graphics/graphics/figureHashTransport.d.ts +1 -1
  116. package/dist-graphics/graphics/figureUpload.d.ts +1 -1
  117. package/dist-graphics/graphics/importFigureHdf5.d.ts +1 -1
  118. package/dist-graphics/graphics/openInFigureViewer.d.ts +1 -1
  119. package/dist-graphics/graphics/plotHelpers.d.ts +1 -1
  120. package/dist-graphics/graphics/plotLegend.d.ts +1 -1
  121. package/dist-graphics/graphics/plotMarkers.d.ts +1 -1
  122. package/dist-graphics/graphics/restoreNaNs.d.ts +1 -1
  123. package/dist-graphics/graphics/uihtmlRelay.d.ts +16 -0
  124. package/dist-graphics/graphics-lib.d.ts +3 -3
  125. package/dist-graphics/index.js +294 -328
  126. package/{dist-lib/graphics → dist-graphics/numbl-core/plotting}/axisLimits.d.ts +14 -2
  127. package/dist-graphics/numbl-core/plotting/colormaps.d.ts +10 -0
  128. package/dist-graphics/numbl-core/plotting/imagescExtent.d.ts +19 -0
  129. package/{dist-browser/graphics → dist-graphics/numbl-core/plotting}/types.d.ts +9 -7
  130. package/dist-lib/browser/mip.d.ts +17 -0
  131. package/dist-lib/cli-scan.d.ts +8 -1
  132. package/dist-lib/lib.d.ts +1 -1
  133. package/dist-lib/lib.js +29201 -35301
  134. package/dist-lib/node.js +22 -14
  135. package/dist-lib/numbl-core/execSession.d.ts +39 -0
  136. package/dist-lib/numbl-core/executeCode.d.ts +10 -1
  137. package/dist-lib/numbl-core/executors/classification.d.ts +2 -10
  138. package/dist-lib/numbl-core/executors/jit/backend.d.ts +65 -0
  139. package/dist-lib/numbl-core/executors/jit/cBackend.d.ts +22 -0
  140. package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +13 -44
  141. package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
  142. package/dist-lib/numbl-core/executors/jit/jsBackend.d.ts +15 -0
  143. package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
  144. package/dist-lib/numbl-core/executors/jit/session.d.ts +1 -1
  145. package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
  146. package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
  147. package/dist-lib/numbl-core/executors/lowering.d.ts +38 -96
  148. package/dist-lib/numbl-core/executors/plugins.d.ts +14 -28
  149. package/dist-lib/numbl-core/executors/registry.d.ts +32 -133
  150. package/dist-lib/numbl-core/executors/types.d.ts +30 -92
  151. package/dist-lib/numbl-core/functionResolve.d.ts +3 -13
  152. package/dist-lib/numbl-core/helpers/check-helpers.d.ts +0 -5
  153. package/dist-lib/numbl-core/helpers/glob.d.ts +14 -0
  154. package/dist-lib/numbl-core/helpers/linsolve.d.ts +3 -13
  155. package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +2 -4
  156. package/dist-lib/numbl-core/helpers/shape-utils.d.ts +10 -0
  157. package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +3 -1
  158. package/dist-lib/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
  159. package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +7 -7
  160. package/dist-lib/numbl-core/interpreter/interpreter.d.ts +6 -6
  161. package/dist-lib/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
  162. package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
  163. package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
  164. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
  165. package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
  166. package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
  167. package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
  168. package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
  169. package/dist-lib/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
  170. package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
  171. package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
  172. package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
  173. package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
  174. package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
  175. package/dist-lib/numbl-core/jit/builtins/registry.d.ts +15 -30
  176. package/dist-lib/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
  177. package/dist-lib/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
  178. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
  179. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
  180. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
  181. package/dist-lib/numbl-core/jit/codegen/emit.d.ts +9 -30
  182. package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +9 -27
  183. package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
  184. package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
  185. package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
  186. package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
  187. package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +7 -28
  188. package/dist-lib/numbl-core/jit/compileSpec.d.ts +3 -6
  189. package/dist-lib/numbl-core/jit/compileSpecC.d.ts +5 -0
  190. package/dist-lib/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
  191. package/dist-lib/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
  192. package/dist-lib/numbl-core/jit/lowering/errors.d.ts +3 -15
  193. package/dist-lib/numbl-core/jit/lowering/ir.d.ts +0 -2
  194. package/dist-lib/numbl-core/jit/lowering/lower.d.ts +4 -12
  195. package/dist-lib/numbl-core/jit/lowering/types.d.ts +2 -7
  196. package/dist-lib/numbl-core/jit/numbl/index.d.ts +5 -14
  197. package/dist-lib/numbl-core/jit/parser/index.d.ts +4 -9
  198. package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +32 -136
  199. package/dist-lib/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
  200. package/dist-lib/numbl-core/jsUserFunctions.d.ts +10 -12
  201. package/dist-lib/numbl-core/lowering/classInfo.d.ts +4 -1
  202. package/dist-lib/numbl-core/lowering/loweringContext.d.ts +15 -23
  203. package/dist-lib/numbl-core/native/lapack-bridge.d.ts +111 -130
  204. package/dist-lib/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
  205. package/dist-lib/numbl-core/native/ts-lapack-complex.d.ts +23 -0
  206. package/dist-lib/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
  207. package/dist-lib/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
  208. package/dist-lib/numbl-core/ops/dispatch.d.ts +4 -5
  209. package/dist-lib/numbl-core/parser/types.d.ts +1 -21
  210. package/{dist-browser/numbl-core/runtime → dist-lib/numbl-core/plotting}/axisCommand.d.ts +2 -2
  211. package/{dist-graphics/graphics → dist-lib/numbl-core/plotting}/axisLimits.d.ts +14 -2
  212. package/dist-lib/numbl-core/plotting/builtins.d.ts +8 -0
  213. package/dist-lib/numbl-core/plotting/colormaps.d.ts +10 -0
  214. package/dist-lib/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
  215. package/dist-lib/numbl-core/plotting/imagescExtent.d.ts +19 -0
  216. package/dist-lib/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
  217. package/dist-lib/numbl-core/plotting/parseArgsChart.d.ts +94 -0
  218. package/dist-lib/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
  219. package/dist-lib/numbl-core/plotting/parseArgsLine.d.ts +103 -0
  220. package/dist-lib/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
  221. package/dist-lib/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
  222. package/dist-lib/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
  223. package/dist-lib/numbl-core/plotting/streamline.d.ts +16 -0
  224. package/dist-lib/{graphics → numbl-core/plotting}/types.d.ts +9 -7
  225. package/dist-lib/numbl-core/runtime/cow.d.ts +0 -8
  226. package/dist-lib/numbl-core/runtime/refcount.d.ts +0 -3
  227. package/dist-lib/numbl-core/runtime/registerSpecial.d.ts +15 -0
  228. package/dist-lib/numbl-core/runtime/runtime.d.ts +11 -35
  229. package/dist-lib/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
  230. package/dist-lib/numbl-core/runtime/specialBuiltins.d.ts +3 -9
  231. package/dist-lib/numbl-core/runtime/uihtmlSession.d.ts +5 -13
  232. package/dist-lib/numbl-core/runtime/utils.d.ts +4 -1
  233. package/dist-lib/numbl-core/version.d.ts +1 -1
  234. package/dist-lib/numbl-core/workspace/workspace.d.ts +64 -0
  235. package/dist-lib/vfs/unzipToFiles.d.ts +7 -0
  236. package/dist-plot-viewer/assets/index-C0fIevlp.js +4504 -0
  237. package/dist-plot-viewer/index.html +1 -1
  238. package/dist-site-viewer/assets/index-BDaviCH6.js +4832 -0
  239. package/dist-site-viewer/assets/numbl-worker-D6m4K2PP.js +5691 -0
  240. package/dist-site-viewer/index.html +2 -2
  241. package/native/numbl_addon.cpp +2 -12
  242. package/native/numbl_addon_common.h +0 -5
  243. package/package.json +6 -5
  244. package/dist-browser/hooks/useProjectFiles.d.ts +0 -45
  245. package/dist-browser/numbl-core/executors/context.d.ts +0 -76
  246. package/dist-browser/numbl-core/executors/index.d.ts +0 -14
  247. package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
  248. package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
  249. package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
  250. package/dist-browser/numbl-core/helpers/dummy.d.ts +0 -5
  251. package/dist-browser/numbl-core/jit/runtime/context.d.ts +0 -23
  252. package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +0 -10
  253. package/dist-browser/numbl-core/jit/runtime/value.d.ts +0 -101
  254. package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
  255. package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
  256. package/dist-browser/numbl-core/native/bridge-resolve.d.ts +0 -14
  257. package/dist-browser/numbl-core/runtime/plotUtils.d.ts +0 -336
  258. package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
  259. package/dist-graphics/graphics/surfColormap.d.ts +0 -2
  260. package/dist-lib/numbl-core/executors/context.d.ts +0 -76
  261. package/dist-lib/numbl-core/executors/index.d.ts +0 -14
  262. package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
  263. package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
  264. package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
  265. package/dist-lib/numbl-core/helpers/dummy.d.ts +0 -5
  266. package/dist-lib/numbl-core/jit/runtime/context.d.ts +0 -23
  267. package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +0 -10
  268. package/dist-lib/numbl-core/jit/runtime/value.d.ts +0 -101
  269. package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
  270. package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
  271. package/dist-lib/numbl-core/native/bridge-resolve.d.ts +0 -14
  272. package/dist-lib/numbl-core/runtime/plotUtils.d.ts +0 -336
  273. package/dist-lib/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
  274. package/dist-plot-viewer/assets/index-YeXWXIxH.js +0 -4504
  275. package/dist-site-viewer/assets/index-DrtkDG_M.js +0 -4832
  276. package/dist-site-viewer/assets/numbl-worker-Dz_Z8B9u.js +0 -5327
  277. package/native/elemwise.cpp +0 -360
  278. package/native/unary_elemwise.cpp +0 -67
  279. /package/dist-browser/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
  280. /package/dist-graphics/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
  281. /package/dist-lib/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Plot builtin registrations: data-bearing plot calls (plot, surf, contour,
3
+ * ...), graphics ops with figure/axes state (figure, hold, subplot, ...), and
4
+ * the ops that return handles or need the runtime's plot state. Names with no
5
+ * custom registration fall through to the generic loop at the end, which
6
+ * routes them to `dispatchPlotBuiltin`.
7
+ */
8
+ export {};
@@ -0,0 +1,10 @@
1
+ export type RGB = [number, number, number];
2
+ /** An axes colormap: a named map, or custom N×3 `data` (which wins). */
3
+ export interface ColormapSpec {
4
+ name?: string;
5
+ data?: number[][];
6
+ }
7
+ export declare const PARULA_ANCHORS: RGB[];
8
+ /** Color at t ∈ [0, 1] (clamped; non-finite → 0) in the given colormap.
9
+ * Unknown names fall back to parula. */
10
+ export declare function colormapLookup(t: number, cm?: ColormapSpec): RGB;
@@ -3,19 +3,10 @@
3
3
  * `(name, args)` → `PlotInstruction[]` mapping that every plotting
4
4
  * builtin performs.
5
5
  *
6
- * Historically this logic was scattered across two places:
7
- * - `runtime.ts` registered the data-bearing plot names
8
- * (`plot`, `surf`, `imagesc`, …) inside `initBuiltins`.
9
- * - `specialBuiltins.ts` registered the graphics ops (`figure`,
10
- * `title`, `xlabel`, `hold`, `subplot`, `clf`, …) inside
11
- * `registerSpecialBuiltins`.
12
- *
13
- * Both sites pushed onto `rt.plotInstructions` and (for `hold` /
14
- * `tiledlayout` / `nexttile`) updated small flags on the Runtime.
15
- * `dispatchPlotBuiltin` is the consolidation. The Runtime registers
16
- * each name with a 1-line wrapper that calls this function and then
17
- * returns the right `nargout`-handle value; the side-effect (the
18
- * push) lives here.
6
+ * Registration lives in `builtins.ts`: each name gets a wrapper that
7
+ * calls this function and returns the right `nargout`-handle value; the
8
+ * side effect (the push onto `rt.plotInstructions`, plus the small
9
+ * hold / tiled-layout flags on the Runtime) lives here.
19
10
  *
20
11
  * Out-of-scope names — kept registered separately because their
21
12
  * semantics need the full Runtime context:
@@ -32,8 +23,8 @@
32
23
  * sibling project) imports this function to render plots in its
33
24
  * browser IDE without reimplementing per-builtin logic.
34
25
  */
35
- import type { RuntimeValue } from "./types.js";
36
- import type { PlotInstruction } from "../../graphics/types.js";
26
+ import type { RuntimeValue } from "../runtime/types.js";
27
+ import type { PlotInstruction } from "./types.js";
37
28
  /** State carried by graphics ops that need to remember things between
38
29
  * calls. `holdState` is read by `ishold()` so `hold on; if ishold ...`
39
30
  * works; `tiledLayoutState` lets `nexttile` know where to place the
@@ -64,17 +55,16 @@ export interface TiledLayoutState {
64
55
  * refactor. Returns `true` iff `name` was a recognized plot builtin;
65
56
  * callers fall through to their own dispatch on `false`. */
66
57
  export declare function dispatchPlotBuiltin(name: string, args: RuntimeValue[], instructions: PlotInstruction[], state: PlotDispatchState): boolean;
67
- /** Names handled by `dispatchPlotBuiltin`. Useful for registering all
68
- * of them in a loop (numbl's `initBuiltins` / `registerSpecialBuiltins`
69
- * do that for the side-effect-only subset). Stays in sync with the
70
- * cases above by construction. */
58
+ /** Names handled by `dispatchPlotBuiltin`. `builtins.ts` registers all
59
+ * of them in a loop (for the side-effect-only subset). Stays in sync
60
+ * with the cases above by construction. */
71
61
  export declare const PLOT_DISPATCH_NAMES: ReadonlyArray<string>;
72
62
  /** Graphics-related names numbl exposes as no-op (or near-no-op)
73
63
  * stubs — they don't push plot instructions and don't render, but
74
64
  * numbl accepts them so MATLAB scripts compile and run. Sources:
75
65
  * - `interpreter/builtins/misc.ts` (`groot`, `gcf`, `gca`, `shg`,
76
- * `newplot`, `xlim`, `ylim`, `set`, `get`, `ishold`)
77
- * - `runtime/specialBuiltins.ts` (`drawnow`, `pause`)
66
+ * `newplot`, `xlim`, `ylim`, `get`)
67
+ * - `plotting/builtins.ts` (`drawnow`, `pause`, `ishold`, `set`)
78
68
  *
79
69
  * These names belong here, alongside `PLOT_DISPATCH_NAMES`, because
80
70
  * downstream consumers (mtoc2's translator, syntax highlighters,
@@ -85,8 +75,7 @@ export declare const PLOT_DISPATCH_NAMES: ReadonlyArray<string>;
85
75
  export declare const PLOT_STUB_NAMES: ReadonlyArray<string>;
86
76
  /** The union of `PLOT_DISPATCH_NAMES` (renderable) and
87
77
  * `PLOT_STUB_NAMES` (recognized-but-no-render). Every name a plotting
88
- * script might invoke that numbl tolerates. Mtoc2 imports this to
89
- * drive its own builtin registration so the two repos stay in
90
- * lockstep — when numbl gains a new plot builtin, mtoc2 picks it up
91
- * at the next `tsc` / `vite build` with no mtoc2-side edit. */
78
+ * script might invoke that numbl tolerates. The JIT registers its plot
79
+ * builtins from this list, so a new plot builtin needs no JIT-side
80
+ * edit. */
92
81
  export declare const PLOT_ALL_NAMES: ReadonlyArray<string>;
@@ -0,0 +1,19 @@
1
+ import type { ImagescTrace } from "./types.js";
2
+ /**
3
+ * Pixel geometry of an imagesc trace. As in MATLAB, `x` and `y` hold the
4
+ * centers of the first and last columns/rows (XData/YData), so the image
5
+ * extends half a pixel beyond them; a single column or row is one unit wide.
6
+ * `dx`/`dy` may be negative (decreasing XData/YData).
7
+ */
8
+ export declare function imagescExtent(t: ImagescTrace): {
9
+ dx: number;
10
+ dy: number;
11
+ x: [number, number];
12
+ y: [number, number];
13
+ };
14
+ /**
15
+ * Color limits for an imagesc trace: the axes' caxis/clim when set, else the
16
+ * finite data range. Values outside the limits clamp to the colormap ends.
17
+ * Returns null when there is no finite data and no caxis.
18
+ */
19
+ export declare function imagescColorLimits(t: ImagescTrace, caxis?: [number, number]): [number, number] | null;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Plot-related operations for the runtime.
2
+ * Plot instruction builders: one `*Call` per plotting builtin, each parsing
3
+ * its runtime arguments and pushing the resulting `PlotInstruction`s.
3
4
  */
4
5
  import { type RuntimeValue } from "../runtime/index.js";
5
- import type { PlotInstruction } from "../../graphics/types.js";
6
- import type { ExecOptions } from "../executeCode.js";
7
- import type { Runtime } from "./runtime.js";
6
+ import type { PlotInstruction } from "./types.js";
7
+ import type { Runtime } from "../runtime/runtime.js";
8
8
  export declare function plotInstr(plotInstructions: PlotInstruction[], instr: {
9
9
  type: "set_figure_handle";
10
10
  handle: unknown;
@@ -74,6 +74,7 @@ export declare function plot3Call(plotInstructions: PlotInstruction[], args: Run
74
74
  export declare function lineCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
75
75
  export declare function patchCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
76
76
  export declare function trimeshCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
77
+ export declare function trisurfCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
77
78
  export declare function fillCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
78
79
  export declare function surfCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
79
80
  export declare function surfaceCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
@@ -114,16 +115,3 @@ export declare function heatmapCall(plotInstructions: PlotInstruction[], args: R
114
115
  export declare function quiverCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
115
116
  export declare function quiver3Call(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
116
117
  export declare function legendCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
117
- export declare function drawnow(plotInstructions: PlotInstruction[], options: ExecOptions): void;
118
- export declare function pause(seconds: unknown): void;
119
- /**
120
- * streamline(X,Y,U,V,startX,startY) — compute and plot 2D streamlines.
121
- * streamline(verts) — plot from pre-computed cell array of vertex matrices.
122
- * Returns a dummy graphics handle.
123
- */
124
- export declare function streamlineCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): RuntimeValue;
125
- /**
126
- * stream2(X,Y,U,V,startX,startY) — compute 2D streamline vertices.
127
- * Returns a cell array of Nx2 vertex matrices.
128
- */
129
- export declare function stream2Call(args: RuntimeValue[]): RuntimeValue;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Argument parsers for statistical charts: bar, barh, bar3, histogram,
3
+ * histogram2, boxchart, swarmchart, and piechart/donutchart.
4
+ */
5
+ import { type RuntimeValue } from "../runtime/types.js";
6
+ import type { PlotTrace, Plot3Trace, BarTrace, Bar3Trace, BoxTrace, PieTrace } from "./types.js";
7
+ /**
8
+ * Parse bar() arguments.
9
+ *
10
+ * Supported forms:
11
+ * bar(Y) — Y values with x = 1:length(Y)
12
+ * bar(X, Y) — explicit X positions
13
+ * bar(..., width) — relative bar width (scalar 0–1)
14
+ * bar(..., color) — single-char color spec
15
+ */
16
+ export declare function parseBarArgs(args: RuntimeValue[]): BarTrace[];
17
+ /**
18
+ * Parse barh() arguments — same forms as bar() but rendered horizontally.
19
+ *
20
+ * Supported forms:
21
+ * barh(Y) — Y values (bar lengths) with positions = 1:length(Y)
22
+ * barh(X, Y) — explicit positions X, bar lengths Y
23
+ * barh(..., width) — relative bar thickness (scalar 0–1)
24
+ * barh(..., color) — single-char color spec
25
+ */
26
+ export declare function parseBarHArgs(args: RuntimeValue[]): BarTrace[];
27
+ /**
28
+ * Parse bar3() / bar3h() arguments.
29
+ *
30
+ * Supported forms:
31
+ * bar3(Z) — Z values with y = 1:m, x = 1:n
32
+ * bar3(Y, Z) — explicit Y positions
33
+ * bar3(..., width) — relative bar width (scalar 0–1)
34
+ * bar3(..., color) — single-char color spec
35
+ */
36
+ export declare function parseBar3Args(args: RuntimeValue[]): Bar3Trace;
37
+ /**
38
+ * Parse histogram() arguments.
39
+ *
40
+ * Supported forms:
41
+ * histogram(X)
42
+ * histogram(X, nbins)
43
+ * histogram(X, edges)
44
+ */
45
+ export declare function parseHistogramArgs(args: RuntimeValue[]): BarTrace[];
46
+ /**
47
+ * Parse histogram2() arguments.
48
+ *
49
+ * Supported forms:
50
+ * histogram2(X, Y)
51
+ * histogram2(X, Y, nbins) — nbins is scalar or [nx, ny]
52
+ * histogram2(X, Y, Xedges, Yedges)
53
+ */
54
+ export declare function parseHistogram2Args(args: RuntimeValue[]): Bar3Trace;
55
+ /**
56
+ * Parse boxchart() arguments.
57
+ *
58
+ * Supported forms:
59
+ * boxchart(ydata) — one box per column of ydata
60
+ * boxchart(xgroupdata, ydata) — group ydata by unique values in xgroupdata
61
+ */
62
+ export declare function parseBoxchartArgs(args: RuntimeValue[]): BoxTrace[];
63
+ /**
64
+ * Parse swarmchart() arguments.
65
+ *
66
+ * Supported forms:
67
+ * swarmchart(x, y)
68
+ * swarmchart(x, y, sz)
69
+ * swarmchart(x, y, sz, c)
70
+ * swarmchart(..., 'filled')
71
+ * swarmchart(..., markertype)
72
+ */
73
+ export declare function parseSwarmchartArgs(args: RuntimeValue[]): PlotTrace[];
74
+ /**
75
+ * Parse swarmchart3() arguments.
76
+ *
77
+ * Supported forms:
78
+ * swarmchart3(x, y, z)
79
+ * swarmchart3(x, y, z, sz)
80
+ * swarmchart3(x, y, z, sz, c)
81
+ * swarmchart3(..., 'filled')
82
+ * swarmchart3(..., markertype)
83
+ */
84
+ export declare function parseSwarmchart3Args(args: RuntimeValue[]): Plot3Trace[];
85
+ /**
86
+ * Parse piechart() / donutchart() arguments.
87
+ *
88
+ * Supported forms:
89
+ * piechart(data)
90
+ * piechart(data, names)
91
+ *
92
+ * @param innerRadius 0 for pie, >0 for donut
93
+ */
94
+ export declare function parsePiechartArgs(args: RuntimeValue[], innerRadius: number): PieTrace;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Shared helpers for plot argument parsing: color specs, LineSpec strings,
3
+ * Name-Value key detection, and conversion of runtime values to plain
4
+ * number arrays and grids.
5
+ */
6
+ import { type RuntimeValue, type RuntimeTensor } from "../runtime/types.js";
7
+ export declare const COLOR_SHORT: Record<string, [number, number, number]>;
8
+ export declare function resolveColor(v: RuntimeValue | string): [number, number, number] | undefined;
9
+ export interface ParsedLineSpec {
10
+ color?: string;
11
+ lineStyle?: string;
12
+ marker?: string;
13
+ }
14
+ export declare function parseLineSpec(s: string): ParsedLineSpec | null;
15
+ export declare function isNameValueKey(v: RuntimeValue): string | null;
16
+ export declare function isNumericArg(v: unknown): boolean;
17
+ export declare function isStringArg(v: unknown): boolean;
18
+ export declare function getStringValue(v: RuntimeValue): string;
19
+ /** Convert runtime value to a flat number array */
20
+ export declare function toNumberArray(v: RuntimeValue): number[];
21
+ /** Extract column j from a column-major tensor with shape [m, n] */
22
+ export declare function tensorColumn(tensor: RuntimeTensor, col: number): number[];
23
+ /**
24
+ * Get the number of columns of a numeric value for matrix splitting.
25
+ * Only returns > 1 for true matrices (nRows > 1 && nCols > 1).
26
+ * Row vectors (1×N) and column vectors (N×1) return 1.
27
+ */
28
+ export declare function numColumns(v: RuntimeValue): number;
29
+ /** Generate 1-based index array [1, 2, ..., n] */
30
+ export declare function oneBasedIndices(n: number): number[];
31
+ /**
32
+ * Expand a numeric value into column-wise traces.
33
+ * For a vector (row or column), returns one array.
34
+ * For an m×n matrix (m>1, n>1), returns n arrays (one per column).
35
+ */
36
+ export declare function expandColumns(v: RuntimeValue): number[][];
37
+ /** A leading argument that should be skipped as an axes handle. numbl has no
38
+ * real axes handles, so `line(ax, ___)` is accepted and the handle ignored. */
39
+ export declare function isAxesHandleArg(v: RuntimeValue): boolean;
40
+ export declare function getMatrixInfo(v: RuntimeValue): {
41
+ data: number[];
42
+ rows: number;
43
+ cols: number;
44
+ };
45
+ /** Generate meshgrid X and Y for a rows×cols grid: X = 1:cols, Y = 1:rows (column-major) */
46
+ export declare function generateMeshgrid(rows: number, cols: number): {
47
+ x: number[];
48
+ y: number[];
49
+ };
50
+ /**
51
+ * Expand X and Y to match the grid dimensions of Z.
52
+ * Handles:
53
+ * - X and Y as full m×n matrices (pass through)
54
+ * - X as 1×n row vector, Y as m×1 column vector (meshgrid expansion)
55
+ * - X as n-element vector, Y as m-element vector (meshgrid expansion)
56
+ */
57
+ export declare function expandXY(xVal: RuntimeValue, yVal: RuntimeValue, rows: number, cols: number): {
58
+ x: number[];
59
+ y: number[];
60
+ };
61
+ /** Get string value if the value is a string/char, otherwise undefined */
62
+ export declare function getStringValueIfString(v: RuntimeValue): string | undefined;
63
+ /** Create a runtime tensor from a plain number array (for synthetic args). */
64
+ export declare function tensorFromArray(arr: number[]): RuntimeValue;
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Argument parsers for line-like plots: plot, plot3, line, scatter, scatter3,
3
+ * stairs, errorbar, and area.
4
+ *
5
+ * Handles: plot(Y), plot(X,Y), plot(X1,Y1,...,Xn,Yn),
6
+ * plot(X1,Y1,LineSpec1,...), and Name-Value pairs like 'Color','r','LineWidth',2.
7
+ */
8
+ import { type RuntimeValue } from "../runtime/types.js";
9
+ import type { PlotTrace, Plot3Trace, ErrorBarTrace } from "./types.js";
10
+ export declare function parsePlotArgs(args: RuntimeValue[]): PlotTrace[];
11
+ /**
12
+ * Parse plot3() arguments.
13
+ *
14
+ * Supported forms:
15
+ * plot3(X, Y, Z)
16
+ * plot3(X, Y, Z, LineSpec)
17
+ * plot3(X1,Y1,Z1,...,Xn,Yn,Zn)
18
+ * plot3(X1,Y1,Z1,LineSpec1,...,Xn,Yn,Zn,LineSpecn)
19
+ * plot3(..., Name, Value)
20
+ */
21
+ export declare function parsePlot3Args(args: RuntimeValue[]): Plot3Trace[];
22
+ /** Result of parsing line() arguments: a set of 2-D or 3-D traces. */
23
+ export type ParsedLine = {
24
+ kind: "2d";
25
+ traces: PlotTrace[];
26
+ } | {
27
+ kind: "3d";
28
+ traces: Plot3Trace[];
29
+ };
30
+ /**
31
+ * Parse line() arguments.
32
+ *
33
+ * Supported forms:
34
+ * line — line from (0,0) to (1,1)
35
+ * line(x, y) — 2-D line(s)
36
+ * line(x, y, z) — 3-D line(s)
37
+ * line(___, Name, Value) — Color/LineStyle/LineWidth/Marker/...
38
+ * line('XData', x, 'YData', y, ...) — low-level form (black line)
39
+ * line(ax, ___) — leading axes handle (ignored)
40
+ *
41
+ * Like plot/plot3, vector inputs make a single line and matrix inputs make one
42
+ * line per column.
43
+ */
44
+ export declare function parseLineArgs(args: RuntimeValue[]): ParsedLine;
45
+ /**
46
+ * Parse scatter() arguments.
47
+ *
48
+ * Supported forms:
49
+ * scatter(X, Y)
50
+ * scatter(X, Y, sz)
51
+ * scatter(X, Y, sz, c)
52
+ * scatter(X, Y, ..., 'filled')
53
+ * scatter(X, Y, ..., mkr)
54
+ * scatter(X, Y, ..., Name, Value)
55
+ */
56
+ export declare function parseScatterArgs(args: RuntimeValue[]): PlotTrace[];
57
+ /**
58
+ * Parse stairs() arguments — same forms as plot() but with staircase-transformed coordinates.
59
+ *
60
+ * Supported forms:
61
+ * stairs(Y)
62
+ * stairs(X, Y)
63
+ * stairs(..., LineSpec)
64
+ * stairs(..., Name, Value)
65
+ */
66
+ export declare function parseStairsArgs(args: RuntimeValue[]): PlotTrace[];
67
+ /**
68
+ * Parse errorbar() arguments.
69
+ *
70
+ * Supported forms:
71
+ * errorbar(y, err) — symmetric vertical
72
+ * errorbar(x, y, err) — symmetric vertical with explicit x
73
+ * errorbar(x, y, neg, pos) — asymmetric vertical
74
+ * errorbar(x, y, yneg, ypos, xneg, xpos) — both axes
75
+ * errorbar(..., LineSpec)
76
+ */
77
+ export declare function parseErrorBarArgs(args: RuntimeValue[]): ErrorBarTrace[];
78
+ /**
79
+ * Parse area() arguments.
80
+ *
81
+ * Supported forms:
82
+ * area(Y) — fill under Y with x = 1:length(Y)
83
+ * area(X, Y) — explicit X
84
+ * area(..., basevalue) — scalar baseline (default 0)
85
+ * area(..., Name, Value)
86
+ *
87
+ * Returns { traces, baseValue }.
88
+ */
89
+ export declare function parseAreaArgs(args: RuntimeValue[]): {
90
+ traces: PlotTrace[];
91
+ baseValue: number;
92
+ };
93
+ /**
94
+ * Parse scatter3() arguments.
95
+ *
96
+ * Supported forms:
97
+ * scatter3(X, Y, Z)
98
+ * scatter3(X, Y, Z, S)
99
+ * scatter3(X, Y, Z, S, C)
100
+ * scatter3(..., 'filled')
101
+ * scatter3(..., markertype)
102
+ */
103
+ export declare function parseScatter3Args(args: RuntimeValue[]): Plot3Trace[];
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Argument parsers for patch-based plots: patch, fill, trimesh, and trisurf.
3
+ */
4
+ import { type RuntimeValue } from "../runtime/types.js";
5
+ import type { PatchTrace } from "./types.js";
6
+ /** Apply a single patch property (lower-cased key) to the trace. Shared by the
7
+ * Name-Value, struct, and `set`/handle paths. */
8
+ export declare function applyPatchProp(trace: PatchTrace, key: string, val: RuntimeValue): void;
9
+ /**
10
+ * Parse patch() arguments into a canonical PatchTrace.
11
+ *
12
+ * Supported forms:
13
+ * patch(X, Y, C) — 2-D polygons, color C
14
+ * patch(X, Y, Z, C) — 3-D polygons
15
+ * patch('XData', X, 'YData', Y[, 'ZData', Z]) — coords as name-value
16
+ * patch('Faces', F, 'Vertices', V) — faces/vertices model
17
+ * patch(S) — struct of patch properties
18
+ * patch(___, Name, Value) — patch properties
19
+ * patch(ax, ___) — leading axes handle (ignored)
20
+ */
21
+ export declare function parsePatchArgs(args: RuntimeValue[]): PatchTrace;
22
+ /**
23
+ * Parse fill() arguments into one patch trace per (X,Y,C) group. fill is the
24
+ * 2-D coordinate form of patch repeated over groups, so it reuses the patch
25
+ * vertex/color/property helpers — the only fill-specific logic is splitting
26
+ * the argument list into X,Y,C triplets.
27
+ *
28
+ * Supported forms:
29
+ * fill(X, Y, C)
30
+ * fill(X1, Y1, C1, ..., Xn, Yn, Cn)
31
+ * fill(___, Name, Value)
32
+ * fill(ax, ___)
33
+ */
34
+ export declare function parseFillArgs(args: RuntimeValue[]): PatchTrace[];
35
+ export declare function parseTriMeshArgs(args: RuntimeValue[]): PatchTrace;
36
+ /** Parse trisurf() arguments. Same forms as trimesh, but (matching MATLAB)
37
+ * the faces default to 'flat' coloring by the per-vertex z values (or c). */
38
+ export declare function parseTriSurfArgs(args: RuntimeValue[]): PatchTrace;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Argument parsers for vector fields: quiver and quiver3.
3
+ */
4
+ import { type RuntimeValue } from "../runtime/types.js";
5
+ import type { QuiverTrace, Quiver3Trace } from "./types.js";
6
+ /**
7
+ * Parse quiver() arguments.
8
+ *
9
+ * Supported forms:
10
+ * quiver(U, V)
11
+ * quiver(X, Y, U, V)
12
+ * quiver(..., scale) — scale: nonnegative number or 'off'
13
+ * quiver(..., LineSpec)
14
+ * quiver(..., LineSpec, 'filled')
15
+ * quiver(..., Name, Value) — Color, LineStyle, LineWidth, ShowArrowHead, etc.
16
+ *
17
+ * X, Y, U, V can be vectors or matrices. If U,V are matrices and X,Y are
18
+ * vectors, X and Y are expanded to a meshgrid.
19
+ */
20
+ export declare function parseQuiverArgs(args: RuntimeValue[]): QuiverTrace[];
21
+ /**
22
+ * Parse quiver3() arguments.
23
+ *
24
+ * Supported forms:
25
+ * quiver3(Z, U, V, W)
26
+ * quiver3(X, Y, Z, U, V, W)
27
+ * quiver3(..., scale) — scale: nonnegative number or 'off'
28
+ * quiver3(..., LineSpec)
29
+ * quiver3(..., LineSpec, 'filled')
30
+ * quiver3(..., Name, Value) — Color, LineStyle, LineWidth, ShowArrowHead, …
31
+ */
32
+ export declare function parseQuiver3Args(args: RuntimeValue[]): Quiver3Trace;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Argument parsers for gridded data: surf, mesh, pcolor, imagesc, contour
3
+ * (including the MATLAB contour matrix), and heatmap.
4
+ */
5
+ import { type RuntimeValue } from "../runtime/types.js";
6
+ import type { SurfTrace, ImagescTrace, PcolorTrace, ContourTrace, HeatmapTrace } from "./types.js";
7
+ /**
8
+ * Parse surf() arguments.
9
+ *
10
+ * Supported forms:
11
+ * surf(Z) — Z is m×n, X = 1:n, Y = 1:m
12
+ * surf(Z, C) — Z is m×n, C is m×n color data
13
+ * surf(X, Y, Z) — X, Y, Z are m×n matrices (or X is 1×n / Y is m×1)
14
+ * surf(X, Y, Z, C) — with explicit color data
15
+ * surf(..., Name, Value) — name-value pairs
16
+ */
17
+ export declare function parseSurfArgs(args: RuntimeValue[]): SurfTrace;
18
+ /**
19
+ * Parse pcolor() arguments.
20
+ *
21
+ * Supported forms:
22
+ * pcolor(C) — C is m×n, X = 1:n, Y = 1:m
23
+ * pcolor(X, Y, C) — X, Y, C are m×n matrices (or X is 1×n / Y is m×1)
24
+ * pcolor(..., Name, Value) — name-value pairs (EdgeColor, FaceAlpha)
25
+ */
26
+ export declare function parsePcolorArgs(args: RuntimeValue[]): PcolorTrace;
27
+ /**
28
+ * Parse imagesc() arguments.
29
+ *
30
+ * Supported forms:
31
+ * imagesc(C) — C is m×n matrix
32
+ * imagesc(x, y, C) — x and y are vectors defining axis limits
33
+ * imagesc(..., clims) — clims = [low high] sets the axes' color limits
34
+ */
35
+ export declare function parseImagescArgs(args: RuntimeValue[]): {
36
+ trace: ImagescTrace;
37
+ clims?: [number, number];
38
+ };
39
+ /**
40
+ * Parse contour()/contourf() arguments.
41
+ *
42
+ * Supported forms:
43
+ * contour(Z)
44
+ * contour(Z, N)
45
+ * contour(X, Y, Z)
46
+ * contour(X, Y, Z, N)
47
+ * contour(..., Name, Value)
48
+ */
49
+ export declare function parseContourArgs(args: RuntimeValue[], filled: boolean): ContourTrace;
50
+ /** Result of computing contour geometry: the MATLAB contour matrix `C`
51
+ * (column-major `2 × n` data) plus the level list actually used. */
52
+ export interface ContourMatrix {
53
+ /** Column-major `2 × n` data for a `RTV.tensor(data, [2, n])`. */
54
+ data: number[];
55
+ n: number;
56
+ levelList: number[];
57
+ }
58
+ /** Compute the MATLAB contour matrix for a parsed contour trace via marching
59
+ * squares. Each marching-squares segment is emitted as its own two-vertex
60
+ * contour line (header `[level; 2]` followed by the two `[x; y]` vertices) —
61
+ * a valid contour matrix whose geometry matches MATLAB's connected polylines
62
+ * segment-for-segment. */
63
+ export declare function computeContourMatrix(trace: ContourTrace): ContourMatrix;
64
+ /**
65
+ * Parse mesh() arguments — same as surf but with different default rendering.
66
+ */
67
+ export declare function parseMeshArgs(args: RuntimeValue[]): SurfTrace;
68
+ /**
69
+ * Parse heatmap() arguments.
70
+ *
71
+ * Supported forms:
72
+ * heatmap(cdata) — matrix of values
73
+ * heatmap(xvalues, yvalues, cdata) — with axis labels
74
+ */
75
+ export declare function parseHeatmapArgs(args: RuntimeValue[]): HeatmapTrace;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * streamline / stream2: trace 2-D streamlines through a gridded vector field.
3
+ */
4
+ import type { RuntimeValue } from "../runtime/index.js";
5
+ import type { PlotInstruction } from "./types.js";
6
+ /**
7
+ * streamline(X,Y,U,V,startX,startY) — compute and plot 2D streamlines.
8
+ * streamline(verts) — plot from pre-computed cell array of vertex matrices.
9
+ * Returns a dummy graphics handle.
10
+ */
11
+ export declare function streamlineCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): RuntimeValue;
12
+ /**
13
+ * stream2(X,Y,U,V,startX,startY) — compute 2D streamline vertices.
14
+ * Returns a cell array of Nx2 vertex matrices.
15
+ */
16
+ export declare function stream2Call(args: RuntimeValue[]): RuntimeValue;
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Shared graphics types used by both numbl-core and the rendering layer.
2
+ * Plot data types: the trace interfaces and `PlotInstruction`, the
3
+ * serializable contract between numbl-core (which emits instructions) and the
4
+ * renderer in src/graphics/ (which consumes them). The renderer imports these
5
+ * from here; numbl-core does not depend on src/graphics/.
3
6
  *
4
- * This file is the single source of truth for plot trace interfaces and
5
- * PlotInstruction. numbl-core re-exports these types so that internal
6
- * runtime code can import them without reaching into src/graphics/.
7
- *
8
- * The numbl-vscode extension syncs this file (and the rest of src/graphics/)
9
- * via devel/sync-graphics.sh.
7
+ * The numbl-vscode extension syncs src/graphics/ via devel/sync-graphics.sh;
8
+ * it also needs the core modules the renderer imports (types, figuresReducer,
9
+ * axisLimits, imagescExtent, colormaps).
10
10
  */
11
11
  export interface PlotTrace {
12
12
  x: number[];
@@ -53,6 +53,8 @@ export interface PatchTrace {
53
53
  edgeColor?: [number, number, number] | "flat" | "interp" | "none";
54
54
  /** Face transparency in [0,1]. */
55
55
  faceAlpha?: number;
56
+ /** Edge transparency in [0,1]. */
57
+ edgeAlpha?: number;
56
58
  lineWidth?: number;
57
59
  lineStyle?: string;
58
60
  marker?: string;
@@ -21,13 +21,5 @@ import { type RefcountRuntime } from "./refcount.js";
21
21
  * be copied (handle-class instances, primitives) — the caller can
22
22
  * `=== v` test if the copy was a no-op. */
23
23
  export declare function cowCopy(v: RuntimeValue): RuntimeValue;
24
- /** If `v` is shared (rc-driven), return a fresh non-shared copy;
25
- * otherwise return `v` unchanged. The new wrapper has refcount 0
26
- * (or 1 if the active scope adopts it via the constructor); the
27
- * caller must bind it into the parent slot to keep it alive.
28
- *
29
- * Returns the original `v` for handle-class instances and primitives —
30
- * callers can `result === v` test to detect a no-op. */
31
- export declare function cowIfShared(v: RuntimeValue): RuntimeValue;
32
24
  export { isShared } from "./refcount.js";
33
25
  export type { RefcountRuntime };
@@ -53,9 +53,6 @@ export declare abstract class Refcounted {
53
53
  * RuntimeDummyHandle, etc.). */
54
54
  protected _destroy(_rt: RefcountRuntime): void;
55
55
  }
56
- /** True if the value is a container that participates in refcounting.
57
- * Primitives (number, boolean, string) return false. */
58
- export declare function isRefcountable(v: unknown): v is Refcounted;
59
56
  /** Increment refcount on a value if it's a container; primitives are noop. */
60
57
  export declare function incref(v: unknown): void;
61
58
  /** Decrement refcount on a value if it's a container; primitives are noop. */
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Registration helpers for builtins that need the active Runtime. They are
3
+ * ordinary IBuiltins; each call gets the runtime from the current-runtime
4
+ * stack.
5
+ */
6
+ import type { Runtime } from "./runtime.js";
7
+ import type { RuntimeValue } from "./types.js";
8
+ /** The runtime executing the current call. */
9
+ export declare function currentRuntime(): Runtime;
10
+ /** Register a builtin that accepts any args and gets the active runtime. */
11
+ export declare function registerSpecial(name: string, fn: (nargout: number, args: RuntimeValue[], rt: Runtime) => unknown): void;
12
+ /** Register a builtin with no outputs. The call site raises "Too many output
13
+ * arguments." when nargout > 0, and `ans` is not set when called as a
14
+ * statement. */
15
+ export declare function registerSpecialVoid(name: string, fn: (args: RuntimeValue[], rt: Runtime) => void): void;