@holoviz/panel 0.14.4 → 1.0.0-a.2
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/luxon/build/global/luxon.min.js.map +1 -1
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_bootstrap3.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_bootstrap4.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_bulma.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_fast.min.css +1 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_materialize.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_midnight.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_modern.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_semanticui.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_simple.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_site.min.css +2 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/js/tabulator.js +26077 -0
- package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/js/tabulator.js.map +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 +34 -0
- package/dist/bundled/notificationarea/panel/1.0.0-a.2/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.2/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.2/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
- package/dist/bundled/panel/1.0.0-a.2/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-a.2/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.2/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@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 +55 -39
- 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/loading.css +5 -6
- 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 +54 -63
- 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 +130 -36
- 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 +20 -19
- package/dist/lib/models/file_download.js.map +1 -1
- package/dist/lib/models/html.d.ts +4 -4
- package/dist/lib/models/html.js +23 -17
- 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 +8 -7
- package/dist/lib/models/jsoneditor.js +30 -19
- 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 +5 -10
- package/dist/lib/models/perspective.js +75 -87
- 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 +45 -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 +9 -16
- package/dist/lib/models/tabulator.js +111 -196
- package/dist/lib/models/tabulator.js.map +1 -1
- package/dist/lib/models/terminal.d.ts +5 -8
- package/dist/lib/models/terminal.js +23 -27
- 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 +6 -7
- package/dist/lib/models/vega.js +34 -37
- 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 +4648 -6067
- 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.0rc1-py3-none-any.whl +0 -0
- package/dist/wheels/{panel-0.14.4-py3-none-any.whl → panel-1.0.0a2-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.4/dist/bundled/bootstrap4/css/bootstrap.min.css +0 -2
- package/dist/bundled/css/panel/0.14.4/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/datatabulator/@holoviz/panel@0.14.4/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/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_bootstrap3.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_bootstrap4.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_bulma.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_materialize.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_midnight.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_modern.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_semanticui.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_simple.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_site.min.css +0 -2
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/js/tabulator.js +0 -27481
- package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/js/tabulator.js.map +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/panel/0.14.4/dist/bundled/bootstrap4/js/bootstrap.bundle.min.js +0 -2
- package/dist/bundled/js/panel/0.14.4/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.4/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/plotlyplot/panel/0.14.4/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/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
- /package/dist/bundled/{js/react-grid-layout@1.3.4 → react-grid-layout@1.3.4}/dist/react-grid-layout.min.js +0 -0
- /package/dist/bundled/{js/react-grid-layout@1.3.4 → react-grid-layout@1.3.4}/dist/react-grid-layout.min.js.map +0 -0
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { hslToRGB, hsvToRGB, labToRGB, lchToRGB, rgbToHSL, rgbToHSV, rgbToLAB, rgbToLCH, rgbToXYZ, xyzToRGB, } from "./color-converters.js";
|
|
2
|
-
import { ColorHSL } from "./color-hsl.js";
|
|
3
|
-
import { ColorHSV } from "./color-hsv.js";
|
|
4
|
-
import { ColorLAB } from "./color-lab.js";
|
|
5
|
-
import { ColorLCH } from "./color-lch.js";
|
|
6
|
-
import { ColorRGBA64 } from "./color-rgba-64.js";
|
|
7
|
-
import { ColorXYZ } from "./color-xyz.js";
|
|
8
|
-
import { lerp, lerpAnglesInDegrees } from "./math-utilities.js";
|
|
9
|
-
/**
|
|
10
|
-
* Interpolate by RGB color space
|
|
11
|
-
*
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export function interpolateRGB(position, left, right) {
|
|
15
|
-
if (isNaN(position) || position <= 0) {
|
|
16
|
-
return left;
|
|
17
|
-
}
|
|
18
|
-
else if (position >= 1) {
|
|
19
|
-
return right;
|
|
20
|
-
}
|
|
21
|
-
return new ColorRGBA64(lerp(position, left.r, right.r), lerp(position, left.g, right.g), lerp(position, left.b, right.b), lerp(position, left.a, right.a));
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Interpolate by HSL color space
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export function interpolateHSL(position, left, right) {
|
|
29
|
-
if (isNaN(position) || position <= 0) {
|
|
30
|
-
return left;
|
|
31
|
-
}
|
|
32
|
-
else if (position >= 1) {
|
|
33
|
-
return right;
|
|
34
|
-
}
|
|
35
|
-
return new ColorHSL(lerpAnglesInDegrees(position, left.h, right.h), lerp(position, left.s, right.s), lerp(position, left.l, right.l));
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Interpolate by HSV color space
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
export function interpolateHSV(position, left, right) {
|
|
43
|
-
if (isNaN(position) || position <= 0) {
|
|
44
|
-
return left;
|
|
45
|
-
}
|
|
46
|
-
else if (position >= 1) {
|
|
47
|
-
return right;
|
|
48
|
-
}
|
|
49
|
-
return new ColorHSV(lerpAnglesInDegrees(position, left.h, right.h), lerp(position, left.s, right.s), lerp(position, left.v, right.v));
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Interpolate by XYZ color space
|
|
53
|
-
*
|
|
54
|
-
* @public
|
|
55
|
-
*/
|
|
56
|
-
export function interpolateXYZ(position, left, right) {
|
|
57
|
-
if (isNaN(position) || position <= 0) {
|
|
58
|
-
return left;
|
|
59
|
-
}
|
|
60
|
-
else if (position >= 1) {
|
|
61
|
-
return right;
|
|
62
|
-
}
|
|
63
|
-
return new ColorXYZ(lerp(position, left.x, right.x), lerp(position, left.y, right.y), lerp(position, left.z, right.z));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Interpolate by LAB color space
|
|
67
|
-
*
|
|
68
|
-
* @public
|
|
69
|
-
*/
|
|
70
|
-
export function interpolateLAB(position, left, right) {
|
|
71
|
-
if (isNaN(position) || position <= 0) {
|
|
72
|
-
return left;
|
|
73
|
-
}
|
|
74
|
-
else if (position >= 1) {
|
|
75
|
-
return right;
|
|
76
|
-
}
|
|
77
|
-
return new ColorLAB(lerp(position, left.l, right.l), lerp(position, left.a, right.a), lerp(position, left.b, right.b));
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Interpolate by LCH color space
|
|
81
|
-
*
|
|
82
|
-
* @public
|
|
83
|
-
*/
|
|
84
|
-
export function interpolateLCH(position, left, right) {
|
|
85
|
-
if (isNaN(position) || position <= 0) {
|
|
86
|
-
return left;
|
|
87
|
-
}
|
|
88
|
-
else if (position >= 1) {
|
|
89
|
-
return right;
|
|
90
|
-
}
|
|
91
|
-
return new ColorLCH(lerp(position, left.l, right.l), lerp(position, left.c, right.c), lerpAnglesInDegrees(position, left.h, right.h));
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Color interpolation spaces
|
|
95
|
-
*
|
|
96
|
-
* @public
|
|
97
|
-
*/
|
|
98
|
-
export var ColorInterpolationSpace;
|
|
99
|
-
(function (ColorInterpolationSpace) {
|
|
100
|
-
ColorInterpolationSpace[ColorInterpolationSpace["RGB"] = 0] = "RGB";
|
|
101
|
-
ColorInterpolationSpace[ColorInterpolationSpace["HSL"] = 1] = "HSL";
|
|
102
|
-
ColorInterpolationSpace[ColorInterpolationSpace["HSV"] = 2] = "HSV";
|
|
103
|
-
ColorInterpolationSpace[ColorInterpolationSpace["XYZ"] = 3] = "XYZ";
|
|
104
|
-
ColorInterpolationSpace[ColorInterpolationSpace["LAB"] = 4] = "LAB";
|
|
105
|
-
ColorInterpolationSpace[ColorInterpolationSpace["LCH"] = 5] = "LCH";
|
|
106
|
-
})(ColorInterpolationSpace || (ColorInterpolationSpace = {}));
|
|
107
|
-
/**
|
|
108
|
-
* Interpolate by color space
|
|
109
|
-
*
|
|
110
|
-
* @public
|
|
111
|
-
*/
|
|
112
|
-
export function interpolateByColorSpace(position, space, left, right) {
|
|
113
|
-
if (isNaN(position) || position <= 0) {
|
|
114
|
-
return left;
|
|
115
|
-
}
|
|
116
|
-
else if (position >= 1) {
|
|
117
|
-
return right;
|
|
118
|
-
}
|
|
119
|
-
switch (space) {
|
|
120
|
-
case ColorInterpolationSpace.HSL:
|
|
121
|
-
return hslToRGB(interpolateHSL(position, rgbToHSL(left), rgbToHSL(right)));
|
|
122
|
-
case ColorInterpolationSpace.HSV:
|
|
123
|
-
return hsvToRGB(interpolateHSV(position, rgbToHSV(left), rgbToHSV(right)));
|
|
124
|
-
case ColorInterpolationSpace.XYZ:
|
|
125
|
-
return xyzToRGB(interpolateXYZ(position, rgbToXYZ(left), rgbToXYZ(right)));
|
|
126
|
-
case ColorInterpolationSpace.LAB:
|
|
127
|
-
return labToRGB(interpolateLAB(position, rgbToLAB(left), rgbToLAB(right)));
|
|
128
|
-
case ColorInterpolationSpace.LCH:
|
|
129
|
-
return lchToRGB(interpolateLCH(position, rgbToLCH(left), rgbToLCH(right)));
|
|
130
|
-
default:
|
|
131
|
-
return interpolateRGB(position, left, right);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { roundToPrecisionSmall } from "./math-utilities.js";
|
|
2
|
-
/**
|
|
3
|
-
* {@link https://en.wikipedia.org/wiki/CIELAB_color_space | CIELAB color space}
|
|
4
|
-
* 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.
|
|
5
|
-
* {@link https://en.wikipedia.org/wiki/Illuminant_D65}
|
|
6
|
-
* These constants determine how the XYZ, LCH and LAB colors convert to/from RGB.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class ColorLAB {
|
|
11
|
-
constructor(l, a, b) {
|
|
12
|
-
this.l = l;
|
|
13
|
-
this.a = a;
|
|
14
|
-
this.b = b;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Construct a {@link ColorLAB} from a config object.
|
|
18
|
-
*/
|
|
19
|
-
static fromObject(data) {
|
|
20
|
-
if (data && !isNaN(data.l) && !isNaN(data.a) && !isNaN(data.b)) {
|
|
21
|
-
return new ColorLAB(data.l, data.a, data.b);
|
|
22
|
-
}
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Determines if a color is equal to another
|
|
27
|
-
* @param rhs - the value to compare
|
|
28
|
-
*/
|
|
29
|
-
equalValue(rhs) {
|
|
30
|
-
return this.l === rhs.l && this.a === rhs.a && this.b === rhs.b;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Returns a new {@link ColorLAB} rounded to the provided precision
|
|
34
|
-
* @param precision - the precision to round to
|
|
35
|
-
*/
|
|
36
|
-
roundToPrecision(precision) {
|
|
37
|
-
return new ColorLAB(roundToPrecisionSmall(this.l, precision), roundToPrecisionSmall(this.a, precision), roundToPrecisionSmall(this.b, precision));
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Returns the {@link ColorLAB} formatted as an object.
|
|
41
|
-
*/
|
|
42
|
-
toObject() {
|
|
43
|
-
return { l: this.l, a: this.a, b: this.b };
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
ColorLAB.epsilon = 216 / 24389;
|
|
47
|
-
ColorLAB.kappa = 24389 / 27;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { roundToPrecisionSmall } from "./math-utilities.js";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* {@link https://en.wikipedia.org/wiki/CIELAB_color_space | CIELCH color space}
|
|
5
|
-
*
|
|
6
|
-
* This is a cylindrical representation of the CIELAB space useful for saturation operations
|
|
7
|
-
* This uses Hue values in "degree" format. So expect a range of [0,360]. Some other implementations instead uses radians or a normalized Hue with range [0,1]. Be aware of this when checking values or using other libraries.
|
|
8
|
-
* 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.
|
|
9
|
-
* {@link https://en.wikipedia.org/wiki/Illuminant_D65}
|
|
10
|
-
* These constants determine how the XYZ, LCH and LAB colors convert to/from RGB.
|
|
11
|
-
*
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export class ColorLCH {
|
|
15
|
-
constructor(l, c, h) {
|
|
16
|
-
this.l = l;
|
|
17
|
-
this.c = c;
|
|
18
|
-
this.h = h;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Construct a {@link ColorLCH} from a config object.
|
|
22
|
-
* @param data - the config object
|
|
23
|
-
*/
|
|
24
|
-
static fromObject(data) {
|
|
25
|
-
if (data && !isNaN(data.l) && !isNaN(data.c) && !isNaN(data.h)) {
|
|
26
|
-
return new ColorLCH(data.l, data.c, data.h);
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Determines if one color is equal to another.
|
|
32
|
-
* @param rhs - the color to compare
|
|
33
|
-
*/
|
|
34
|
-
equalValue(rhs) {
|
|
35
|
-
return this.l === rhs.l && this.c === rhs.c && this.h === rhs.h;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Returns a new {@link ColorLCH} rounded to the provided precision
|
|
39
|
-
* @param precision - the precision to round to
|
|
40
|
-
*/
|
|
41
|
-
roundToPrecision(precision) {
|
|
42
|
-
return new ColorLCH(roundToPrecisionSmall(this.l, precision), roundToPrecisionSmall(this.c, precision), roundToPrecisionSmall(this.h, precision));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Converts the {@link ColorLCH} to a config object.
|
|
46
|
-
*/
|
|
47
|
-
toObject() {
|
|
48
|
-
return { l: this.l, c: this.c, h: this.h };
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { blendMultiply, blendOverlay, saturateViaLCH } from "./color-blending.js";
|
|
2
|
-
import { rgbToHSL } from "./color-converters.js";
|
|
3
|
-
import { ColorInterpolationSpace, interpolateByColorSpace, } from "./color-interpolation.js";
|
|
4
|
-
import { ColorRGBA64 } from "./color-rgba-64.js";
|
|
5
|
-
import { ColorScale } from "./color-scale.js";
|
|
6
|
-
import { parseColorHexRGB } from "./parse-color.js";
|
|
7
|
-
/**
|
|
8
|
-
* Generates a color palette
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export class ColorPalette {
|
|
12
|
-
constructor(config) {
|
|
13
|
-
this.config = Object.assign({}, ColorPalette.defaultPaletteConfig, config);
|
|
14
|
-
this.palette = [];
|
|
15
|
-
this.updatePaletteColors();
|
|
16
|
-
}
|
|
17
|
-
updatePaletteGenerationValues(newConfig) {
|
|
18
|
-
let changed = false;
|
|
19
|
-
for (const key in newConfig) {
|
|
20
|
-
if (this.config[key]) {
|
|
21
|
-
if (this.config[key].equalValue) {
|
|
22
|
-
if (!this.config[key].equalValue(newConfig[key])) {
|
|
23
|
-
this.config[key] = newConfig[key];
|
|
24
|
-
changed = true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
if (newConfig[key] !== this.config[key]) {
|
|
29
|
-
this.config[key] = newConfig[key];
|
|
30
|
-
changed = true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (changed) {
|
|
36
|
-
this.updatePaletteColors();
|
|
37
|
-
}
|
|
38
|
-
return changed;
|
|
39
|
-
}
|
|
40
|
-
updatePaletteColors() {
|
|
41
|
-
const scale = this.generatePaletteColorScale();
|
|
42
|
-
for (let i = 0; i < this.config.steps; i++) {
|
|
43
|
-
this.palette[i] = scale.getColor(i / (this.config.steps - 1), this.config.interpolationMode);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
generatePaletteColorScale() {
|
|
47
|
-
// Even when config.baseScalePosition is specified, using 0.5 for the baseColor
|
|
48
|
-
// in the baseScale gives better results. Otherwise very off-center palettes
|
|
49
|
-
// tend to go completely grey at the end furthest from the specified base color.
|
|
50
|
-
const baseColorHSL = rgbToHSL(this.config.baseColor);
|
|
51
|
-
const baseScale = new ColorScale([
|
|
52
|
-
{ position: 0, color: this.config.scaleColorLight },
|
|
53
|
-
{ position: 0.5, color: this.config.baseColor },
|
|
54
|
-
{ position: 1, color: this.config.scaleColorDark },
|
|
55
|
-
]);
|
|
56
|
-
const trimmedScale = baseScale.trim(this.config.clipLight, 1 - this.config.clipDark);
|
|
57
|
-
const trimmedLight = trimmedScale.getColor(0);
|
|
58
|
-
const trimmedDark = trimmedScale.getColor(1);
|
|
59
|
-
let adjustedLight = trimmedLight;
|
|
60
|
-
let adjustedDark = trimmedDark;
|
|
61
|
-
if (baseColorHSL.s >= this.config.saturationAdjustmentCutoff) {
|
|
62
|
-
adjustedLight = saturateViaLCH(adjustedLight, this.config.saturationLight);
|
|
63
|
-
adjustedDark = saturateViaLCH(adjustedDark, this.config.saturationDark);
|
|
64
|
-
}
|
|
65
|
-
if (this.config.multiplyLight !== 0) {
|
|
66
|
-
const multiply = blendMultiply(this.config.baseColor, adjustedLight);
|
|
67
|
-
adjustedLight = interpolateByColorSpace(this.config.multiplyLight, this.config.interpolationMode, adjustedLight, multiply);
|
|
68
|
-
}
|
|
69
|
-
if (this.config.multiplyDark !== 0) {
|
|
70
|
-
const multiply = blendMultiply(this.config.baseColor, adjustedDark);
|
|
71
|
-
adjustedDark = interpolateByColorSpace(this.config.multiplyDark, this.config.interpolationMode, adjustedDark, multiply);
|
|
72
|
-
}
|
|
73
|
-
if (this.config.overlayLight !== 0) {
|
|
74
|
-
const overlay = blendOverlay(this.config.baseColor, adjustedLight);
|
|
75
|
-
adjustedLight = interpolateByColorSpace(this.config.overlayLight, this.config.interpolationMode, adjustedLight, overlay);
|
|
76
|
-
}
|
|
77
|
-
if (this.config.overlayDark !== 0) {
|
|
78
|
-
const overlay = blendOverlay(this.config.baseColor, adjustedDark);
|
|
79
|
-
adjustedDark = interpolateByColorSpace(this.config.overlayDark, this.config.interpolationMode, adjustedDark, overlay);
|
|
80
|
-
}
|
|
81
|
-
if (this.config.baseScalePosition) {
|
|
82
|
-
if (this.config.baseScalePosition <= 0) {
|
|
83
|
-
return new ColorScale([
|
|
84
|
-
{ position: 0, color: this.config.baseColor },
|
|
85
|
-
{ position: 1, color: adjustedDark.clamp() },
|
|
86
|
-
]);
|
|
87
|
-
}
|
|
88
|
-
else if (this.config.baseScalePosition >= 1) {
|
|
89
|
-
return new ColorScale([
|
|
90
|
-
{ position: 0, color: adjustedLight.clamp() },
|
|
91
|
-
{ position: 1, color: this.config.baseColor },
|
|
92
|
-
]);
|
|
93
|
-
}
|
|
94
|
-
return new ColorScale([
|
|
95
|
-
{ position: 0, color: adjustedLight.clamp() },
|
|
96
|
-
{
|
|
97
|
-
position: this.config.baseScalePosition,
|
|
98
|
-
color: this.config.baseColor,
|
|
99
|
-
},
|
|
100
|
-
{ position: 1, color: adjustedDark.clamp() },
|
|
101
|
-
]);
|
|
102
|
-
}
|
|
103
|
-
return new ColorScale([
|
|
104
|
-
{ position: 0, color: adjustedLight.clamp() },
|
|
105
|
-
{ position: 0.5, color: this.config.baseColor },
|
|
106
|
-
{ position: 1, color: adjustedDark.clamp() },
|
|
107
|
-
]);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
ColorPalette.defaultPaletteConfig = {
|
|
111
|
-
baseColor: parseColorHexRGB("#808080"),
|
|
112
|
-
steps: 11,
|
|
113
|
-
interpolationMode: ColorInterpolationSpace.RGB,
|
|
114
|
-
scaleColorLight: new ColorRGBA64(1, 1, 1, 1),
|
|
115
|
-
scaleColorDark: new ColorRGBA64(0, 0, 0, 1),
|
|
116
|
-
clipLight: 0.185,
|
|
117
|
-
clipDark: 0.16,
|
|
118
|
-
saturationAdjustmentCutoff: 0.05,
|
|
119
|
-
saturationLight: 0.35,
|
|
120
|
-
saturationDark: 1.25,
|
|
121
|
-
overlayLight: 0,
|
|
122
|
-
overlayDark: 0.25,
|
|
123
|
-
multiplyLight: 0,
|
|
124
|
-
multiplyDark: 0,
|
|
125
|
-
baseScalePosition: 0.5,
|
|
126
|
-
};
|
|
127
|
-
ColorPalette.greyscalePaletteConfig = {
|
|
128
|
-
baseColor: parseColorHexRGB("#808080"),
|
|
129
|
-
steps: 11,
|
|
130
|
-
interpolationMode: ColorInterpolationSpace.RGB,
|
|
131
|
-
scaleColorLight: new ColorRGBA64(1, 1, 1, 1),
|
|
132
|
-
scaleColorDark: new ColorRGBA64(0, 0, 0, 1),
|
|
133
|
-
clipLight: 0,
|
|
134
|
-
clipDark: 0,
|
|
135
|
-
saturationAdjustmentCutoff: 0,
|
|
136
|
-
saturationLight: 0,
|
|
137
|
-
saturationDark: 0,
|
|
138
|
-
overlayLight: 0,
|
|
139
|
-
overlayDark: 0,
|
|
140
|
-
multiplyLight: 0,
|
|
141
|
-
multiplyDark: 0,
|
|
142
|
-
baseScalePosition: 0.5,
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Takes the input color and compares it to each color in the reference array to find the index with the closest Lightness value in HSL color space
|
|
146
|
-
* @public
|
|
147
|
-
*/
|
|
148
|
-
export function matchLightnessIndex(input, reference) {
|
|
149
|
-
const hsl = rgbToHSL(input);
|
|
150
|
-
let bestFitValue = Number.MAX_VALUE;
|
|
151
|
-
let bestFitIndex = 0;
|
|
152
|
-
for (let i = 0; i < reference.length; i++) {
|
|
153
|
-
const ihsl = rgbToHSL(reference[i]);
|
|
154
|
-
const fitValue = Math.abs(ihsl.l - hsl.l);
|
|
155
|
-
if (fitValue < bestFitValue) {
|
|
156
|
-
bestFitValue = fitValue;
|
|
157
|
-
bestFitIndex = i;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return bestFitIndex;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Generates a greyscale palette using greyscaleConfig. The Lightness (in HSL) of the input color is then compared to the greyscale palette to determine how far off center the input color should be placed. The output palette is then generated with outputSteps number of steps using colorConfig.
|
|
164
|
-
* @public
|
|
165
|
-
*/
|
|
166
|
-
export function generateOffCenterPalette(input, outputSteps, greyscaleConfig = ColorPalette.greyscalePaletteConfig, colorConfig = ColorPalette.defaultPaletteConfig) {
|
|
167
|
-
const greyscale = new ColorPalette(Object.assign(Object.assign({}, greyscaleConfig), { steps: outputSteps }));
|
|
168
|
-
const scaleIndex = matchLightnessIndex(input, greyscale.palette);
|
|
169
|
-
return new ColorPalette(Object.assign(Object.assign({}, colorConfig), { steps: outputSteps, baseColor: input, baseScalePosition: scaleIndex / (outputSteps - 1) }));
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Take the input array of colors and extrapolates them to a larger palette of size targetSize. If preserveInputColors is false the input colors are evenly distributed into the output. Otherwise, the positions of the input colors are adjusted from a perfectly even distribution in order to ensure that the exact color values appearing in the input array also appear in the output array. The larger targetSize is compared to input.length the smaller those adjustments will be.
|
|
173
|
-
*
|
|
174
|
-
* @public
|
|
175
|
-
*/
|
|
176
|
-
export function rescale(input, targetSize, preserveInputColors) {
|
|
177
|
-
if (input.length <= 1 || targetSize <= 1) {
|
|
178
|
-
throw new Error("The input array and targetSize must both be greater than 1");
|
|
179
|
-
}
|
|
180
|
-
if (preserveInputColors && targetSize <= input.length) {
|
|
181
|
-
throw new Error("If preserveInputColors is true then targetSize must be greater than the length of the input array");
|
|
182
|
-
}
|
|
183
|
-
const stops = new Array(input.length);
|
|
184
|
-
if (preserveInputColors) {
|
|
185
|
-
for (let i = 0; i < input.length; i++) {
|
|
186
|
-
const p = i / (input.length - 1);
|
|
187
|
-
let bestFitValue = 2;
|
|
188
|
-
let bestFitIndex = 0;
|
|
189
|
-
for (let j = 0; j < targetSize; j++) {
|
|
190
|
-
const fitValue = Math.abs(j / (targetSize - 1) - p);
|
|
191
|
-
if (fitValue < bestFitValue) {
|
|
192
|
-
bestFitValue = fitValue;
|
|
193
|
-
bestFitIndex = j;
|
|
194
|
-
}
|
|
195
|
-
if (fitValue === 0) {
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
stops[i] = {
|
|
200
|
-
color: input[i],
|
|
201
|
-
position: bestFitIndex / (targetSize - 1),
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
for (let i = 0; i < stops.length; i++) {
|
|
207
|
-
stops[i] = { color: input[i], position: i / (input.length - 1) };
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
const scale = new ColorScale(stops);
|
|
211
|
-
const retVal = new Array(targetSize);
|
|
212
|
-
for (let i = 0; i < targetSize; i++) {
|
|
213
|
-
retVal[i] = scale.getColor(i / (targetSize - 1));
|
|
214
|
-
}
|
|
215
|
-
return retVal;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* @public
|
|
219
|
-
*/
|
|
220
|
-
export const defaultCenteredRescaleConfig = {
|
|
221
|
-
targetSize: 63,
|
|
222
|
-
spacing: 4,
|
|
223
|
-
scaleColorLight: ColorPalette.defaultPaletteConfig.scaleColorLight,
|
|
224
|
-
scaleColorDark: ColorPalette.defaultPaletteConfig.scaleColorDark,
|
|
225
|
-
};
|
|
226
|
-
/**
|
|
227
|
-
* Takes an input array of colors and extrapolates them to a larger palette. The mapping first takes the input array and extrapolates between each color so that they are separated by spacing-1 slots. Then it adds to either end enough new colors to make up the desired targetSize. All output color slots between the defined stops are interpolated.
|
|
228
|
-
* @example
|
|
229
|
-
* For an input array with length 5, a targetSize of 17 and spacing of 3 the output would be:
|
|
230
|
-
* 0: scaleColorLight
|
|
231
|
-
* 1:
|
|
232
|
-
* 2: input 0
|
|
233
|
-
* 3:
|
|
234
|
-
* 4:
|
|
235
|
-
* 5: input 1
|
|
236
|
-
* 6:
|
|
237
|
-
* 7:
|
|
238
|
-
* 8: input 2
|
|
239
|
-
* 9:
|
|
240
|
-
* 10:
|
|
241
|
-
* 11: input 3
|
|
242
|
-
* 12:
|
|
243
|
-
* 13:
|
|
244
|
-
* 14: input 4
|
|
245
|
-
* 15:
|
|
246
|
-
* 16: scaleColorDark
|
|
247
|
-
*
|
|
248
|
-
* @public
|
|
249
|
-
*/
|
|
250
|
-
export function centeredRescale(input, config = defaultCenteredRescaleConfig) {
|
|
251
|
-
if (input.length === 0) {
|
|
252
|
-
return [];
|
|
253
|
-
}
|
|
254
|
-
const offset = Math.floor((config.targetSize - ((input.length - 1) * config.spacing + 1)) / 2);
|
|
255
|
-
if (offset < 0) {
|
|
256
|
-
throw new Error("(targetSize - ((input.length - 1) * spacing + 1)) / 2 must be >= 0");
|
|
257
|
-
}
|
|
258
|
-
const stops = new Array(input.length + 2);
|
|
259
|
-
stops[0] = { position: 0, color: config.scaleColorLight };
|
|
260
|
-
stops[stops.length - 1] = {
|
|
261
|
-
position: 1,
|
|
262
|
-
color: config.scaleColorDark,
|
|
263
|
-
};
|
|
264
|
-
for (let i = 0; i < input.length; i++) {
|
|
265
|
-
stops[i + 1] = {
|
|
266
|
-
color: input[i],
|
|
267
|
-
position: (i * config.spacing + offset) / (config.targetSize - 1),
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
const scale = new ColorScale(stops);
|
|
271
|
-
const retVal = new Array(config.targetSize);
|
|
272
|
-
for (let i = 0; i < config.targetSize; i++) {
|
|
273
|
-
retVal[i] = scale.getColor(i / (config.targetSize - 1));
|
|
274
|
-
}
|
|
275
|
-
return retVal;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Generates two palettes of length shortPaletteLength and longPaletteLength from a base color. The base color is compared to the default greyscale palette to determine where it should be placed. The short palette is then fed into centeredRescale to create the long palette. The colors in the short palette are always contained within the long.
|
|
279
|
-
* @public
|
|
280
|
-
*/
|
|
281
|
-
export function generateScaledPalettes(input, shortPaletteLength = 11, config = defaultCenteredRescaleConfig) {
|
|
282
|
-
const shortPalette = generateOffCenterPalette(input, shortPaletteLength);
|
|
283
|
-
const longPalette = centeredRescale(shortPalette.palette, config);
|
|
284
|
-
return { short: shortPalette.palette, long: longPalette };
|
|
285
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { Histogram } from "./histogram.js";
|
|
2
|
-
import { insertIntoSortedList, PixelBox } from "./pixel-box.js";
|
|
3
|
-
function countValidBoxes(queue, isBoxValid) {
|
|
4
|
-
if (isBoxValid === null) {
|
|
5
|
-
return queue.length;
|
|
6
|
-
}
|
|
7
|
-
let retVal = 0;
|
|
8
|
-
for (let i = 0; i < queue.length; i++) {
|
|
9
|
-
if (isBoxValid(queue[i])) {
|
|
10
|
-
retVal++;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return retVal;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The default quantize configuration.
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export const defaultQuantizeConfig = {
|
|
20
|
-
significantBits: 5,
|
|
21
|
-
pixelSkipping: 5,
|
|
22
|
-
targetPaletteSize: 64,
|
|
23
|
-
fractionByPopulation: 0.85,
|
|
24
|
-
isBoxValid: (box) => {
|
|
25
|
-
if (box.pixelCount < 5) {
|
|
26
|
-
// Screen out outlier results that aren't present in the original image
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
},
|
|
31
|
-
isHistogramPixelValid: (pixel) => {
|
|
32
|
-
if (pixel[3] < 128) {
|
|
33
|
-
// Ignore pixels that are too transparent
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
},
|
|
38
|
-
maxIterations: 1000,
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* The data in the color histogram is reduced down to a small set of colors.
|
|
42
|
-
* It can be useful to create the Histogram manually in cases where one wants to remove or alter the colors in it
|
|
43
|
-
* or to re-use it in order to quantize multiple times with different config settings.
|
|
44
|
-
* Based on the Modified Median Cut Quantization implementation from https://github.com/DanBloomberg/leptonica/blob/master/src/colorquant2.c
|
|
45
|
-
*
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
export function quantizeHistogram(histogram, config = defaultQuantizeConfig) {
|
|
49
|
-
const initialBox = new PixelBox(histogram, histogram.minRed, histogram.maxRed, histogram.minGreen, histogram.maxGreen, histogram.minBlue, histogram.maxBlue);
|
|
50
|
-
const queue = [initialBox];
|
|
51
|
-
let count = countValidBoxes(queue, config.isBoxValid);
|
|
52
|
-
// For a final palette of size targetPaletteSize, we determine the first fractionByPopulation*targetPaletteSize
|
|
53
|
-
// using population as the only factor when determening sort order. For the rest of the colors the
|
|
54
|
-
// sort order is population * colorVolume. This helps highly contrasting colors in a small area to show
|
|
55
|
-
// up in some of the final output.
|
|
56
|
-
const colorsByPopulation = Math.floor(config.targetPaletteSize * config.fractionByPopulation);
|
|
57
|
-
const popSort = (box) => {
|
|
58
|
-
return box.pixelCount;
|
|
59
|
-
};
|
|
60
|
-
let iterationCount = 0;
|
|
61
|
-
while (iterationCount <= config.maxIterations) {
|
|
62
|
-
if (queue.length > 0) {
|
|
63
|
-
const currentBox = queue.shift();
|
|
64
|
-
const cutBoxes = currentBox.modifiedMedianCut();
|
|
65
|
-
if (cutBoxes[0] !== null) {
|
|
66
|
-
insertIntoSortedList(queue, cutBoxes[0], popSort);
|
|
67
|
-
}
|
|
68
|
-
if (cutBoxes[1] !== null) {
|
|
69
|
-
insertIntoSortedList(queue, cutBoxes[1], popSort);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
count = countValidBoxes(queue, config.isBoxValid);
|
|
73
|
-
if (count >= colorsByPopulation || queue.length <= 1) {
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
iterationCount++;
|
|
77
|
-
}
|
|
78
|
-
if (count < config.targetPaletteSize) {
|
|
79
|
-
const popAndVolumeSort = (box) => {
|
|
80
|
-
return box.pixelCount * box.colorVolume;
|
|
81
|
-
};
|
|
82
|
-
queue.sort((a, b) => {
|
|
83
|
-
const aSort = popAndVolumeSort(a);
|
|
84
|
-
const bSort = popAndVolumeSort(b);
|
|
85
|
-
if (aSort === bSort) {
|
|
86
|
-
return 0;
|
|
87
|
-
}
|
|
88
|
-
else if (aSort > bSort) {
|
|
89
|
-
return -1;
|
|
90
|
-
}
|
|
91
|
-
return 1;
|
|
92
|
-
});
|
|
93
|
-
iterationCount = 0;
|
|
94
|
-
while (iterationCount <= config.maxIterations) {
|
|
95
|
-
if (queue.length > 0) {
|
|
96
|
-
const currentBox = queue.shift();
|
|
97
|
-
const cutBoxes = currentBox.modifiedMedianCut();
|
|
98
|
-
if (cutBoxes[0] !== null) {
|
|
99
|
-
insertIntoSortedList(queue, cutBoxes[0], popAndVolumeSort);
|
|
100
|
-
}
|
|
101
|
-
if (cutBoxes[1] !== null) {
|
|
102
|
-
insertIntoSortedList(queue, cutBoxes[1], popAndVolumeSort);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
count = countValidBoxes(queue, config.isBoxValid);
|
|
106
|
-
if (count >= config.targetPaletteSize || queue.length <= 1) {
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
iterationCount++;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
const retVal = new Array(count);
|
|
113
|
-
let index = 0;
|
|
114
|
-
for (let i = 0; i < queue.length; i++) {
|
|
115
|
-
if (!config.isBoxValid || config.isBoxValid(queue[i])) {
|
|
116
|
-
retVal[index] = {
|
|
117
|
-
color: queue[i].averageColor,
|
|
118
|
-
pixelCount: queue[i].pixelCount,
|
|
119
|
-
colorVolume: queue[i].colorVolume,
|
|
120
|
-
};
|
|
121
|
-
index++;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return retVal;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* The image stored in the source PixelBlob is reduced down to a small set of colors.
|
|
128
|
-
* Based on the Modified Median Cut Quantization implementation from https://github.com/DanBloomberg/leptonica/blob/master/src/colorquant2.c
|
|
129
|
-
*
|
|
130
|
-
* @public
|
|
131
|
-
*/
|
|
132
|
-
export function quantize(source, config = defaultQuantizeConfig) {
|
|
133
|
-
const histogram = new Histogram(source, config.significantBits, config.pixelSkipping, config.isHistogramPixelValid);
|
|
134
|
-
return quantizeHistogram(histogram, config);
|
|
135
|
-
}
|