@datalayer/jupyter-react 0.8.2 → 0.9.0

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 (431) hide show
  1. package/LICENSE +1 -1
  2. package/lib/app/App.js +1 -1
  3. package/lib/app/JupyterReact.js +1 -1
  4. package/lib/app/tabs/AboutTab.js +2 -2
  5. package/lib/app/tabs/AboutTab.js.map +1 -1
  6. package/lib/app/tabs/ComponentsTab.js +2 -2
  7. package/lib/app/tabs/ComponentsTab.js.map +1 -1
  8. package/lib/app/tabs/components/CellComponent.js +4 -4
  9. package/lib/app/tabs/components/CellComponent.js.map +1 -1
  10. package/lib/app/tabs/components/FileBrowserComponent.js +1 -1
  11. package/lib/app/tabs/components/IPyWidgetsComponent.js +1 -1
  12. package/lib/app/tabs/components/NotebookComponent.js +3 -3
  13. package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
  14. package/lib/app/tabs/components/ViewerComponent.js +3 -3
  15. package/lib/app/tabs/components/ViewerComponent.js.map +1 -1
  16. package/lib/components/button/Button.js +1 -1
  17. package/lib/components/cell/Cell.d.ts +6 -0
  18. package/lib/components/cell/Cell.js +5 -9
  19. package/lib/components/cell/Cell.js.map +1 -1
  20. package/lib/components/cell/CellAdapter.js +3 -3
  21. package/lib/components/cell/CellAdapter.js.map +1 -1
  22. package/lib/components/cell/CellCommands.js +2 -2
  23. package/lib/components/cell/CellRedux.js +1 -1
  24. package/lib/components/cell/CellZustand.js +1 -1
  25. package/lib/components/codemirror/CodeMirrorEditor.js +2 -3
  26. package/lib/components/codemirror/CodeMirrorEditor.js.map +1 -1
  27. package/lib/components/codemirror/CodeMirrorOutputToolbar.js +2 -2
  28. package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -1
  29. package/lib/components/codemirror/CodeMirrorTheme.js +1 -1
  30. package/lib/components/commands/Commands.js +2 -2
  31. package/lib/components/commands/Commands.js.map +1 -1
  32. package/lib/components/commands/CommandsAdapter.css +1 -1
  33. package/lib/components/commands/CommandsAdapter.js +1 -1
  34. package/lib/components/commands/CommandsState.js +1 -1
  35. package/lib/components/console/Console.css +1 -1
  36. package/lib/components/console/Console.d.ts +12 -1
  37. package/lib/components/console/Console.js +12 -8
  38. package/lib/components/console/Console.js.map +1 -1
  39. package/lib/components/console/ConsoleAdapter.d.ts +23 -2
  40. package/lib/components/console/ConsoleAdapter.js +28 -14
  41. package/lib/components/console/ConsoleAdapter.js.map +1 -1
  42. package/lib/components/console/ConsoleRedux.js +1 -1
  43. package/lib/components/console/ConsoleZustand.js +1 -1
  44. package/lib/components/dialog/Dialog.js +2 -2
  45. package/lib/components/dialog/Dialog.js.map +1 -1
  46. package/lib/components/dialog/DialogAdapter.js +1 -1
  47. package/lib/components/filebrowser/FileBrowser.js +1 -1
  48. package/lib/components/filemanager/FileManagerJupyterLab.js +2 -2
  49. package/lib/components/filemanager/FileManagerJupyterLab.js.map +1 -1
  50. package/lib/components/filemanager/FileManagerState.js +1 -1
  51. package/lib/components/filemanager/lab/FileManagerAdapter.css +1 -1
  52. package/lib/components/filemanager/lab/FileManagerAdapter.js +1 -1
  53. package/lib/components/jupyterlab/JupyterLabApp.d.ts +2 -2
  54. package/lib/components/jupyterlab/JupyterLabApp.js +1 -1
  55. package/lib/components/jupyterlab/JupyterLabAppAdapter.js +1 -1
  56. package/lib/components/jupyterlab/JupyterLabAppCss.d.ts +2 -2
  57. package/lib/components/jupyterlab/JupyterLabAppCss.js +1 -1
  58. package/lib/components/jupyterlab/JupyterLabAppPlugins.js +1 -1
  59. package/lib/components/kernel/KernelActionMenu.d.ts +8 -0
  60. package/lib/components/kernel/KernelActionMenu.js +21 -0
  61. package/lib/components/kernel/KernelActionMenu.js.map +1 -0
  62. package/lib/components/kernel/KernelInspector.d.ts +6 -0
  63. package/lib/components/kernel/KernelInspector.js +31 -0
  64. package/lib/components/kernel/KernelInspector.js.map +1 -0
  65. package/lib/components/kernel/KernelLauncher.d.ts +2 -0
  66. package/lib/components/kernel/KernelLauncher.js +11 -0
  67. package/lib/components/kernel/KernelLauncher.js.map +1 -0
  68. package/lib/components/kernel/KernelLogs.d.ts +2 -0
  69. package/lib/components/kernel/KernelLogs.js +11 -0
  70. package/lib/components/kernel/KernelLogs.js.map +1 -0
  71. package/lib/components/kernel/KernelProgressBar.d.ts +2 -0
  72. package/lib/components/kernel/KernelProgressBar.js +26 -0
  73. package/lib/components/kernel/KernelProgressBar.js.map +1 -0
  74. package/lib/components/kernel/KernelSelector.d.ts +8 -0
  75. package/lib/components/kernel/KernelSelector.js +40 -0
  76. package/lib/components/kernel/KernelSelector.js.map +1 -0
  77. package/lib/components/kernel/KernelStatus.d.ts +27 -0
  78. package/lib/components/kernel/KernelStatus.js +67 -0
  79. package/lib/components/kernel/KernelStatus.js.map +1 -0
  80. package/lib/components/kernel/KernelUsage.d.ts +6 -0
  81. package/lib/components/kernel/KernelUsage.js +100 -0
  82. package/lib/components/kernel/KernelUsage.js.map +1 -0
  83. package/lib/components/kernel/KernelVariables.d.ts +6 -0
  84. package/lib/components/kernel/KernelVariables.js +23 -0
  85. package/lib/components/kernel/KernelVariables.js.map +1 -0
  86. package/lib/components/kernel/Kernels.d.ts +2 -0
  87. package/lib/components/kernel/Kernels.js +88 -0
  88. package/lib/components/kernel/Kernels.js.map +1 -0
  89. package/lib/components/kernel/index.d.ts +10 -0
  90. package/lib/components/kernel/index.js +16 -0
  91. package/lib/components/kernel/index.js.map +1 -0
  92. package/lib/components/kernel/inspector/kernelinspector.css +68 -0
  93. package/lib/components/kernel/inspector/model.d.ts +56 -0
  94. package/lib/components/kernel/inspector/model.js +201 -0
  95. package/lib/components/kernel/inspector/model.js.map +1 -0
  96. package/lib/components/kernel/inspector/widget.d.ts +40 -0
  97. package/lib/components/kernel/inspector/widget.js +190 -0
  98. package/lib/components/kernel/inspector/widget.js.map +1 -0
  99. package/lib/components/kernel/variables/handler.d.ts +86 -0
  100. package/lib/components/kernel/variables/handler.js +262 -0
  101. package/lib/components/kernel/variables/handler.js.map +1 -0
  102. package/lib/components/kernel/variables/inspectorscripts.d.ts +20 -0
  103. package/lib/components/kernel/variables/inspectorscripts.js +349 -0
  104. package/lib/components/kernel/variables/inspectorscripts.js.map +1 -0
  105. package/lib/components/kernel/variables/kernelconnector.d.ts +37 -0
  106. package/lib/components/kernel/variables/kernelconnector.js +76 -0
  107. package/lib/components/kernel/variables/kernelconnector.js.map +1 -0
  108. package/lib/components/kernel/variables/manager.d.ts +26 -0
  109. package/lib/components/kernel/variables/manager.js +70 -0
  110. package/lib/components/kernel/variables/manager.js.map +1 -0
  111. package/lib/components/kernel/variables/tokens.d.ts +48 -0
  112. package/lib/components/kernel/variables/tokens.js +7 -0
  113. package/lib/components/kernel/variables/tokens.js.map +1 -0
  114. package/lib/components/kernel/variables/variablesinspector.css +110 -0
  115. package/lib/components/kernel/variables/variablesinspector.d.ts +5 -0
  116. package/lib/components/kernel/variables/variablesinspector.js +85 -0
  117. package/lib/components/kernel/variables/variablesinspector.js.map +1 -0
  118. package/lib/components/kernel/variables/widget.d.ts +33 -0
  119. package/lib/components/kernel/variables/widget.js +391 -0
  120. package/lib/components/kernel/variables/widget.js.map +1 -0
  121. package/lib/{jupyter → components}/lumino/Lumino.js +1 -1
  122. package/lib/components/lumino/Lumino.js.map +1 -0
  123. package/lib/{jupyter → components}/lumino/LuminoBox.js +1 -1
  124. package/lib/components/lumino/LuminoBox.js.map +1 -0
  125. package/lib/{jupyter → components}/lumino/LuminoDetached.js +1 -1
  126. package/lib/components/lumino/LuminoDetached.js.map +1 -0
  127. package/lib/{jupyter → components}/lumino/LuminoObservable.js +1 -1
  128. package/lib/components/lumino/LuminoObservable.js.map +1 -0
  129. package/lib/components/lumino/LuminoRedux.js +7 -0
  130. package/lib/components/lumino/LuminoRedux.js.map +1 -0
  131. package/lib/{jupyter → components}/lumino/ReactPortalWidget.js +1 -1
  132. package/lib/components/lumino/ReactPortalWidget.js.map +1 -0
  133. package/lib/components/notebook/Notebook.css +1 -1
  134. package/lib/components/notebook/Notebook.js +12 -8
  135. package/lib/components/notebook/Notebook.js.map +1 -1
  136. package/lib/components/notebook/NotebookAdapter.d.ts +3 -1
  137. package/lib/components/notebook/NotebookAdapter.js +92 -61
  138. package/lib/components/notebook/NotebookAdapter.js.map +1 -1
  139. package/lib/components/notebook/NotebookCommands.d.ts +23 -21
  140. package/lib/components/notebook/NotebookCommands.js +52 -27
  141. package/lib/components/notebook/NotebookCommands.js.map +1 -1
  142. package/lib/components/notebook/NotebookRedux.js +1 -1
  143. package/lib/components/notebook/NotebookZustand.js +1 -1
  144. package/lib/components/notebook/cell/metadata/CellMetadataEditor.js +2 -2
  145. package/lib/components/notebook/cell/metadata/CellMetadataEditor.js.map +1 -1
  146. package/lib/components/notebook/cell/metadata/NbGraderCells.js +11 -11
  147. package/lib/components/notebook/cell/prompt/Countdown.js +2 -2
  148. package/lib/components/notebook/cell/prompt/Countdown.js.map +1 -1
  149. package/lib/components/notebook/cell/prompt/CountdownInputPrompt.js +1 -1
  150. package/lib/components/notebook/cell/prompt/CountdownOutputPrompt.js +1 -1
  151. package/lib/components/notebook/cell/prompt/CountdownOutputPrompt.js.map +1 -1
  152. package/lib/components/notebook/cell/sidebar/CellSidebar.js +1 -1
  153. package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +1 -1
  154. package/lib/components/notebook/cell/sidebar/CellSidebarRun.js +1 -1
  155. package/lib/components/notebook/cell/sidebar/CellSidebarWidget.d.ts +1 -1
  156. package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js +2 -2
  157. package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js.map +1 -1
  158. package/lib/components/notebook/content/JupyterReactContentFactory.js +1 -1
  159. package/lib/components/notebook/marked/marked.js +2 -2
  160. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js +1 -1
  161. package/lib/components/output/Output.css +1 -1
  162. package/lib/components/output/Output.d.ts +13 -10
  163. package/lib/components/output/Output.js +34 -59
  164. package/lib/components/output/Output.js.map +1 -1
  165. package/lib/components/output/OutputAdapter.d.ts +3 -3
  166. package/lib/components/output/OutputAdapter.js +19 -17
  167. package/lib/components/output/OutputAdapter.js.map +1 -1
  168. package/lib/components/output/OutputIPyWidgets.css +1 -1
  169. package/lib/components/output/OutputIPyWidgets.js +2 -2
  170. package/lib/components/output/OutputIPyWidgets.js.map +1 -1
  171. package/lib/components/output/OutputRedux.js +1 -1
  172. package/lib/components/output/OutputRenderer.js +26 -2
  173. package/lib/components/output/OutputRenderer.js.map +1 -1
  174. package/lib/components/output/OutputZustand.d.ts +5 -0
  175. package/lib/components/output/OutputZustand.js +6 -1
  176. package/lib/components/output/OutputZustand.js.map +1 -1
  177. package/lib/{jupyter → components/output}/ipywidgets/IPyWidgetsAttached.js +2 -2
  178. package/lib/components/output/ipywidgets/IPyWidgetsAttached.js.map +1 -0
  179. package/lib/{jupyter → components/output}/ipywidgets/IPyWidgetsViewManager.js +8 -7
  180. package/lib/components/output/ipywidgets/IPyWidgetsViewManager.js.map +1 -0
  181. package/lib/components/settings/Settings.js +2 -2
  182. package/lib/components/settings/Settings.js.map +1 -1
  183. package/lib/components/settings/SettingsAdapter.css +1 -1
  184. package/lib/components/settings/SettingsAdapter.js +1 -1
  185. package/lib/components/settings/SettingsRedux.js +1 -1
  186. package/lib/components/settings/SettingsZustand.js +1 -1
  187. package/lib/components/terminal/Terminal.d.ts +5 -1
  188. package/lib/components/terminal/Terminal.js +3 -3
  189. package/lib/components/terminal/Terminal.js.map +1 -1
  190. package/lib/components/terminal/TerminalAdapter.js +13 -4
  191. package/lib/components/terminal/TerminalAdapter.js.map +1 -1
  192. package/lib/components/terminal/TerminalRedux.js +1 -1
  193. package/lib/components/terminal/TerminalZustand.js +1 -1
  194. package/lib/components/textinput/TextInput.js +1 -1
  195. package/lib/components/viewer/Viewer.d.ts +2 -1
  196. package/lib/components/viewer/Viewer.js +17 -4
  197. package/lib/components/viewer/Viewer.js.map +1 -1
  198. package/lib/components/viewer/input/CodemirrorView.js +1 -1
  199. package/lib/components/viewer/input/CodemirrorViewer.js +3 -3
  200. package/lib/components/viewer/input/CodemirrorViewer.js.map +1 -1
  201. package/lib/components/viewer/input/InputViewer.js +2 -5
  202. package/lib/components/viewer/input/InputViewer.js.map +1 -1
  203. package/lib/components/viewer/output/OutputAdapter.js +3 -3
  204. package/lib/components/viewer/output/OutputAdapter.js.map +1 -1
  205. package/lib/components/viewer/output/OutputViewer.js +1 -1
  206. package/lib/components/viewer/output/OutputViewer.js.map +1 -1
  207. package/lib/examples/All.js +6 -5
  208. package/lib/examples/All.js.map +1 -1
  209. package/lib/examples/Bokeh.js +1 -1
  210. package/lib/examples/Bqplot.js +8 -2
  211. package/lib/examples/Bqplot.js.map +1 -1
  212. package/lib/examples/Cell.js +1 -1
  213. package/lib/examples/CellLite.js +16 -0
  214. package/lib/examples/CellLite.js.map +1 -0
  215. package/lib/examples/Cells.js +1 -1
  216. package/lib/examples/Console.js +2 -2
  217. package/lib/examples/Console.js.map +1 -1
  218. package/lib/examples/ConsoleLite.js +4 -2
  219. package/lib/examples/ConsoleLite.js.map +1 -1
  220. package/lib/examples/Dashboard.js +1 -1
  221. package/lib/examples/Deno.js +18 -0
  222. package/lib/examples/Deno.js.map +1 -0
  223. package/lib/examples/FileBrowser.js +1 -1
  224. package/lib/examples/GeoJson.js +1 -1
  225. package/lib/examples/IPyLeaflet.js +8 -2
  226. package/lib/examples/IPyLeaflet.js.map +1 -1
  227. package/lib/examples/IPyReact.js +8 -4
  228. package/lib/examples/IPyReact.js.map +1 -1
  229. package/lib/examples/IPyWidgets.js +1 -1
  230. package/lib/examples/IPyWidgetsWithState.js +1 -1
  231. package/lib/examples/JupyterLabApp.js +2 -2
  232. package/lib/examples/JupyterLabHeadlessApp.js +3 -3
  233. package/lib/examples/JupyterLabHeadlessApp.js.map +1 -1
  234. package/lib/examples/KernelExecResult.d.ts +1 -0
  235. package/lib/examples/KernelExecResult.js +40 -0
  236. package/lib/examples/KernelExecResult.js.map +1 -0
  237. package/lib/examples/KernelExecutor.js +55 -0
  238. package/lib/examples/KernelExecutor.js.map +1 -0
  239. package/lib/examples/Kernels.d.ts +1 -0
  240. package/lib/examples/Kernels.js +78 -0
  241. package/lib/examples/Kernels.js.map +1 -0
  242. package/lib/examples/Lumino.js +2 -2
  243. package/lib/examples/Lumino.js.map +1 -1
  244. package/lib/examples/Matplotlib.js +12 -8
  245. package/lib/examples/Matplotlib.js.map +1 -1
  246. package/lib/examples/Notebook.js +11 -6
  247. package/lib/examples/Notebook.js.map +1 -1
  248. package/lib/examples/NotebookCellSidebar.js +10 -6
  249. package/lib/examples/NotebookCellSidebar.js.map +1 -1
  250. package/lib/examples/NotebookColorMode.js +47 -0
  251. package/lib/examples/NotebookColorMode.js.map +1 -0
  252. package/lib/examples/NotebookExternalContent.js +10 -6
  253. package/lib/examples/NotebookExternalContent.js.map +1 -1
  254. package/lib/examples/NotebookInit.js +9 -5
  255. package/lib/examples/NotebookInit.js.map +1 -1
  256. package/lib/examples/NotebookInjectableReduxStore.js +1 -1
  257. package/lib/examples/NotebookKernelChange.js +5 -4
  258. package/lib/examples/NotebookKernelChange.js.map +1 -1
  259. package/lib/examples/NotebookLite.d.ts +1 -0
  260. package/lib/examples/NotebookLite.js +20 -0
  261. package/lib/examples/NotebookLite.js.map +1 -0
  262. package/lib/examples/NotebookNbFormat.d.ts +1 -0
  263. package/lib/examples/{NotebookModel.js → NotebookNbFormat.js} +12 -8
  264. package/lib/examples/NotebookNbFormat.js.map +1 -0
  265. package/lib/examples/NotebookNbFormatChange.d.ts +1 -0
  266. package/lib/examples/{NotebookModelChange.js → NotebookNbFormatChange.js} +13 -9
  267. package/lib/examples/NotebookNbFormatChange.js.map +1 -0
  268. package/lib/examples/NotebookPath.js +10 -6
  269. package/lib/examples/NotebookPath.js.map +1 -1
  270. package/lib/examples/NotebookPathChange.js +10 -6
  271. package/lib/examples/NotebookPathChange.js.map +1 -1
  272. package/lib/examples/NotebookSkeleton.d.ts +1 -0
  273. package/lib/examples/NotebookSkeleton.js +28 -0
  274. package/lib/examples/NotebookSkeleton.js.map +1 -0
  275. package/lib/examples/NotebookTheme.d.ts +1 -0
  276. package/lib/examples/NotebookTheme.js +48 -0
  277. package/lib/examples/NotebookTheme.js.map +1 -0
  278. package/lib/examples/NotebookUnmount.js +6 -5
  279. package/lib/examples/NotebookUnmount.js.map +1 -1
  280. package/lib/examples/ObservableHQ.d.ts +1 -0
  281. package/lib/examples/ObservableHQ.js +18 -0
  282. package/lib/examples/ObservableHQ.js.map +1 -0
  283. package/lib/examples/Output.js +4 -4
  284. package/lib/examples/Output.js.map +1 -1
  285. package/lib/examples/OutputIPyWidgets.js +1 -1
  286. package/lib/examples/Outputs.js +3 -3
  287. package/lib/examples/Outputs.js.map +1 -1
  288. package/lib/examples/Panel.js +1 -1
  289. package/lib/examples/Plotly.js +1 -1
  290. package/lib/examples/RunningSessions.js +3 -3
  291. package/lib/examples/RunningSessions.js.map +1 -1
  292. package/lib/examples/Terminal.js +2 -2
  293. package/lib/examples/Terminal.js.map +1 -1
  294. package/lib/examples/Vega.js +1 -1
  295. package/lib/examples/Viewer.js +7 -69
  296. package/lib/examples/Viewer.js.map +1 -1
  297. package/lib/examples/lumino/LuminoWidget.d.ts +1 -1
  298. package/lib/examples/lumino/LuminoWidget.js +5 -5
  299. package/lib/examples/lumino/LuminoWidget.js.map +1 -1
  300. package/lib/examples/notebooks/OutputIPyWidgetsExample.js +1 -1
  301. package/lib/examples/sidebars/CellSidebarSource.js +1 -1
  302. package/lib/examples/state/ExampleReduxState.js +1 -1
  303. package/lib/examples/toolbars/NotebookToolbar.js +8 -5
  304. package/lib/examples/toolbars/NotebookToolbar.js.map +1 -1
  305. package/lib/examples/toolbars/NotebookToolbarAutoSave.js +2 -2
  306. package/lib/examples/toolbars/NotebookToolbarAutoSave.js.map +1 -1
  307. package/lib/examples/toolbars/NotebookToolbarStatus.js +1 -1
  308. package/lib/index.css +1 -1
  309. package/lib/index.d.ts +33 -24
  310. package/lib/index.js +54 -37
  311. package/lib/index.js.map +1 -1
  312. package/lib/jupyter/Jupyter.d.ts +7 -26
  313. package/lib/jupyter/Jupyter.js +24 -19
  314. package/lib/jupyter/Jupyter.js.map +1 -1
  315. package/lib/jupyter/JupyterAuthError.js +1 -1
  316. package/lib/jupyter/JupyterConfig.js +2 -2
  317. package/lib/jupyter/JupyterConfig.js.map +1 -1
  318. package/lib/jupyter/JupyterContext.d.ts +117 -24
  319. package/lib/jupyter/JupyterContext.js +116 -101
  320. package/lib/jupyter/JupyterContext.js.map +1 -1
  321. package/lib/jupyter/JupyterHandlers.js +1 -1
  322. package/lib/jupyter/ipywidgets/{lab → cache}/semvercache.d.ts +3 -1
  323. package/lib/jupyter/ipywidgets/{lab → cache}/semvercache.js +3 -1
  324. package/lib/jupyter/ipywidgets/cache/semvercache.js.map +1 -0
  325. package/lib/jupyter/ipywidgets/classic/IPyWidgetsClassicManager.d.ts +34 -0
  326. package/lib/jupyter/ipywidgets/classic/IPyWidgetsClassicManager.js +185 -0
  327. package/lib/jupyter/ipywidgets/classic/IPyWidgetsClassicManager.js.map +1 -0
  328. package/lib/jupyter/ipywidgets/lab/manager.d.ts +4 -4
  329. package/lib/jupyter/ipywidgets/lab/manager.js +21 -9
  330. package/lib/jupyter/ipywidgets/lab/manager.js.map +1 -1
  331. package/lib/jupyter/ipywidgets/lab/output.js +1 -1
  332. package/lib/jupyter/ipywidgets/lab/plugin.d.ts +6 -5
  333. package/lib/jupyter/ipywidgets/lab/plugin.js +44 -42
  334. package/lib/jupyter/ipywidgets/lab/plugin.js.map +1 -1
  335. package/lib/jupyter/ipywidgets/lab/renderer.js +1 -1
  336. package/lib/jupyter/ipywidgets/lab/renderer.js.map +1 -1
  337. package/lib/jupyter/ipywidgets/plotly/Figure.js +181 -170
  338. package/lib/jupyter/ipywidgets/plotly/Figure.js.map +1 -1
  339. package/lib/jupyter/ipywidgets/plotly/JupyterlabPlugin.js +1 -1
  340. package/lib/jupyter/ipywidgets/plotly/Version.js +1 -1
  341. package/lib/jupyter/ipywidgets/plotly/index.js +1 -1
  342. package/lib/jupyter/kernel/Kernel.d.ts +69 -17
  343. package/lib/jupyter/kernel/Kernel.js +68 -42
  344. package/lib/jupyter/kernel/Kernel.js.map +1 -1
  345. package/lib/jupyter/kernel/KernelExecutor.d.ts +38 -0
  346. package/lib/jupyter/kernel/KernelExecutor.js +149 -0
  347. package/lib/jupyter/kernel/KernelExecutor.js.map +1 -0
  348. package/lib/jupyter/kernel/index.d.ts +2 -0
  349. package/lib/jupyter/kernel/index.js +8 -0
  350. package/lib/jupyter/kernel/index.js.map +1 -0
  351. package/lib/jupyter/lab/JupyterLabColorMode.d.ts +1 -0
  352. package/lib/jupyter/lab/JupyterLabColorMode.js +7 -0
  353. package/lib/jupyter/lab/JupyterLabColorMode.js.map +1 -0
  354. package/lib/jupyter/lab/JupyterLabCss.d.ts +6 -3
  355. package/lib/jupyter/lab/JupyterLabCss.js +53 -25
  356. package/lib/jupyter/lab/JupyterLabCss.js.map +1 -1
  357. package/lib/jupyter/lab/JupyterLabCssImports.d.ts +16 -16
  358. package/lib/jupyter/lab/JupyterLabCssImports.js +17 -17
  359. package/lib/jupyter/lab/JupyterLabCssImports.js.map +1 -1
  360. package/lib/jupyter/lab/__tests__/datalayer.spec.js +1 -1
  361. package/lib/jupyter/lab/index.d.ts +2 -2
  362. package/lib/jupyter/lab/index.js +2 -3
  363. package/lib/jupyter/lab/index.js.map +1 -1
  364. package/lib/jupyter/lab/notebook/content/CountdownContentFactory.d.ts +3 -8
  365. package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js +7 -13
  366. package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js.map +1 -1
  367. package/lib/jupyter/lab/notebook/content/plugin.js +3 -3
  368. package/lib/jupyter/lab/notebook/content/plugin.js.map +1 -1
  369. package/lib/jupyter/lab/notebook/index.js +1 -1
  370. package/lib/jupyter/lite/LiteServer.d.ts +11 -2
  371. package/lib/jupyter/lite/LiteServer.js +42 -67
  372. package/lib/jupyter/lite/LiteServer.js.map +1 -1
  373. package/lib/jupyter/renderers/index.js +1 -1
  374. package/lib/jupyter/renderers/plotly/PlotlyRenderer.js +5 -5
  375. package/lib/jupyter/renderers/plotly/PlotlyRenderer.js.map +1 -1
  376. package/lib/jupyter/renderers/plotly/plotly.css +1 -1
  377. package/lib/jupyter/services/Services.js +1 -1
  378. package/lib/jupyter/theme.d.ts +2 -2
  379. package/lib/jupyter/theme.js +16 -15
  380. package/lib/jupyter/theme.js.map +1 -1
  381. package/lib/state/index.js +1 -1
  382. package/lib/state/redux/InitState.js +1 -1
  383. package/lib/state/redux/State.js +1 -1
  384. package/lib/state/redux/Store.js +1 -1
  385. package/lib/utils/Utils.d.ts +3 -2
  386. package/lib/utils/Utils.js +46 -2
  387. package/lib/utils/Utils.js.map +1 -1
  388. package/lib/utils/index.d.ts +1 -0
  389. package/lib/utils/index.js +2 -0
  390. package/lib/utils/index.js.map +1 -0
  391. package/package.json +170 -86
  392. package/style/base.css +1 -1
  393. package/style/index.css +1 -1
  394. package/style/index.js +1 -1
  395. package/lib/examples/NotebookModel.js.map +0 -1
  396. package/lib/examples/NotebookModelChange.js.map +0 -1
  397. package/lib/examples/NotebookThemed.js +0 -52
  398. package/lib/examples/NotebookThemed.js.map +0 -1
  399. package/lib/examples/ViewerFile.js +0 -19
  400. package/lib/examples/ViewerFile.js.map +0 -1
  401. package/lib/jupyter/ipywidgets/IPyWidgetsAttached.js.map +0 -1
  402. package/lib/jupyter/ipywidgets/IPyWidgetsViewManager.js.map +0 -1
  403. package/lib/jupyter/ipywidgets/lab/semvercache.js.map +0 -1
  404. package/lib/jupyter/ipywidgets/manager/IPyWidgetsClassicManager.d.ts +0 -19
  405. package/lib/jupyter/ipywidgets/manager/IPyWidgetsClassicManager.js +0 -85
  406. package/lib/jupyter/ipywidgets/manager/IPyWidgetsClassicManager.js.map +0 -1
  407. package/lib/jupyter/kernel/KernelModel.d.ts +0 -18
  408. package/lib/jupyter/kernel/KernelModel.js +0 -57
  409. package/lib/jupyter/kernel/KernelModel.js.map +0 -1
  410. package/lib/jupyter/lab/JupyterLabTheme.d.ts +0 -1
  411. package/lib/jupyter/lab/JupyterLabTheme.js +0 -7
  412. package/lib/jupyter/lab/JupyterLabTheme.js.map +0 -1
  413. package/lib/jupyter/lumino/Lumino.js.map +0 -1
  414. package/lib/jupyter/lumino/LuminoBox.js.map +0 -1
  415. package/lib/jupyter/lumino/LuminoDetached.js.map +0 -1
  416. package/lib/jupyter/lumino/LuminoObservable.js.map +0 -1
  417. package/lib/jupyter/lumino/LuminoRedux.js +0 -7
  418. package/lib/jupyter/lumino/LuminoRedux.js.map +0 -1
  419. package/lib/jupyter/lumino/ReactPortalWidget.js.map +0 -1
  420. /package/lib/{jupyter → components}/lumino/Lumino.d.ts +0 -0
  421. /package/lib/{jupyter → components}/lumino/LuminoBox.d.ts +0 -0
  422. /package/lib/{jupyter → components}/lumino/LuminoDetached.d.ts +0 -0
  423. /package/lib/{jupyter → components}/lumino/LuminoObservable.d.ts +0 -0
  424. /package/lib/{jupyter → components}/lumino/LuminoRedux.d.ts +0 -0
  425. /package/lib/{jupyter → components}/lumino/ReactPortalWidget.d.ts +0 -0
  426. /package/lib/{jupyter → components/output}/ipywidgets/IPyWidgetsAttached.d.ts +0 -0
  427. /package/lib/{jupyter → components/output}/ipywidgets/IPyWidgetsViewManager.d.ts +0 -0
  428. /package/lib/examples/{NotebookModel.d.ts → CellLite.d.ts} +0 -0
  429. /package/lib/examples/{NotebookModelChange.d.ts → Deno.d.ts} +0 -0
  430. /package/lib/examples/{NotebookThemed.d.ts → KernelExecutor.d.ts} +0 -0
  431. /package/lib/examples/{ViewerFile.d.ts → NotebookColorMode.d.ts} +0 -0
