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.
- package/binding.gyp +12 -6
- package/dist-browser/browser/index.d.ts +1 -1
- package/dist-browser/browser/mip.d.ts +7 -0
- package/dist-browser/browser/protocol.d.ts +1 -1
- package/dist-browser/browser.js +1 -1
- package/dist-browser/db/operations.d.ts +0 -1
- package/dist-browser/gpuHelper.d.ts +29 -0
- package/dist-browser/hooks/projectFilesState.d.ts +37 -0
- package/dist-browser/numbl-core/execSession.d.ts +39 -0
- package/dist-browser/numbl-core/executeCode.d.ts +10 -1
- package/dist-browser/numbl-core/executors/classification.d.ts +2 -10
- package/dist-browser/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-browser/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-browser/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-browser/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-browser/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-browser/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-browser/numbl-core/executors/registry.d.ts +32 -133
- package/dist-browser/numbl-core/executors/types.d.ts +30 -92
- package/dist-browser/numbl-core/functionResolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-browser/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-browser/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-browser/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +3 -1
- package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-browser/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-browser/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-browser/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-browser/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-browser/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-browser/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-browser/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-browser/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-browser/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-browser/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-browser/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-browser/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-browser/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-browser/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-browser/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-browser/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-browser/numbl-core/native/lapack-bridge.d.ts +111 -130
- package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-browser/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-browser/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-browser/numbl-core/parser/types.d.ts +1 -21
- package/{dist-lib/numbl-core/runtime → dist-browser/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/dist-browser/{graphics → numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-browser/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-browser/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-browser/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-browser/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-browser/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-browser/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-browser/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-browser/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-browser/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-browser/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-browser/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-browser/numbl-core/plotting/streamline.d.ts +16 -0
- package/{dist-graphics/graphics → dist-browser/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-browser/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-browser/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-browser/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-browser/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-browser/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-browser/numbl-core/version.d.ts +1 -1
- package/dist-browser/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-browser/vfs/syncVfsChanges.d.ts +2 -2
- package/dist-cli/cli.js +74244 -80566
- package/dist-graphics/graphics/FigureView.d.ts +1 -1
- package/dist-graphics/graphics/SurfView.d.ts +3 -2
- package/dist-graphics/graphics/drawPlot.d.ts +1 -1
- package/dist-graphics/graphics/exportFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/figureHashTransport.d.ts +1 -1
- package/dist-graphics/graphics/figureUpload.d.ts +1 -1
- package/dist-graphics/graphics/importFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/openInFigureViewer.d.ts +1 -1
- package/dist-graphics/graphics/plotHelpers.d.ts +1 -1
- package/dist-graphics/graphics/plotLegend.d.ts +1 -1
- package/dist-graphics/graphics/plotMarkers.d.ts +1 -1
- package/dist-graphics/graphics/restoreNaNs.d.ts +1 -1
- package/dist-graphics/graphics/uihtmlRelay.d.ts +16 -0
- package/dist-graphics/graphics-lib.d.ts +3 -3
- package/dist-graphics/index.js +294 -328
- package/{dist-lib/graphics → dist-graphics/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-graphics/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-graphics/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/{dist-browser/graphics → dist-graphics/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/browser/mip.d.ts +17 -0
- package/dist-lib/cli-scan.d.ts +8 -1
- package/dist-lib/lib.d.ts +1 -1
- package/dist-lib/lib.js +29201 -35301
- package/dist-lib/node.js +22 -14
- package/dist-lib/numbl-core/execSession.d.ts +39 -0
- package/dist-lib/numbl-core/executeCode.d.ts +10 -1
- package/dist-lib/numbl-core/executors/classification.d.ts +2 -10
- package/dist-lib/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-lib/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-lib/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-lib/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-lib/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-lib/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-lib/numbl-core/executors/registry.d.ts +32 -133
- package/dist-lib/numbl-core/executors/types.d.ts +30 -92
- package/dist-lib/numbl-core/functionResolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-lib/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-lib/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-lib/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +3 -1
- package/dist-lib/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-lib/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-lib/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-lib/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-lib/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-lib/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-lib/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-lib/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-lib/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-lib/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-lib/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-lib/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-lib/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-lib/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-lib/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-lib/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-lib/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-lib/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-lib/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-lib/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-lib/numbl-core/native/lapack-bridge.d.ts +111 -130
- package/dist-lib/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-lib/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-lib/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-lib/numbl-core/parser/types.d.ts +1 -21
- package/{dist-browser/numbl-core/runtime → dist-lib/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/{dist-graphics/graphics → dist-lib/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-lib/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-lib/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-lib/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-lib/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-lib/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-lib/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-lib/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-lib/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-lib/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-lib/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-lib/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-lib/numbl-core/plotting/streamline.d.ts +16 -0
- package/dist-lib/{graphics → numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-lib/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-lib/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-lib/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-lib/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-lib/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-lib/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-lib/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-lib/numbl-core/version.d.ts +1 -1
- package/dist-lib/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-lib/vfs/unzipToFiles.d.ts +7 -0
- package/dist-plot-viewer/assets/index-C0fIevlp.js +4504 -0
- package/dist-plot-viewer/index.html +1 -1
- package/dist-site-viewer/assets/index-BDaviCH6.js +4832 -0
- package/dist-site-viewer/assets/numbl-worker-D6m4K2PP.js +5691 -0
- package/dist-site-viewer/index.html +2 -2
- package/native/numbl_addon.cpp +2 -12
- package/native/numbl_addon_common.h +0 -5
- package/package.json +6 -5
- package/dist-browser/hooks/useProjectFiles.d.ts +0 -45
- package/dist-browser/numbl-core/executors/context.d.ts +0 -76
- package/dist-browser/numbl-core/executors/index.d.ts +0 -14
- package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-browser/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-browser/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-browser/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-browser/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-browser/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-graphics/graphics/surfColormap.d.ts +0 -2
- package/dist-lib/numbl-core/executors/context.d.ts +0 -76
- package/dist-lib/numbl-core/executors/index.d.ts +0 -14
- package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-lib/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-lib/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-lib/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-lib/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-lib/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-lib/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-plot-viewer/assets/index-YeXWXIxH.js +0 -4504
- package/dist-site-viewer/assets/index-DrtkDG_M.js +0 -4832
- package/dist-site-viewer/assets/numbl-worker-Dz_Z8B9u.js +0 -5327
- package/native/elemwise.cpp +0 -360
- package/native/unary_elemwise.cpp +0 -67
- /package/dist-browser/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-graphics/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-lib/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
package/dist-graphics/index.js
CHANGED
|
@@ -20829,15 +20829,15 @@ function resolveIncludes(string) {
|
|
|
20829
20829
|
return string.replace(includePattern, includeReplacer);
|
|
20830
20830
|
}
|
|
20831
20831
|
var shaderChunkMap = /* @__PURE__ */ new Map();
|
|
20832
|
-
function includeReplacer(match,
|
|
20833
|
-
let string = ShaderChunk[
|
|
20832
|
+
function includeReplacer(match, include2) {
|
|
20833
|
+
let string = ShaderChunk[include2];
|
|
20834
20834
|
if (string === void 0) {
|
|
20835
|
-
const newInclude = shaderChunkMap.get(
|
|
20835
|
+
const newInclude = shaderChunkMap.get(include2);
|
|
20836
20836
|
if (newInclude !== void 0) {
|
|
20837
20837
|
string = ShaderChunk[newInclude];
|
|
20838
|
-
warn('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',
|
|
20838
|
+
warn('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include2, newInclude);
|
|
20839
20839
|
} else {
|
|
20840
|
-
throw new Error("Can not resolve #include <" +
|
|
20840
|
+
throw new Error("Can not resolve #include <" + include2 + ">");
|
|
20841
20841
|
}
|
|
20842
20842
|
}
|
|
20843
20843
|
return resolveIncludes(string);
|
|
@@ -30053,32 +30053,75 @@ var Line2 = class extends LineSegments2 {
|
|
|
30053
30053
|
}
|
|
30054
30054
|
};
|
|
30055
30055
|
|
|
30056
|
-
// src/
|
|
30057
|
-
var
|
|
30056
|
+
// src/numbl-core/plotting/colormaps.ts
|
|
30057
|
+
var PARULA_ANCHORS = [
|
|
30058
30058
|
[0.2422, 0.1504, 0.6603],
|
|
30059
|
-
[0.
|
|
30060
|
-
[0.
|
|
30061
|
-
[0.
|
|
30062
|
-
[0.
|
|
30063
|
-
[0.
|
|
30064
|
-
[0.
|
|
30065
|
-
[0.
|
|
30066
|
-
[0.
|
|
30067
|
-
[0.9763, 0.517, 0.034]
|
|
30059
|
+
[0.278, 0.3556, 0.9777],
|
|
30060
|
+
[0.1085, 0.5267, 0.8943],
|
|
30061
|
+
[0.0469, 0.6353, 0.7861],
|
|
30062
|
+
[0.2161, 0.7269, 0.6499],
|
|
30063
|
+
[0.5044, 0.7993, 0.4519],
|
|
30064
|
+
[0.8328, 0.8056, 0.2008],
|
|
30065
|
+
[0.9871, 0.8092, 0.1432],
|
|
30066
|
+
[0.9763, 0.9831, 0.0538]
|
|
30068
30067
|
];
|
|
30069
|
-
function
|
|
30070
|
-
const
|
|
30071
|
-
|
|
30072
|
-
const idx =
|
|
30068
|
+
function interpTable(data, t) {
|
|
30069
|
+
const n = data.length;
|
|
30070
|
+
if (n === 1) return data[0];
|
|
30071
|
+
const idx = t * (n - 1);
|
|
30073
30072
|
const lo = Math.floor(idx);
|
|
30074
|
-
const hi = Math.min(lo + 1,
|
|
30073
|
+
const hi = Math.min(lo + 1, n - 1);
|
|
30075
30074
|
const frac = idx - lo;
|
|
30076
30075
|
return [
|
|
30077
|
-
|
|
30078
|
-
|
|
30079
|
-
|
|
30076
|
+
data[lo][0] + frac * (data[hi][0] - data[lo][0]),
|
|
30077
|
+
data[lo][1] + frac * (data[hi][1] - data[lo][1]),
|
|
30078
|
+
data[lo][2] + frac * (data[hi][2] - data[lo][2])
|
|
30080
30079
|
];
|
|
30081
30080
|
}
|
|
30081
|
+
function jetColormap(t) {
|
|
30082
|
+
let r, g, b;
|
|
30083
|
+
if (t < 0.125) {
|
|
30084
|
+
r = 0;
|
|
30085
|
+
g = 0;
|
|
30086
|
+
b = 0.5 + t * 4;
|
|
30087
|
+
} else if (t < 0.375) {
|
|
30088
|
+
r = 0;
|
|
30089
|
+
g = (t - 0.125) * 4;
|
|
30090
|
+
b = 1;
|
|
30091
|
+
} else if (t < 0.625) {
|
|
30092
|
+
r = (t - 0.375) * 4;
|
|
30093
|
+
g = 1;
|
|
30094
|
+
b = 1 - (t - 0.375) * 4;
|
|
30095
|
+
} else if (t < 0.875) {
|
|
30096
|
+
r = 1;
|
|
30097
|
+
g = 1 - (t - 0.625) * 4;
|
|
30098
|
+
b = 0;
|
|
30099
|
+
} else {
|
|
30100
|
+
r = 1 - (t - 0.875) * 4;
|
|
30101
|
+
g = 0;
|
|
30102
|
+
b = 0;
|
|
30103
|
+
}
|
|
30104
|
+
return [
|
|
30105
|
+
Math.max(0, Math.min(1, r)),
|
|
30106
|
+
Math.max(0, Math.min(1, g)),
|
|
30107
|
+
Math.max(0, Math.min(1, b))
|
|
30108
|
+
];
|
|
30109
|
+
}
|
|
30110
|
+
function redblueColormap(t) {
|
|
30111
|
+
if (t < 0.5) {
|
|
30112
|
+
const s2 = t * 2;
|
|
30113
|
+
return [s2, s2, 1];
|
|
30114
|
+
}
|
|
30115
|
+
const s = (t - 0.5) * 2;
|
|
30116
|
+
return [1, 1 - s, 1 - s];
|
|
30117
|
+
}
|
|
30118
|
+
function colormapLookup(t, cm = {}) {
|
|
30119
|
+
const clamped = Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : 0;
|
|
30120
|
+
if (cm.data && cm.data.length > 0) return interpTable(cm.data, clamped);
|
|
30121
|
+
if (cm.name === "jet") return jetColormap(clamped);
|
|
30122
|
+
if (cm.name === "redblue") return redblueColormap(clamped);
|
|
30123
|
+
return interpTable(PARULA_ANCHORS, clamped);
|
|
30124
|
+
}
|
|
30082
30125
|
|
|
30083
30126
|
// src/graphics/SurfView.tsx
|
|
30084
30127
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -30109,6 +30152,7 @@ function SurfView({
|
|
|
30109
30152
|
colorbar,
|
|
30110
30153
|
colorbarLocation,
|
|
30111
30154
|
colormap,
|
|
30155
|
+
colormapData,
|
|
30112
30156
|
axisVisible
|
|
30113
30157
|
}) {
|
|
30114
30158
|
const containerRef = useRef(null);
|
|
@@ -30163,6 +30207,7 @@ function SurfView({
|
|
|
30163
30207
|
const st = stateRef.current;
|
|
30164
30208
|
if (!st) return;
|
|
30165
30209
|
const { scene } = st;
|
|
30210
|
+
const cm = { name: colormap, data: colormapData };
|
|
30166
30211
|
const toRemove = [];
|
|
30167
30212
|
scene.traverse((obj) => {
|
|
30168
30213
|
if (obj instanceof Mesh || obj instanceof LineSegments || obj instanceof Line) {
|
|
@@ -30311,7 +30356,7 @@ function SurfView({
|
|
|
30311
30356
|
positions[vi * 3 + 2] = ny;
|
|
30312
30357
|
const cval = trace.c ? trace.c[idx] : z[idx];
|
|
30313
30358
|
const t = (cval - cMin) / cRange;
|
|
30314
|
-
const [r, g, b] = colormapLookup(t);
|
|
30359
|
+
const [r, g, b] = colormapLookup(t, cm);
|
|
30315
30360
|
colors[vi * 3] = r;
|
|
30316
30361
|
colors[vi * 3 + 1] = g;
|
|
30317
30362
|
colors[vi * 3 + 2] = b;
|
|
@@ -30460,7 +30505,7 @@ function SurfView({
|
|
|
30460
30505
|
if (Array.isArray(c)) {
|
|
30461
30506
|
[r, g, b] = c;
|
|
30462
30507
|
} else {
|
|
30463
|
-
[r, g, b] = colormapLookup((c - lo) / range);
|
|
30508
|
+
[r, g, b] = colormapLookup((c - lo) / range, cm);
|
|
30464
30509
|
}
|
|
30465
30510
|
vertexColors[i * 3] = r;
|
|
30466
30511
|
vertexColors[i * 3 + 1] = g;
|
|
@@ -30505,7 +30550,7 @@ function SurfView({
|
|
|
30505
30550
|
});
|
|
30506
30551
|
scene.add(new Mesh(geometry, faceMaterial));
|
|
30507
30552
|
}
|
|
30508
|
-
const showEdges = trace.edgeColor !== "none" && trace.lineStyle !== "none";
|
|
30553
|
+
const showEdges = trace.edgeColor !== "none" && trace.lineStyle !== "none" && (shading ?? "faceted") === "faceted";
|
|
30509
30554
|
if (showEdges) {
|
|
30510
30555
|
const edgePositions = [];
|
|
30511
30556
|
for (const face of trace.faces) {
|
|
@@ -30528,8 +30573,11 @@ function SurfView({
|
|
|
30528
30573
|
new Float32BufferAttribute(edgePositions, 3)
|
|
30529
30574
|
);
|
|
30530
30575
|
const edgeColor = Array.isArray(trace.edgeColor) ? trace.edgeColor : [0, 0, 0];
|
|
30576
|
+
const edgeAlpha = trace.edgeAlpha ?? 1;
|
|
30531
30577
|
const edgeMat = new LineBasicMaterial({
|
|
30532
|
-
color: new Color(edgeColor[0], edgeColor[1], edgeColor[2])
|
|
30578
|
+
color: new Color(edgeColor[0], edgeColor[1], edgeColor[2]),
|
|
30579
|
+
opacity: edgeAlpha,
|
|
30580
|
+
transparent: edgeAlpha < 1
|
|
30533
30581
|
});
|
|
30534
30582
|
scene.add(new LineSegments(edgeGeometry, edgeMat));
|
|
30535
30583
|
}
|
|
@@ -30692,7 +30740,7 @@ function SurfView({
|
|
|
30692
30740
|
halfW * 2 / barRangeMax
|
|
30693
30741
|
);
|
|
30694
30742
|
const t = (bz - zMin) / zRangeT;
|
|
30695
|
-
const [cr, cg, cb] = trace.color ?? colormapLookup(t);
|
|
30743
|
+
const [cr, cg, cb] = trace.color ?? colormapLookup(t, cm);
|
|
30696
30744
|
const mat = new MeshPhongMaterial({
|
|
30697
30745
|
color: new Color(cr, cg, cb)
|
|
30698
30746
|
});
|
|
@@ -30726,7 +30774,7 @@ function SurfView({
|
|
|
30726
30774
|
halfW * 2 / barRangeMax
|
|
30727
30775
|
);
|
|
30728
30776
|
const t = (len - xMin) / xRangeH;
|
|
30729
|
-
const [cr, cg, cb] = trace.color ?? colormapLookup(t);
|
|
30777
|
+
const [cr, cg, cb] = trace.color ?? colormapLookup(t, cm);
|
|
30730
30778
|
const mat = new MeshPhongMaterial({
|
|
30731
30779
|
color: new Color(cr, cg, cb)
|
|
30732
30780
|
});
|
|
@@ -30771,7 +30819,9 @@ function SurfView({
|
|
|
30771
30819
|
quiver3Traces,
|
|
30772
30820
|
patchTraces,
|
|
30773
30821
|
shading,
|
|
30774
|
-
axisVisible
|
|
30822
|
+
axisVisible,
|
|
30823
|
+
colormap,
|
|
30824
|
+
colormapData
|
|
30775
30825
|
]);
|
|
30776
30826
|
let cbMin = Infinity;
|
|
30777
30827
|
let cbMax = -Infinity;
|
|
@@ -30807,7 +30857,7 @@ function SurfView({
|
|
|
30807
30857
|
location: (colorbarLocation ?? "eastoutside").toLowerCase(),
|
|
30808
30858
|
dMin: cbMin,
|
|
30809
30859
|
dMax: cbMax,
|
|
30810
|
-
colormap
|
|
30860
|
+
colormap: { name: colormap, data: colormapData }
|
|
30811
30861
|
}
|
|
30812
30862
|
)
|
|
30813
30863
|
] });
|
|
@@ -30818,12 +30868,11 @@ function ColorbarOverlay({
|
|
|
30818
30868
|
dMax,
|
|
30819
30869
|
colormap
|
|
30820
30870
|
}) {
|
|
30821
|
-
void colormap;
|
|
30822
30871
|
const N = 32;
|
|
30823
30872
|
const stops = [];
|
|
30824
30873
|
for (let i = 0; i < N; i++) {
|
|
30825
30874
|
const t = i / (N - 1);
|
|
30826
|
-
const [r, g, b] = colormapLookup(t);
|
|
30875
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
30827
30876
|
const rgb = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
30828
30877
|
stops.push(`${rgb} ${(t * 100).toFixed(2)}%`);
|
|
30829
30878
|
}
|
|
@@ -31195,6 +31244,161 @@ function formatTick(v) {
|
|
|
31195
31244
|
return parseFloat(v.toPrecision(6)).toString();
|
|
31196
31245
|
}
|
|
31197
31246
|
|
|
31247
|
+
// src/numbl-core/plotting/imagescExtent.ts
|
|
31248
|
+
function imagescExtent(t) {
|
|
31249
|
+
const dx = t.cols > 1 ? (t.x[1] - t.x[0]) / (t.cols - 1) : 1;
|
|
31250
|
+
const dy = t.rows > 1 ? (t.y[1] - t.y[0]) / (t.rows - 1) : 1;
|
|
31251
|
+
const xa = t.x[0] - dx / 2;
|
|
31252
|
+
const xb = t.x[0] + (t.cols - 0.5) * dx;
|
|
31253
|
+
const ya = t.y[0] - dy / 2;
|
|
31254
|
+
const yb = t.y[0] + (t.rows - 0.5) * dy;
|
|
31255
|
+
return {
|
|
31256
|
+
dx,
|
|
31257
|
+
dy,
|
|
31258
|
+
x: [Math.min(xa, xb), Math.max(xa, xb)],
|
|
31259
|
+
y: [Math.min(ya, yb), Math.max(ya, yb)]
|
|
31260
|
+
};
|
|
31261
|
+
}
|
|
31262
|
+
function imagescColorLimits(t, caxis) {
|
|
31263
|
+
if (caxis) return caxis;
|
|
31264
|
+
let lo = Infinity, hi = -Infinity;
|
|
31265
|
+
for (const v of t.z) {
|
|
31266
|
+
if (isFinite(v)) {
|
|
31267
|
+
if (v < lo) lo = v;
|
|
31268
|
+
if (v > hi) hi = v;
|
|
31269
|
+
}
|
|
31270
|
+
}
|
|
31271
|
+
return isFinite(lo) ? [lo, hi] : null;
|
|
31272
|
+
}
|
|
31273
|
+
|
|
31274
|
+
// src/numbl-core/plotting/axisLimits.ts
|
|
31275
|
+
var EMPTY = { min: Infinity, max: -Infinity };
|
|
31276
|
+
function include(e, v) {
|
|
31277
|
+
if (Number.isFinite(v)) {
|
|
31278
|
+
if (v < e.min) e.min = v;
|
|
31279
|
+
if (v > e.max) e.max = v;
|
|
31280
|
+
}
|
|
31281
|
+
}
|
|
31282
|
+
function includeAll(e, vs) {
|
|
31283
|
+
if (!vs) return;
|
|
31284
|
+
for (let i = 0; i < vs.length; i++) include(e, vs[i]);
|
|
31285
|
+
}
|
|
31286
|
+
function dataExtents(axes) {
|
|
31287
|
+
const x = { ...EMPTY };
|
|
31288
|
+
const y = { ...EMPTY };
|
|
31289
|
+
const z = { ...EMPTY };
|
|
31290
|
+
for (const t of axes.traces ?? []) {
|
|
31291
|
+
includeAll(x, t.x);
|
|
31292
|
+
includeAll(y, t.y);
|
|
31293
|
+
}
|
|
31294
|
+
for (const t of axes.plot3Traces ?? []) {
|
|
31295
|
+
includeAll(x, t.x);
|
|
31296
|
+
includeAll(y, t.y);
|
|
31297
|
+
includeAll(z, t.z);
|
|
31298
|
+
}
|
|
31299
|
+
for (const t of [...axes.surfTraces ?? []]) {
|
|
31300
|
+
includeAll(x, t.x);
|
|
31301
|
+
includeAll(y, t.y);
|
|
31302
|
+
includeAll(z, t.z);
|
|
31303
|
+
}
|
|
31304
|
+
if (axes.imagescTrace) {
|
|
31305
|
+
const ext = imagescExtent(axes.imagescTrace);
|
|
31306
|
+
include(x, ext.x[0]);
|
|
31307
|
+
include(x, ext.x[1]);
|
|
31308
|
+
include(y, ext.y[0]);
|
|
31309
|
+
include(y, ext.y[1]);
|
|
31310
|
+
}
|
|
31311
|
+
for (const t of axes.pcolorTraces ?? []) {
|
|
31312
|
+
includeAll(x, t.x);
|
|
31313
|
+
includeAll(y, t.y);
|
|
31314
|
+
}
|
|
31315
|
+
for (const t of axes.contourTraces ?? []) {
|
|
31316
|
+
includeAll(x, t.x);
|
|
31317
|
+
includeAll(y, t.y);
|
|
31318
|
+
}
|
|
31319
|
+
for (const t of axes.patchTraces ?? []) {
|
|
31320
|
+
for (const v of t.vertices) {
|
|
31321
|
+
include(x, v[0]);
|
|
31322
|
+
include(y, v[1]);
|
|
31323
|
+
include(z, v[2] ?? 0);
|
|
31324
|
+
}
|
|
31325
|
+
}
|
|
31326
|
+
for (const bt of axes.barTraces ?? []) {
|
|
31327
|
+
const hw = bt.width / 2;
|
|
31328
|
+
for (let i = 0; i < bt.x.length; i++) {
|
|
31329
|
+
include(x, bt.x[i] - hw);
|
|
31330
|
+
include(x, bt.x[i] + hw);
|
|
31331
|
+
include(y, bt.y[i]);
|
|
31332
|
+
}
|
|
31333
|
+
include(y, 0);
|
|
31334
|
+
}
|
|
31335
|
+
for (const bt of axes.barhTraces ?? []) {
|
|
31336
|
+
const hh = bt.width / 2;
|
|
31337
|
+
for (let i = 0; i < bt.x.length; i++) {
|
|
31338
|
+
include(y, bt.x[i] - hh);
|
|
31339
|
+
include(y, bt.x[i] + hh);
|
|
31340
|
+
include(x, bt.y[i]);
|
|
31341
|
+
}
|
|
31342
|
+
include(x, 0);
|
|
31343
|
+
}
|
|
31344
|
+
for (const bt of [...axes.bar3Traces ?? [], ...axes.bar3hTraces ?? []]) {
|
|
31345
|
+
includeAll(x, bt.x);
|
|
31346
|
+
includeAll(y, bt.y);
|
|
31347
|
+
includeAll(z, bt.z);
|
|
31348
|
+
include(z, 0);
|
|
31349
|
+
}
|
|
31350
|
+
for (const et2 of axes.errorBarTraces ?? []) {
|
|
31351
|
+
for (let i = 0; i < et2.x.length; i++) {
|
|
31352
|
+
include(x, et2.xNeg ? et2.x[i] - et2.xNeg[i] : et2.x[i]);
|
|
31353
|
+
include(x, et2.xPos ? et2.x[i] + et2.xPos[i] : et2.x[i]);
|
|
31354
|
+
include(y, et2.y[i] - et2.yNeg[i]);
|
|
31355
|
+
include(y, et2.y[i] + et2.yPos[i]);
|
|
31356
|
+
}
|
|
31357
|
+
}
|
|
31358
|
+
for (const bt of axes.boxTraces ?? []) {
|
|
31359
|
+
const hw = bt.width / 2;
|
|
31360
|
+
include(x, bt.x - hw);
|
|
31361
|
+
include(x, bt.x + hw);
|
|
31362
|
+
include(y, bt.whiskerLow);
|
|
31363
|
+
include(y, bt.whiskerHigh);
|
|
31364
|
+
for (const o of bt.outliers) include(y, o);
|
|
31365
|
+
}
|
|
31366
|
+
if (axes.areaTraces && axes.areaTraces.length > 0) {
|
|
31367
|
+
const base = axes.areaBaseValue ?? 0;
|
|
31368
|
+
include(y, base);
|
|
31369
|
+
const n = axes.areaTraces[0].x.length;
|
|
31370
|
+
for (let i = 0; i < n; i++) {
|
|
31371
|
+
let cum = base;
|
|
31372
|
+
for (const t of axes.areaTraces) {
|
|
31373
|
+
if (i < t.x.length) {
|
|
31374
|
+
include(x, t.x[i]);
|
|
31375
|
+
cum += t.y[i] - base;
|
|
31376
|
+
include(y, cum);
|
|
31377
|
+
}
|
|
31378
|
+
}
|
|
31379
|
+
}
|
|
31380
|
+
}
|
|
31381
|
+
for (const qt of axes.quiverTraces ?? []) {
|
|
31382
|
+
for (let i = 0; i < qt.x.length; i++) {
|
|
31383
|
+
include(x, qt.x[i]);
|
|
31384
|
+
include(x, qt.x[i] + qt.u[i]);
|
|
31385
|
+
include(y, qt.y[i]);
|
|
31386
|
+
include(y, qt.y[i] + qt.v[i]);
|
|
31387
|
+
}
|
|
31388
|
+
}
|
|
31389
|
+
for (const qt of axes.quiver3Traces ?? []) {
|
|
31390
|
+
for (let i = 0; i < qt.x.length; i++) {
|
|
31391
|
+
include(x, qt.x[i]);
|
|
31392
|
+
include(x, qt.x[i] + qt.u[i]);
|
|
31393
|
+
include(y, qt.y[i]);
|
|
31394
|
+
include(y, qt.y[i] + qt.v[i]);
|
|
31395
|
+
include(z, qt.z[i]);
|
|
31396
|
+
include(z, qt.z[i] + qt.w[i]);
|
|
31397
|
+
}
|
|
31398
|
+
}
|
|
31399
|
+
return { x, y, z };
|
|
31400
|
+
}
|
|
31401
|
+
|
|
31198
31402
|
// src/graphics/plotMarkers.ts
|
|
31199
31403
|
function drawMarkers(ctx, trace, toCanvasX, toCanvasY, defaultColor) {
|
|
31200
31404
|
if (!trace.marker || trace.marker === "none") return;
|
|
@@ -31417,7 +31621,7 @@ function formatLogTick(v) {
|
|
|
31417
31621
|
return v.toExponential(0);
|
|
31418
31622
|
}
|
|
31419
31623
|
function drawPlot(canvas, traces, title, xlabel, ylabel, legend, gridOn, imagescTrace, contourTraces, colormap, axisMode, axisScale, barTraces, barhTraces, errorBarTraces, boxTraces, pieTrace, heatmapTrace, areaTraces, areaBaseValue, pcolorTraces, shading, colorbar, colorbarLocation, caxis, colormapData, quiverTraces, xlim, ylim, yDir, axisVisible, boxOn, patchTraces) {
|
|
31420
|
-
|
|
31624
|
+
const cmap = { name: colormap, data: colormapData };
|
|
31421
31625
|
const ctx = canvas.getContext("2d");
|
|
31422
31626
|
const hasContent = traces.length > 0 || imagescTrace !== void 0 || pcolorTraces && pcolorTraces.length > 0 || contourTraces && contourTraces.length > 0 || barTraces && barTraces.length > 0 || barhTraces && barhTraces.length > 0 || errorBarTraces && errorBarTraces.length > 0 || boxTraces && boxTraces.length > 0 || pieTrace !== void 0 || heatmapTrace !== void 0 || areaTraces && areaTraces.length > 0 || quiverTraces && quiverTraces.length > 0 || patchTraces && patchTraces.length > 0;
|
|
31423
31627
|
if (!ctx || !hasContent) return;
|
|
@@ -31434,7 +31638,7 @@ function drawPlot(canvas, traces, title, xlabel, ylabel, legend, gridOn, imagesc
|
|
|
31434
31638
|
return;
|
|
31435
31639
|
}
|
|
31436
31640
|
if (heatmapTrace) {
|
|
31437
|
-
drawHeatmap(ctx, cw, ch, heatmapTrace, title,
|
|
31641
|
+
drawHeatmap(ctx, cw, ch, heatmapTrace, title, cmap);
|
|
31438
31642
|
return;
|
|
31439
31643
|
}
|
|
31440
31644
|
const margin = {
|
|
@@ -31453,193 +31657,21 @@ function drawPlot(canvas, traces, title, xlabel, ylabel, legend, gridOn, imagesc
|
|
|
31453
31657
|
const plotW = cw - margin.left - margin.right;
|
|
31454
31658
|
const plotH = ch - margin.top - margin.bottom;
|
|
31455
31659
|
if (plotW <= 0 || plotH <= 0) return;
|
|
31456
|
-
|
|
31457
|
-
|
|
31458
|
-
|
|
31459
|
-
|
|
31460
|
-
|
|
31461
|
-
|
|
31462
|
-
|
|
31463
|
-
|
|
31464
|
-
|
|
31465
|
-
|
|
31466
|
-
|
|
31467
|
-
|
|
31468
|
-
|
|
31469
|
-
|
|
31470
|
-
|
|
31471
|
-
if (imagescTrace) {
|
|
31472
|
-
if (imagescTrace.x[0] < xMin) xMin = imagescTrace.x[0];
|
|
31473
|
-
if (imagescTrace.x[1] > xMax) xMax = imagescTrace.x[1];
|
|
31474
|
-
if (imagescTrace.y[0] < yMin) yMin = imagescTrace.y[0];
|
|
31475
|
-
if (imagescTrace.y[1] > yMax) yMax = imagescTrace.y[1];
|
|
31476
|
-
}
|
|
31477
|
-
if (pcolorTraces) {
|
|
31478
|
-
for (const pt of pcolorTraces) {
|
|
31479
|
-
for (const v of pt.x) {
|
|
31480
|
-
if (isFinite(v)) {
|
|
31481
|
-
if (v < xMin) xMin = v;
|
|
31482
|
-
if (v > xMax) xMax = v;
|
|
31483
|
-
}
|
|
31484
|
-
}
|
|
31485
|
-
for (const v of pt.y) {
|
|
31486
|
-
if (isFinite(v)) {
|
|
31487
|
-
if (v < yMin) yMin = v;
|
|
31488
|
-
if (v > yMax) yMax = v;
|
|
31489
|
-
}
|
|
31490
|
-
}
|
|
31491
|
-
}
|
|
31492
|
-
}
|
|
31493
|
-
if (contourTraces) {
|
|
31494
|
-
for (const ct of contourTraces) {
|
|
31495
|
-
for (const v of ct.x) {
|
|
31496
|
-
if (isFinite(v)) {
|
|
31497
|
-
if (v < xMin) xMin = v;
|
|
31498
|
-
if (v > xMax) xMax = v;
|
|
31499
|
-
}
|
|
31500
|
-
}
|
|
31501
|
-
for (const v of ct.y) {
|
|
31502
|
-
if (isFinite(v)) {
|
|
31503
|
-
if (v < yMin) yMin = v;
|
|
31504
|
-
if (v > yMax) yMax = v;
|
|
31505
|
-
}
|
|
31506
|
-
}
|
|
31507
|
-
}
|
|
31508
|
-
}
|
|
31509
|
-
if (patchTraces) {
|
|
31510
|
-
for (const pt of patchTraces) {
|
|
31511
|
-
for (const v of pt.vertices) {
|
|
31512
|
-
if (isFinite(v[0])) {
|
|
31513
|
-
if (v[0] < xMin) xMin = v[0];
|
|
31514
|
-
if (v[0] > xMax) xMax = v[0];
|
|
31515
|
-
}
|
|
31516
|
-
if (isFinite(v[1])) {
|
|
31517
|
-
if (v[1] < yMin) yMin = v[1];
|
|
31518
|
-
if (v[1] > yMax) yMax = v[1];
|
|
31519
|
-
}
|
|
31520
|
-
}
|
|
31521
|
-
}
|
|
31522
|
-
}
|
|
31523
|
-
if (barTraces) {
|
|
31524
|
-
for (const bt of barTraces) {
|
|
31525
|
-
const halfW = bt.width / 2;
|
|
31526
|
-
for (let i = 0; i < bt.x.length; i++) {
|
|
31527
|
-
const bx = bt.x[i];
|
|
31528
|
-
if (isFinite(bx)) {
|
|
31529
|
-
if (bx - halfW < xMin) xMin = bx - halfW;
|
|
31530
|
-
if (bx + halfW > xMax) xMax = bx + halfW;
|
|
31531
|
-
}
|
|
31532
|
-
const by = bt.y[i];
|
|
31533
|
-
if (isFinite(by)) {
|
|
31534
|
-
if (by < yMin) yMin = by;
|
|
31535
|
-
if (by > yMax) yMax = by;
|
|
31536
|
-
}
|
|
31537
|
-
}
|
|
31538
|
-
if (0 < yMin) yMin = 0;
|
|
31539
|
-
if (0 > yMax) yMax = 0;
|
|
31540
|
-
}
|
|
31541
|
-
}
|
|
31542
|
-
if (barhTraces) {
|
|
31543
|
-
for (const bt of barhTraces) {
|
|
31544
|
-
const halfH = bt.width / 2;
|
|
31545
|
-
for (let i = 0; i < bt.x.length; i++) {
|
|
31546
|
-
const pos = bt.x[i];
|
|
31547
|
-
if (isFinite(pos)) {
|
|
31548
|
-
if (pos - halfH < yMin) yMin = pos - halfH;
|
|
31549
|
-
if (pos + halfH > yMax) yMax = pos + halfH;
|
|
31550
|
-
}
|
|
31551
|
-
const len = bt.y[i];
|
|
31552
|
-
if (isFinite(len)) {
|
|
31553
|
-
if (len < xMin) xMin = len;
|
|
31554
|
-
if (len > xMax) xMax = len;
|
|
31555
|
-
}
|
|
31556
|
-
}
|
|
31557
|
-
if (0 < xMin) xMin = 0;
|
|
31558
|
-
if (0 > xMax) xMax = 0;
|
|
31559
|
-
}
|
|
31560
|
-
}
|
|
31561
|
-
if (errorBarTraces) {
|
|
31562
|
-
for (const et2 of errorBarTraces) {
|
|
31563
|
-
for (let i = 0; i < et2.x.length; i++) {
|
|
31564
|
-
const ex = et2.x[i];
|
|
31565
|
-
const ey = et2.y[i];
|
|
31566
|
-
if (isFinite(ex)) {
|
|
31567
|
-
const xl = et2.xNeg ? ex - et2.xNeg[i] : ex;
|
|
31568
|
-
const xr = et2.xPos ? ex + et2.xPos[i] : ex;
|
|
31569
|
-
if (xl < xMin) xMin = xl;
|
|
31570
|
-
if (xr > xMax) xMax = xr;
|
|
31571
|
-
}
|
|
31572
|
-
if (isFinite(ey)) {
|
|
31573
|
-
const ylo = ey - et2.yNeg[i];
|
|
31574
|
-
const yhi = ey + et2.yPos[i];
|
|
31575
|
-
if (ylo < yMin) yMin = ylo;
|
|
31576
|
-
if (yhi > yMax) yMax = yhi;
|
|
31577
|
-
}
|
|
31578
|
-
}
|
|
31579
|
-
}
|
|
31580
|
-
}
|
|
31581
|
-
if (boxTraces) {
|
|
31582
|
-
for (const bt of boxTraces) {
|
|
31583
|
-
const halfW = bt.width / 2;
|
|
31584
|
-
if (bt.x - halfW < xMin) xMin = bt.x - halfW;
|
|
31585
|
-
if (bt.x + halfW > xMax) xMax = bt.x + halfW;
|
|
31586
|
-
if (bt.whiskerLow < yMin) yMin = bt.whiskerLow;
|
|
31587
|
-
if (bt.whiskerHigh > yMax) yMax = bt.whiskerHigh;
|
|
31588
|
-
for (const o of bt.outliers) {
|
|
31589
|
-
if (o < yMin) yMin = o;
|
|
31590
|
-
if (o > yMax) yMax = o;
|
|
31591
|
-
}
|
|
31592
|
-
}
|
|
31593
|
-
}
|
|
31594
|
-
if (areaTraces && areaTraces.length > 0) {
|
|
31595
|
-
const base = areaBaseValue ?? 0;
|
|
31596
|
-
if (base < yMin) yMin = base;
|
|
31597
|
-
if (base > yMax) yMax = base;
|
|
31598
|
-
const n = areaTraces[0].x.length;
|
|
31599
|
-
for (let i = 0; i < n; i++) {
|
|
31600
|
-
let cumY = base;
|
|
31601
|
-
for (const t of areaTraces) {
|
|
31602
|
-
if (i < t.x.length) {
|
|
31603
|
-
const v = t.x[i];
|
|
31604
|
-
if (isFinite(v)) {
|
|
31605
|
-
if (v < xMin) xMin = v;
|
|
31606
|
-
if (v > xMax) xMax = v;
|
|
31607
|
-
}
|
|
31608
|
-
cumY += t.y[i] - base;
|
|
31609
|
-
if (isFinite(cumY)) {
|
|
31610
|
-
if (cumY < yMin) yMin = cumY;
|
|
31611
|
-
if (cumY > yMax) yMax = cumY;
|
|
31612
|
-
}
|
|
31613
|
-
}
|
|
31614
|
-
}
|
|
31615
|
-
}
|
|
31616
|
-
}
|
|
31617
|
-
if (quiverTraces) {
|
|
31618
|
-
for (const qt of quiverTraces) {
|
|
31619
|
-
for (let i = 0; i < qt.x.length; i++) {
|
|
31620
|
-
const x0 = qt.x[i];
|
|
31621
|
-
const y0 = qt.y[i];
|
|
31622
|
-
const x1 = x0 + qt.u[i];
|
|
31623
|
-
const y1 = y0 + qt.v[i];
|
|
31624
|
-
if (isFinite(x0)) {
|
|
31625
|
-
if (x0 < xMin) xMin = x0;
|
|
31626
|
-
if (x0 > xMax) xMax = x0;
|
|
31627
|
-
}
|
|
31628
|
-
if (isFinite(x1)) {
|
|
31629
|
-
if (x1 < xMin) xMin = x1;
|
|
31630
|
-
if (x1 > xMax) xMax = x1;
|
|
31631
|
-
}
|
|
31632
|
-
if (isFinite(y0)) {
|
|
31633
|
-
if (y0 < yMin) yMin = y0;
|
|
31634
|
-
if (y0 > yMax) yMax = y0;
|
|
31635
|
-
}
|
|
31636
|
-
if (isFinite(y1)) {
|
|
31637
|
-
if (y1 < yMin) yMin = y1;
|
|
31638
|
-
if (y1 > yMax) yMax = y1;
|
|
31639
|
-
}
|
|
31640
|
-
}
|
|
31641
|
-
}
|
|
31642
|
-
}
|
|
31660
|
+
const ext = dataExtents({
|
|
31661
|
+
traces,
|
|
31662
|
+
imagescTrace,
|
|
31663
|
+
pcolorTraces,
|
|
31664
|
+
contourTraces,
|
|
31665
|
+
patchTraces,
|
|
31666
|
+
barTraces,
|
|
31667
|
+
barhTraces,
|
|
31668
|
+
errorBarTraces,
|
|
31669
|
+
boxTraces,
|
|
31670
|
+
areaTraces,
|
|
31671
|
+
areaBaseValue,
|
|
31672
|
+
quiverTraces
|
|
31673
|
+
});
|
|
31674
|
+
let xMin = ext.x.min, xMax = ext.x.max, yMin = ext.y.min, yMax = ext.y.max;
|
|
31643
31675
|
if (!isFinite(xMin)) return;
|
|
31644
31676
|
if (xMax === xMin) {
|
|
31645
31677
|
xMin -= 1;
|
|
@@ -31650,7 +31682,7 @@ function drawPlot(canvas, traces, title, xlabel, ylabel, legend, gridOn, imagesc
|
|
|
31650
31682
|
yMax += 1;
|
|
31651
31683
|
}
|
|
31652
31684
|
const isImage = axisMode?.includes("image") ?? false;
|
|
31653
|
-
const isTight = (axisMode?.includes("tight") ?? false) || isImage;
|
|
31685
|
+
const isTight = (axisMode?.includes("tight") ?? false) || isImage || imagescTrace !== void 0;
|
|
31654
31686
|
const isEqual = (axisMode?.includes("equal") ?? false) || isImage;
|
|
31655
31687
|
const isSquare = axisMode?.includes("square") ?? false;
|
|
31656
31688
|
const isPadded = axisMode?.includes("padded") ?? false;
|
|
@@ -31833,21 +31865,21 @@ function drawPlot(canvas, traces, title, xlabel, ylabel, legend, gridOn, imagesc
|
|
|
31833
31865
|
ctx.rect(effMarginLeft, effMarginTop, effPlotW, effPlotH);
|
|
31834
31866
|
ctx.clip();
|
|
31835
31867
|
if (imagescTrace) {
|
|
31836
|
-
drawImagesc(ctx, imagescTrace, toCanvasX, toCanvasY,
|
|
31868
|
+
drawImagesc(ctx, imagescTrace, toCanvasX, toCanvasY, cmap, caxis);
|
|
31837
31869
|
}
|
|
31838
31870
|
if (pcolorTraces) {
|
|
31839
31871
|
for (const pt of pcolorTraces) {
|
|
31840
|
-
drawPcolor(ctx, pt, toCanvasX, toCanvasY,
|
|
31872
|
+
drawPcolor(ctx, pt, toCanvasX, toCanvasY, cmap, shading, caxis);
|
|
31841
31873
|
}
|
|
31842
31874
|
}
|
|
31843
31875
|
if (contourTraces) {
|
|
31844
31876
|
for (const ct of contourTraces) {
|
|
31845
|
-
drawContour(ctx, ct, toCanvasX, toCanvasY,
|
|
31877
|
+
drawContour(ctx, ct, toCanvasX, toCanvasY, cmap);
|
|
31846
31878
|
}
|
|
31847
31879
|
}
|
|
31848
31880
|
if (patchTraces) {
|
|
31849
31881
|
for (const pt of patchTraces) {
|
|
31850
|
-
drawPatch(ctx, pt, toCanvasX, toCanvasY,
|
|
31882
|
+
drawPatch(ctx, pt, toCanvasX, toCanvasY, cmap, caxis);
|
|
31851
31883
|
}
|
|
31852
31884
|
}
|
|
31853
31885
|
if (barTraces) {
|
|
@@ -32148,7 +32180,7 @@ function drawPlot(canvas, traces, title, xlabel, ylabel, legend, gridOn, imagesc
|
|
|
32148
32180
|
effPlotH,
|
|
32149
32181
|
cbRange[0],
|
|
32150
32182
|
cbRange[1],
|
|
32151
|
-
|
|
32183
|
+
cmap
|
|
32152
32184
|
);
|
|
32153
32185
|
}
|
|
32154
32186
|
}
|
|
@@ -32223,101 +32255,30 @@ function drawQuiver(ctx, quiverTraces, toCanvasX, toCanvasY, dpr) {
|
|
|
32223
32255
|
ctx.setLineDash([]);
|
|
32224
32256
|
}
|
|
32225
32257
|
}
|
|
32226
|
-
|
|
32227
|
-
function colormapLookup2(t, name) {
|
|
32228
|
-
const clamped = Math.max(0, Math.min(1, t));
|
|
32229
|
-
if (_activeColormapData && _activeColormapData.length > 0) {
|
|
32230
|
-
const data = _activeColormapData;
|
|
32231
|
-
const n = data.length;
|
|
32232
|
-
if (n === 1) return data[0];
|
|
32233
|
-
const idx = clamped * (n - 1);
|
|
32234
|
-
const lo = Math.floor(idx);
|
|
32235
|
-
const hi = Math.min(lo + 1, n - 1);
|
|
32236
|
-
const frac = idx - lo;
|
|
32237
|
-
return [
|
|
32238
|
-
data[lo][0] + frac * (data[hi][0] - data[lo][0]),
|
|
32239
|
-
data[lo][1] + frac * (data[hi][1] - data[lo][1]),
|
|
32240
|
-
data[lo][2] + frac * (data[hi][2] - data[lo][2])
|
|
32241
|
-
];
|
|
32242
|
-
}
|
|
32243
|
-
if (name === "jet") {
|
|
32244
|
-
return jetColormap(clamped);
|
|
32245
|
-
}
|
|
32246
|
-
if (name === "redblue") {
|
|
32247
|
-
return redblueColormap(clamped);
|
|
32248
|
-
}
|
|
32249
|
-
return parulaColormap(clamped);
|
|
32250
|
-
}
|
|
32251
|
-
function parulaColormap(t) {
|
|
32252
|
-
if (t < 0.5) {
|
|
32253
|
-
const s2 = t * 2;
|
|
32254
|
-
return [0.2 * (1 - s2), 0.1 + 0.6 * s2, 0.9 - 0.3 * s2];
|
|
32255
|
-
}
|
|
32256
|
-
const s = (t - 0.5) * 2;
|
|
32257
|
-
return [0.2 + 0.8 * s, 0.7 + 0.3 * s, 0.6 - 0.5 * s];
|
|
32258
|
-
}
|
|
32259
|
-
function jetColormap(t) {
|
|
32260
|
-
let r, g, b;
|
|
32261
|
-
if (t < 0.125) {
|
|
32262
|
-
r = 0;
|
|
32263
|
-
g = 0;
|
|
32264
|
-
b = 0.5 + t * 4;
|
|
32265
|
-
} else if (t < 0.375) {
|
|
32266
|
-
r = 0;
|
|
32267
|
-
g = (t - 0.125) * 4;
|
|
32268
|
-
b = 1;
|
|
32269
|
-
} else if (t < 0.625) {
|
|
32270
|
-
r = (t - 0.375) * 4;
|
|
32271
|
-
g = 1;
|
|
32272
|
-
b = 1 - (t - 0.375) * 4;
|
|
32273
|
-
} else if (t < 0.875) {
|
|
32274
|
-
r = 1;
|
|
32275
|
-
g = 1 - (t - 0.625) * 4;
|
|
32276
|
-
b = 0;
|
|
32277
|
-
} else {
|
|
32278
|
-
r = 1 - (t - 0.875) * 4;
|
|
32279
|
-
g = 0;
|
|
32280
|
-
b = 0;
|
|
32281
|
-
}
|
|
32282
|
-
return [
|
|
32283
|
-
Math.max(0, Math.min(1, r)),
|
|
32284
|
-
Math.max(0, Math.min(1, g)),
|
|
32285
|
-
Math.max(0, Math.min(1, b))
|
|
32286
|
-
];
|
|
32287
|
-
}
|
|
32288
|
-
function redblueColormap(t) {
|
|
32289
|
-
if (t < 0.5) {
|
|
32290
|
-
const s2 = t * 2;
|
|
32291
|
-
return [s2, s2, 1];
|
|
32292
|
-
}
|
|
32293
|
-
const s = (t - 0.5) * 2;
|
|
32294
|
-
return [1, 1 - s, 1 - s];
|
|
32295
|
-
}
|
|
32296
|
-
function drawImagesc(ctx, trace, toCanvasX, toCanvasY, colormap) {
|
|
32258
|
+
function drawImagesc(ctx, trace, toCanvasX, toCanvasY, colormap, caxis) {
|
|
32297
32259
|
const { rows, cols, z, x, y } = trace;
|
|
32298
32260
|
if (rows === 0 || cols === 0) return;
|
|
32299
|
-
|
|
32300
|
-
|
|
32301
|
-
|
|
32302
|
-
if (v < zMin) zMin = v;
|
|
32303
|
-
if (v > zMax) zMax = v;
|
|
32304
|
-
}
|
|
32305
|
-
}
|
|
32306
|
-
if (!isFinite(zMin)) return;
|
|
32261
|
+
const limits = imagescColorLimits(trace, caxis);
|
|
32262
|
+
if (!limits) return;
|
|
32263
|
+
const [zMin, zMax] = limits;
|
|
32307
32264
|
const zRange = zMax - zMin || 1;
|
|
32308
|
-
const dx = (
|
|
32309
|
-
const dy = (y[1] - y[0]) / rows;
|
|
32265
|
+
const { dx, dy } = imagescExtent(trace);
|
|
32310
32266
|
for (let j = 0; j < cols; j++) {
|
|
32311
32267
|
for (let i = 0; i < rows; i++) {
|
|
32312
32268
|
const val = z[j * rows + i];
|
|
32313
|
-
const t = (val - zMin) / zRange;
|
|
32314
|
-
const [r, g, b] =
|
|
32315
|
-
const
|
|
32316
|
-
const
|
|
32317
|
-
const
|
|
32318
|
-
const
|
|
32269
|
+
const t = Number.isNaN(val) ? 0 : (val - zMin) / zRange;
|
|
32270
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
32271
|
+
const cxa = toCanvasX(x[0] + (j - 0.5) * dx);
|
|
32272
|
+
const cxb = toCanvasX(x[0] + (j + 0.5) * dx);
|
|
32273
|
+
const cya = toCanvasY(y[0] + (i - 0.5) * dy);
|
|
32274
|
+
const cyb = toCanvasY(y[0] + (i + 0.5) * dy);
|
|
32319
32275
|
ctx.fillStyle = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
32320
|
-
ctx.fillRect(
|
|
32276
|
+
ctx.fillRect(
|
|
32277
|
+
Math.min(cxa, cxb),
|
|
32278
|
+
Math.min(cya, cyb),
|
|
32279
|
+
Math.abs(cxb - cxa),
|
|
32280
|
+
Math.abs(cyb - cya)
|
|
32281
|
+
);
|
|
32321
32282
|
}
|
|
32322
32283
|
}
|
|
32323
32284
|
}
|
|
@@ -32349,8 +32310,9 @@ function drawContour(ctx, trace, toCanvasX, toCanvasY, colormap) {
|
|
|
32349
32310
|
for (let j = 0; j < cols - 1; j++) {
|
|
32350
32311
|
for (let i = 0; i < rows - 1; i++) {
|
|
32351
32312
|
const zAvg = (getZ(i, j) + getZ(i + 1, j) + getZ(i, j + 1) + getZ(i + 1, j + 1)) / 4;
|
|
32313
|
+
if (Number.isNaN(zAvg)) continue;
|
|
32352
32314
|
const t = (zAvg - zMin) / zRange;
|
|
32353
|
-
const [r, g, b] =
|
|
32315
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
32354
32316
|
const cx1 = toCanvasX(getX(i, j));
|
|
32355
32317
|
const cy1 = toCanvasY(getY(i, j));
|
|
32356
32318
|
const cx2 = toCanvasX(getX(i + 1, j + 1));
|
|
@@ -32368,7 +32330,7 @@ function drawContour(ctx, trace, toCanvasX, toCanvasY, colormap) {
|
|
|
32368
32330
|
for (let li = 1; li < levels.length - 1; li++) {
|
|
32369
32331
|
const level = levels[li];
|
|
32370
32332
|
const t = (level - zMin) / zRange;
|
|
32371
|
-
const [r, g, b] =
|
|
32333
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
32372
32334
|
ctx.strokeStyle = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
32373
32335
|
ctx.lineWidth = trace.lineWidth ?? 1;
|
|
32374
32336
|
for (let j = 0; j < cols - 1; j++) {
|
|
@@ -32567,7 +32529,7 @@ function drawHeatmap(ctx, cw, ch, hm, title, colormap) {
|
|
|
32567
32529
|
const cx = plotL + j * cellW;
|
|
32568
32530
|
const cy = plotT + i * cellH;
|
|
32569
32531
|
const t = isFinite(v) ? (v - dMin) / dRange : 0;
|
|
32570
|
-
const [r, g, b] =
|
|
32532
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
32571
32533
|
ctx.fillStyle = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
32572
32534
|
ctx.fillRect(cx, cy, cellW, cellH);
|
|
32573
32535
|
ctx.strokeStyle = "#fff";
|
|
@@ -32604,7 +32566,7 @@ function drawHeatmap(ctx, cw, ch, hm, title, colormap) {
|
|
|
32604
32566
|
const nSteps = Math.max(1, Math.round(cbH));
|
|
32605
32567
|
for (let s = 0; s < nSteps; s++) {
|
|
32606
32568
|
const t = 1 - s / nSteps;
|
|
32607
|
-
const [r, g, b] =
|
|
32569
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
32608
32570
|
ctx.fillStyle = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
32609
32571
|
ctx.fillRect(cbL, cbT + s / nSteps * cbH, cbW, cbH / nSteps + 1);
|
|
32610
32572
|
}
|
|
@@ -32644,7 +32606,7 @@ function drawPatch(ctx, trace, toCanvasX, toCanvasY, colormap, caxis) {
|
|
|
32644
32606
|
if (Array.isArray(entry)) return entry;
|
|
32645
32607
|
if (typeof entry !== "number") return [0, 0, 0];
|
|
32646
32608
|
const t = isFinite(cMin) ? (entry - cMin) / cRange : 0.5;
|
|
32647
|
-
return
|
|
32609
|
+
return colormapLookup(t, colormap);
|
|
32648
32610
|
};
|
|
32649
32611
|
const cdataAt = (idx) => cdata ? mapColor(cdata[Math.min(Math.max(idx, 0), cdata.length - 1)]) : void 0;
|
|
32650
32612
|
const css = (c) => `rgb(${Math.round(c[0] * 255)},${Math.round(c[1] * 255)},${Math.round(c[2] * 255)})`;
|
|
@@ -32804,7 +32766,7 @@ function drawPcolorFlat(ctx, trace, toCanvasX, toCanvasY, colormap, drawEdges, c
|
|
|
32804
32766
|
const cv = c[idx00];
|
|
32805
32767
|
if (!isFinite(cv)) continue;
|
|
32806
32768
|
const t = (cv - cMin) / cRange;
|
|
32807
|
-
const [r, g, b] =
|
|
32769
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
32808
32770
|
const fill = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
32809
32771
|
const x0 = toCanvasX(x[idx00]);
|
|
32810
32772
|
const y0 = toCanvasY(y[idx00]);
|
|
@@ -33007,7 +32969,7 @@ function drawColorbarVertical(ctx, x, y, w, h, dMin, dMax, colormap, labelSide)
|
|
|
33007
32969
|
const nSteps = Math.max(1, Math.round(h));
|
|
33008
32970
|
for (let s = 0; s < nSteps; s++) {
|
|
33009
32971
|
const t = 1 - s / nSteps;
|
|
33010
|
-
const [r, g, b] =
|
|
32972
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
33011
32973
|
ctx.fillStyle = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
33012
32974
|
ctx.fillRect(x, y + s / nSteps * h, w, h / nSteps + 1);
|
|
33013
32975
|
}
|
|
@@ -33034,7 +32996,7 @@ function drawColorbarHorizontal(ctx, x, y, w, h, dMin, dMax, colormap, labelSide
|
|
|
33034
32996
|
const nSteps = Math.max(1, Math.round(w));
|
|
33035
32997
|
for (let s = 0; s < nSteps; s++) {
|
|
33036
32998
|
const t = s / nSteps;
|
|
33037
|
-
const [r, g, b] =
|
|
32999
|
+
const [r, g, b] = colormapLookup(t, colormap);
|
|
33038
33000
|
ctx.fillStyle = `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
|
|
33039
33001
|
ctx.fillRect(x + s / nSteps * w, y, w / nSteps + 1, h);
|
|
33040
33002
|
}
|
|
@@ -33307,6 +33269,7 @@ function SingleAxesView({ axes }) {
|
|
|
33307
33269
|
colorbar: axes.colorbar,
|
|
33308
33270
|
colorbarLocation: axes.colorbarLocation,
|
|
33309
33271
|
colormap: axes.colormap,
|
|
33272
|
+
colormapData: axes.colormapData,
|
|
33310
33273
|
axisVisible: axes.axisVisible
|
|
33311
33274
|
}
|
|
33312
33275
|
);
|
|
@@ -33476,7 +33439,7 @@ function PlotCanvas({
|
|
|
33476
33439
|
return /* @__PURE__ */ jsx2("div", { ref: containerRef, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx2("canvas", { ref: canvasRef, style: { display: "block" } }) });
|
|
33477
33440
|
}
|
|
33478
33441
|
|
|
33479
|
-
// src/
|
|
33442
|
+
// src/numbl-core/plotting/figuresReducer.ts
|
|
33480
33443
|
var defaultAxes = {
|
|
33481
33444
|
holdOn: false,
|
|
33482
33445
|
traces: [],
|
|
@@ -33645,8 +33608,11 @@ var figuresReducer = (state, action) => {
|
|
|
33645
33608
|
surfTraces: [...axes.surfTraces, action.trace]
|
|
33646
33609
|
});
|
|
33647
33610
|
}
|
|
33648
|
-
case "imagesc":
|
|
33649
|
-
|
|
33611
|
+
case "imagesc": {
|
|
33612
|
+
const hold = getAxes(ensureFig(state)).holdOn;
|
|
33613
|
+
const next = addTraces(state, { imagescTrace: action.trace });
|
|
33614
|
+
return hold ? next : updateAxes(next, { yDir: "reverse" });
|
|
33615
|
+
}
|
|
33650
33616
|
case "pcolor": {
|
|
33651
33617
|
const axes = getAxes(ensureFig(state));
|
|
33652
33618
|
return addTraces(state, {
|