@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.
Files changed (364) hide show
  1. package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.iife.min.js +217 -0
  2. package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.js +28286 -0
  3. package/dist/bundled/@microsoft/fast-components@2.30.6/dist/fast-components.min.js +217 -0
  4. package/dist/bundled/bootstrap/css/bootstrap.css +688 -0
  5. package/dist/bundled/bootstrap5/css/bootstrap-grid.css +4226 -0
  6. package/dist/bundled/bootstrap5/css/bootstrap-grid.min.css +6 -0
  7. package/dist/bundled/bootstrap5/css/bootstrap-grid.rtl.css +4225 -0
  8. package/dist/bundled/bootstrap5/css/bootstrap-grid.rtl.min.css +6 -0
  9. package/dist/bundled/bootstrap5/css/bootstrap-reboot.css +591 -0
  10. package/dist/bundled/bootstrap5/css/bootstrap-reboot.min.css +6 -0
  11. package/dist/bundled/bootstrap5/css/bootstrap-reboot.rtl.css +588 -0
  12. package/dist/bundled/bootstrap5/css/bootstrap-reboot.rtl.min.css +6 -0
  13. package/dist/bundled/bootstrap5/css/bootstrap-utilities.css +5099 -0
  14. package/dist/bundled/bootstrap5/css/bootstrap-utilities.min.css +6 -0
  15. package/dist/bundled/bootstrap5/css/bootstrap-utilities.rtl.css +5090 -0
  16. package/dist/bundled/bootstrap5/css/bootstrap-utilities.rtl.min.css +6 -0
  17. package/dist/bundled/bootstrap5/css/bootstrap.css +11783 -0
  18. package/dist/bundled/bootstrap5/css/bootstrap.min.css +6 -0
  19. package/dist/bundled/bootstrap5/css/bootstrap.rtl.css +11747 -0
  20. package/dist/bundled/bootstrap5/css/bootstrap.rtl.min.css +6 -0
  21. package/dist/bundled/bootstrap5/js/bootstrap.bundle.js +6295 -0
  22. package/dist/bundled/bootstrap5/js/bootstrap.bundle.js.map +1 -0
  23. package/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +7 -0
  24. package/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js.map +1 -0
  25. package/dist/bundled/bootstrap5/js/bootstrap.esm.js +4422 -0
  26. package/dist/bundled/bootstrap5/js/bootstrap.esm.js.map +1 -0
  27. package/dist/bundled/bootstrap5/js/bootstrap.esm.min.js +7 -0
  28. package/dist/bundled/bootstrap5/js/bootstrap.esm.min.js.map +1 -0
  29. package/dist/bundled/bootstrap5/js/bootstrap.js +4468 -0
  30. package/dist/bundled/bootstrap5/js/bootstrap.js.map +1 -0
  31. package/dist/bundled/bootstrap5/js/bootstrap.min.js +7 -0
  32. package/dist/bundled/bootstrap5/js/bootstrap.min.js.map +1 -0
  33. package/dist/bundled/bootstrapdarktheme/bootstrap_dark.css +170 -0
  34. package/dist/bundled/bootstrapdefaulttheme/bootstrap_default.css +120 -0
  35. package/dist/bundled/bootstraptemplate/bootstrap.css +119 -77
  36. package/dist/bundled/darktheme/dark.css +33 -106
  37. package/dist/bundled/datatabulator/luxon/build/global/luxon.min.js.map +1 -1
  38. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator.min.css +2 -0
  39. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_bootstrap3.min.css +2 -0
  40. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_bootstrap4.min.css +2 -0
  41. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_bulma.min.css +2 -0
  42. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_fast.min.css +1 -0
  43. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_materialize.min.css +2 -0
  44. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_midnight.min.css +2 -0
  45. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_modern.min.css +2 -0
  46. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_semanticui.min.css +2 -0
  47. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_simple.min.css +2 -0
  48. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/css/tabulator_site.min.css +2 -0
  49. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/js/tabulator.js +26077 -0
  50. package/dist/bundled/datatabulator/tabulator-tables@5.4.4/dist/js/tabulator.js.map +1 -0
  51. package/dist/bundled/defaulttheme/default.css +33 -2
  52. package/dist/bundled/fast/css/fast.css +919 -0
  53. package/dist/bundled/fast/js/fast_design.js +87 -0
  54. package/dist/bundled/fastbasetemplate/fast.css +335 -0
  55. package/dist/bundled/fastgridtemplate/fast_grid_template.css +256 -232
  56. package/dist/bundled/golden-layout@1.5.9/dist/css/goldenlayout-base.css +1 -0
  57. package/dist/bundled/golden-layout@1.5.9/dist/css/theme/goldenlayout-dark-theme.css +1 -0
  58. package/dist/bundled/goldentemplate/golden.css +2 -22
  59. package/dist/bundled/material/css/material.css +443 -0
  60. package/dist/bundled/materialtemplate/dark.css +2 -20
  61. package/dist/bundled/materialtemplate/default.css +2 -17
  62. package/dist/bundled/materialtemplate/material.css +119 -114
  63. package/dist/bundled/materialthememixin/material_variables.css +19 -0
  64. package/dist/bundled/native/css/native.css +34 -0
  65. package/dist/bundled/notificationarea/panel/1.0.0-a.2/dist/bundled/font-awesome/css/all.min.css +2 -0
  66. package/dist/bundled/panel/1.0.0-a.2/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
  67. package/dist/bundled/panel/1.0.0-a.2/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
  68. package/dist/bundled/panel/1.0.0-a.2/dist/bundled/font-awesome/css/all.min.css +2 -0
  69. package/dist/bundled/panel/1.0.0-a.2/dist/bundled/jquery/jquery.slim.min.js +2 -0
  70. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/fonts.css +1 -0
  71. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/material-dark.css +1 -0
  72. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/material.css +1 -0
  73. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/monokai.css +1 -0
  74. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/solarized-dark.css +1 -0
  75. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/solarized.css +1 -0
  76. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/themes.css +1 -0
  77. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/vaporwave.css +1 -0
  78. package/dist/bundled/perspective/@finos/perspective-viewer@1.9.3/dist/css/variables.css +0 -0
  79. package/dist/bundled/plotlyplot/panel/1.0.0-a.2/dist/bundled/jquery/jquery.slim.min.js +2 -0
  80. package/dist/bundled/react-dom@17/umd/react-dom.production.min.js +245 -0
  81. package/dist/bundled/react@17/umd/react.production.min.js +31 -0
  82. package/dist/bundled/reacttemplate/react.css +0 -12
  83. package/dist/bundled/vanillatemplate/vanilla.css +129 -134
  84. package/dist/css/alerts.css +64 -64
  85. package/dist/css/booleanstatus.css +48 -0
  86. package/dist/css/card.css +55 -39
  87. package/dist/css/dataframe.css +7 -2
  88. package/dist/css/debugger.css +16 -10
  89. package/dist/css/divider.css +10 -0
  90. package/dist/css/editable_slider.css +22 -0
  91. package/dist/css/katex.css +3 -0
  92. package/dist/css/loading.css +5 -6
  93. package/dist/css/loadingspinner.css +119 -0
  94. package/dist/css/markdown.css +2 -1
  95. package/dist/css/perspective-datatable.css +504 -0
  96. package/dist/css/plotly.css +246 -0
  97. package/dist/css/progress.css +209 -0
  98. package/dist/css/widgetbox.css +9 -0
  99. package/dist/css/widgets.css +0 -305
  100. package/dist/dts/styles/alerts.css.d.ts +3 -0
  101. package/dist/dts/styles/booleanstatus.css.d.ts +3 -0
  102. package/dist/dts/styles/card.css.d.ts +3 -0
  103. package/dist/dts/styles/dataframe.css.d.ts +3 -0
  104. package/dist/dts/styles/debugger.css.d.ts +3 -0
  105. package/dist/dts/styles/divider.css.d.ts +4 -0
  106. package/dist/dts/styles/editable_slider.css.d.ts +8 -0
  107. package/dist/dts/styles/json.css.d.ts +3 -0
  108. package/dist/dts/styles/katex.css.d.ts +3 -0
  109. package/dist/dts/styles/loading.css.d.ts +3 -0
  110. package/dist/dts/styles/loadingspinner.css.d.ts +3 -0
  111. package/dist/dts/styles/markdown.css.d.ts +3 -0
  112. package/dist/dts/styles/perspective-datatable.css.d.ts +3 -0
  113. package/dist/dts/styles/plotly.css.d.ts +3 -0
  114. package/dist/dts/styles/progress.css.d.ts +3 -0
  115. package/dist/dts/styles/widgetbox.css.d.ts +3 -0
  116. package/dist/dts/styles/widgets.css.d.ts +4 -0
  117. package/dist/lib/models/ace.d.ts +3 -5
  118. package/dist/lib/models/ace.js +24 -23
  119. package/dist/lib/models/ace.js.map +1 -1
  120. package/dist/lib/models/audio.d.ts +2 -4
  121. package/dist/lib/models/audio.js +18 -18
  122. package/dist/lib/models/audio.js.map +1 -1
  123. package/dist/lib/models/card.d.ts +3 -3
  124. package/dist/lib/models/card.js +54 -63
  125. package/dist/lib/models/card.js.map +1 -1
  126. package/dist/lib/models/comm_manager.d.ts +2 -2
  127. package/dist/lib/models/comm_manager.js +20 -19
  128. package/dist/lib/models/comm_manager.js.map +1 -1
  129. package/dist/lib/models/data.js +1 -1
  130. package/dist/lib/models/data.js.map +1 -1
  131. package/dist/lib/models/datetime_picker.d.ts +8 -7
  132. package/dist/lib/models/datetime_picker.js +130 -36
  133. package/dist/lib/models/datetime_picker.js.map +1 -1
  134. package/dist/lib/models/deckgl.d.ts +2 -4
  135. package/dist/lib/models/deckgl.js +24 -25
  136. package/dist/lib/models/deckgl.js.map +1 -1
  137. package/dist/lib/models/echarts.d.ts +3 -2
  138. package/dist/lib/models/echarts.js +22 -12
  139. package/dist/lib/models/echarts.js.map +1 -1
  140. package/dist/lib/models/file_download.d.ts +2 -2
  141. package/dist/lib/models/file_download.js +20 -19
  142. package/dist/lib/models/file_download.js.map +1 -1
  143. package/dist/lib/models/html.d.ts +4 -4
  144. package/dist/lib/models/html.js +23 -17
  145. package/dist/lib/models/html.js.map +1 -1
  146. package/dist/lib/models/index.d.ts +1 -2
  147. package/dist/lib/models/index.js +1 -2
  148. package/dist/lib/models/index.js.map +1 -1
  149. package/dist/lib/models/ipywidget.d.ts +2 -6
  150. package/dist/lib/models/ipywidget.js +14 -24
  151. package/dist/lib/models/ipywidget.js.map +1 -1
  152. package/dist/lib/models/json.d.ts +1 -1
  153. package/dist/lib/models/json.js +14 -12
  154. package/dist/lib/models/json.js.map +1 -1
  155. package/dist/lib/models/jsoneditor.d.ts +8 -7
  156. package/dist/lib/models/jsoneditor.js +30 -19
  157. package/dist/lib/models/jsoneditor.js.map +1 -1
  158. package/dist/lib/models/katex.d.ts +0 -1
  159. package/dist/lib/models/katex.js +7 -6
  160. package/dist/lib/models/katex.js.map +1 -1
  161. package/dist/lib/models/layout.d.ts +25 -22
  162. package/dist/lib/models/layout.js +75 -81
  163. package/dist/lib/models/layout.js.map +1 -1
  164. package/dist/lib/models/location.d.ts +0 -1
  165. package/dist/lib/models/location.js +15 -14
  166. package/dist/lib/models/location.js.map +1 -1
  167. package/dist/lib/models/mathjax.d.ts +0 -3
  168. package/dist/lib/models/mathjax.js +6 -16
  169. package/dist/lib/models/mathjax.js.map +1 -1
  170. package/dist/lib/models/pdf.d.ts +24 -0
  171. package/dist/lib/models/pdf.js +62 -0
  172. package/dist/lib/models/pdf.js.map +1 -0
  173. package/dist/lib/models/perspective.d.ts +5 -10
  174. package/dist/lib/models/perspective.js +75 -87
  175. package/dist/lib/models/perspective.js.map +1 -1
  176. package/dist/lib/models/player.d.ts +0 -1
  177. package/dist/lib/models/player.js +18 -17
  178. package/dist/lib/models/player.js.map +1 -1
  179. package/dist/lib/models/plotly.d.ts +3 -7
  180. package/dist/lib/models/plotly.js +60 -67
  181. package/dist/lib/models/plotly.js.map +1 -1
  182. package/dist/lib/models/progress.d.ts +4 -7
  183. package/dist/lib/models/progress.js +28 -32
  184. package/dist/lib/models/progress.js.map +1 -1
  185. package/dist/lib/models/quill.d.ts +3 -6
  186. package/dist/lib/models/quill.js +25 -24
  187. package/dist/lib/models/quill.js.map +1 -1
  188. package/dist/lib/models/reactive_html.d.ts +6 -12
  189. package/dist/lib/models/reactive_html.js +45 -121
  190. package/dist/lib/models/reactive_html.js.map +1 -1
  191. package/dist/lib/models/singleselect.d.ts +0 -1
  192. package/dist/lib/models/singleselect.js +11 -10
  193. package/dist/lib/models/singleselect.js.map +1 -1
  194. package/dist/lib/models/speech_to_text.d.ts +1 -2
  195. package/dist/lib/models/speech_to_text.js +27 -26
  196. package/dist/lib/models/speech_to_text.js.map +1 -1
  197. package/dist/lib/models/state.d.ts +0 -2
  198. package/dist/lib/models/state.js +12 -13
  199. package/dist/lib/models/state.js.map +1 -1
  200. package/dist/lib/models/tabulator.d.ts +9 -16
  201. package/dist/lib/models/tabulator.js +111 -196
  202. package/dist/lib/models/tabulator.js.map +1 -1
  203. package/dist/lib/models/terminal.d.ts +5 -8
  204. package/dist/lib/models/terminal.js +23 -27
  205. package/dist/lib/models/terminal.js.map +1 -1
  206. package/dist/lib/models/text_to_speech.d.ts +1 -2
  207. package/dist/lib/models/text_to_speech.js +16 -15
  208. package/dist/lib/models/text_to_speech.js.map +1 -1
  209. package/dist/lib/models/trend.d.ts +1 -2
  210. package/dist/lib/models/trend.js +24 -23
  211. package/dist/lib/models/trend.js.map +1 -1
  212. package/dist/lib/models/vega.d.ts +6 -7
  213. package/dist/lib/models/vega.js +34 -37
  214. package/dist/lib/models/vega.js.map +1 -1
  215. package/dist/lib/models/video.d.ts +2 -4
  216. package/dist/lib/models/video.js +18 -18
  217. package/dist/lib/models/video.js.map +1 -1
  218. package/dist/lib/models/videostream.d.ts +2 -4
  219. package/dist/lib/models/videostream.js +19 -19
  220. package/dist/lib/models/videostream.js.map +1 -1
  221. package/dist/lib/models/vtk/util.d.ts +4 -4
  222. package/dist/lib/models/vtk/vtkaxes.d.ts +1 -2
  223. package/dist/lib/models/vtk/vtkaxes.js +15 -14
  224. package/dist/lib/models/vtk/vtkaxes.js.map +1 -1
  225. package/dist/lib/models/vtk/vtkjs.d.ts +0 -1
  226. package/dist/lib/models/vtk/vtkjs.js +9 -8
  227. package/dist/lib/models/vtk/vtkjs.js.map +1 -1
  228. package/dist/lib/models/vtk/vtklayout.d.ts +2 -5
  229. package/dist/lib/models/vtk/vtklayout.js +24 -30
  230. package/dist/lib/models/vtk/vtklayout.js.map +1 -1
  231. package/dist/lib/models/vtk/vtksynchronized.d.ts +0 -1
  232. package/dist/lib/models/vtk/vtksynchronized.js +17 -16
  233. package/dist/lib/models/vtk/vtksynchronized.js.map +1 -1
  234. package/dist/lib/models/vtk/vtkvolume.d.ts +0 -1
  235. package/dist/lib/models/vtk/vtkvolume.js +27 -26
  236. package/dist/lib/models/vtk/vtkvolume.js.map +1 -1
  237. package/dist/lib/styles/alerts.css.d.ts +1 -2
  238. package/dist/lib/styles/alerts.css.js +1 -139
  239. package/dist/lib/styles/booleanstatus.css.d.ts +1 -0
  240. package/dist/lib/styles/booleanstatus.css.js +1 -0
  241. package/dist/lib/styles/card.css.d.ts +1 -2
  242. package/dist/lib/styles/card.css.js +1 -43
  243. package/dist/lib/styles/dataframe.css.d.ts +1 -2
  244. package/dist/lib/styles/dataframe.css.js +1 -44
  245. package/dist/lib/styles/debugger.css.d.ts +1 -2
  246. package/dist/lib/styles/debugger.css.js +1 -68
  247. package/dist/lib/styles/divider.css.d.ts +2 -0
  248. package/dist/lib/styles/divider.css.js +2 -0
  249. package/dist/lib/styles/editable_slider.css.d.ts +6 -0
  250. package/dist/lib/styles/editable_slider.css.js +6 -0
  251. package/dist/lib/styles/json.css.d.ts +1 -2
  252. package/dist/lib/styles/json.css.js +1 -197
  253. package/dist/lib/styles/katex.css.d.ts +1 -0
  254. package/dist/lib/styles/katex.css.js +1 -0
  255. package/dist/lib/styles/loading.css.d.ts +1 -2
  256. package/dist/lib/styles/loading.css.js +1 -31
  257. package/dist/lib/styles/loadingspinner.css.d.ts +1 -0
  258. package/dist/lib/styles/loadingspinner.css.js +17 -0
  259. package/dist/lib/styles/markdown.css.d.ts +1 -2
  260. package/dist/lib/styles/markdown.css.js +1 -91
  261. package/dist/lib/styles/perspective-datatable.css.d.ts +1 -0
  262. package/dist/lib/styles/perspective-datatable.css.js +1 -0
  263. package/dist/lib/styles/plotly.css.d.ts +1 -0
  264. package/dist/lib/styles/plotly.css.js +1 -0
  265. package/dist/lib/styles/progress.css.d.ts +1 -0
  266. package/dist/lib/styles/progress.css.js +22 -0
  267. package/dist/lib/styles/widgetbox.css.d.ts +1 -0
  268. package/dist/lib/styles/widgetbox.css.js +1 -0
  269. package/dist/lib/styles/widgets.css.d.ts +2 -2
  270. package/dist/lib/styles/widgets.css.js +2 -320
  271. package/dist/panel.js +4648 -6067
  272. package/dist/panel.js.map +1 -1
  273. package/dist/panel.json +1 -1
  274. package/dist/panel.min.js +65 -102
  275. package/dist/wheels/bokeh-3.1.0rc1-py3-none-any.whl +0 -0
  276. package/dist/wheels/{panel-0.14.4-py3-none-any.whl → panel-1.0.0a2-py3-none-any.whl} +0 -0
  277. package/package.json +5 -4
  278. package/dist/bundled/bootstraptemplate/dark.css +0 -19
  279. package/dist/bundled/css/golden-layout@1.5.9/src/css/goldenlayout-base.css +0 -1
  280. package/dist/bundled/css/panel/0.14.4/dist/bundled/bootstrap4/css/bootstrap.min.css +0 -2
  281. package/dist/bundled/css/panel/0.14.4/dist/bundled/font-awesome/css/all.min.css +0 -2
  282. 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
  283. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/fast/tabulator_fast.min.css +0 -1
  284. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator.min.css +0 -2
  285. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_bootstrap3.min.css +0 -2
  286. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_bootstrap4.min.css +0 -2
  287. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_bulma.min.css +0 -2
  288. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_materialize.min.css +0 -2
  289. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_midnight.min.css +0 -2
  290. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_modern.min.css +0 -2
  291. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_semanticui.min.css +0 -2
  292. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_simple.min.css +0 -2
  293. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/css/tabulator_site.min.css +0 -2
  294. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/js/tabulator.js +0 -27481
  295. package/dist/bundled/datatabulator/tabulator-tables@5.3.2/dist/js/tabulator.js.map +0 -1
  296. package/dist/bundled/fastbasetemplate/fast_awesome.css +0 -13
  297. package/dist/bundled/fastbasetemplate/fast_bokeh.css +0 -1646
  298. package/dist/bundled/fastbasetemplate/fast_bokeh_slickgrid.css +0 -200
  299. package/dist/bundled/fastbasetemplate/fast_panel.css +0 -53
  300. package/dist/bundled/fastbasetemplate/fast_panel_dataframe.css +0 -14
  301. package/dist/bundled/fastbasetemplate/fast_panel_markdown.css +0 -23
  302. package/dist/bundled/fastbasetemplate/fast_panel_widgets.css +0 -301
  303. package/dist/bundled/fastbasetemplate/fast_root.css +0 -41
  304. package/dist/bundled/fastdarktheme/fast_root_dark.css +0 -4
  305. package/dist/bundled/fastdefaulttheme/fast_root_default.css +0 -4
  306. package/dist/bundled/fastgridtemplate/dark.css +0 -26
  307. package/dist/bundled/fastgridtemplate/default.css +0 -4
  308. package/dist/bundled/fastlisttemplate/dark.css +0 -13
  309. package/dist/bundled/fastlisttemplate/default.css +0 -1
  310. package/dist/bundled/fastlisttemplate/fast_list_template.css +0 -237
  311. package/dist/bundled/goldentemplate/dark.css +0 -26
  312. package/dist/bundled/goldentemplate/default.css +0 -23
  313. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/array-pixel-blob.js +0 -39
  314. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-blending.js +0 -270
  315. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-converters.js +0 -524
  316. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsl.js +0 -42
  317. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsv.js +0 -42
  318. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-interpolation.js +0 -133
  319. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lab.js +0 -47
  320. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lch.js +0 -50
  321. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-palette.js +0 -285
  322. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-quantization.js +0 -135
  323. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-rgba-64.js +0 -95
  324. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-scale.js +0 -176
  325. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-xyz.js +0 -50
  326. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/component-state-color-palette.js +0 -113
  327. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/histogram.js +0 -76
  328. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/index.js +0 -19
  329. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/math-utilities.js +0 -138
  330. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/named-colors.js +0 -743
  331. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/palette-extractor.js +0 -134
  332. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/parse-color.js +0 -219
  333. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-blob.js +0 -72
  334. package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-box.js +0 -249
  335. package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/harness.js +0 -33
  336. package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/server.js +0 -36
  337. package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.iife.min.js +0 -19
  338. package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.js +0 -25813
  339. package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.min.js +0 -19
  340. package/dist/bundled/js/panel/0.14.4/dist/bundled/bootstrap4/js/bootstrap.bundle.min.js +0 -2
  341. package/dist/bundled/js/panel/0.14.4/dist/bundled/jquery/jquery.slim.min.js +0 -2
  342. package/dist/bundled/js/react-dom@18/umd/react-dom.production.min.js +0 -267
  343. package/dist/bundled/js/react@18/umd/react.production.min.js +0 -31
  344. package/dist/bundled/notificationarea/panel/0.14.4/dist/bundled/font-awesome/css/all.min.css +0 -2
  345. package/dist/bundled/plotlyplot/panel/0.14.4/dist/bundled/jquery/jquery.slim.min.js +0 -2
  346. package/dist/bundled/reacttemplate/dark.css +0 -18
  347. package/dist/bundled/reacttemplate/default.css +0 -12
  348. package/dist/bundled/theme/dark.css +0 -107
  349. package/dist/bundled/theme/default.css +0 -3
  350. package/dist/bundled/vanillatemplate/default.css +0 -8
  351. package/dist/idom/package.json +0 -38
  352. package/dist/lib/models/idom.d.ts +0 -36
  353. package/dist/lib/models/idom.js +0 -239
  354. package/dist/lib/models/idom.js.map +0 -1
  355. package/dist/lib/models/tabs.d.ts +0 -24
  356. package/dist/lib/models/tabs.js +0 -231
  357. package/dist/lib/models/tabs.js.map +0 -1
  358. package/dist/wheels/bokeh-2.4.3-py3-none-any.whl +0 -0
  359. /package/dist/bundled/{js/babel-standalone@latest → babel-standalone@latest}/babel.min.js +0 -0
  360. /package/dist/bundled/{js/golden-layout@1.5.9 → golden-layout@1.5.9}/dist/goldenlayout.min.js +0 -0
  361. /package/dist/bundled/{css/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.css +0 -0
  362. /package/dist/bundled/{js/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.js +0 -0
  363. /package/dist/bundled/{js/react-grid-layout@1.3.4 → react-grid-layout@1.3.4}/dist/react-grid-layout.min.js +0 -0
  364. /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,134 +0,0 @@
1
- import { rgbToHSL } from "./color-converters.js";
2
- /**
3
- * The default configuration for palette extraction.
4
- * @public
5
- */
6
- export const defaultPaletteExtractionConfig = {
7
- saturationWeight: 6,
8
- luminosityWeight: 3,
9
- populationWeight: 1,
10
- volumeWeight: 0.1,
11
- constraints: [
12
- {
13
- id: "Vibrant",
14
- targetSaturation: 1,
15
- minSaturation: 0.35,
16
- maxSaturation: 1,
17
- targetLuminosity: 0.5,
18
- minLuminosity: 0.3,
19
- maxLuminosity: 0.7,
20
- },
21
- {
22
- id: "LightVibrant",
23
- targetSaturation: 1,
24
- minSaturation: 0.35,
25
- maxSaturation: 1,
26
- targetLuminosity: 0.74,
27
- minLuminosity: 0.55,
28
- maxLuminosity: 1,
29
- },
30
- {
31
- id: "DarkVibrant",
32
- targetSaturation: 1,
33
- minSaturation: 0.35,
34
- maxSaturation: 1,
35
- targetLuminosity: 0.26,
36
- minLuminosity: 0,
37
- maxLuminosity: 0.45,
38
- },
39
- {
40
- id: "Muted",
41
- targetSaturation: 0.3,
42
- minSaturation: 0,
43
- maxSaturation: 0.4,
44
- targetLuminosity: 0.5,
45
- minLuminosity: 0.3,
46
- maxLuminosity: 0.7,
47
- },
48
- {
49
- id: "LightMuted",
50
- targetSaturation: 0.3,
51
- minSaturation: 0,
52
- maxSaturation: 0.4,
53
- targetLuminosity: 0.74,
54
- minLuminosity: 0.55,
55
- maxLuminosity: 1,
56
- },
57
- {
58
- id: "DarkMuted",
59
- targetSaturation: 0.3,
60
- minSaturation: 0,
61
- maxSaturation: 0.4,
62
- targetLuminosity: 0.26,
63
- minLuminosity: 0,
64
- maxLuminosity: 0.45,
65
- },
66
- ],
67
- };
68
- /**
69
- * Extracts a palette.
70
- * @param colors - the quantized colors
71
- * @param config - the extraction config
72
- * @public
73
- */
74
- export function extractPalette(colors, config = defaultPaletteExtractionConfig) {
75
- if (config.constraints.length === 0) {
76
- return [];
77
- }
78
- let totalPixelCount = 0;
79
- let totalVolume = 0;
80
- for (let i = 0; i < colors.length; i++) {
81
- totalPixelCount += colors[i].pixelCount;
82
- totalVolume += colors[i].colorVolume;
83
- }
84
- const retVal = new Array(config.constraints.length);
85
- const bestFitValues = new Array(config.constraints.length);
86
- for (let i = 0; i < retVal.length; i++) {
87
- bestFitValues[i] = 0;
88
- retVal[i] = {
89
- found: false,
90
- constraint: config.constraints[i],
91
- };
92
- }
93
- const totalWeight = config.saturationWeight +
94
- config.luminosityWeight +
95
- config.populationWeight +
96
- config.volumeWeight;
97
- for (let i = 0; i < colors.length; i++) {
98
- const hsl = rgbToHSL(colors[i].color);
99
- for (let j = 0; j < config.constraints.length; j++) {
100
- // Check for min and max saturation / luminosity
101
- if (hsl.s >= config.constraints[j].minSaturation &&
102
- hsl.s <= config.constraints[j].maxSaturation &&
103
- hsl.l >= config.constraints[j].minLuminosity &&
104
- hsl.l <= config.constraints[j].maxLuminosity) {
105
- const populationFactor = colors[i].pixelCount / totalPixelCount;
106
- const volumeFactor = colors[i].colorVolume / totalVolume;
107
- const saturationFactor = 1 - Math.abs(hsl.s - config.constraints[j].targetSaturation);
108
- const luminosityFactor = 1 - Math.abs(hsl.l - config.constraints[j].targetLuminosity);
109
- const fitValue = (populationFactor * config.populationWeight +
110
- volumeFactor * config.volumeWeight +
111
- saturationFactor * config.saturationWeight +
112
- luminosityFactor * config.luminosityWeight) /
113
- totalWeight;
114
- if (fitValue > bestFitValues[j]) {
115
- // Check if this color is already in use
116
- let dupe = false;
117
- for (let k = 0; k < j; k++) {
118
- if (retVal[k].found &&
119
- retVal[k].color.color.equalValue(colors[i].color)) {
120
- dupe = true;
121
- break;
122
- }
123
- }
124
- if (!dupe) {
125
- bestFitValues[j] = fitValue;
126
- retVal[j].found = true;
127
- retVal[j].color = colors[i];
128
- }
129
- }
130
- }
131
- }
132
- }
133
- return retVal;
134
- }
@@ -1,219 +0,0 @@
1
- import { ColorRGBA64 } from "./color-rgba-64.js";
2
- import { normalize } from "./math-utilities.js";
3
- import { namedColorsConfigs } from "./named-colors.js";
4
- // Matches rgb(R, G, B) where R, G, and B are integers [0 - 255]
5
- const webRGBRegex = /^rgb\(\s*((?:(?:25[0-5]|2[0-4]\d|1\d\d|\d{1,2})\s*,\s*){2}(?:25[0-5]|2[0-4]\d|1\d\d|\d{1,2})\s*)\)$/i;
6
- // Matches rgb(R, G, B, A) where R, G, and B are integers [0 - 255] and A is [0-1] floating
7
- const webRGBARegex = /^rgba\(\s*((?:(?:25[0-5]|2[0-4]\d|1\d\d|\d{1,2})\s*,\s*){3}(?:0|1|0?\.\d*)\s*)\)$/i;
8
- // Matches #RGB and #RRGGBB, where R, G, and B are [0-9] or [A-F]
9
- const hexRGBRegex = /^#((?:[0-9a-f]{6}|[0-9a-f]{3}))$/i;
10
- // Matches #RGB and #RRGGBBAA, where R, G, B, and A are [0-9] or [A-F]
11
- const hexRGBARegex = /^#((?:[0-9a-f]{8}|[0-9a-f]{4}))$/i;
12
- /**
13
- * Test if a color matches #RRGGBB or #RGB
14
- * @public
15
- */
16
- export function isColorStringHexRGB(raw) {
17
- return hexRGBRegex.test(raw);
18
- }
19
- /**
20
- * Test if a color matches #AARRGGBB or #ARGB
21
- * @public
22
- */
23
- export function isColorStringHexARGB(raw) {
24
- return hexRGBARegex.test(raw);
25
- }
26
- /**
27
- * Test if a color matches #RRGGBBAA or #RGBA
28
- * @public
29
- */
30
- export function isColorStringHexRGBA(raw) {
31
- return isColorStringHexARGB(raw); // No way to differentiate these two formats, so just use the same test
32
- }
33
- /**
34
- * Test if a color matches rgb(rr, gg, bb)
35
- * @public
36
- */
37
- export function isColorStringWebRGB(raw) {
38
- return webRGBRegex.test(raw);
39
- }
40
- /**
41
- * Test if a color matches rgba(rr, gg, bb, aa)
42
- *
43
- * @public
44
- */
45
- export function isColorStringWebRGBA(raw) {
46
- return webRGBARegex.test(raw);
47
- }
48
- /**
49
- * Tests whether a color is in {@link @microsoft/fast-colors#NamedColors}.
50
- * @param raw - the color name to test
51
- * @public
52
- */
53
- export function isColorNamed(raw) {
54
- return namedColorsConfigs.hasOwnProperty(raw);
55
- }
56
- /**
57
- * Converts a hexadecimal color string to a {@link @microsoft/fast-colors#ColorRGBA64}.
58
- * @param raw - a color string in the form of "#RRGGBB" or "#RGB"
59
- * @example
60
- * ```ts
61
- * parseColorHexRGBA("#FF0000");
62
- * parseColorHexRGBA("#F00");
63
- * ```
64
- * @public
65
- */
66
- export function parseColorHexRGB(raw) {
67
- const result = hexRGBRegex.exec(raw);
68
- if (result === null) {
69
- return null;
70
- }
71
- let digits = result[1];
72
- if (digits.length === 3) {
73
- const r = digits.charAt(0);
74
- const g = digits.charAt(1);
75
- const b = digits.charAt(2);
76
- digits = r.concat(r, g, g, b, b);
77
- }
78
- const rawInt = parseInt(digits, 16);
79
- if (isNaN(rawInt)) {
80
- return null;
81
- }
82
- // Note the use of >>> rather than >> as we want JS to manipulate these as unsigned numbers
83
- return new ColorRGBA64(normalize((rawInt & 0xff0000) >>> 16, 0, 255), normalize((rawInt & 0x00ff00) >>> 8, 0, 255), normalize(rawInt & 0x0000ff, 0, 255), 1);
84
- }
85
- /**
86
- * Converts a hexadecimal color string to a {@link @microsoft/fast-colors#ColorRGBA64}.
87
- * @param raw - a color string in the form of "#AARRGGBB" or "#ARGB"
88
- * @example
89
- * ```ts
90
- * parseColorHexRGBA("#AAFF0000");
91
- * parseColorHexRGBA("#AF00");
92
- * ```
93
- * @public
94
- */
95
- export function parseColorHexARGB(raw) {
96
- const result = hexRGBARegex.exec(raw);
97
- if (result === null) {
98
- return null;
99
- }
100
- let digits = result[1];
101
- if (digits.length === 4) {
102
- const a = digits.charAt(0);
103
- const r = digits.charAt(1);
104
- const g = digits.charAt(2);
105
- const b = digits.charAt(3);
106
- digits = a.concat(a, r, r, g, g, b, b);
107
- }
108
- const rawInt = parseInt(digits, 16);
109
- if (isNaN(rawInt)) {
110
- return null;
111
- }
112
- // Note the use of >>> rather than >> as we want JS to manipulate these as unsigned numbers
113
- return new ColorRGBA64(normalize((rawInt & 0x00ff0000) >>> 16, 0, 255), normalize((rawInt & 0x0000ff00) >>> 8, 0, 255), normalize(rawInt & 0x000000ff, 0, 255), normalize((rawInt & 0xff000000) >>> 24, 0, 255));
114
- }
115
- /**
116
- * Converts a hexadecimal color string to a {@link @microsoft/fast-colors#ColorRGBA64}.
117
- * @param raw - a color string in the form of "#RRGGBBAA" or "#RGBA"
118
- * @example
119
- * ```ts
120
- * parseColorHexRGBA("#FF0000AA");
121
- * parseColorHexRGBA("#F00A");
122
- * ```
123
- * @public
124
- */
125
- export function parseColorHexRGBA(raw) {
126
- const result = hexRGBARegex.exec(raw);
127
- if (result === null) {
128
- return null;
129
- }
130
- let digits = result[1];
131
- if (digits.length === 4) {
132
- const r = digits.charAt(0);
133
- const g = digits.charAt(1);
134
- const b = digits.charAt(2);
135
- const a = digits.charAt(3);
136
- digits = r.concat(r, g, g, b, b, a, a);
137
- }
138
- const rawInt = parseInt(digits, 16);
139
- if (isNaN(rawInt)) {
140
- return null;
141
- }
142
- // Note the use of >>> rather than >> as we want JS to manipulate these as unsigned numbers
143
- return new ColorRGBA64(normalize((rawInt & 0xff000000) >>> 24, 0, 255), normalize((rawInt & 0x00ff0000) >>> 16, 0, 255), normalize((rawInt & 0x0000ff00) >>> 8, 0, 255), normalize(rawInt & 0x000000ff, 0, 255));
144
- }
145
- /**
146
- * Converts a rgb color string to a {@link @microsoft/fast-colors#ColorRGBA64}.
147
- * @param raw - a color string format "rgba(RR,GG,BB)" where RR,GG,BB are [0,255]
148
- * @example
149
- * ```ts
150
- * parseColorWebRGB("rgba(255, 0, 0");
151
- * ```
152
- * @public
153
- */
154
- export function parseColorWebRGB(raw) {
155
- const result = webRGBRegex.exec(raw);
156
- if (result === null) {
157
- return null;
158
- }
159
- const split = result[1].split(",");
160
- return new ColorRGBA64(normalize(Number(split[0]), 0, 255), normalize(Number(split[1]), 0, 255), normalize(Number(split[2]), 0, 255), 1);
161
- }
162
- /**
163
- * Converts a rgba color string to a {@link @microsoft/fast-colors#ColorRGBA64}.
164
- * @param raw - a color string format "rgba(RR,GG,BB,a)" where RR,GG,BB are [0,255] and a is [0,1]
165
- * @example
166
- * ```ts
167
- * parseColorWebRGBA("rgba(255, 0, 0, 1");
168
- * ```
169
- * @public
170
- */
171
- export function parseColorWebRGBA(raw) {
172
- const result = webRGBARegex.exec(raw);
173
- if (result === null) {
174
- return null;
175
- }
176
- const split = result[1].split(",");
177
- if (split.length === 4) {
178
- return new ColorRGBA64(normalize(Number(split[0]), 0, 255), normalize(Number(split[1]), 0, 255), normalize(Number(split[2]), 0, 255), Number(split[3]));
179
- }
180
- return null;
181
- }
182
- /**
183
- * Converts a named color to a {@link @microsoft/fast-colors#ColorRGBA64}.
184
- * @param raw - a {@link https://www.w3schools.com/colors/colors_names.asp | CSS color name}.
185
- * @example
186
- * ```ts
187
- * parseColorNamed("red");
188
- * ```
189
- * @public
190
- */
191
- export function parseColorNamed(raw) {
192
- // const rawLower: typeof raw = raw.toLowerCase() : raw.toString();
193
- const config = namedColorsConfigs[raw.toLowerCase()];
194
- return config
195
- ? new ColorRGBA64(config.r, config.g, config.b, config.hasOwnProperty("a") ? config.a : void 0)
196
- : null;
197
- }
198
- /**
199
- *
200
- Expects any of the following and attempts to determine which is being used
201
- * #RRGGBB, #AARRGGBB, rgb(RR,GG,BB) rgba(RR,GG,BB,a),
202
- * or any of the {@link https://www.w3schools.com/colors/colors_names.asp | CSS color names}.
203
- * @param raw - the color string to parse
204
- * @public
205
- */
206
- export function parseColor(raw) {
207
- const rawLower = raw.toLowerCase();
208
- return isColorStringHexRGB(rawLower)
209
- ? parseColorHexRGB(rawLower)
210
- : isColorStringHexRGBA(rawLower)
211
- ? parseColorHexARGB(rawLower)
212
- : isColorStringWebRGB(rawLower)
213
- ? parseColorWebRGB(rawLower)
214
- : isColorStringWebRGBA(rawLower)
215
- ? parseColorWebRGBA(rawLower)
216
- : isColorNamed(rawLower)
217
- ? parseColorNamed(rawLower)
218
- : null;
219
- }
@@ -1,72 +0,0 @@
1
- import { ColorRGBA64 } from "./color-rgba-64.js";
2
- /**
3
- * Creates an HTMLImageElement and loads the source argument as its src. Then an HTMLCanvasElement is created and the image is copied into the canvas. The pixel data is then returned from the CanvasRenderingContext2D for that canvas.
4
- *
5
- * @public
6
- */
7
- export function loadImageData(source) {
8
- return new Promise((resolve, reject) => {
9
- const image = new Image();
10
- if (!image) {
11
- reject("Unable to create image");
12
- return;
13
- }
14
- /* eslint-disable-next-line */
15
- image.onload = (e) => {
16
- const canvas = document.createElement("canvas");
17
- if (!canvas) {
18
- reject("Unable to create canvas");
19
- return;
20
- }
21
- canvas.width = image.naturalWidth;
22
- canvas.height = image.naturalHeight;
23
- const context = canvas.getContext("2d");
24
- if (!context) {
25
- reject("Unable to create context");
26
- return;
27
- }
28
- context.drawImage(image, 0, 0, canvas.width, canvas.height);
29
- const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
30
- resolve(imageData);
31
- };
32
- image.onerror = (e) => {
33
- reject(e);
34
- };
35
- image.onabort = (e) => {
36
- reject(e);
37
- };
38
- image.src = source;
39
- });
40
- }
41
- /**
42
- * A {@link PixelBlob} implementation from an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageData | ImageData} object.
43
- * @public
44
- * @privateRemarks
45
- * Note that this class and the function loadImageData are not covered by unit tests
46
- * due to not being able to create a valid canvas rendering context or ImageData object
47
- * in the unit test framework. ArrayPixelBlob is used instead in tests needing a PixelBlob.
48
- */
49
- export class ImageDataPixelBlob {
50
- constructor(image) {
51
- this.getPixel = (x, y) => {
52
- const rgba = this.getPixelRGBA(x, y);
53
- return new ColorRGBA64(rgba[0] / 255, rgba[1] / 255, rgba[2] / 255, rgba[3] / 255);
54
- };
55
- this.getPixelRGBA = (x, y) => {
56
- if (x < 0 || x >= this.width || y < 0 || y >= this.height) {
57
- throw new Error("Requested pixel is outside of the image bounds");
58
- }
59
- const offset = (y * this.width + x) * 4;
60
- return [
61
- this.image.data[offset],
62
- this.image.data[offset + 1],
63
- this.image.data[offset + 2],
64
- this.image.data[offset + 3],
65
- ];
66
- };
67
- this.image = image;
68
- this.width = image.width;
69
- this.height = image.height;
70
- this.totalPixels = this.width * this.height;
71
- }
72
- }
@@ -1,249 +0,0 @@
1
- import { ColorRGBA64 } from "./color-rgba-64.js";
2
- /**
3
- * Adds a newItem to an already sorted list without needing to do a full re-sort.
4
- * Higher sort priority puts the newItem closer to the start (index 0) of the list.
5
- *
6
- * @public
7
- */
8
- export function insertIntoSortedList(list, newItem, sortPriority) {
9
- if (list.length === 0) {
10
- list.push(newItem);
11
- return;
12
- }
13
- const newItemPriority = sortPriority(newItem);
14
- // The new item being either first or last happens often enough that it is worth special casing
15
- // In cases of a tie the new item should be inserted after existing items of the same priority
16
- if (newItemPriority > sortPriority(list[0])) {
17
- list.unshift(newItem);
18
- return;
19
- }
20
- if (newItemPriority <= sortPriority(list[list.length - 1])) {
21
- list.push(newItem);
22
- return;
23
- }
24
- let newIndex = 0;
25
- for (let i = 0; i < list.length; i++) {
26
- if (newItemPriority > sortPriority(list[i])) {
27
- newIndex = i;
28
- break;
29
- }
30
- }
31
- list.splice(newIndex, 0, newItem);
32
- }
33
- /**
34
- * Represents a range of colors in RGB color space.
35
- *
36
- * @public
37
- */
38
- export class PixelBox {
39
- constructor(globalHistogram, minRed, maxRed, minGreen, maxGreen, minBlue, maxBlue) {
40
- /**
41
- * Attempts to divide the range of colors represented by this PixelBox into two smaller PixelBox objects.
42
- * This does not actually cut directly at the median, rather it finds the median then cuts halfway through the larger box on either side of that median. The result is that small areas of color are better represented in the final output.
43
- * Based on the Modified Median Cut Quantization implementation from https://github.com/DanBloomberg/leptonica/blob/master/src/colorquant2.c
44
- */
45
- this.modifiedMedianCut = () => {
46
- if (this.rangeRed === 1 && this.rangeGreen === 1 && this.rangeBlue === 1) {
47
- // This box is already sliced as finely as possible
48
- return [this, null];
49
- }
50
- let CutAxis;
51
- (function (CutAxis) {
52
- CutAxis[CutAxis["Red"] = 0] = "Red";
53
- CutAxis[CutAxis["Green"] = 1] = "Green";
54
- CutAxis[CutAxis["Blue"] = 2] = "Blue";
55
- })(CutAxis || (CutAxis = {}));
56
- let axis;
57
- let axisRange;
58
- if (this.rangeRed >= this.rangeGreen && this.rangeRed >= this.rangeBlue) {
59
- axis = CutAxis.Red;
60
- axisRange = this.rangeRed;
61
- }
62
- else if (this.rangeGreen >= this.rangeRed &&
63
- this.rangeGreen >= this.rangeBlue) {
64
- axis = CutAxis.Green;
65
- axisRange = this.rangeGreen;
66
- }
67
- else {
68
- axis = CutAxis.Blue;
69
- axisRange = this.rangeBlue;
70
- }
71
- const partialSum = new Array(axisRange);
72
- const lookAheadSum = new Array(axisRange);
73
- let retLeft = null;
74
- let retRight = null;
75
- let axisTotal = 0;
76
- // This does not actually cut directly at the median, rather it finds the median then
77
- // cuts halfway through the larger box on either side of that median
78
- // The result is that small areas of color are better represented in the final output
79
- if (axis === CutAxis.Red) {
80
- // Calculate partial sums
81
- for (let r = this.minRed; r <= this.maxRed; r++) {
82
- let sum = 0;
83
- for (let g = this.minGreen; g <= this.maxGreen; g++) {
84
- for (let b = this.minBlue; b <= this.maxBlue; b++) {
85
- sum += this.globalHistogram.getHistogramValue(r, g, b);
86
- }
87
- }
88
- axisTotal += sum;
89
- partialSum[r - this.minRed] = axisTotal;
90
- }
91
- for (let i = 0; i < partialSum.length; i++) {
92
- lookAheadSum[i] = axisTotal - partialSum[i];
93
- }
94
- // Find the cut point based on partial sums vs total
95
- for (let r = this.minRed; r <= this.maxRed; r++) {
96
- if (partialSum[r - this.minRed] >= axisTotal / 2) {
97
- const left = r - this.minRed;
98
- const right = this.maxRed - r;
99
- let cut;
100
- if (left <= right) {
101
- cut = Math.min(this.maxRed - 1, Math.floor(r + right / 2));
102
- }
103
- else {
104
- cut = Math.max(this.minRed, Math.floor(r - 1 - left / 2));
105
- }
106
- // Adjust the cut point if either side has 0 pixelCount
107
- while (partialSum[cut - this.minRed] <= 0 && cut < this.maxRed - 1) {
108
- cut++;
109
- }
110
- let lookAhead = lookAheadSum[cut - this.minRed];
111
- while (lookAhead === 0 &&
112
- cut > this.minRed &&
113
- partialSum[cut - this.minRed - 1] !== 0) {
114
- cut--;
115
- lookAhead = lookAheadSum[cut - this.minRed];
116
- }
117
- retLeft = new PixelBox(this.globalHistogram, this.minRed, cut, this.minGreen, this.maxGreen, this.minBlue, this.maxBlue);
118
- retRight = new PixelBox(this.globalHistogram, cut + 1, this.maxRed, this.minGreen, this.maxGreen, this.minBlue, this.maxBlue);
119
- break;
120
- }
121
- }
122
- }
123
- else if (axis === CutAxis.Green) {
124
- // Calculate partial sums
125
- for (let g = this.minGreen; g <= this.maxGreen; g++) {
126
- let sum = 0;
127
- for (let r = this.minRed; r <= this.maxRed; r++) {
128
- for (let b = this.minBlue; b <= this.maxBlue; b++) {
129
- sum += this.globalHistogram.getHistogramValue(r, g, b);
130
- }
131
- }
132
- axisTotal += sum;
133
- partialSum[g - this.minGreen] = axisTotal;
134
- }
135
- for (let i = 0; i < partialSum.length; i++) {
136
- lookAheadSum[i] = axisTotal - partialSum[i];
137
- }
138
- // Find the cut point based on partial sums vs total
139
- for (let g = this.minGreen; g <= this.maxGreen; g++) {
140
- if (partialSum[g - this.minGreen] >= axisTotal / 2) {
141
- const left = g - this.minGreen;
142
- const right = this.maxGreen - g;
143
- let cut;
144
- if (left <= right) {
145
- cut = Math.min(this.maxGreen - 1, Math.floor(g + right / 2));
146
- }
147
- else {
148
- cut = Math.max(this.minGreen, Math.floor(g - 1 - left / 2));
149
- }
150
- // Adjust the cut point if either side has 0 pixelCount
151
- while (partialSum[cut - this.minGreen] <= 0 &&
152
- cut < this.maxGreen - 1) {
153
- cut++;
154
- }
155
- let lookAhead = lookAheadSum[cut - this.minGreen];
156
- while (lookAhead === 0 &&
157
- cut > this.minGreen &&
158
- partialSum[cut - this.minGreen - 1] !== 0) {
159
- cut--;
160
- lookAhead = lookAheadSum[cut - this.minGreen];
161
- }
162
- retLeft = new PixelBox(this.globalHistogram, this.minRed, this.maxRed, this.minGreen, cut, this.minBlue, this.maxBlue);
163
- retRight = new PixelBox(this.globalHistogram, this.minRed, this.maxRed, cut + 1, this.maxGreen, this.minBlue, this.maxBlue);
164
- break;
165
- }
166
- }
167
- }
168
- else {
169
- // Calculate partial sums
170
- for (let b = this.minBlue; b <= this.maxBlue; b++) {
171
- let sum = 0;
172
- for (let r = this.minRed; r <= this.maxRed; r++) {
173
- for (let g = this.minGreen; g <= this.maxGreen; g++) {
174
- sum += this.globalHistogram.getHistogramValue(r, g, b);
175
- }
176
- }
177
- axisTotal += sum;
178
- partialSum[b - this.minBlue] = axisTotal;
179
- }
180
- for (let i = 0; i < partialSum.length; i++) {
181
- lookAheadSum[i] = axisTotal - partialSum[i];
182
- }
183
- // Find the cut point based on partial sums vs total
184
- for (let b = this.minBlue; b <= this.maxBlue; b++) {
185
- if (partialSum[b - this.minBlue] >= axisTotal / 2) {
186
- const left = b - this.minBlue;
187
- const right = this.maxBlue - b;
188
- let cut;
189
- if (left <= right) {
190
- cut = Math.min(this.maxBlue - 1, Math.floor(b + right / 2));
191
- }
192
- else {
193
- cut = Math.max(this.minBlue, Math.floor(b - 1 - left / 2));
194
- }
195
- // Adjust the cut point if either side has 0 pixelCount
196
- while (partialSum[cut - this.minBlue] <= 0 &&
197
- cut < this.maxBlue - 1) {
198
- cut++;
199
- }
200
- let lookAhead = lookAheadSum[cut - this.minBlue];
201
- while (lookAhead === 0 &&
202
- cut > this.minBlue &&
203
- partialSum[cut - this.minBlue - 1] !== 0) {
204
- cut--;
205
- lookAhead = lookAheadSum[cut - this.minBlue];
206
- }
207
- retLeft = new PixelBox(this.globalHistogram, this.minRed, this.maxRed, this.minGreen, this.maxGreen, this.minBlue, cut);
208
- retRight = new PixelBox(this.globalHistogram, this.minRed, this.maxRed, this.minGreen, this.maxGreen, cut + 1, this.maxBlue);
209
- break;
210
- }
211
- }
212
- }
213
- return [retLeft, retRight];
214
- };
215
- this.pixelCount = 0;
216
- this.globalHistogram = globalHistogram;
217
- this.minRed = minRed;
218
- this.maxRed = maxRed;
219
- this.minGreen = minGreen;
220
- this.maxGreen = maxGreen;
221
- this.minBlue = minBlue;
222
- this.maxBlue = maxBlue;
223
- this.rangeRed = this.maxRed - this.minRed + 1;
224
- this.rangeGreen = this.maxGreen - this.minGreen + 1;
225
- this.rangeBlue = this.maxBlue - this.minBlue + 1;
226
- this.colorVolume = this.rangeRed * this.rangeGreen * this.rangeBlue;
227
- let redSum = 0;
228
- let greenSum = 0;
229
- let blueSum = 0;
230
- const factor = 1 << (8 - this.globalHistogram.significantBits);
231
- for (let r = minRed; r <= maxRed; r++) {
232
- for (let g = minGreen; g <= maxGreen; g++) {
233
- for (let b = minBlue; b <= maxBlue; b++) {
234
- const histoValue = this.globalHistogram.getHistogramValue(r, g, b);
235
- this.pixelCount += histoValue;
236
- redSum += histoValue * (r + 0.5) * factor;
237
- greenSum += histoValue * (g + 0.5) * factor;
238
- blueSum += histoValue * (b + 0.5) * factor;
239
- }
240
- }
241
- }
242
- if (this.pixelCount === 0) {
243
- this.averageColor = new ColorRGBA64((factor * ((minRed + maxRed + 1) / 2)) / 255, (factor * ((minGreen + maxGreen + 1) / 2)) / 255, (factor * ((minBlue + maxBlue + 1) / 2)) / 255, 1);
244
- }
245
- else {
246
- this.averageColor = new ColorRGBA64(redSum / this.pixelCount / 255, greenSum / this.pixelCount / 255, blueSum / this.pixelCount / 255, 1);
247
- }
248
- }
249
- }