@@ -1,13 +1,18 @@
1
1
  /*
2
- * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
3
  *
4
4
  * MIT License
5
5
  */
6
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
7
+ /* eslint-disable @typescript-eslint/no-this-alias */
8
+ /* eslint-disable prefer-rest-params */
9
+ /* eslint-disable no-var */
10
+ /* eslint-disable no-prototype-builtins */
6
11
  import { DOMWidgetModel, DOMWidgetView, } from '@jupyter-widgets/base';
7
12
  import _ from 'lodash';
8
13
  import Plotly from 'plotly.js';
9
14
  import { MODULE_NAME, MODULE_VERSION } from './Version';
10
- // @ts-ignore
15
+ // @ts-expect-error unknown global PlotlyConfig
11
16
  window.PlotlyConfig = { MathJaxConfig: 'local' };
12
17
  const semver_range = '^' + MODULE_VERSION;
13
18
  // Model
@@ -397,7 +402,7 @@ class FigureModel extends DOMWidgetModel {
397
402
  */
398
403
  _normalize_trace_indexes(trace_indexes) {
399
404
  if (trace_indexes === null || trace_indexes === undefined) {
400
- var numTraces = this.get('_data').length;
405
+ const numTraces = this.get('_data').length;
401
406
  trace_indexes = _.range(numTraces);
402
407
  }
403
408
  if (!Array.isArray(trace_indexes)) {
@@ -424,11 +429,11 @@ class FigureModel extends DOMWidgetModel {
424
429
  do_addTraces() {
425
430
  // add trace to plot
426
431
  /** @type {Py2JsAddTracesMsg} */
427
- var msgData = this.get('_py2js_addTraces');
432
+ const msgData = this.get('_py2js_addTraces');
428
433
  if (msgData !== null) {
429
- var currentTraces = this.get('_data');
430
- var newTraces = msgData.trace_data;
431
- _.forEach(newTraces, function (newTrace) {
434
+ const currentTraces = this.get('_data');
435
+ const newTraces = msgData.trace_data;
436
+ _.forEach(newTraces, newTrace => {
432
437
  currentTraces.push(newTrace);
433
438
  });
434
439
  }
@@ -439,16 +444,16 @@ class FigureModel extends DOMWidgetModel {
439
444
  do_deleteTraces() {
440
445
  // remove traces from plot
441
446
  /** @type {Py2JsDeleteTracesMsg} */
442
- var msgData = this.get('_py2js_deleteTraces');
447
+ const msgData = this.get('_py2js_deleteTraces');
443
448
  if (msgData !== null) {
444
- var delete_inds = msgData.delete_inds;
445
- var tracesData = this.get('_data');
449
+ const delete_inds = msgData.delete_inds;
450
+ const tracesData = this.get('_data');
446
451
  // Remove del inds in reverse order so indexes remain valid
447
452
  // throughout loop
448
453
  delete_inds
449
454
  .slice()
450
455
  .reverse()
451
- .forEach(function (del_ind) {
456
+ .forEach(del_ind => {
452
457
  tracesData.splice(del_ind, 1);
453
458
  });
454
459
  }
@@ -458,11 +463,11 @@ class FigureModel extends DOMWidgetModel {
458
463
  */
459
464
  do_moveTraces() {
460
465
  /** @type {Py2JsMoveTracesMsg} */
461
- var msgData = this.get('_py2js_moveTraces');
466
+ const msgData = this.get('_py2js_moveTraces');
462
467
  if (msgData !== null) {
463
- var tracesData = this.get('_data');
464
- var currentInds = msgData.current_trace_inds;
465
- var newInds = msgData.new_trace_inds;
468
+ const tracesData = this.get('_data');
469
+ const currentInds = msgData.current_trace_inds;
470
+ const newInds = msgData.new_trace_inds;
466
471
  performMoveTracesLike(tracesData, currentInds, newInds);
467
472
  }
468
473
  }
@@ -471,10 +476,10 @@ class FigureModel extends DOMWidgetModel {
471
476
  */
472
477
  do_restyle() {
473
478
  /** @type {Py2JsRestyleMsg} */
474
- var msgData = this.get('_py2js_restyle');
479
+ const msgData = this.get('_py2js_restyle');
475
480
  if (msgData !== null) {
476
- var restyleData = msgData.restyle_data;
477
- var restyleTraces = this._normalize_trace_indexes(msgData.restyle_traces);
481
+ const restyleData = msgData.restyle_data;
482
+ const restyleTraces = this._normalize_trace_indexes(msgData.restyle_traces);
478
483
  performRestyleLike(this.get('_data'), restyleData, restyleTraces);
479
484
  }
480
485
  }
@@ -483,7 +488,7 @@ class FigureModel extends DOMWidgetModel {
483
488
  */
484
489
  do_relayout() {
485
490
  /** @type {Py2JsRelayoutMsg} */
486
- var msgData = this.get('_py2js_relayout');
491
+ const msgData = this.get('_py2js_relayout');
487
492
  if (msgData !== null) {
488
493
  performRelayoutLike(this.get('_layout'), msgData.relayout_data);
489
494
  }
@@ -493,11 +498,11 @@ class FigureModel extends DOMWidgetModel {
493
498
  */
494
499
  do_update() {
495
500
  /** @type {Py2JsUpdateMsg} */
496
- var msgData = this.get('_py2js_update');
501
+ const msgData = this.get('_py2js_update');
497
502
  if (msgData !== null) {
498
- var style = msgData.style_data;
499
- var layout = msgData.layout_data;
500
- var styleTraces = this._normalize_trace_indexes(msgData.style_traces);
503
+ const style = msgData.style_data;
504
+ const layout = msgData.layout_data;
505
+ const styleTraces = this._normalize_trace_indexes(msgData.style_traces);
501
506
  performRestyleLike(this.get('_data'), style, styleTraces);
502
507
  performRelayoutLike(this.get('_layout'), layout);
503
508
  }
@@ -507,15 +512,15 @@ class FigureModel extends DOMWidgetModel {
507
512
  */
508
513
  do_animate() {
509
514
  /** @type {Py2JsAnimateMsg} */
510
- var msgData = this.get('_py2js_animate');
515
+ const msgData = this.get('_py2js_animate');
511
516
  if (msgData !== null) {
512
- var styles = msgData.style_data;
513
- var layout = msgData.layout_data;
514
- var trace_indexes = this._normalize_trace_indexes(msgData.style_traces);
515
- for (var i = 0; i < styles.length; i++) {
516
- var style = styles[i];
517
- var trace_index = trace_indexes[i];
518
- var trace = this.get('_data')[trace_index];
517
+ const styles = msgData.style_data;
518
+ const layout = msgData.layout_data;
519
+ const trace_indexes = this._normalize_trace_indexes(msgData.style_traces);
520
+ for (let i = 0; i < styles.length; i++) {
521
+ const style = styles[i];
522
+ const trace_index = trace_indexes[i];
523
+ const trace = this.get('_data')[trace_index];
519
524
  performRelayoutLike(trace, style);
520
525
  }
521
526
  performRelayoutLike(this.get('_layout'), layout);
@@ -526,10 +531,10 @@ class FigureModel extends DOMWidgetModel {
526
531
  */
527
532
  do_removeLayoutProps() {
528
533
  /** @type {Py2JsRemoveLayoutPropsMsg} */
529
- var msgData = this.get('_py2js_removeLayoutProps');
534
+ const msgData = this.get('_py2js_removeLayoutProps');
530
535
  if (msgData !== null) {
531
- var keyPaths = msgData.remove_props;
532
- var layout = this.get('_layout');
536
+ const keyPaths = msgData.remove_props;
537
+ const layout = this.get('_layout');
533
538
  performRemoveProps(layout, keyPaths);
534
539
  }
535
540
  }
@@ -538,11 +543,11 @@ class FigureModel extends DOMWidgetModel {
538
543
  */
539
544
  do_removeTraceProps() {
540
545
  /** @type {Py2JsRemoveTracePropsMsg} */
541
- var msgData = this.get('_py2js_removeTraceProps');
546
+ const msgData = this.get('_py2js_removeTraceProps');
542
547
  if (msgData !== null) {
543
- var keyPaths = msgData.remove_props;
544
- var traceIndex = msgData.remove_trace;
545
- var trace = this.get('_data')[traceIndex];
548
+ const keyPaths = msgData.remove_props;
549
+ const traceIndex = msgData.remove_trace;
550
+ const trace = this.get('_data')[traceIndex];
546
551
  performRemoveProps(trace, keyPaths);
547
552
  }
548
553
  }
@@ -643,7 +648,7 @@ export class FigureView extends DOMWidgetView {
643
648
  * is never displayed in a notebook output cell
644
649
  */
645
650
  perform_render() {
646
- var that = this;
651
+ const that = this;
647
652
  // Wire up message property callbacks
648
653
  // ----------------------------------
649
654
  // Python -> JS event properties
@@ -661,8 +666,8 @@ export class FigureView extends DOMWidgetView {
661
666
  }
662
667
  // Get message ids
663
668
  // ---------------------
664
- var layout_edit_id = this.model.get('_last_layout_edit_id');
665
- var trace_edit_id = this.model.get('_last_trace_edit_id');
669
+ const layout_edit_id = this.model.get('_last_layout_edit_id');
670
+ const trace_edit_id = this.model.get('_last_trace_edit_id');
666
671
  // Set view UID
667
672
  // ------------
668
673
  this.viewID = randstr();
@@ -670,10 +675,10 @@ export class FigureView extends DOMWidgetView {
670
675
  // ---------------------------
671
676
  // We must clone the model's data and layout properties so that
672
677
  // the model is not directly mutated by the Plotly.js library.
673
- var initialTraces = _.cloneDeep(this.model.get('_data'));
674
- var initialLayout = _.cloneDeep(this.model.get('_layout'));
675
- var config = this.model.get('_config');
676
- Plotly.newPlot(that.el, initialTraces, initialLayout, config).then(function () {
678
+ const initialTraces = _.cloneDeep(this.model.get('_data'));
679
+ const initialLayout = _.cloneDeep(this.model.get('_layout'));
680
+ const config = this.model.get('_config');
681
+ Plotly.newPlot(that.el, initialTraces, initialLayout, config).then(() => {
677
682
  // ### Send trace deltas ###
678
683
  // We create an array of deltas corresponding to the new
679
684
  // traces.
@@ -681,40 +686,40 @@ export class FigureView extends DOMWidgetView {
681
686
  // ### Send layout delta ###
682
687
  that._sendLayoutDelta(layout_edit_id);
683
688
  // Wire up plotly event callbacks
684
- that.el.on('plotly_restyle', function (update) {
689
+ that.el.on('plotly_restyle', (update) => {
685
690
  that.handle_plotly_restyle(update);
686
691
  });
687
- that.el.on('plotly_relayout', function (update) {
692
+ that.el.on('plotly_relayout', (update) => {
688
693
  that.handle_plotly_relayout(update);
689
694
  });
690
695
  /*
691
- (<Plotly.PlotlyHTMLElement>that.el).on("plotly_update", function (update: any) {
692
- that.handle_plotly_update(update);
693
- });
694
- */
695
- that.el.on('plotly_click', function (update) {
696
+ (<Plotly.PlotlyHTMLElement>that.el).on("plotly_update", function (update: any) {
697
+ that.handle_plotly_update(update);
698
+ });
699
+ */
700
+ that.el.on('plotly_click', (update) => {
696
701
  that.handle_plotly_click(update);
697
702
  });
698
- that.el.on('plotly_hover', function (update) {
703
+ that.el.on('plotly_hover', (update) => {
699
704
  that.handle_plotly_hover(update);
700
705
  });
701
- that.el.on('plotly_unhover', function (update) {
706
+ that.el.on('plotly_unhover', (update) => {
702
707
  that.handle_plotly_unhover(update);
703
708
  });
704
- that.el.on('plotly_selected', function (update) {
709
+ that.el.on('plotly_selected', (update) => {
705
710
  that.handle_plotly_selected(update);
706
711
  });
707
712
  /*
708
- (<Plotly.PlotlyHTMLElement>that.el).on("plotly_deselect", function (update: any) {
709
- that.handle_plotly_deselect(update);
710
- });
711
- (<Plotly.PlotlyHTMLElement>that.el).on("plotly_doubleclick", function (update: any) {
712
- that.handle_plotly_doubleclick(update);
713
- });
714
- */
713
+ (<Plotly.PlotlyHTMLElement>that.el).on("plotly_deselect", function (update: any) {
714
+ that.handle_plotly_deselect(update);
715
+ });
716
+ (<Plotly.PlotlyHTMLElement>that.el).on("plotly_doubleclick", function (update: any) {
717
+ that.handle_plotly_doubleclick(update);
718
+ });
719
+ */
715
720
  // Emit event indicating that the widget has finished
716
721
  // rendering
717
- var event = new CustomEvent('plotlywidget-after-render', {
722
+ const event = new CustomEvent('plotlywidget-after-render', {
718
723
  detail: { element: that.el, viewID: that.viewID },
719
724
  });
720
725
  // Dispatch/Trigger/Fire the event
@@ -726,7 +731,7 @@ export class FigureView extends DOMWidgetView {
726
731
  */
727
732
  processLuminoMessage(msg) {
728
733
  super.processLuminoMessage.apply(this, arguments);
729
- var that = this;
734
+ const that = this;
730
735
  switch (msg.type) {
731
736
  case 'before-attach':
732
737
  // Render an initial empty figure. This establishes with
@@ -742,7 +747,7 @@ export class FigureView extends DOMWidgetView {
742
747
  xaxis: axisHidden,
743
748
  yaxis: axisHidden,
744
749
  });
745
- window.addEventListener('resize', function () {
750
+ window.addEventListener('resize', () => {
746
751
  that.autosizeFigure();
747
752
  });
748
753
  break;
@@ -757,12 +762,12 @@ export class FigureView extends DOMWidgetView {
757
762
  }
758
763
  }
759
764
  autosizeFigure() {
760
- var that = this;
761
- var layout = that.model.get('_layout');
765
+ const that = this;
766
+ const layout = that.model.get('_layout');
762
767
  if (_.isNil(layout) || _.isNil(layout.width)) {
763
768
  // @ts-ignore
764
- Plotly.Plots.resize(that.el).then(function () {
765
- var layout_edit_id = that.model.get('_last_layout_edit_id');
769
+ Plotly.Plots.resize(that.el).then(() => {
770
+ const layout_edit_id = that.model.get('_last_layout_edit_id');
766
771
  that._sendLayoutDelta(layout_edit_id);
767
772
  });
768
773
  }
@@ -810,20 +815,21 @@ export class FigureView extends DOMWidgetView {
810
815
  * @returns {null|Points}
811
816
  */
812
817
  buildPointsObject(data) {
813
- var pointsObject;
818
+ let pointsObject;
814
819
  if (data.hasOwnProperty('points')) {
815
820
  // Most cartesian plots
816
- var pointObjects = data['points'];
817
- var numPoints = pointObjects.length;
818
- var hasNestedPointObjects = true;
821
+ const pointObjects = data['points'];
822
+ const numPoints = pointObjects.length;
823
+ let hasNestedPointObjects = true;
819
824
  for (let i = 0; i < numPoints; i++) {
820
825
  hasNestedPointObjects =
821
826
  hasNestedPointObjects &&
822
827
  pointObjects[i].hasOwnProperty('pointNumbers');
823
- if (!hasNestedPointObjects)
828
+ if (!hasNestedPointObjects) {
824
829
  break;
830
+ }
825
831
  }
826
- var numPointNumbers = numPoints;
832
+ let numPointNumbers = numPoints;
827
833
  if (hasNestedPointObjects) {
828
834
  numPointNumbers = 0;
829
835
  for (let i = 0; i < numPoints; i++) {
@@ -837,7 +843,7 @@ export class FigureView extends DOMWidgetView {
837
843
  ys: new Array(numPointNumbers),
838
844
  };
839
845
  if (hasNestedPointObjects) {
840
- var flatPointIndex = 0;
846
+ let flatPointIndex = 0;
841
847
  for (var p = 0; p < numPoints; p++) {
842
848
  for (let i = 0; i < pointObjects[p]['pointNumbers'].length; i++, flatPointIndex++) {
843
849
  pointsObject['point_indexes'][flatPointIndex] =
@@ -855,11 +861,12 @@ export class FigureView extends DOMWidgetView {
855
861
  single_trace &&
856
862
  pointsObject['trace_indexes'][i - 1] ===
857
863
  pointsObject['trace_indexes'][i];
858
- if (!single_trace)
864
+ if (!single_trace) {
859
865
  break;
866
+ }
860
867
  }
861
868
  if (single_trace) {
862
- pointsObject['point_indexes'].sort(function (a, b) {
869
+ pointsObject['point_indexes'].sort((a, b) => {
863
870
  return a - b;
864
871
  });
865
872
  }
@@ -873,7 +880,7 @@ export class FigureView extends DOMWidgetView {
873
880
  }
874
881
  }
875
882
  // Add z if present
876
- var hasZ = pointObjects[0] !== undefined && pointObjects[0].hasOwnProperty('z');
883
+ const hasZ = pointObjects[0] !== undefined && pointObjects[0].hasOwnProperty('z');
877
884
  if (hasZ) {
878
885
  pointsObject['zs'] = new Array(numPoints);
879
886
  for (p = 0; p < numPoints; p++) {
@@ -893,13 +900,13 @@ export class FigureView extends DOMWidgetView {
893
900
  * @returns {null|InputDeviceState}
894
901
  */
895
902
  buildInputDeviceStateObject(data) {
896
- var event = data['event'];
903
+ const event = data['event'];
897
904
  if (event === undefined) {
898
905
  return null;
899
906
  }
900
907
  else {
901
908
  /** @type {InputDeviceState} */
902
- var inputDeviceState = {
909
+ const inputDeviceState = {
903
910
  // Keyboard modifiers
904
911
  alt: event['altKey'],
905
912
  ctrl: event['ctrlKey'],
@@ -919,7 +926,7 @@ export class FigureView extends DOMWidgetView {
919
926
  * @returns {null|Selector}
920
927
  */
921
928
  buildSelectorObject(data) {
922
- var selectorObject;
929
+ let selectorObject;
923
930
  if (data.hasOwnProperty('range')) {
924
931
  // Box selection
925
932
  selectorObject = {
@@ -959,11 +966,11 @@ export class FigureView extends DOMWidgetView {
959
966
  return;
960
967
  }
961
968
  // Unpack data
962
- var styleData = data[0];
963
- var styleTraces = data[1];
969
+ const styleData = data[0];
970
+ const styleTraces = data[1];
964
971
  // Construct restyle message to send to the Python side
965
972
  /** @type {Js2PyRestyleMsg} */
966
- var restyleMsg = {
973
+ const restyleMsg = {
967
974
  style_data: styleData,
968
975
  style_traces: styleTraces,
969
976
  source_view_id: this.viewID,
@@ -985,7 +992,7 @@ export class FigureView extends DOMWidgetView {
985
992
  return;
986
993
  }
987
994
  /** @type {Js2PyRelayoutMsg} */
988
- var relayoutMsg = {
995
+ const relayoutMsg = {
989
996
  relayout_data: data,
990
997
  source_view_id: this.viewID,
991
998
  };
@@ -1006,7 +1013,7 @@ export class FigureView extends DOMWidgetView {
1006
1013
  return;
1007
1014
  }
1008
1015
  /** @type {Js2PyUpdateMsg} */
1009
- var updateMsg = {
1016
+ const updateMsg = {
1010
1017
  style_data: data['data'][0],
1011
1018
  style_traces: data['data'][1],
1012
1019
  layout_data: data['layout'],
@@ -1071,7 +1078,7 @@ export class FigureView extends DOMWidgetView {
1071
1078
  return;
1072
1079
  }
1073
1080
  /** @type {Js2PyPointsCallbackMsg} */
1074
- var pointsMsg = {
1081
+ const pointsMsg = {
1075
1082
  event_type: event_type,
1076
1083
  points: this.buildPointsObject(data),
1077
1084
  device_state: this.buildInputDeviceStateObject(data),
@@ -1092,14 +1099,14 @@ export class FigureView extends DOMWidgetView {
1092
1099
  */
1093
1100
  do_addTraces() {
1094
1101
  /** @type {Py2JsAddTracesMsg} */
1095
- var msgData = this.model.get('_py2js_addTraces');
1102
+ const msgData = this.model.get('_py2js_addTraces');
1096
1103
  if (msgData !== null) {
1097
- var that = this;
1098
- Plotly.addTraces(this.el, msgData.trace_data).then(function () {
1104
+ const that = this;
1105
+ Plotly.addTraces(this.el, msgData.trace_data).then(() => {
1099
1106
  // ### Send trace deltas ###
1100
1107
  that._sendTraceDeltas(msgData.trace_edit_id);
1101
1108
  // ### Send layout delta ###
1102
- var layout_edit_id = msgData.layout_edit_id;
1109
+ const layout_edit_id = msgData.layout_edit_id;
1103
1110
  that._sendLayoutDelta(layout_edit_id);
1104
1111
  });
1105
1112
  }
@@ -1109,16 +1116,16 @@ export class FigureView extends DOMWidgetView {
1109
1116
  */
1110
1117
  do_deleteTraces() {
1111
1118
  /** @type {Py2JsDeleteTracesMsg} */
1112
- var msgData = this.model.get('_py2js_deleteTraces');
1119
+ const msgData = this.model.get('_py2js_deleteTraces');
1113
1120
  if (msgData !== null) {
1114
- var delete_inds = msgData.delete_inds;
1115
- var that = this;
1116
- Plotly.deleteTraces(this.el, delete_inds).then(function () {
1121
+ const delete_inds = msgData.delete_inds;
1122
+ const that = this;
1123
+ Plotly.deleteTraces(this.el, delete_inds).then(() => {
1117
1124
  // ### Send trace deltas ###
1118
- var trace_edit_id = msgData.trace_edit_id;
1125
+ const trace_edit_id = msgData.trace_edit_id;
1119
1126
  that._sendTraceDeltas(trace_edit_id);
1120
1127
  // ### Send layout delta ###
1121
- var layout_edit_id = msgData.layout_edit_id;
1128
+ const layout_edit_id = msgData.layout_edit_id;
1122
1129
  that._sendLayoutDelta(layout_edit_id);
1123
1130
  });
1124
1131
  }
@@ -1128,14 +1135,14 @@ export class FigureView extends DOMWidgetView {
1128
1135
  */
1129
1136
  do_moveTraces() {
1130
1137
  /** @type {Py2JsMoveTracesMsg} */
1131
- var msgData = this.model.get('_py2js_moveTraces');
1138
+ const msgData = this.model.get('_py2js_moveTraces');
1132
1139
  if (msgData !== null) {
1133
1140
  // Unpack message
1134
- var currentInds = msgData.current_trace_inds;
1135
- var newInds = msgData.new_trace_inds;
1141
+ const currentInds = msgData.current_trace_inds;
1142
+ const newInds = msgData.new_trace_inds;
1136
1143
  // Check if the new trace indexes are actually different than
1137
1144
  // the current indexes
1138
- var inds_equal = _.isEqual(currentInds, newInds);
1145
+ const inds_equal = _.isEqual(currentInds, newInds);
1139
1146
  if (!inds_equal) {
1140
1147
  Plotly.moveTraces(this.el, currentInds, newInds);
1141
1148
  }
@@ -1146,10 +1153,10 @@ export class FigureView extends DOMWidgetView {
1146
1153
  */
1147
1154
  do_restyle() {
1148
1155
  /** @type {Py2JsRestyleMsg} */
1149
- var msgData = this.model.get('_py2js_restyle');
1156
+ const msgData = this.model.get('_py2js_restyle');
1150
1157
  if (msgData !== null) {
1151
- var restyleData = msgData.restyle_data;
1152
- var traceIndexes = this.model._normalize_trace_indexes(msgData.restyle_traces);
1158
+ const restyleData = msgData.restyle_data;
1159
+ const traceIndexes = this.model._normalize_trace_indexes(msgData.restyle_traces);
1153
1160
  restyleData['_doNotReportToPy'] = true;
1154
1161
  Plotly.restyle(this.el, restyleData, traceIndexes);
1155
1162
  // ### Send trace deltas ###
@@ -1157,7 +1164,7 @@ export class FigureView extends DOMWidgetView {
1157
1164
  // traces.
1158
1165
  this._sendTraceDeltas(msgData.trace_edit_id);
1159
1166
  // ### Send layout delta ###
1160
- var layout_edit_id = msgData.layout_edit_id;
1167
+ const layout_edit_id = msgData.layout_edit_id;
1161
1168
  this._sendLayoutDelta(layout_edit_id);
1162
1169
  }
1163
1170
  }
@@ -1166,15 +1173,15 @@ export class FigureView extends DOMWidgetView {
1166
1173
  */
1167
1174
  do_relayout() {
1168
1175
  /** @type {Py2JsRelayoutMsg} */
1169
- var msgData = this.model.get('_py2js_relayout');
1176
+ const msgData = this.model.get('_py2js_relayout');
1170
1177
  if (msgData !== null) {
1171
1178
  if (msgData.source_view_id !== this.viewID) {
1172
- var relayoutData = msgData.relayout_data;
1179
+ const relayoutData = msgData.relayout_data;
1173
1180
  relayoutData['_doNotReportToPy'] = true;
1174
1181
  Plotly.relayout(this.el, msgData.relayout_data);
1175
1182
  }
1176
1183
  // ### Send layout delta ###
1177
- var layout_edit_id = msgData.layout_edit_id;
1184
+ const layout_edit_id = msgData.layout_edit_id;
1178
1185
  this._sendLayoutDelta(layout_edit_id);
1179
1186
  }
1180
1187
  }
@@ -1183,11 +1190,11 @@ export class FigureView extends DOMWidgetView {
1183
1190
  */
1184
1191
  do_update() {
1185
1192
  /** @type {Py2JsUpdateMsg} */
1186
- var msgData = this.model.get('_py2js_update');
1193
+ const msgData = this.model.get('_py2js_update');
1187
1194
  if (msgData !== null) {
1188
- var style = msgData.style_data || {};
1189
- var layout = msgData.layout_data || {};
1190
- var traceIndexes = this.model._normalize_trace_indexes(msgData.style_traces);
1195
+ const style = msgData.style_data || {};
1196
+ const layout = msgData.layout_data || {};
1197
+ const traceIndexes = this.model._normalize_trace_indexes(msgData.style_traces);
1191
1198
  style['_doNotReportToPy'] = true;
1192
1199
  Plotly.update(this.el, style, layout, traceIndexes);
1193
1200
  // ### Send trace deltas ###
@@ -1195,7 +1202,7 @@ export class FigureView extends DOMWidgetView {
1195
1202
  // traces.
1196
1203
  this._sendTraceDeltas(msgData.trace_edit_id);
1197
1204
  // ### Send layout delta ###
1198
- var layout_edit_id = msgData.layout_edit_id;
1205
+ const layout_edit_id = msgData.layout_edit_id;
1199
1206
  this._sendLayoutDelta(layout_edit_id);
1200
1207
  }
1201
1208
  }
@@ -1204,29 +1211,29 @@ export class FigureView extends DOMWidgetView {
1204
1211
  */
1205
1212
  do_animate() {
1206
1213
  /** @type {Py2JsAnimateMsg} */
1207
- var msgData = this.model.get('_py2js_animate');
1214
+ const msgData = this.model.get('_py2js_animate');
1208
1215
  if (msgData !== null) {
1209
1216
  // Unpack params
1210
1217
  // var animationData = msgData[0];
1211
- var animationOpts = msgData.animation_opts;
1212
- var styles = msgData.style_data;
1213
- var layout = msgData.layout_data;
1214
- var traceIndexes = this.model._normalize_trace_indexes(msgData.style_traces);
1215
- var animationData = {
1218
+ const animationOpts = msgData.animation_opts;
1219
+ const styles = msgData.style_data;
1220
+ const layout = msgData.layout_data;
1221
+ const traceIndexes = this.model._normalize_trace_indexes(msgData.style_traces);
1222
+ const animationData = {
1216
1223
  data: styles,
1217
1224
  layout: layout,
1218
1225
  traces: traceIndexes,
1219
1226
  };
1220
1227
  animationData['_doNotReportToPy'] = true;
1221
- var that = this;
1228
+ const that = this;
1222
1229
  // @ts-ignore
1223
- Plotly.animate(this.el, animationData, animationOpts).then(function () {
1230
+ Plotly.animate(this.el, animationData, animationOpts).then(() => {
1224
1231
  // ### Send trace deltas ###
1225
1232
  // We create an array of deltas corresponding to the
1226
1233
  // animated traces.
1227
1234
  that._sendTraceDeltas(msgData.trace_edit_id);
1228
1235
  // ### Send layout delta ###
1229
- var layout_edit_id = msgData.layout_edit_id;
1236
+ const layout_edit_id = msgData.layout_edit_id;
1230
1237
  that._sendLayoutDelta(layout_edit_id);
1231
1238
  });
1232
1239
  }
@@ -1241,9 +1248,9 @@ export class FigureView extends DOMWidgetView {
1241
1248
  */
1242
1249
  _sendLayoutDelta(layout_edit_id) {
1243
1250
  // ### Handle layout delta ###
1244
- var layout_delta = createDeltaObject(this.getFullLayout(), this.model.get('_layout'));
1251
+ const layout_delta = createDeltaObject(this.getFullLayout(), this.model.get('_layout'));
1245
1252
  /** @type{Js2PyLayoutDeltaMsg} */
1246
- var layoutDeltaMsg = {
1253
+ const layoutDeltaMsg = {
1247
1254
  layout_delta: layout_delta,
1248
1255
  layout_edit_id: layout_edit_id,
1249
1256
  };
@@ -1259,16 +1266,16 @@ export class FigureView extends DOMWidgetView {
1259
1266
  * @private
1260
1267
  */
1261
1268
  _sendTraceDeltas(trace_edit_id) {
1262
- var trace_data = this.model.get('_data');
1263
- var traceIndexes = _.range(trace_data.length);
1264
- var trace_deltas = new Array(traceIndexes.length);
1265
- var fullData = this.getFullData();
1266
- for (var i = 0; i < traceIndexes.length; i++) {
1267
- var traceInd = traceIndexes[i];
1269
+ const trace_data = this.model.get('_data');
1270
+ const traceIndexes = _.range(trace_data.length);
1271
+ const trace_deltas = new Array(traceIndexes.length);
1272
+ const fullData = this.getFullData();
1273
+ for (let i = 0; i < traceIndexes.length; i++) {
1274
+ const traceInd = traceIndexes[i];
1268
1275
  trace_deltas[i] = createDeltaObject(fullData[traceInd], trace_data[traceInd]);
1269
1276
  }
1270
1277
  /** @type{Js2PyTraceDeltasMsg} */
1271
- var traceDeltasMsg = {
1278
+ const traceDeltasMsg = {
1272
1279
  trace_deltas: trace_deltas,
1273
1280
  trace_edit_id: trace_edit_id,
1274
1281
  };
@@ -1292,7 +1299,7 @@ const numpy_dtype_to_typedarray_type = {
1292
1299
  float64: Float64Array,
1293
1300
  };
1294
1301
  function serializeTypedArray(v) {
1295
- var numpyType;
1302
+ let numpyType;
1296
1303
  if (v instanceof Int8Array) {
1297
1304
  numpyType = 'int8';
1298
1305
  }
@@ -1321,7 +1328,7 @@ function serializeTypedArray(v) {
1321
1328
  // Don't understand it, return as is
1322
1329
  return v;
1323
1330
  }
1324
- var res = {
1331
+ const res = {
1325
1332
  dtype: numpyType,
1326
1333
  shape: [v.length],
1327
1334
  value: v.buffer,
@@ -1332,21 +1339,21 @@ function serializeTypedArray(v) {
1332
1339
  * ipywidget JavaScript -> Python serializer
1333
1340
  */
1334
1341
  function js2py_serializer(v, widgetManager) {
1335
- var res;
1342
+ let res;
1336
1343
  if (_.isTypedArray(v)) {
1337
1344
  res = serializeTypedArray(v);
1338
1345
  }
1339
1346
  else if (Array.isArray(v)) {
1340
1347
  // Serialize array elements recursively
1341
1348
  res = new Array(v.length);
1342
- for (var i = 0; i < v.length; i++) {
1349
+ for (let i = 0; i < v.length; i++) {
1343
1350
  res[i] = js2py_serializer(v[i]);
1344
1351
  }
1345
1352
  }
1346
1353
  else if (_.isPlainObject(v)) {
1347
1354
  // Serialize object properties recursively
1348
1355
  res = {};
1349
- for (var p in v) {
1356
+ for (const p in v) {
1350
1357
  if (v.hasOwnProperty(p)) {
1351
1358
  res[p] = js2py_serializer(v[p]);
1352
1359
  }
@@ -1368,11 +1375,11 @@ function js2py_serializer(v, widgetManager) {
1368
1375
  * ipywidget Python -> Javascript deserializer
1369
1376
  */
1370
1377
  function py2js_deserializer(v, widgetManager) {
1371
- var res;
1378
+ let res;
1372
1379
  if (Array.isArray(v)) {
1373
1380
  // Deserialize array elements recursively
1374
1381
  res = new Array(v.length);
1375
- for (var i = 0; i < v.length; i++) {
1382
+ for (let i = 0; i < v.length; i++) {
1376
1383
  res[i] = py2js_deserializer(v[i]);
1377
1384
  }
1378
1385
  }
@@ -1387,14 +1394,14 @@ function py2js_deserializer(v, widgetManager) {
1387
1394
  // This was renamed `value` in 3.2 to work around a naming conflict
1388
1395
  // when saving widget state to a notebook.
1389
1396
  // @ts-ignore
1390
- var typedarray_type = numpy_dtype_to_typedarray_type[v.dtype];
1391
- var buffer = _.has(v, 'value') ? v.value.buffer : v.buffer.buffer;
1397
+ const typedarray_type = numpy_dtype_to_typedarray_type[v.dtype];
1398
+ const buffer = _.has(v, 'value') ? v.value.buffer : v.buffer.buffer;
1392
1399
  res = new typedarray_type(buffer);
1393
1400
  }
1394
1401
  else {
1395
1402
  // Deserialize object properties recursively
1396
1403
  res = {};
1397
- for (var p in v) {
1404
+ for (const p in v) {
1398
1405
  if (v.hasOwnProperty(p)) {
1399
1406
  res[p] = py2js_deserializer(v[p]);
1400
1407
  }
@@ -1463,12 +1470,12 @@ function fullMergeCustomizer(objValue, srcValue, key) {
1463
1470
  */
1464
1471
  function performRelayoutLike(parentObj, relayoutData) {
1465
1472
  // Perform a relayout style operation on a given parent object
1466
- for (var rawKey in relayoutData) {
1473
+ for (const rawKey in relayoutData) {
1467
1474
  if (!relayoutData.hasOwnProperty(rawKey)) {
1468
1475
  continue;
1469
1476
  }
1470
1477
  // Extract value for this key
1471
- var relayoutVal = relayoutData[rawKey];
1478
+ const relayoutVal = relayoutData[rawKey];
1472
1479
  // Set property value
1473
1480
  if (relayoutVal === null) {
1474
1481
  _.unset(parentObj, rawKey);
@@ -1504,22 +1511,22 @@ function performRelayoutLike(parentObj, relayoutData) {
1504
1511
  */
1505
1512
  function performRestyleLike(parentArray, restyleData, restyleTraces) {
1506
1513
  // Loop over the properties of restyleData
1507
- for (var rawKey in restyleData) {
1514
+ for (const rawKey in restyleData) {
1508
1515
  if (!restyleData.hasOwnProperty(rawKey)) {
1509
1516
  continue;
1510
1517
  }
1511
1518
  // Extract value for property and normalize into a value list
1512
- var valArray = restyleData[rawKey];
1519
+ let valArray = restyleData[rawKey];
1513
1520
  if (!Array.isArray(valArray)) {
1514
1521
  valArray = [valArray];
1515
1522
  }
1516
1523
  // Loop over the indexes of the traces being restyled
1517
- for (var i = 0; i < restyleTraces.length; i++) {
1524
+ for (let i = 0; i < restyleTraces.length; i++) {
1518
1525
  // Get trace object
1519
- var traceInd = restyleTraces[i];
1520
- var trace = parentArray[traceInd];
1526
+ const traceInd = restyleTraces[i];
1527
+ const trace = parentArray[traceInd];
1521
1528
  // Extract value for this trace
1522
- var singleVal = valArray[i % valArray.length];
1529
+ const singleVal = valArray[i % valArray.length];
1523
1530
  // Set property value
1524
1531
  if (singleVal === null) {
1525
1532
  _.unset(trace, rawKey);
@@ -1551,14 +1558,14 @@ function performRestyleLike(parentArray, restyleData, restyleTraces) {
1551
1558
  */
1552
1559
  function performMoveTracesLike(parentArray, currentInds, newInds) {
1553
1560
  // ### Remove by currentInds in reverse order ###
1554
- var movingTracesData = [];
1555
- for (var ci = currentInds.length - 1; ci >= 0; ci--) {
1561
+ let movingTracesData = [];
1562
+ for (let ci = currentInds.length - 1; ci >= 0; ci--) {
1556
1563
  // Insert moving parentArray at beginning of the list
1557
1564
  movingTracesData.splice(0, 0, parentArray[currentInds[ci]]);
1558
1565
  parentArray.splice(currentInds[ci], 1);
1559
1566
  }
1560
1567
  // ### Sort newInds and movingTracesData by newInds ###
1561
- var newIndexSortedArrays = _(newInds)
1568
+ const newIndexSortedArrays = _(newInds)
1562
1569
  .zip(movingTracesData)
1563
1570
  .sortBy(0)
1564
1571
  .unzip()
@@ -1566,7 +1573,7 @@ function performMoveTracesLike(parentArray, currentInds, newInds) {
1566
1573
  newInds = newIndexSortedArrays[0];
1567
1574
  movingTracesData = newIndexSortedArrays[1];
1568
1575
  // ### Insert by newInds in forward order ###
1569
- for (var ni = 0; ni < newInds.length; ni++) {
1576
+ for (let ni = 0; ni < newInds.length; ni++) {
1570
1577
  parentArray.splice(newInds[ni], 0, movingTracesData[ni]);
1571
1578
  }
1572
1579
  }
@@ -1590,8 +1597,8 @@ function performMoveTracesLike(parentArray, currentInds, newInds) {
1590
1597
  *
1591
1598
  */
1592
1599
  function performRemoveProps(parentObj, keyPaths) {
1593
- for (var i = 0; i < keyPaths.length; i++) {
1594
- var keyPath = keyPaths[i];
1600
+ for (let i = 0; i < keyPaths.length; i++) {
1601
+ const keyPath = keyPaths[i];
1595
1602
  _.unset(parentObj, keyPath);
1596
1603
  }
1597
1604
  }
@@ -1625,7 +1632,7 @@ function performRemoveProps(parentObj, keyPaths) {
1625
1632
  */
1626
1633
  function createDeltaObject(fullObj, removeObj) {
1627
1634
  // Initialize result as object or array
1628
- var res;
1635
+ let res;
1629
1636
  if (Array.isArray(fullObj)) {
1630
1637
  res = new Array(fullObj.length);
1631
1638
  }
@@ -1637,7 +1644,7 @@ function createDeltaObject(fullObj, removeObj) {
1637
1644
  removeObj = {};
1638
1645
  }
1639
1646
  // Iterate over object properties or array indices
1640
- for (var p in fullObj) {
1647
+ for (const p in fullObj) {
1641
1648
  if (p[0] !== '_' && // Don't consider private properties
1642
1649
  fullObj.hasOwnProperty(p) && // Exclude parent properties
1643
1650
  fullObj[p] !== null // Exclude cases where fullObj doesn't
@@ -1651,14 +1658,14 @@ function createDeltaObject(fullObj, removeObj) {
1651
1658
  // Let uids through
1652
1659
  // property has non-null value in fullObj that doesn't
1653
1660
  // match the value in removeObj
1654
- var fullVal = fullObj[p];
1661
+ const fullVal = fullObj[p];
1655
1662
  if (removeObj.hasOwnProperty(p) && typeof fullVal === 'object') {
1656
1663
  // Recurse over object properties
1657
1664
  if (Array.isArray(fullVal)) {
1658
1665
  if (fullVal.length > 0 && typeof fullVal[0] === 'object') {
1659
1666
  // We have an object array
1660
1667
  res[p] = new Array(fullVal.length);
1661
- for (var i = 0; i < fullVal.length; i++) {
1668
+ for (let i = 0; i < fullVal.length; i++) {
1662
1669
  if (!Array.isArray(removeObj[p]) || removeObj[p].length <= i) {
1663
1670
  res[p][i] = fullVal[i];
1664
1671
  }
@@ -1674,7 +1681,7 @@ function createDeltaObject(fullObj, removeObj) {
1674
1681
  }
1675
1682
  else {
1676
1683
  // object
1677
- var full_obj = createDeltaObject(fullVal, removeObj[p]);
1684
+ const full_obj = createDeltaObject(fullVal, removeObj[p]);
1678
1685
  if (Object.keys(full_obj).length > 0) {
1679
1686
  // new object is not empty
1680
1687
  res[p] = full_obj;
@@ -1698,19 +1705,22 @@ function createDeltaObject(fullObj, removeObj) {
1698
1705
  return res;
1699
1706
  }
1700
1707
  function randstr(existing, bits, base, _recursion) {
1701
- if (!base)
1708
+ if (!base) {
1702
1709
  base = 16;
1703
- if (bits === undefined)
1710
+ }
1711
+ if (bits === undefined) {
1704
1712
  bits = 24;
1705
- if (bits <= 0)
1713
+ }
1714
+ if (bits <= 0) {
1706
1715
  return '0';
1707
- var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
1708
- var res = '';
1709
- var i, b, x;
1716
+ }
1717
+ let digits = Math.log(Math.pow(2, bits)) / Math.log(base);
1718
+ let res = '';
1719
+ let i, b, x;
1710
1720
  for (i = 2; digits === Infinity; i *= 2) {
1711
1721
  digits = (Math.log(Math.pow(2, bits / i)) / Math.log(base)) * i;
1712
1722
  }
1713
- var rem = digits - Math.floor(digits);
1723
+ const rem = digits - Math.floor(digits);
1714
1724
  for (i = 0; i < Math.floor(digits); i++) {
1715
1725
  x = Math.floor(Math.random() * base).toString(base);
1716
1726
  res = x + res;
@@ -1720,7 +1730,7 @@ function randstr(existing, bits, base, _recursion) {
1720
1730
  x = Math.floor(Math.random() * b).toString(base);
1721
1731
  res = x + res;
1722
1732
  }
1723
- var parsed = parseInt(res, base);
1733
+ const parsed = parseInt(res, base);
1724
1734
  if ((existing && existing[res]) ||
1725
1735
  (parsed !== Infinity && parsed >= Math.pow(2, bits))) {
1726
1736
  if (_recursion > 10) {
@@ -1729,7 +1739,8 @@ function randstr(existing, bits, base, _recursion) {
1729
1739
  }
1730
1740
  return randstr(existing, bits, base, (_recursion || 0) + 1);
1731
1741
  }
1732
- else
1742
+ else {
1733
1743
  return res;
1744
+ }
1734
1745
  }
1735
1746
  //# sourceMappingURL=Figure.js.map