@holoviz/panel 0.14.3 → 1.0.0-a.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.iife.min.js +217 -0
- package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.js +28286 -0
- package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.min.js +217 -0
- package/dist/bundled/bootstrap/css/bootstrap.css +688 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.css +4226 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.rtl.css +4225 -0
- package/dist/bundled/bootstrap5/css/bootstrap-grid.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.css +591 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.rtl.css +588 -0
- package/dist/bundled/bootstrap5/css/bootstrap-reboot.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.css +5099 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.rtl.css +5090 -0
- package/dist/bundled/bootstrap5/css/bootstrap-utilities.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap.css +11783 -0
- package/dist/bundled/bootstrap5/css/bootstrap.min.css +6 -0
- package/dist/bundled/bootstrap5/css/bootstrap.rtl.css +11747 -0
- package/dist/bundled/bootstrap5/css/bootstrap.rtl.min.css +6 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.js +6295 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +7 -0
- package/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.js +4422 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.min.js +7 -0
- package/dist/bundled/bootstrap5/js/bootstrap.esm.min.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.js +4468 -0
- package/dist/bundled/bootstrap5/js/bootstrap.js.map +1 -0
- package/dist/bundled/bootstrap5/js/bootstrap.min.js +7 -0
- package/dist/bundled/bootstrap5/js/bootstrap.min.js.map +1 -0
- package/dist/bundled/bootstrapdarktheme/bootstrap_dark.css +170 -0
- package/dist/bundled/bootstrapdefaulttheme/bootstrap_default.css +120 -0
- package/dist/bundled/bootstraptemplate/bootstrap.css +119 -77
- package/dist/bundled/darktheme/dark.css +33 -106
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_fast.min.css +1 -0
- package/dist/bundled/defaulttheme/default.css +33 -2
- package/dist/bundled/fast/css/fast.css +919 -0
- package/dist/bundled/fast/js/fast_design.js +87 -0
- package/dist/bundled/fastbasetemplate/fast.css +335 -0
- package/dist/bundled/fastgridtemplate/fast_grid_template.css +256 -232
- package/dist/bundled/golden-layout@1.5.9/dist/css/goldenlayout-base.css +1 -0
- package/dist/bundled/golden-layout@1.5.9/dist/css/theme/goldenlayout-dark-theme.css +1 -0
- package/dist/bundled/goldentemplate/golden.css +2 -22
- package/dist/bundled/material/css/material.css +443 -0
- package/dist/bundled/materialtemplate/dark.css +2 -20
- package/dist/bundled/materialtemplate/default.css +2 -17
- package/dist/bundled/materialtemplate/material.css +119 -114
- package/dist/bundled/materialthememixin/material_variables.css +19 -0
- package/dist/bundled/native/css/native.css +28 -0
- package/dist/bundled/notificationarea/panel/1.0.0-a.1/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.1/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/fonts.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/material-dark.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/material.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/monokai.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/solarized-dark.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/solarized.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/themes.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/vaporwave.css +1 -0
- package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/variables.css +0 -0
- package/dist/bundled/plotlyplot/panel/1.0.0-a.1/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/bundled/react-dom@17/umd/react-dom.production.min.js +245 -0
- package/dist/bundled/react-grid-layout@1.3.4/dist/react-grid-layout.min.js +2 -0
- package/dist/bundled/react-grid-layout@1.3.4/dist/react-grid-layout.min.js.map +1 -0
- package/dist/bundled/react@17/umd/react.production.min.js +31 -0
- package/dist/bundled/reacttemplate/react.css +0 -12
- package/dist/bundled/vanillatemplate/vanilla.css +129 -134
- package/dist/css/alerts.css +64 -64
- package/dist/css/booleanstatus.css +48 -0
- package/dist/css/card.css +16 -8
- package/dist/css/dataframe.css +7 -2
- package/dist/css/debugger.css +16 -10
- package/dist/css/divider.css +10 -0
- package/dist/css/editable_slider.css +22 -0
- package/dist/css/katex.css +3 -0
- package/dist/css/loadingspinner.css +119 -0
- package/dist/css/markdown.css +2 -1
- package/dist/css/perspective-datatable.css +504 -0
- package/dist/css/plotly.css +246 -0
- package/dist/css/progress.css +209 -0
- package/dist/css/widgetbox.css +9 -0
- package/dist/css/widgets.css +0 -305
- package/dist/dts/styles/alerts.css.d.ts +3 -0
- package/dist/dts/styles/booleanstatus.css.d.ts +3 -0
- package/dist/dts/styles/card.css.d.ts +3 -0
- package/dist/dts/styles/dataframe.css.d.ts +3 -0
- package/dist/dts/styles/debugger.css.d.ts +3 -0
- package/dist/dts/styles/divider.css.d.ts +4 -0
- package/dist/dts/styles/editable_slider.css.d.ts +8 -0
- package/dist/dts/styles/json.css.d.ts +3 -0
- package/dist/dts/styles/katex.css.d.ts +3 -0
- package/dist/dts/styles/loading.css.d.ts +3 -0
- package/dist/dts/styles/loadingspinner.css.d.ts +3 -0
- package/dist/dts/styles/markdown.css.d.ts +3 -0
- package/dist/dts/styles/perspective-datatable.css.d.ts +3 -0
- package/dist/dts/styles/plotly.css.d.ts +3 -0
- package/dist/dts/styles/progress.css.d.ts +3 -0
- package/dist/dts/styles/widgetbox.css.d.ts +3 -0
- package/dist/dts/styles/widgets.css.d.ts +4 -0
- package/dist/lib/models/ace.d.ts +3 -5
- package/dist/lib/models/ace.js +24 -23
- package/dist/lib/models/ace.js.map +1 -1
- package/dist/lib/models/audio.d.ts +2 -4
- package/dist/lib/models/audio.js +18 -18
- package/dist/lib/models/audio.js.map +1 -1
- package/dist/lib/models/card.d.ts +3 -3
- package/dist/lib/models/card.js +56 -62
- package/dist/lib/models/card.js.map +1 -1
- package/dist/lib/models/comm_manager.d.ts +2 -2
- package/dist/lib/models/comm_manager.js +20 -19
- package/dist/lib/models/comm_manager.js.map +1 -1
- package/dist/lib/models/data.js +1 -1
- package/dist/lib/models/data.js.map +1 -1
- package/dist/lib/models/datetime_picker.d.ts +8 -7
- package/dist/lib/models/datetime_picker.js +128 -34
- package/dist/lib/models/datetime_picker.js.map +1 -1
- package/dist/lib/models/deckgl.d.ts +2 -4
- package/dist/lib/models/deckgl.js +24 -25
- package/dist/lib/models/deckgl.js.map +1 -1
- package/dist/lib/models/echarts.d.ts +3 -2
- package/dist/lib/models/echarts.js +22 -12
- package/dist/lib/models/echarts.js.map +1 -1
- package/dist/lib/models/file_download.d.ts +2 -2
- package/dist/lib/models/file_download.js +18 -17
- package/dist/lib/models/file_download.js.map +1 -1
- package/dist/lib/models/html.d.ts +5 -3
- package/dist/lib/models/html.js +20 -16
- package/dist/lib/models/html.js.map +1 -1
- package/dist/lib/models/index.d.ts +1 -2
- package/dist/lib/models/index.js +1 -2
- package/dist/lib/models/index.js.map +1 -1
- package/dist/lib/models/ipywidget.d.ts +2 -6
- package/dist/lib/models/ipywidget.js +14 -24
- package/dist/lib/models/ipywidget.js.map +1 -1
- package/dist/lib/models/json.d.ts +1 -1
- package/dist/lib/models/json.js +14 -12
- package/dist/lib/models/json.js.map +1 -1
- package/dist/lib/models/jsoneditor.d.ts +9 -6
- package/dist/lib/models/jsoneditor.js +27 -18
- package/dist/lib/models/jsoneditor.js.map +1 -1
- package/dist/lib/models/katex.d.ts +0 -1
- package/dist/lib/models/katex.js +7 -6
- package/dist/lib/models/katex.js.map +1 -1
- package/dist/lib/models/layout.d.ts +25 -22
- package/dist/lib/models/layout.js +75 -81
- package/dist/lib/models/layout.js.map +1 -1
- package/dist/lib/models/location.d.ts +0 -1
- package/dist/lib/models/location.js +15 -14
- package/dist/lib/models/location.js.map +1 -1
- package/dist/lib/models/mathjax.d.ts +0 -3
- package/dist/lib/models/mathjax.js +6 -16
- package/dist/lib/models/mathjax.js.map +1 -1
- package/dist/lib/models/pdf.d.ts +24 -0
- package/dist/lib/models/pdf.js +62 -0
- package/dist/lib/models/pdf.js.map +1 -0
- package/dist/lib/models/perspective.d.ts +4 -9
- package/dist/lib/models/perspective.js +36 -64
- package/dist/lib/models/perspective.js.map +1 -1
- package/dist/lib/models/player.d.ts +0 -1
- package/dist/lib/models/player.js +18 -17
- package/dist/lib/models/player.js.map +1 -1
- package/dist/lib/models/plotly.d.ts +3 -7
- package/dist/lib/models/plotly.js +60 -67
- package/dist/lib/models/plotly.js.map +1 -1
- package/dist/lib/models/progress.d.ts +4 -7
- package/dist/lib/models/progress.js +28 -32
- package/dist/lib/models/progress.js.map +1 -1
- package/dist/lib/models/quill.d.ts +3 -6
- package/dist/lib/models/quill.js +25 -24
- package/dist/lib/models/quill.js.map +1 -1
- package/dist/lib/models/reactive_html.d.ts +6 -12
- package/dist/lib/models/reactive_html.js +48 -121
- package/dist/lib/models/reactive_html.js.map +1 -1
- package/dist/lib/models/singleselect.d.ts +0 -1
- package/dist/lib/models/singleselect.js +11 -10
- package/dist/lib/models/singleselect.js.map +1 -1
- package/dist/lib/models/speech_to_text.d.ts +1 -2
- package/dist/lib/models/speech_to_text.js +27 -26
- package/dist/lib/models/speech_to_text.js.map +1 -1
- package/dist/lib/models/state.d.ts +0 -2
- package/dist/lib/models/state.js +12 -13
- package/dist/lib/models/state.js.map +1 -1
- package/dist/lib/models/tabulator.d.ts +10 -14
- package/dist/lib/models/tabulator.js +73 -150
- package/dist/lib/models/tabulator.js.map +1 -1
- package/dist/lib/models/terminal.d.ts +6 -7
- package/dist/lib/models/terminal.js +20 -26
- package/dist/lib/models/terminal.js.map +1 -1
- package/dist/lib/models/text_to_speech.d.ts +1 -2
- package/dist/lib/models/text_to_speech.js +16 -15
- package/dist/lib/models/text_to_speech.js.map +1 -1
- package/dist/lib/models/trend.d.ts +1 -2
- package/dist/lib/models/trend.js +24 -23
- package/dist/lib/models/trend.js.map +1 -1
- package/dist/lib/models/vega.d.ts +7 -6
- package/dist/lib/models/vega.js +31 -36
- package/dist/lib/models/vega.js.map +1 -1
- package/dist/lib/models/video.d.ts +2 -4
- package/dist/lib/models/video.js +18 -18
- package/dist/lib/models/video.js.map +1 -1
- package/dist/lib/models/videostream.d.ts +2 -4
- package/dist/lib/models/videostream.js +19 -19
- package/dist/lib/models/videostream.js.map +1 -1
- package/dist/lib/models/vtk/util.d.ts +4 -4
- package/dist/lib/models/vtk/vtkaxes.d.ts +1 -2
- package/dist/lib/models/vtk/vtkaxes.js +15 -14
- package/dist/lib/models/vtk/vtkaxes.js.map +1 -1
- package/dist/lib/models/vtk/vtkjs.d.ts +0 -1
- package/dist/lib/models/vtk/vtkjs.js +9 -8
- package/dist/lib/models/vtk/vtkjs.js.map +1 -1
- package/dist/lib/models/vtk/vtklayout.d.ts +2 -5
- package/dist/lib/models/vtk/vtklayout.js +24 -30
- package/dist/lib/models/vtk/vtklayout.js.map +1 -1
- package/dist/lib/models/vtk/vtksynchronized.d.ts +0 -1
- package/dist/lib/models/vtk/vtksynchronized.js +17 -16
- package/dist/lib/models/vtk/vtksynchronized.js.map +1 -1
- package/dist/lib/models/vtk/vtkvolume.d.ts +0 -1
- package/dist/lib/models/vtk/vtkvolume.js +27 -26
- package/dist/lib/models/vtk/vtkvolume.js.map +1 -1
- package/dist/lib/styles/alerts.css.d.ts +1 -2
- package/dist/lib/styles/alerts.css.js +1 -139
- package/dist/lib/styles/booleanstatus.css.d.ts +1 -0
- package/dist/lib/styles/booleanstatus.css.js +1 -0
- package/dist/lib/styles/card.css.d.ts +1 -2
- package/dist/lib/styles/card.css.js +1 -43
- package/dist/lib/styles/dataframe.css.d.ts +1 -2
- package/dist/lib/styles/dataframe.css.js +1 -44
- package/dist/lib/styles/debugger.css.d.ts +1 -2
- package/dist/lib/styles/debugger.css.js +1 -68
- package/dist/lib/styles/divider.css.d.ts +2 -0
- package/dist/lib/styles/divider.css.js +2 -0
- package/dist/lib/styles/editable_slider.css.d.ts +6 -0
- package/dist/lib/styles/editable_slider.css.js +6 -0
- package/dist/lib/styles/json.css.d.ts +1 -2
- package/dist/lib/styles/json.css.js +1 -197
- package/dist/lib/styles/katex.css.d.ts +1 -0
- package/dist/lib/styles/katex.css.js +1 -0
- package/dist/lib/styles/loading.css.d.ts +1 -2
- package/dist/lib/styles/loading.css.js +1 -31
- package/dist/lib/styles/loadingspinner.css.d.ts +1 -0
- package/dist/lib/styles/loadingspinner.css.js +17 -0
- package/dist/lib/styles/markdown.css.d.ts +1 -2
- package/dist/lib/styles/markdown.css.js +1 -91
- package/dist/lib/styles/perspective-datatable.css.d.ts +1 -0
- package/dist/lib/styles/perspective-datatable.css.js +1 -0
- package/dist/lib/styles/plotly.css.d.ts +1 -0
- package/dist/lib/styles/plotly.css.js +1 -0
- package/dist/lib/styles/progress.css.d.ts +1 -0
- package/dist/lib/styles/progress.css.js +22 -0
- package/dist/lib/styles/widgetbox.css.d.ts +1 -0
- package/dist/lib/styles/widgetbox.css.js +1 -0
- package/dist/lib/styles/widgets.css.d.ts +2 -2
- package/dist/lib/styles/widgets.css.js +2 -320
- package/dist/panel.js +4467 -5894
- package/dist/panel.js.map +1 -1
- package/dist/panel.json +1 -1
- package/dist/panel.min.js +65 -102
- package/dist/wheels/bokeh-3.1.0.dev4-py3-none-any.whl +0 -0
- package/dist/wheels/panel-1.0.0a1-py3-none-any.whl +0 -0
- package/package.json +5 -4
- package/dist/bundled/bootstraptemplate/dark.css +0 -19
- package/dist/bundled/css/golden-layout@1.5.9/src/css/goldenlayout-base.css +0 -1
- package/dist/bundled/css/panel/0.14.3/dist/bundled/bootstrap4/css/bootstrap.min.css +0 -2
- package/dist/bundled/css/panel/0.14.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/datatabulator/@holoviz/panel@0.14.3/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/fast/tabulator_fast.min.css +0 -1
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/fast/tabulator_fast.min.css +0 -1
- package/dist/bundled/fastbasetemplate/fast_awesome.css +0 -13
- package/dist/bundled/fastbasetemplate/fast_bokeh.css +0 -1646
- package/dist/bundled/fastbasetemplate/fast_bokeh_slickgrid.css +0 -200
- package/dist/bundled/fastbasetemplate/fast_panel.css +0 -53
- package/dist/bundled/fastbasetemplate/fast_panel_dataframe.css +0 -14
- package/dist/bundled/fastbasetemplate/fast_panel_markdown.css +0 -23
- package/dist/bundled/fastbasetemplate/fast_panel_widgets.css +0 -301
- package/dist/bundled/fastbasetemplate/fast_root.css +0 -41
- package/dist/bundled/fastdarktheme/fast_root_dark.css +0 -4
- package/dist/bundled/fastdefaulttheme/fast_root_default.css +0 -4
- package/dist/bundled/fastgridtemplate/dark.css +0 -26
- package/dist/bundled/fastgridtemplate/default.css +0 -4
- package/dist/bundled/fastlisttemplate/dark.css +0 -13
- package/dist/bundled/fastlisttemplate/default.css +0 -1
- package/dist/bundled/fastlisttemplate/fast_list_template.css +0 -237
- package/dist/bundled/goldentemplate/dark.css +0 -26
- package/dist/bundled/goldentemplate/default.css +0 -23
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/array-pixel-blob.js +0 -39
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-blending.js +0 -270
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-converters.js +0 -524
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsl.js +0 -42
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsv.js +0 -42
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-interpolation.js +0 -133
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lab.js +0 -47
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lch.js +0 -50
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-palette.js +0 -285
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-quantization.js +0 -135
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-rgba-64.js +0 -95
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-scale.js +0 -176
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-xyz.js +0 -50
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/component-state-color-palette.js +0 -113
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/histogram.js +0 -76
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/index.js +0 -19
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/math-utilities.js +0 -138
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/named-colors.js +0 -743
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/palette-extractor.js +0 -134
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/parse-color.js +0 -219
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-blob.js +0 -72
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-box.js +0 -249
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/harness.js +0 -33
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/server.js +0 -36
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.iife.min.js +0 -19
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.js +0 -25813
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.min.js +0 -19
- package/dist/bundled/js/ajax/libs/react-grid-layout/1.1.1/react-grid-layout.min.js +0 -7
- package/dist/bundled/js/ajax/libs/react-grid-layout/1.1.1/react-grid-layout.min.js.map +0 -1
- package/dist/bundled/js/panel/0.14.3/dist/bundled/bootstrap4/js/bootstrap.bundle.min.js +0 -2
- package/dist/bundled/js/panel/0.14.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
- package/dist/bundled/js/react-dom@18/umd/react-dom.production.min.js +0 -267
- package/dist/bundled/js/react@18/umd/react.production.min.js +0 -31
- package/dist/bundled/notificationarea/panel/0.14.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/plotlyplot/panel/0.14.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
- package/dist/bundled/reacttemplate/dark.css +0 -18
- package/dist/bundled/reacttemplate/default.css +0 -12
- package/dist/bundled/theme/dark.css +0 -107
- package/dist/bundled/theme/default.css +0 -3
- package/dist/bundled/vanillatemplate/default.css +0 -8
- package/dist/idom/package.json +0 -38
- package/dist/lib/models/idom.d.ts +0 -36
- package/dist/lib/models/idom.js +0 -239
- package/dist/lib/models/idom.js.map +0 -1
- package/dist/lib/models/tabs.d.ts +0 -24
- package/dist/lib/models/tabs.js +0 -231
- package/dist/lib/models/tabs.js.map +0 -1
- package/dist/wheels/bokeh-2.4.3-py3-none-any.whl +0 -0
- package/dist/wheels/panel-0.14.3-py3-none-any.whl +0 -0
- /package/dist/bundled/{js/babel-standalone@latest → babel-standalone@latest}/babel.min.js +0 -0
- /package/dist/bundled/{js/golden-layout@1.5.9 → golden-layout@1.5.9}/dist/goldenlayout.min.js +0 -0
- /package/dist/bundled/{css/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.css +0 -0
- /package/dist/bundled/{js/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.js +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { clamp, denormalize, getHexStringForByte, roundToPrecisionSmall, } from "./math-utilities.js";
|
|
2
|
-
/**
|
|
3
|
-
* A RGBA color with 64 bit channels.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```ts
|
|
7
|
-
* new ColorRGBA64(1, 0, 0, 1) // red
|
|
8
|
-
* ```
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export class ColorRGBA64 {
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param red - the red value
|
|
15
|
-
* @param green - the green value
|
|
16
|
-
* @param blue - the blue value
|
|
17
|
-
* @param alpha - the alpha value
|
|
18
|
-
*/
|
|
19
|
-
constructor(red, green, blue, alpha) {
|
|
20
|
-
this.r = red;
|
|
21
|
-
this.g = green;
|
|
22
|
-
this.b = blue;
|
|
23
|
-
this.a = typeof alpha === "number" && !isNaN(alpha) ? alpha : 1;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Construct a {@link ColorRGBA64} from a {@link ColorRGBA64Config}
|
|
27
|
-
* @param data - the config object
|
|
28
|
-
*/
|
|
29
|
-
static fromObject(data) {
|
|
30
|
-
return data && !isNaN(data.r) && !isNaN(data.g) && !isNaN(data.b)
|
|
31
|
-
? new ColorRGBA64(data.r, data.g, data.b, data.a)
|
|
32
|
-
: null;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Determines if one color is equal to another.
|
|
36
|
-
* @param rhs - the color to compare
|
|
37
|
-
*/
|
|
38
|
-
equalValue(rhs) {
|
|
39
|
-
return (this.r === rhs.r && this.g === rhs.g && this.b === rhs.b && this.a === rhs.a);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Returns the color formatted as a string; #RRGGBB
|
|
43
|
-
*/
|
|
44
|
-
toStringHexRGB() {
|
|
45
|
-
return "#" + [this.r, this.g, this.b].map(this.formatHexValue).join("");
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Returns the color formatted as a string; #RRGGBBAA
|
|
49
|
-
*/
|
|
50
|
-
toStringHexRGBA() {
|
|
51
|
-
return this.toStringHexRGB() + this.formatHexValue(this.a);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Returns the color formatted as a string; #AARRGGBB
|
|
55
|
-
*/
|
|
56
|
-
toStringHexARGB() {
|
|
57
|
-
return "#" + [this.a, this.r, this.g, this.b].map(this.formatHexValue).join("");
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Returns the color formatted as a string; "rgb(0xRR, 0xGG, 0xBB)"
|
|
61
|
-
*/
|
|
62
|
-
toStringWebRGB() {
|
|
63
|
-
return `rgb(${Math.round(denormalize(this.r, 0.0, 255.0))},${Math.round(denormalize(this.g, 0.0, 255.0))},${Math.round(denormalize(this.b, 0.0, 255.0))})`;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Returns the color formatted as a string; "rgba(0xRR, 0xGG, 0xBB, a)"
|
|
67
|
-
* @remarks
|
|
68
|
-
* Note that this follows the convention of putting alpha in the range [0.0,1.0] while the other three channels are [0,255]
|
|
69
|
-
*/
|
|
70
|
-
toStringWebRGBA() {
|
|
71
|
-
return `rgba(${Math.round(denormalize(this.r, 0.0, 255.0))},${Math.round(denormalize(this.g, 0.0, 255.0))},${Math.round(denormalize(this.b, 0.0, 255.0))},${clamp(this.a, 0, 1)})`;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Returns a new {@link ColorRGBA64} rounded to the provided precision
|
|
75
|
-
* @param precision - the precision to round to
|
|
76
|
-
*/
|
|
77
|
-
roundToPrecision(precision) {
|
|
78
|
-
return new ColorRGBA64(roundToPrecisionSmall(this.r, precision), roundToPrecisionSmall(this.g, precision), roundToPrecisionSmall(this.b, precision), roundToPrecisionSmall(this.a, precision));
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Returns a new {@link ColorRGBA64} with channel values clamped between 0 and 1.
|
|
82
|
-
*/
|
|
83
|
-
clamp() {
|
|
84
|
-
return new ColorRGBA64(clamp(this.r, 0, 1), clamp(this.g, 0, 1), clamp(this.b, 0, 1), clamp(this.a, 0, 1));
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Converts the {@link ColorRGBA64} to a {@link ColorRGBA64Config}.
|
|
88
|
-
*/
|
|
89
|
-
toObject() {
|
|
90
|
-
return { r: this.r, g: this.g, b: this.b, a: this.a };
|
|
91
|
-
}
|
|
92
|
-
formatHexValue(value) {
|
|
93
|
-
return getHexStringForByte(denormalize(value, 0.0, 255.0));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { contrastRatio } from "./color-converters.js";
|
|
2
|
-
import { ColorInterpolationSpace, interpolateByColorSpace, } from "./color-interpolation.js";
|
|
3
|
-
/**
|
|
4
|
-
* A color scale created from linear stops
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export class ColorScale {
|
|
8
|
-
constructor(stops) {
|
|
9
|
-
if (stops == null || stops.length === 0) {
|
|
10
|
-
throw new Error("The stops argument must be non-empty");
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
this.stops = this.sortColorScaleStops(stops);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
static createBalancedColorScale(colors) {
|
|
17
|
-
if (colors == null || colors.length === 0) {
|
|
18
|
-
throw new Error("The colors argument must be non-empty");
|
|
19
|
-
}
|
|
20
|
-
const stops = new Array(colors.length);
|
|
21
|
-
for (let i = 0; i < colors.length; i++) {
|
|
22
|
-
// Special case first and last in order to avoid floating point jaggies
|
|
23
|
-
if (i === 0) {
|
|
24
|
-
stops[i] = { color: colors[i], position: 0 };
|
|
25
|
-
}
|
|
26
|
-
else if (i === colors.length - 1) {
|
|
27
|
-
stops[i] = { color: colors[i], position: 1 };
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
stops[i] = {
|
|
31
|
-
color: colors[i],
|
|
32
|
-
position: i * (1 / (colors.length - 1)),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return new ColorScale(stops);
|
|
37
|
-
}
|
|
38
|
-
getColor(position, interpolationMode = ColorInterpolationSpace.RGB) {
|
|
39
|
-
if (this.stops.length === 1) {
|
|
40
|
-
return this.stops[0].color;
|
|
41
|
-
}
|
|
42
|
-
else if (position <= 0) {
|
|
43
|
-
return this.stops[0].color;
|
|
44
|
-
}
|
|
45
|
-
else if (position >= 1) {
|
|
46
|
-
return this.stops[this.stops.length - 1].color;
|
|
47
|
-
}
|
|
48
|
-
let lowerIndex = 0;
|
|
49
|
-
for (let i = 0; i < this.stops.length; i++) {
|
|
50
|
-
if (this.stops[i].position <= position) {
|
|
51
|
-
lowerIndex = i;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
let upperIndex = lowerIndex + 1;
|
|
55
|
-
if (upperIndex >= this.stops.length) {
|
|
56
|
-
upperIndex = this.stops.length - 1;
|
|
57
|
-
}
|
|
58
|
-
const scalePosition = (position - this.stops[lowerIndex].position) *
|
|
59
|
-
(1.0 / (this.stops[upperIndex].position - this.stops[lowerIndex].position));
|
|
60
|
-
return interpolateByColorSpace(scalePosition, interpolationMode, this.stops[lowerIndex].color, this.stops[upperIndex].color);
|
|
61
|
-
}
|
|
62
|
-
trim(lowerBound, upperBound, interpolationMode = ColorInterpolationSpace.RGB) {
|
|
63
|
-
if (lowerBound < 0 || upperBound > 1 || upperBound < lowerBound) {
|
|
64
|
-
throw new Error("Invalid bounds");
|
|
65
|
-
}
|
|
66
|
-
if (lowerBound === upperBound) {
|
|
67
|
-
return new ColorScale([
|
|
68
|
-
{ color: this.getColor(lowerBound, interpolationMode), position: 0 },
|
|
69
|
-
]);
|
|
70
|
-
}
|
|
71
|
-
const containedStops = [];
|
|
72
|
-
for (let i = 0; i < this.stops.length; i++) {
|
|
73
|
-
if (this.stops[i].position >= lowerBound &&
|
|
74
|
-
this.stops[i].position <= upperBound) {
|
|
75
|
-
containedStops.push(this.stops[i]);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (containedStops.length === 0) {
|
|
79
|
-
return new ColorScale([
|
|
80
|
-
{ color: this.getColor(lowerBound), position: lowerBound },
|
|
81
|
-
{ color: this.getColor(upperBound), position: upperBound },
|
|
82
|
-
]);
|
|
83
|
-
}
|
|
84
|
-
if (containedStops[0].position !== lowerBound) {
|
|
85
|
-
containedStops.unshift({
|
|
86
|
-
color: this.getColor(lowerBound),
|
|
87
|
-
position: lowerBound,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (containedStops[containedStops.length - 1].position !== upperBound) {
|
|
91
|
-
containedStops.push({
|
|
92
|
-
color: this.getColor(upperBound),
|
|
93
|
-
position: upperBound,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
const range = upperBound - lowerBound;
|
|
97
|
-
const finalStops = new Array(containedStops.length);
|
|
98
|
-
for (let i = 0; i < containedStops.length; i++) {
|
|
99
|
-
finalStops[i] = {
|
|
100
|
-
color: containedStops[i].color,
|
|
101
|
-
position: (containedStops[i].position - lowerBound) / range,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
return new ColorScale(finalStops);
|
|
105
|
-
}
|
|
106
|
-
findNextColor(position, contrast, searchDown = false, interpolationMode = ColorInterpolationSpace.RGB, contrastErrorMargin = 0.005, maxSearchIterations = 32) {
|
|
107
|
-
if (isNaN(position) || position <= 0) {
|
|
108
|
-
position = 0;
|
|
109
|
-
}
|
|
110
|
-
else if (position >= 1) {
|
|
111
|
-
position = 1;
|
|
112
|
-
}
|
|
113
|
-
const startingColor = this.getColor(position, interpolationMode);
|
|
114
|
-
const finalPosition = searchDown ? 0 : 1;
|
|
115
|
-
const finalColor = this.getColor(finalPosition, interpolationMode);
|
|
116
|
-
const finalContrast = contrastRatio(startingColor, finalColor);
|
|
117
|
-
if (finalContrast <= contrast) {
|
|
118
|
-
return finalPosition;
|
|
119
|
-
}
|
|
120
|
-
let testRangeMin = searchDown ? 0 : position;
|
|
121
|
-
let testRangeMax = searchDown ? position : 0;
|
|
122
|
-
let mid = finalPosition;
|
|
123
|
-
let iterations = 0;
|
|
124
|
-
while (iterations <= maxSearchIterations) {
|
|
125
|
-
mid = Math.abs(testRangeMax - testRangeMin) / 2 + testRangeMin;
|
|
126
|
-
const midColor = this.getColor(mid, interpolationMode);
|
|
127
|
-
const midContrast = contrastRatio(startingColor, midColor);
|
|
128
|
-
if (Math.abs(midContrast - contrast) <= contrastErrorMargin) {
|
|
129
|
-
return mid;
|
|
130
|
-
}
|
|
131
|
-
else if (midContrast > contrast) {
|
|
132
|
-
if (searchDown) {
|
|
133
|
-
testRangeMin = mid;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
testRangeMax = mid;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
if (searchDown) {
|
|
141
|
-
testRangeMax = mid;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
testRangeMin = mid;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
iterations++;
|
|
148
|
-
}
|
|
149
|
-
return mid;
|
|
150
|
-
}
|
|
151
|
-
clone() {
|
|
152
|
-
const newStops = new Array(this.stops.length);
|
|
153
|
-
for (let i = 0; i < newStops.length; i++) {
|
|
154
|
-
newStops[i] = {
|
|
155
|
-
color: this.stops[i].color,
|
|
156
|
-
position: this.stops[i].position,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
return new ColorScale(newStops);
|
|
160
|
-
}
|
|
161
|
-
sortColorScaleStops(stops) {
|
|
162
|
-
return stops.sort((a, b) => {
|
|
163
|
-
const A = a.position;
|
|
164
|
-
const B = b.position;
|
|
165
|
-
if (A < B) {
|
|
166
|
-
return -1;
|
|
167
|
-
}
|
|
168
|
-
else if (A > B) {
|
|
169
|
-
return 1;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
return 0;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { roundToPrecisionSmall } from "./math-utilities.js";
|
|
2
|
-
/**
|
|
3
|
-
* {@link https://en.wikipedia.org/wiki/CIE_1931_color_space | XYZ color space}
|
|
4
|
-
*
|
|
5
|
-
* This implementation uses the D65 constants for 2 degrees. That determines the constants used for the pure white point of the XYZ space of 0.95047, 1.0, 1.08883.
|
|
6
|
-
* {@link https://en.wikipedia.org/wiki/Illuminant_D65}
|
|
7
|
-
* These constants determine how the XYZ, LCH and LAB colors convert to/from RGB.
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export class ColorXYZ {
|
|
12
|
-
constructor(x, y, z) {
|
|
13
|
-
this.x = x;
|
|
14
|
-
this.y = y;
|
|
15
|
-
this.z = z;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Construct a {@link ColorXYZ} from a config object.
|
|
19
|
-
*/
|
|
20
|
-
static fromObject(data) {
|
|
21
|
-
if (data && !isNaN(data.x) && !isNaN(data.y) && !isNaN(data.z)) {
|
|
22
|
-
return new ColorXYZ(data.x, data.y, data.z);
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Determines if a color is equal to another
|
|
28
|
-
* @param rhs - the value to compare
|
|
29
|
-
*/
|
|
30
|
-
equalValue(rhs) {
|
|
31
|
-
return this.x === rhs.x && this.y === rhs.y && this.z === rhs.z;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Returns a new {@link ColorXYZ} rounded to the provided precision
|
|
35
|
-
* @param precision - the precision to round to
|
|
36
|
-
*/
|
|
37
|
-
roundToPrecision(precision) {
|
|
38
|
-
return new ColorXYZ(roundToPrecisionSmall(this.x, precision), roundToPrecisionSmall(this.y, precision), roundToPrecisionSmall(this.z, precision));
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Returns the {@link ColorXYZ} formatted as an object.
|
|
42
|
-
*/
|
|
43
|
-
toObject() {
|
|
44
|
-
return { x: this.x, y: this.y, z: this.z };
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* D65 2 degree white point
|
|
49
|
-
*/
|
|
50
|
-
ColorXYZ.whitePoint = new ColorXYZ(0.95047, 1.0, 1.08883);
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { ColorRGBA64 } from "./color-rgba-64.js";
|
|
2
|
-
import { ColorPalette } from "./color-palette.js";
|
|
3
|
-
import { hslToRGB, rgbToHSL, rgbToLinearLuminance } from "./color-converters.js";
|
|
4
|
-
import { ColorScale } from "./color-scale.js";
|
|
5
|
-
import { ColorHSL } from "./color-hsl.js";
|
|
6
|
-
import { ColorInterpolationSpace } from "./color-interpolation.js";
|
|
7
|
-
import { parseColorHexRGB } from "./parse-color.js";
|
|
8
|
-
/**
|
|
9
|
-
* Creates a color palette for UI components
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export class ComponentStateColorPalette {
|
|
13
|
-
constructor(config) {
|
|
14
|
-
this.palette = [];
|
|
15
|
-
this.config = Object.assign({}, ComponentStateColorPalette.defaultPaletteConfig, config);
|
|
16
|
-
this.regenPalettes();
|
|
17
|
-
}
|
|
18
|
-
regenPalettes() {
|
|
19
|
-
let steps = this.config.steps;
|
|
20
|
-
if (isNaN(steps) || steps < 3) {
|
|
21
|
-
steps = 3;
|
|
22
|
-
}
|
|
23
|
-
// This palette is tuned to go as dark as differences between the levels can be perceived according to tests
|
|
24
|
-
// on numerous monitors in different conditions. Stay linear from white until this first cutoff.
|
|
25
|
-
const darkLum = 0.14;
|
|
26
|
-
// In the dark compression, this is the last luminance value before full black.
|
|
27
|
-
const darkestLum = 0.06;
|
|
28
|
-
// The Color for the luminance value above, placed on the ramp at it's normal position, so darker colors after
|
|
29
|
-
// it can be compressed.
|
|
30
|
-
const darkLumColor = new ColorRGBA64(darkLum, darkLum, darkLum, 1);
|
|
31
|
-
// The number of steps in the ramp that has been tuned for default use. This coincides with the size of the
|
|
32
|
-
// default ramp, but the palette could be generated with fewer steps to increase final contrast. This number
|
|
33
|
-
// should however stay the same.
|
|
34
|
-
const stepsForLuminanceRamp = 94;
|
|
35
|
-
// Create the reference, dark-compressed, grey palette, like:
|
|
36
|
-
// F------------------------------------------------------------------------------------[dark]------[darkest]0
|
|
37
|
-
// |--compressed area--|
|
|
38
|
-
const r = new ColorPalette(Object.assign(Object.assign({}, ColorPalette.greyscalePaletteConfig), { baseColor: darkLumColor, baseScalePosition: ((1 - darkLum) * 100) / stepsForLuminanceRamp, steps }));
|
|
39
|
-
const referencePalette = r.palette;
|
|
40
|
-
// Find the requested base color on the adjusted luminance reference ramp.
|
|
41
|
-
// There is no _right_ way to desaturate a color, and both methods we've tested have value, so average them out.
|
|
42
|
-
const baseColorLum1 = rgbToLinearLuminance(this.config.baseColor);
|
|
43
|
-
const baseColorLum2 = rgbToHSL(this.config.baseColor).l;
|
|
44
|
-
const baseColorLum = (baseColorLum1 + baseColorLum2) / 2;
|
|
45
|
-
const baseColorRefIndex = this.matchRelativeLuminanceIndex(baseColorLum, referencePalette);
|
|
46
|
-
const baseColorPercent = baseColorRefIndex / (steps - 1);
|
|
47
|
-
// Find the luminance location for the dark cutoff.
|
|
48
|
-
const darkRefIndex = this.matchRelativeLuminanceIndex(darkLum, referencePalette);
|
|
49
|
-
const darkPercent = darkRefIndex / (steps - 1);
|
|
50
|
-
// Issue https://github.com/microsoft/fast/issues/1904
|
|
51
|
-
// Creating a color from H, S, and a known L value is not the inverse of getting the relative
|
|
52
|
-
// luminace as above. Need to derive a relative luminance version of the color to better match on the dark end.
|
|
53
|
-
// Find the dark cutoff and darkest variations of the requested base color.
|
|
54
|
-
const baseColorHSL = rgbToHSL(this.config.baseColor);
|
|
55
|
-
const darkBaseColor = hslToRGB(ColorHSL.fromObject({
|
|
56
|
-
h: baseColorHSL.h,
|
|
57
|
-
s: baseColorHSL.s,
|
|
58
|
-
l: darkLum,
|
|
59
|
-
}));
|
|
60
|
-
const darkestBaseColor = hslToRGB(ColorHSL.fromObject({
|
|
61
|
-
h: baseColorHSL.h,
|
|
62
|
-
s: baseColorHSL.s,
|
|
63
|
-
l: darkestLum,
|
|
64
|
-
}));
|
|
65
|
-
// Create the gradient stops, including the base color and anchor colors for the dark end compression.
|
|
66
|
-
const fullColorScaleStops = new Array(5);
|
|
67
|
-
fullColorScaleStops[0] = {
|
|
68
|
-
position: 0,
|
|
69
|
-
color: new ColorRGBA64(1, 1, 1, 1),
|
|
70
|
-
};
|
|
71
|
-
fullColorScaleStops[1] = {
|
|
72
|
-
position: baseColorPercent,
|
|
73
|
-
color: this.config.baseColor,
|
|
74
|
-
};
|
|
75
|
-
fullColorScaleStops[2] = {
|
|
76
|
-
position: darkPercent,
|
|
77
|
-
color: darkBaseColor,
|
|
78
|
-
};
|
|
79
|
-
fullColorScaleStops[3] = {
|
|
80
|
-
position: 0.99,
|
|
81
|
-
color: darkestBaseColor,
|
|
82
|
-
};
|
|
83
|
-
fullColorScaleStops[4] = {
|
|
84
|
-
position: 1,
|
|
85
|
-
color: new ColorRGBA64(0, 0, 0, 1),
|
|
86
|
-
};
|
|
87
|
-
const scale = new ColorScale(fullColorScaleStops);
|
|
88
|
-
// Create the palette.
|
|
89
|
-
this.palette = new Array(steps);
|
|
90
|
-
for (let i = 0; i < steps; i++) {
|
|
91
|
-
const c = scale.getColor(i / (steps - 1), ColorInterpolationSpace.RGB);
|
|
92
|
-
this.palette[i] = c;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
matchRelativeLuminanceIndex(input, reference) {
|
|
96
|
-
let bestFitValue = Number.MAX_VALUE;
|
|
97
|
-
let bestFitIndex = 0;
|
|
98
|
-
let i = 0;
|
|
99
|
-
const referenceLength = reference.length;
|
|
100
|
-
for (; i < referenceLength; i++) {
|
|
101
|
-
const fitValue = Math.abs(rgbToLinearLuminance(reference[i]) - input);
|
|
102
|
-
if (fitValue < bestFitValue) {
|
|
103
|
-
bestFitValue = fitValue;
|
|
104
|
-
bestFitIndex = i;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return bestFitIndex;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
ComponentStateColorPalette.defaultPaletteConfig = {
|
|
111
|
-
baseColor: parseColorHexRGB("#808080"),
|
|
112
|
-
steps: 94,
|
|
113
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* For each possible color, this counts how many pixels in the source image match that color.
|
|
3
|
-
* If signifigantBits is less than 8, each channel (eg: red, green, blue) in each color is reduced to fit in significantBits. So for the default value of 5 significantBits colors are reduced from 8 bits per channel (0-255) to 5 (0-31). Colors that were previously distinct get combined together.
|
|
4
|
-
* If the image source has more than 2^32 pixels (eg: a square image 65536x65536 in size) of the same color this code will break.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export class Histogram {
|
|
9
|
-
/**
|
|
10
|
-
* @param source - the source pixel data.
|
|
11
|
-
* @param significantBits - The memory needed for the histogram increases dramatically if significantBits is increased. It needs a buffer which is 4*2^(3*significantBits) in size. EG: for 5 significant bits the histogram is 128K while for 8 it is 64 megs.
|
|
12
|
-
* @param pixelSkipping - CPU time increases linearly as pixelSkipping is reduced.
|
|
13
|
-
* @param isHistogramPixelValid - isHistogramPixelValid is an optional predicate which can screen out unwanted pixels from the source data. EG: ignoring transparent pixels.
|
|
14
|
-
*/
|
|
15
|
-
constructor(source, significantBits = 5, pixelSkipping = 5, isHistogramPixelValid = null) {
|
|
16
|
-
this.getHistogramIndex = (r, g, b) => {
|
|
17
|
-
const index = (r << (2 * this.significantBits)) + (g << this.significantBits) + b;
|
|
18
|
-
if (index >= this.data.length) {
|
|
19
|
-
throw new Error("RGB value is outside the bounds of the histogram");
|
|
20
|
-
}
|
|
21
|
-
return index;
|
|
22
|
-
};
|
|
23
|
-
this.getHistogramValue = (r, g, b) => {
|
|
24
|
-
return this.data[this.getHistogramIndex(r, g, b)];
|
|
25
|
-
};
|
|
26
|
-
this.setHistogramValue = (value, r, g, b) => {
|
|
27
|
-
this.data[this.getHistogramIndex(r, g, b)] = value;
|
|
28
|
-
};
|
|
29
|
-
if (significantBits < 1 || significantBits > 8) {
|
|
30
|
-
throw new Error("significantBits must be in the range [1,8]");
|
|
31
|
-
}
|
|
32
|
-
if (pixelSkipping < 0) {
|
|
33
|
-
throw new Error("pixelSkipping must be >= 0");
|
|
34
|
-
}
|
|
35
|
-
this.significantBits = significantBits;
|
|
36
|
-
const sigShift = 8 - this.significantBits;
|
|
37
|
-
this.minRed = 255 >>> sigShift;
|
|
38
|
-
this.maxRed = 0;
|
|
39
|
-
this.minGreen = 255 >>> sigShift;
|
|
40
|
-
this.maxGreen = 0;
|
|
41
|
-
this.minBlue = 255 >>> sigShift;
|
|
42
|
-
this.maxBlue = 0;
|
|
43
|
-
const histoSize = 1 << (significantBits * 3);
|
|
44
|
-
this.data = new Uint32Array(histoSize);
|
|
45
|
-
this.data.fill(0);
|
|
46
|
-
this.total = 0;
|
|
47
|
-
let pixelIndex = 0;
|
|
48
|
-
for (let y = 0; y < source.height; y++) {
|
|
49
|
-
for (let x = 0; x < source.width; x++) {
|
|
50
|
-
if (pixelSkipping > 0 && pixelIndex++ % pixelSkipping !== 0) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
const rgba = source.getPixelRGBA(x, y);
|
|
54
|
-
if (isHistogramPixelValid !== null) {
|
|
55
|
-
if (!isHistogramPixelValid(rgba)) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// Shift the pixel data into the range determined by significantBits
|
|
60
|
-
// after checking minAlpha the alpha data is no longer needed
|
|
61
|
-
rgba[0] = rgba[0] >>> sigShift;
|
|
62
|
-
rgba[1] = rgba[1] >>> sigShift;
|
|
63
|
-
rgba[2] = rgba[2] >>> sigShift;
|
|
64
|
-
this.minRed = Math.min(rgba[0], this.minRed);
|
|
65
|
-
this.maxRed = Math.max(rgba[0], this.maxRed);
|
|
66
|
-
this.minGreen = Math.min(rgba[1], this.minGreen);
|
|
67
|
-
this.maxGreen = Math.max(rgba[1], this.maxGreen);
|
|
68
|
-
this.minBlue = Math.min(rgba[2], this.minBlue);
|
|
69
|
-
this.maxBlue = Math.max(rgba[2], this.maxBlue);
|
|
70
|
-
const histoIndex = this.getHistogramIndex(rgba[0], rgba[1], rgba[2]);
|
|
71
|
-
this.data[histoIndex] += 1;
|
|
72
|
-
this.total++;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./color-blending.js";
|
|
2
|
-
export * from "./color-converters.js";
|
|
3
|
-
export * from "./color-hsl.js";
|
|
4
|
-
export * from "./color-hsv.js";
|
|
5
|
-
export * from "./color-interpolation.js";
|
|
6
|
-
export * from "./color-lab.js";
|
|
7
|
-
export * from "./color-lch.js";
|
|
8
|
-
export * from "./color-palette.js";
|
|
9
|
-
export * from "./color-quantization.js";
|
|
10
|
-
export * from "./color-rgba-64.js";
|
|
11
|
-
export * from "./color-scale.js";
|
|
12
|
-
export * from "./color-xyz.js";
|
|
13
|
-
export * from "./component-state-color-palette.js";
|
|
14
|
-
export * from "./histogram.js";
|
|
15
|
-
export * from "./math-utilities.js";
|
|
16
|
-
export * from "./palette-extractor.js";
|
|
17
|
-
export * from "./parse-color.js";
|
|
18
|
-
export * from "./pixel-blob.js";
|
|
19
|
-
export * from "./pixel-box.js";
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensures that an input number does not exceed a max value and is not less than a min value.
|
|
3
|
-
* @param i - the number to clamp
|
|
4
|
-
* @param min - the maximum (inclusive) value
|
|
5
|
-
* @param max - the minimum (inclusive) value
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export function clamp(i, min, max) {
|
|
9
|
-
if (isNaN(i) || i <= min) {
|
|
10
|
-
return min;
|
|
11
|
-
}
|
|
12
|
-
else if (i >= max) {
|
|
13
|
-
return max;
|
|
14
|
-
}
|
|
15
|
-
return i;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Scales an input to a number between 0 and 1
|
|
19
|
-
* @param i - a number between min and max
|
|
20
|
-
* @param min - the max value
|
|
21
|
-
* @param max - the min value
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export function normalize(i, min, max) {
|
|
25
|
-
if (isNaN(i) || i <= min) {
|
|
26
|
-
return 0.0;
|
|
27
|
-
}
|
|
28
|
-
else if (i >= max) {
|
|
29
|
-
return 1.0;
|
|
30
|
-
}
|
|
31
|
-
return i / (max - min);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Scales a number between 0 and 1
|
|
35
|
-
* @param i - the number to denormalize
|
|
36
|
-
* @param min - the min value
|
|
37
|
-
* @param max - the max value
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
export function denormalize(i, min, max) {
|
|
41
|
-
if (isNaN(i)) {
|
|
42
|
-
return min;
|
|
43
|
-
}
|
|
44
|
-
return min + i * (max - min);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Converts degrees to radians.
|
|
48
|
-
* @param i - degrees
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
export function degreesToRadians(i) {
|
|
52
|
-
return i * (Math.PI / 180.0);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Converts radians to degrees.
|
|
56
|
-
* @param i - radians
|
|
57
|
-
* @public
|
|
58
|
-
*/
|
|
59
|
-
export function radiansToDegrees(i) {
|
|
60
|
-
return i * (180.0 / Math.PI);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Converts a number between 0 and 255 to a hex string.
|
|
64
|
-
* @param i - the number to convert to a hex string
|
|
65
|
-
* @public
|
|
66
|
-
*/
|
|
67
|
-
export function getHexStringForByte(i) {
|
|
68
|
-
const s = Math.round(clamp(i, 0.0, 255.0)).toString(16);
|
|
69
|
-
if (s.length === 1) {
|
|
70
|
-
return "0" + s;
|
|
71
|
-
}
|
|
72
|
-
return s;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Linearly interpolate
|
|
76
|
-
* @public
|
|
77
|
-
*/
|
|
78
|
-
export function lerp(i, min, max) {
|
|
79
|
-
if (isNaN(i) || i <= 0.0) {
|
|
80
|
-
return min;
|
|
81
|
-
}
|
|
82
|
-
else if (i >= 1.0) {
|
|
83
|
-
return max;
|
|
84
|
-
}
|
|
85
|
-
return min + i * (max - min);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Linearly interpolate angles in degrees
|
|
89
|
-
* @public
|
|
90
|
-
*/
|
|
91
|
-
export function lerpAnglesInDegrees(i, min, max) {
|
|
92
|
-
if (i <= 0.0) {
|
|
93
|
-
return min % 360.0;
|
|
94
|
-
}
|
|
95
|
-
else if (i >= 1.0) {
|
|
96
|
-
return max % 360.0;
|
|
97
|
-
}
|
|
98
|
-
const a = (min - max + 360.0) % 360.0;
|
|
99
|
-
const b = (max - min + 360.0) % 360.0;
|
|
100
|
-
if (a <= b) {
|
|
101
|
-
return (min - a * i + 360.0) % 360.0;
|
|
102
|
-
}
|
|
103
|
-
return (min + a * i + 360.0) % 360.0;
|
|
104
|
-
}
|
|
105
|
-
const TwoPI = Math.PI * 2;
|
|
106
|
-
/**
|
|
107
|
-
* Linearly interpolate angles in radians
|
|
108
|
-
* @public
|
|
109
|
-
*/
|
|
110
|
-
export function lerpAnglesInRadians(i, min, max) {
|
|
111
|
-
if (isNaN(i) || i <= 0.0) {
|
|
112
|
-
return min % TwoPI;
|
|
113
|
-
}
|
|
114
|
-
else if (i >= 1.0) {
|
|
115
|
-
return max % TwoPI;
|
|
116
|
-
}
|
|
117
|
-
const a = (min - max + TwoPI) % TwoPI;
|
|
118
|
-
const b = (max - min + TwoPI) % TwoPI;
|
|
119
|
-
if (a <= b) {
|
|
120
|
-
return (min - a * i + TwoPI) % TwoPI;
|
|
121
|
-
}
|
|
122
|
-
return (min + a * i + TwoPI) % TwoPI;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* Will return infinity if i*10^(precision) overflows number
|
|
127
|
-
* note that floating point rounding rules come into play here
|
|
128
|
-
* so values that end up rounding on a .5 round to the nearest
|
|
129
|
-
* even not always up so 2.5 rounds to 2
|
|
130
|
-
* @param i - the number to round
|
|
131
|
-
* @param precision - the precision to round to
|
|
132
|
-
*
|
|
133
|
-
* @public
|
|
134
|
-
*/
|
|
135
|
-
export function roundToPrecisionSmall(i, precision) {
|
|
136
|
-
const factor = Math.pow(10, precision);
|
|
137
|
-
return Math.round(i * factor) / factor;
|
|
138
|
-
}
|