solara 1.30.1__py2.py3-none-any.whl → 1.32.0__py2.py3-none-any.whl

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 (438) hide show
  1. {solara-1.30.1.dist-info → solara-1.32.0.dist-info}/METADATA +12 -42
  2. solara-1.32.0.dist-info/RECORD +5 -0
  3. {solara-1.30.1.dist-info → solara-1.32.0.dist-info}/WHEEL +1 -1
  4. {solara/template/portal → solara-1.32.0.dist-info/licenses}/LICENSE +1 -1
  5. solara/__init__.py +0 -123
  6. solara/__main__.py +0 -734
  7. solara/alias.py +0 -6
  8. solara/autorouting.py +0 -545
  9. solara/cache.py +0 -294
  10. solara/checks.html +0 -71
  11. solara/checks.py +0 -224
  12. solara/comm.py +0 -28
  13. solara/components/__init__.py +0 -59
  14. solara/components/alert.py +0 -155
  15. solara/components/applayout.py +0 -393
  16. solara/components/button.py +0 -85
  17. solara/components/card.py +0 -87
  18. solara/components/checkbox.py +0 -50
  19. solara/components/code_highlight_css.py +0 -11
  20. solara/components/code_highlight_css.vue +0 -63
  21. solara/components/columns.py +0 -159
  22. solara/components/component_vue.py +0 -110
  23. solara/components/cross_filter.py +0 -335
  24. solara/components/dataframe.py +0 -546
  25. solara/components/datatable.py +0 -221
  26. solara/components/datatable.vue +0 -175
  27. solara/components/details.py +0 -21
  28. solara/components/download.vue +0 -35
  29. solara/components/echarts.py +0 -75
  30. solara/components/echarts.vue +0 -128
  31. solara/components/figure_altair.py +0 -39
  32. solara/components/file_browser.py +0 -182
  33. solara/components/file_download.py +0 -199
  34. solara/components/file_drop.py +0 -139
  35. solara/components/file_drop.vue +0 -83
  36. solara/components/file_list_widget.vue +0 -78
  37. solara/components/head.py +0 -27
  38. solara/components/head_tag.py +0 -49
  39. solara/components/head_tag.vue +0 -60
  40. solara/components/image.py +0 -173
  41. solara/components/input.py +0 -440
  42. solara/components/link.py +0 -55
  43. solara/components/markdown.py +0 -371
  44. solara/components/markdown_editor.py +0 -25
  45. solara/components/markdown_editor.vue +0 -362
  46. solara/components/matplotlib.py +0 -74
  47. solara/components/meta.py +0 -47
  48. solara/components/misc.py +0 -333
  49. solara/components/pivot_table.py +0 -258
  50. solara/components/pivot_table.vue +0 -158
  51. solara/components/progress.py +0 -47
  52. solara/components/select.py +0 -186
  53. solara/components/select.vue +0 -27
  54. solara/components/slider.py +0 -442
  55. solara/components/slider_date.vue +0 -56
  56. solara/components/spinner-solara.vue +0 -105
  57. solara/components/spinner.py +0 -30
  58. solara/components/sql_code.py +0 -33
  59. solara/components/sql_code.vue +0 -128
  60. solara/components/style.py +0 -105
  61. solara/components/switch.py +0 -68
  62. solara/components/tab_navigation.py +0 -37
  63. solara/components/title.py +0 -90
  64. solara/components/title.vue +0 -38
  65. solara/components/togglebuttons.py +0 -202
  66. solara/components/tooltip.py +0 -61
  67. solara/datatypes.py +0 -143
  68. solara/express.py +0 -241
  69. solara/hooks/__init__.py +0 -4
  70. solara/hooks/dataframe.py +0 -99
  71. solara/hooks/misc.py +0 -263
  72. solara/hooks/use_reactive.py +0 -129
  73. solara/hooks/use_thread.py +0 -129
  74. solara/kitchensink.py +0 -8
  75. solara/lab/__init__.py +0 -34
  76. solara/lab/components/__init__.py +0 -6
  77. solara/lab/components/chat.py +0 -203
  78. solara/lab/components/confirmation_dialog.py +0 -165
  79. solara/lab/components/cross_filter.py +0 -7
  80. solara/lab/components/input_date.py +0 -298
  81. solara/lab/components/menu.py +0 -181
  82. solara/lab/components/menu.vue +0 -38
  83. solara/lab/components/tabs.py +0 -274
  84. solara/lab/components/theming.py +0 -98
  85. solara/lab/components/theming.vue +0 -72
  86. solara/lab/hooks/__init__.py +0 -0
  87. solara/lab/hooks/dataframe.py +0 -12
  88. solara/lab/toestand.py +0 -3
  89. solara/lab/utils/__init__.py +0 -2
  90. solara/lab/utils/cookies.py +0 -5
  91. solara/lab/utils/dataframe.py +0 -115
  92. solara/lab/utils/headers.py +0 -5
  93. solara/layout.py +0 -44
  94. solara/minisettings.py +0 -133
  95. solara/py.typed +0 -0
  96. solara/reactive.py +0 -93
  97. solara/routing.py +0 -268
  98. solara/scope/__init__.py +0 -88
  99. solara/scope/types.py +0 -55
  100. solara/server/__init__.py +0 -0
  101. solara/server/app.py +0 -490
  102. solara/server/assets/custom.css +0 -1
  103. solara/server/assets/custom.js +0 -1
  104. solara/server/assets/favicon.png +0 -0
  105. solara/server/assets/favicon.svg +0 -5
  106. solara/server/assets/style.css +0 -1665
  107. solara/server/assets/theme-dark.css +0 -437
  108. solara/server/assets/theme-light.css +0 -420
  109. solara/server/assets/theme.js +0 -3
  110. solara/server/cdn_helper.py +0 -77
  111. solara/server/esm.py +0 -69
  112. solara/server/fastapi.py +0 -5
  113. solara/server/flask.py +0 -286
  114. solara/server/jupyter/__init__.py +0 -2
  115. solara/server/jupyter/cdn_handler.py +0 -28
  116. solara/server/jupyter/server_extension.py +0 -29
  117. solara/server/jupytertools.py +0 -46
  118. solara/server/kernel.py +0 -319
  119. solara/server/kernel_context.py +0 -396
  120. solara/server/patch.py +0 -552
  121. solara/server/reload.py +0 -242
  122. solara/server/server.py +0 -437
  123. solara/server/settings.py +0 -212
  124. solara/server/shell.py +0 -240
  125. solara/server/starlette.py +0 -597
  126. solara/server/static/ansi.js +0 -270
  127. solara/server/static/highlight-dark.css +0 -82
  128. solara/server/static/highlight.css +0 -43
  129. solara/server/static/main-vuetify.js +0 -260
  130. solara/server/static/main.js +0 -163
  131. solara/server/static/solara_bootstrap.py +0 -129
  132. solara/server/static/sun.svg +0 -23
  133. solara/server/static/webworker.js +0 -42
  134. solara/server/telemetry.py +0 -212
  135. solara/server/templates/index.html.j2 +0 -1
  136. solara/server/templates/loader-plain.css +0 -11
  137. solara/server/templates/loader-plain.html +0 -20
  138. solara/server/templates/loader-solara.css +0 -111
  139. solara/server/templates/loader-solara.html +0 -40
  140. solara/server/templates/plain.html +0 -82
  141. solara/server/templates/solara.html.j2 +0 -446
  142. solara/server/threaded.py +0 -75
  143. solara/server/utils.py +0 -30
  144. solara/server/websocket.py +0 -44
  145. solara/settings.py +0 -56
  146. solara/tasks.py +0 -847
  147. solara/template/button.py +0 -16
  148. solara/template/markdown.py +0 -42
  149. solara/template/portal/.flake8 +0 -6
  150. solara/template/portal/.pre-commit-config.yaml +0 -28
  151. solara/template/portal/Procfile +0 -7
  152. solara/template/portal/mypy.ini +0 -3
  153. solara/template/portal/pyproject.toml +0 -26
  154. solara/template/portal/solara_portal/__init__.py +0 -3
  155. solara/template/portal/solara_portal/components/__init__.py +0 -2
  156. solara/template/portal/solara_portal/components/article.py +0 -28
  157. solara/template/portal/solara_portal/components/data.py +0 -28
  158. solara/template/portal/solara_portal/components/header.py +0 -6
  159. solara/template/portal/solara_portal/components/layout.py +0 -6
  160. solara/template/portal/solara_portal/content/articles/equis-in-vidi.md +0 -85
  161. solara/template/portal/solara_portal/content/articles/substiterat-vati.md +0 -70
  162. solara/template/portal/solara_portal/data.py +0 -60
  163. solara/template/portal/solara_portal/pages/__init__.py +0 -67
  164. solara/template/portal/solara_portal/pages/article/__init__.py +0 -26
  165. solara/template/portal/solara_portal/pages/tabular.py +0 -29
  166. solara/template/portal/solara_portal/pages/viz/__init__.py +0 -69
  167. solara/template/portal/solara_portal/pages/viz/overview.py +0 -14
  168. solara/test/__init__.py +0 -0
  169. solara/test/pytest_plugin.py +0 -698
  170. solara/toestand.py +0 -772
  171. solara/util.py +0 -308
  172. solara/website/__init__.py +0 -0
  173. solara/website/assets/custom.css +0 -462
  174. solara/website/assets/images/logo-small.png +0 -0
  175. solara/website/assets/images/logo.svg +0 -17
  176. solara/website/assets/images/logo_white.svg +0 -50
  177. solara/website/assets/theme.js +0 -8
  178. solara/website/components/__init__.py +0 -5
  179. solara/website/components/algolia.vue +0 -24
  180. solara/website/components/algolia_api.vue +0 -157
  181. solara/website/components/docs.py +0 -118
  182. solara/website/components/header.py +0 -72
  183. solara/website/components/hero.py +0 -15
  184. solara/website/components/mailchimp.py +0 -12
  185. solara/website/components/mailchimp.vue +0 -47
  186. solara/website/components/markdown.py +0 -30
  187. solara/website/components/notebook.py +0 -172
  188. solara/website/pages/__init__.py +0 -575
  189. solara/website/pages/apps/__init__.py +0 -16
  190. solara/website/pages/apps/authorization/__init__.py +0 -118
  191. solara/website/pages/apps/authorization/admin.py +0 -12
  192. solara/website/pages/apps/authorization/users.py +0 -12
  193. solara/website/pages/apps/jupyter-dashboard-1.py +0 -116
  194. solara/website/pages/apps/layout-demo.py +0 -40
  195. solara/website/pages/apps/multipage/__init__.py +0 -38
  196. solara/website/pages/apps/multipage/page1.py +0 -26
  197. solara/website/pages/apps/multipage/page2.py +0 -34
  198. solara/website/pages/apps/scatter.py +0 -136
  199. solara/website/pages/apps/scrolling.py +0 -63
  200. solara/website/pages/apps/tutorial-streamlit.py +0 -18
  201. solara/website/pages/changelog/__init__.py +0 -8
  202. solara/website/pages/changelog/changelog.md +0 -195
  203. solara/website/pages/contact/__init__.py +0 -8
  204. solara/website/pages/contact/contact.md +0 -17
  205. solara/website/pages/doc_use_download.py +0 -85
  206. solara/website/pages/documentation/__init__.py +0 -184
  207. solara/website/pages/documentation/advanced/__init__.py +0 -9
  208. solara/website/pages/documentation/advanced/content/00-overview.md +0 -1
  209. solara/website/pages/documentation/advanced/content/10-howto/00-overview.md +0 -6
  210. solara/website/pages/documentation/advanced/content/10-howto/10-multipage.md +0 -196
  211. solara/website/pages/documentation/advanced/content/10-howto/20-layout.md +0 -125
  212. solara/website/pages/documentation/advanced/content/10-howto/30-testing.md +0 -154
  213. solara/website/pages/documentation/advanced/content/10-howto/31-debugging.md +0 -69
  214. solara/website/pages/documentation/advanced/content/10-howto/40-embed.md +0 -49
  215. solara/website/pages/documentation/advanced/content/10-howto/50-ipywidget_libraries.md +0 -124
  216. solara/website/pages/documentation/advanced/content/20-understanding/00-introduction.md +0 -10
  217. solara/website/pages/documentation/advanced/content/20-understanding/05-ipywidgets.md +0 -35
  218. solara/website/pages/documentation/advanced/content/20-understanding/06-ipyvuetify.md +0 -42
  219. solara/website/pages/documentation/advanced/content/20-understanding/10-reacton.md +0 -28
  220. solara/website/pages/documentation/advanced/content/20-understanding/12-reacton-basics.md +0 -108
  221. solara/website/pages/documentation/advanced/content/20-understanding/15-anatomy.md +0 -23
  222. solara/website/pages/documentation/advanced/content/20-understanding/17-rules-of-hooks.md +0 -7
  223. solara/website/pages/documentation/advanced/content/20-understanding/18-containers.md +0 -166
  224. solara/website/pages/documentation/advanced/content/20-understanding/20-solara.md +0 -18
  225. solara/website/pages/documentation/advanced/content/20-understanding/40-routing.md +0 -240
  226. solara/website/pages/documentation/advanced/content/20-understanding/50-solara-server.md +0 -86
  227. solara/website/pages/documentation/advanced/content/20-understanding/60-voila.md +0 -12
  228. solara/website/pages/documentation/advanced/content/30-enterprise/00-overview.md +0 -1
  229. solara/website/pages/documentation/advanced/content/30-enterprise/10-oauth.md +0 -171
  230. solara/website/pages/documentation/advanced/content/40-development/00-overview.md +0 -0
  231. solara/website/pages/documentation/advanced/content/40-development/01-contribute.md +0 -45
  232. solara/website/pages/documentation/advanced/content/40-development/10-setup.md +0 -76
  233. solara/website/pages/documentation/api/__init__.py +0 -19
  234. solara/website/pages/documentation/api/cross_filter/__init__.py +0 -9
  235. solara/website/pages/documentation/api/cross_filter/cross_filter_dataframe.py +0 -23
  236. solara/website/pages/documentation/api/cross_filter/cross_filter_report.py +0 -22
  237. solara/website/pages/documentation/api/cross_filter/cross_filter_select.py +0 -22
  238. solara/website/pages/documentation/api/cross_filter/cross_filter_slider.py +0 -22
  239. solara/website/pages/documentation/api/hooks/__init__.py +0 -9
  240. solara/website/pages/documentation/api/hooks/use_cross_filter.py +0 -25
  241. solara/website/pages/documentation/api/hooks/use_dark_effective.py +0 -13
  242. solara/website/pages/documentation/api/hooks/use_effect.md +0 -43
  243. solara/website/pages/documentation/api/hooks/use_effect.py +0 -9
  244. solara/website/pages/documentation/api/hooks/use_exception.py +0 -33
  245. solara/website/pages/documentation/api/hooks/use_memo.md +0 -16
  246. solara/website/pages/documentation/api/hooks/use_memo.py +0 -9
  247. solara/website/pages/documentation/api/hooks/use_previous.py +0 -32
  248. solara/website/pages/documentation/api/hooks/use_reactive.py +0 -15
  249. solara/website/pages/documentation/api/hooks/use_state.py +0 -11
  250. solara/website/pages/documentation/api/hooks/use_state_or_update.py +0 -68
  251. solara/website/pages/documentation/api/hooks/use_thread.md +0 -58
  252. solara/website/pages/documentation/api/hooks/use_thread.py +0 -44
  253. solara/website/pages/documentation/api/hooks/use_trait_observe.py +0 -13
  254. solara/website/pages/documentation/api/routing/__init__.py +0 -9
  255. solara/website/pages/documentation/api/routing/generate_routes.py +0 -11
  256. solara/website/pages/documentation/api/routing/generate_routes_directory.py +0 -11
  257. solara/website/pages/documentation/api/routing/resolve_path.py +0 -36
  258. solara/website/pages/documentation/api/routing/route.py +0 -32
  259. solara/website/pages/documentation/api/routing/use_route.py +0 -80
  260. solara/website/pages/documentation/api/routing/use_router.py +0 -15
  261. solara/website/pages/documentation/api/utilities/__init__.py +0 -9
  262. solara/website/pages/documentation/api/utilities/component_vue.py +0 -11
  263. solara/website/pages/documentation/api/utilities/computed.py +0 -16
  264. solara/website/pages/documentation/api/utilities/display.py +0 -15
  265. solara/website/pages/documentation/api/utilities/get_kernel_id.py +0 -16
  266. solara/website/pages/documentation/api/utilities/get_session_id.py +0 -16
  267. solara/website/pages/documentation/api/utilities/memoize.py +0 -36
  268. solara/website/pages/documentation/api/utilities/on_kernel_start.py +0 -27
  269. solara/website/pages/documentation/api/utilities/reactive.py +0 -15
  270. solara/website/pages/documentation/api/utilities/widget.py +0 -104
  271. solara/website/pages/documentation/components/__init__.py +0 -12
  272. solara/website/pages/documentation/components/advanced/__init__.py +0 -9
  273. solara/website/pages/documentation/components/advanced/link.py +0 -28
  274. solara/website/pages/documentation/components/advanced/meta.py +0 -21
  275. solara/website/pages/documentation/components/advanced/style.py +0 -44
  276. solara/website/pages/documentation/components/common.py +0 -9
  277. solara/website/pages/documentation/components/data/__init__.py +0 -9
  278. solara/website/pages/documentation/components/data/dataframe.py +0 -44
  279. solara/website/pages/documentation/components/data/pivot_table.py +0 -81
  280. solara/website/pages/documentation/components/enterprise/__init__.py +0 -9
  281. solara/website/pages/documentation/components/enterprise/avatar.py +0 -19
  282. solara/website/pages/documentation/components/enterprise/avatar_menu.py +0 -20
  283. solara/website/pages/documentation/components/input/__init__.py +0 -9
  284. solara/website/pages/documentation/components/input/button.py +0 -22
  285. solara/website/pages/documentation/components/input/checkbox.py +0 -12
  286. solara/website/pages/documentation/components/input/file_browser.py +0 -33
  287. solara/website/pages/documentation/components/input/file_drop.py +0 -75
  288. solara/website/pages/documentation/components/input/input.py +0 -18
  289. solara/website/pages/documentation/components/input/select.py +0 -21
  290. solara/website/pages/documentation/components/input/slider.py +0 -28
  291. solara/website/pages/documentation/components/input/switch.py +0 -12
  292. solara/website/pages/documentation/components/input/togglebuttons.py +0 -20
  293. solara/website/pages/documentation/components/lab/__init__.py +0 -9
  294. solara/website/pages/documentation/components/lab/chat.py +0 -108
  295. solara/website/pages/documentation/components/lab/confirmation_dialog.py +0 -55
  296. solara/website/pages/documentation/components/lab/cookies_headers.py +0 -48
  297. solara/website/pages/documentation/components/lab/input_date.py +0 -19
  298. solara/website/pages/documentation/components/lab/menu.py +0 -21
  299. solara/website/pages/documentation/components/lab/tab.py +0 -24
  300. solara/website/pages/documentation/components/lab/tabs.py +0 -44
  301. solara/website/pages/documentation/components/lab/task.py +0 -12
  302. solara/website/pages/documentation/components/lab/theming.py +0 -72
  303. solara/website/pages/documentation/components/lab/use_task.py +0 -12
  304. solara/website/pages/documentation/components/layout/__init__.py +0 -9
  305. solara/website/pages/documentation/components/layout/app_bar.py +0 -15
  306. solara/website/pages/documentation/components/layout/app_bar_title.py +0 -15
  307. solara/website/pages/documentation/components/layout/app_layout.py +0 -23
  308. solara/website/pages/documentation/components/layout/card.py +0 -14
  309. solara/website/pages/documentation/components/layout/card_actions.py +0 -15
  310. solara/website/pages/documentation/components/layout/column.py +0 -29
  311. solara/website/pages/documentation/components/layout/columns.py +0 -26
  312. solara/website/pages/documentation/components/layout/columns_responsive.py +0 -67
  313. solara/website/pages/documentation/components/layout/griddraggable.py +0 -61
  314. solara/website/pages/documentation/components/layout/gridfixed.py +0 -21
  315. solara/website/pages/documentation/components/layout/hbox.py +0 -17
  316. solara/website/pages/documentation/components/layout/row.py +0 -29
  317. solara/website/pages/documentation/components/layout/sidebar.py +0 -23
  318. solara/website/pages/documentation/components/layout/vbox.py +0 -19
  319. solara/website/pages/documentation/components/output/__init__.py +0 -9
  320. solara/website/pages/documentation/components/output/file_download.py +0 -12
  321. solara/website/pages/documentation/components/output/html.py +0 -22
  322. solara/website/pages/documentation/components/output/image.py +0 -12
  323. solara/website/pages/documentation/components/output/markdown.py +0 -59
  324. solara/website/pages/documentation/components/output/markdown_editor.py +0 -53
  325. solara/website/pages/documentation/components/output/sql_code.py +0 -84
  326. solara/website/pages/documentation/components/output/tooltip.py +0 -12
  327. solara/website/pages/documentation/components/page/__init__.py +0 -9
  328. solara/website/pages/documentation/components/page/head.py +0 -19
  329. solara/website/pages/documentation/components/page/title.py +0 -28
  330. solara/website/pages/documentation/components/status/__init__.py +0 -9
  331. solara/website/pages/documentation/components/status/error.py +0 -40
  332. solara/website/pages/documentation/components/status/info.py +0 -40
  333. solara/website/pages/documentation/components/status/progress.py +0 -10
  334. solara/website/pages/documentation/components/status/spinner.py +0 -10
  335. solara/website/pages/documentation/components/status/success.py +0 -40
  336. solara/website/pages/documentation/components/status/warning.py +0 -47
  337. solara/website/pages/documentation/components/viz/__init__.py +0 -9
  338. solara/website/pages/documentation/components/viz/altair.py +0 -44
  339. solara/website/pages/documentation/components/viz/echarts.py +0 -78
  340. solara/website/pages/documentation/components/viz/matplotlib.py +0 -32
  341. solara/website/pages/documentation/components/viz/plotly.py +0 -63
  342. solara/website/pages/documentation/components/viz/plotly_express.py +0 -41
  343. solara/website/pages/documentation/examples/__init__.py +0 -52
  344. solara/website/pages/documentation/examples/ai/__init__.py +0 -10
  345. solara/website/pages/documentation/examples/ai/chatbot.py +0 -96
  346. solara/website/pages/documentation/examples/ai/tokenizer.py +0 -106
  347. solara/website/pages/documentation/examples/basics/__init__.py +0 -2
  348. solara/website/pages/documentation/examples/basics/sine.py +0 -28
  349. solara/website/pages/documentation/examples/fullscreen/__init__.py +0 -9
  350. solara/website/pages/documentation/examples/fullscreen/authorization.py +0 -3
  351. solara/website/pages/documentation/examples/fullscreen/layout_demo.py +0 -3
  352. solara/website/pages/documentation/examples/fullscreen/multipage.py +0 -3
  353. solara/website/pages/documentation/examples/fullscreen/scatter.py +0 -3
  354. solara/website/pages/documentation/examples/fullscreen/scrolling.py +0 -3
  355. solara/website/pages/documentation/examples/fullscreen/tutorial_streamlit.py +0 -3
  356. solara/website/pages/documentation/examples/general/__init__.py +0 -9
  357. solara/website/pages/documentation/examples/general/custom_storage.py +0 -69
  358. solara/website/pages/documentation/examples/general/deploy_model.py +0 -114
  359. solara/website/pages/documentation/examples/general/live_update.py +0 -38
  360. solara/website/pages/documentation/examples/general/login_oauth.py +0 -76
  361. solara/website/pages/documentation/examples/general/mycard.vue +0 -58
  362. solara/website/pages/documentation/examples/general/pokemon_search.py +0 -51
  363. solara/website/pages/documentation/examples/general/vue_component.py +0 -50
  364. solara/website/pages/documentation/examples/ipycanvas.py +0 -49
  365. solara/website/pages/documentation/examples/libraries/__init__.py +0 -9
  366. solara/website/pages/documentation/examples/libraries/altair.py +0 -63
  367. solara/website/pages/documentation/examples/libraries/bqplot.py +0 -39
  368. solara/website/pages/documentation/examples/libraries/ipyleaflet.py +0 -32
  369. solara/website/pages/documentation/examples/libraries/ipyleaflet_advanced.py +0 -65
  370. solara/website/pages/documentation/examples/utilities/__init__.py +0 -9
  371. solara/website/pages/documentation/examples/utilities/calculator.py +0 -157
  372. solara/website/pages/documentation/examples/utilities/countdown_timer.py +0 -64
  373. solara/website/pages/documentation/examples/utilities/todo.py +0 -195
  374. solara/website/pages/documentation/examples/visualization/__init__.py +0 -6
  375. solara/website/pages/documentation/examples/visualization/annotator.py +0 -68
  376. solara/website/pages/documentation/examples/visualization/linked_views.py +0 -84
  377. solara/website/pages/documentation/examples/visualization/plotly.py +0 -43
  378. solara/website/pages/documentation/faq/__init__.py +0 -12
  379. solara/website/pages/documentation/faq/content/99-faq.md +0 -76
  380. solara/website/pages/documentation/getting_started/__init__.py +0 -9
  381. solara/website/pages/documentation/getting_started/content/00-quickstart.md +0 -89
  382. solara/website/pages/documentation/getting_started/content/01-introduction.md +0 -125
  383. solara/website/pages/documentation/getting_started/content/02-installing.md +0 -85
  384. solara/website/pages/documentation/getting_started/content/04-tutorials/00-overview.md +0 -14
  385. solara/website/pages/documentation/getting_started/content/04-tutorials/10_data_science.py +0 -13
  386. solara/website/pages/documentation/getting_started/content/04-tutorials/20-web-app.md +0 -89
  387. solara/website/pages/documentation/getting_started/content/04-tutorials/30-ipywidgets.md +0 -124
  388. solara/website/pages/documentation/getting_started/content/04-tutorials/40-streamlit.md +0 -146
  389. solara/website/pages/documentation/getting_started/content/04-tutorials/50-dash.md +0 -144
  390. solara/website/pages/documentation/getting_started/content/04-tutorials/60-jupyter-dashboard-part1.py +0 -64
  391. solara/website/pages/documentation/getting_started/content/04-tutorials/SF_crime_sample.csv.gz +0 -0
  392. solara/website/pages/documentation/getting_started/content/04-tutorials/_data_science.ipynb +0 -445
  393. solara/website/pages/documentation/getting_started/content/04-tutorials/_jupyter_dashboard_1.ipynb +0 -1000
  394. solara/website/pages/documentation/getting_started/content/05-fundamentals/00-overview.md +0 -11
  395. solara/website/pages/documentation/getting_started/content/05-fundamentals/10-components.md +0 -223
  396. solara/website/pages/documentation/getting_started/content/05-fundamentals/50-state-management.md +0 -88
  397. solara/website/pages/documentation/getting_started/content/06-reference/00-overview.md +0 -3
  398. solara/website/pages/documentation/getting_started/content/06-reference/40-static_files.md +0 -31
  399. solara/website/pages/documentation/getting_started/content/06-reference/41-asset-files.md +0 -36
  400. solara/website/pages/documentation/getting_started/content/06-reference/60-static-site-generation.md +0 -59
  401. solara/website/pages/documentation/getting_started/content/06-reference/70-search.md +0 -34
  402. solara/website/pages/documentation/getting_started/content/06-reference/80-reloading.md +0 -34
  403. solara/website/pages/documentation/getting_started/content/06-reference/90-notebook-support.md +0 -7
  404. solara/website/pages/documentation/getting_started/content/06-reference/95-caching.md +0 -148
  405. solara/website/pages/documentation/getting_started/content/07-deploying/00-overview.md +0 -7
  406. solara/website/pages/documentation/getting_started/content/07-deploying/10-self-hosted.md +0 -273
  407. solara/website/pages/documentation/getting_started/content/07-deploying/20-cloud-hosted.md +0 -80
  408. solara/website/pages/documentation/getting_started/content/80-what-is-lab.md +0 -7
  409. solara/website/pages/documentation/getting_started/content/90-troubleshoot.md +0 -26
  410. solara/website/pages/docutils.py +0 -38
  411. solara/website/pages/showcase/__init__.py +0 -105
  412. solara/website/pages/showcase/domino_code_assist.py +0 -60
  413. solara/website/pages/showcase/planeto_tessa.py +0 -19
  414. solara/website/pages/showcase/solara_dev.py +0 -54
  415. solara/website/pages/showcase/solarathon_2023_team_2.py +0 -22
  416. solara/website/pages/showcase/solarathon_2023_team_4.py +0 -22
  417. solara/website/pages/showcase/solarathon_2023_team_5.py +0 -23
  418. solara/website/pages/showcase/solarathon_2023_team_6.py +0 -34
  419. solara/website/pages/showcase/wanderlust.py +0 -27
  420. solara/website/public/beach.jpeg +0 -0
  421. solara/website/public/logo.svg +0 -6
  422. solara/website/public/social/discord.svg +0 -1
  423. solara/website/public/social/github.svg +0 -1
  424. solara/website/public/social/twitter.svg +0 -3
  425. solara/website/public/success.html +0 -25
  426. solara/website/templates/index.html.j2 +0 -117
  427. solara/website/utils.py +0 -51
  428. solara/widgets/__init__.py +0 -1
  429. solara/widgets/vue/gridlayout.vue +0 -110
  430. solara/widgets/vue/html.vue +0 -4
  431. solara/widgets/vue/navigator.vue +0 -104
  432. solara/widgets/vue/vegalite.vue +0 -115
  433. solara/widgets/widgets.py +0 -65
  434. solara-1.30.1.data/data/etc/jupyter/jupyter_notebook_config.d/solara.json +0 -7
  435. solara-1.30.1.data/data/etc/jupyter/jupyter_server_config.d/solara.json +0 -7
  436. solara-1.30.1.dist-info/RECORD +0 -437
  437. solara-1.30.1.dist-info/entry_points.txt +0 -5
  438. /solara-1.30.1.dist-info/licenses/LICENSE → /LICENSE +0 -0
@@ -1,196 +0,0 @@
1
- ---
2
- title: Building multi-page apps in Solara
3
- description: The simplest way to create a multi-page app is to create a directory with multiple scripts.
4
- ---
5
-
6
- # Multi-page support
7
-
8
- In the [Web App tutorial](/documentation/getting_started/tutorials/web-app), we created an application consisting of a single page. Web applications generally have multiple pages, and Solara supports this as well.
9
-
10
-
11
- ## Multiple scripts
12
-
13
- The simplest way to create a multi-page app is to create a directory with multiple scripts.
14
-
15
- ```bash
16
- $ solara create button multipage-demo/01-click-button.py
17
- Wrote: /mypath/multipage-demo/01-click-button.py
18
- ...
19
- $ solara create markdown multipage-demo/02-markdown-editor.py
20
- Wrote: /mypath/multipage-demo/02-markdown-editor.py
21
- ...
22
- ```
23
-
24
-
25
- You should have the following directory structure:
26
-
27
- ```
28
- multipage-demo
29
- ├── 01-click-button.py
30
- └── 02-markdown-editor.py
31
- ```
32
-
33
- Now run Solara, with this directory as argument:
34
-
35
- ```bash
36
- $ solara run ./multipage-demo
37
- Solara server is starting at http://localhost:8765
38
- ```
39
-
40
- Giving you an output like:
41
-
42
- ![screencapture](https://user-images.githubusercontent.com/1765949/214879312-19323de3-c4ce-4528-ac84-5aa0021ca5b4.gif)
43
-
44
- Solara now:
45
-
46
- * Sort the paths according to the filename (hence the 01- and 02- prefix)
47
- * Generate a nice URL by stripping of prefix, splitting the filename taking out `-`, `_` and spaces, and join them together using a `-` (e.g. "/markdown-editor").
48
- * Generate a nice default title similar to the link, but now capitalize the first letter and join with a space instead (e.g. "Mardown Editor").
49
- * The first page will be the default (and its URL will be empty instead, i.e., the empty string `""`)
50
- * Since the first script does not define a `Layout` component, nor did we add a `__init__.py` with a `Layout` component, Solara will add a [Layout component](/documentation/components/layout/app_layout) which includes a navigation sidebar.
51
- * If a path is a directory, Solara will recursively scan the subdirectory and include it in the navigation. Read more on this in the [Layout section](layout)
52
-
53
- Solara will render two pages:
54
-
55
- * http://localhost:8765 with title "Click Button"
56
- * http://localhost:8765/markdown-editor with title "Markdown Editor"
57
-
58
-
59
-
60
- ## Classical widgets support
61
-
62
- Multipage is also supported for regular ipywidgets. An example directory can be seen on [GitHub](https://github.com/widgetti/solara/tree/master/tests/unit/solara_test_apps/multipage),
63
- which we use for testing.
64
-
65
- A large difference between using regular ipywidgets for pages compared to using components is that there is no lifecycle
66
- management in regular ipywidgets. This means Solara cannot clean up your ipywidget-based page (garbage-collect the unused widgets, unregister callbacks)
67
- when a user navigates away from your page.
68
-
69
- At the same time, rerunning your regular ipywidget-based script each time a user navigates to that page will result in a buildup of many widgets.
70
-
71
- This means that Solara will run your page once (the first time it is loaded by a user/browser tab), and, when navigating back,
72
- will show the page in the same state as when the user left the page.
73
-
74
-
75
- ## As a package
76
-
77
- Once you start building a larger application, it pays off using a Python package instead. This allows you to organize and distribute your app as a Python package (as a wheel for instance) and allows you to organize your application
78
- into reusable packages for components, stores, hooks etc.
79
-
80
- As a quickstart, we can generate a startup project using:
81
- ```bash
82
- $ solara create portal solara-test-portal
83
- Wrote: /Users/maartenbreddels/github/widgetti/solara/solara-test-portal
84
- Install as:
85
- $ (cd solara-test-portal; pip install -e .)
86
- Run as:
87
- $ solara run solara_test_portal.pages
88
- ```
89
-
90
- You should have the following directory structure:
91
- ```bash
92
- ├── LICENSE
93
- ├── Procfile # will make it run on heroku
94
- ├── mypy.ini # adds strict type checking
95
- ├── pyproject.toml # make it installable with pip/hatch etc
96
- └── solara_test_portal # Python package containing all code
97
- ├── __init__.py
98
- ├── components # contains general react components
99
- │ ├── __init__.py
100
- │ ├── header.py
101
- │ └── layout.py
102
- ├── content # contains content (markdown articles in this case)
103
- │ └── articles
104
- │ ├── 7-reasons-why-i-love-vaex-for-data-science.md
105
- │ └── a-hybrid-apache-arrow-numpy-dataframe-with-vaex-version-4.md
106
- ├── data.py # here is where we store shared data or application state
107
- └── pages # contains the pages
108
- ├── __init__.py
109
- ├── article
110
- │ └── __init__.py
111
- ├── tabular.py
112
- └── viz
113
- ├── __init__.py
114
- └── overview.py
115
- ```
116
-
117
- Install it using
118
- ```bash
119
- $ (cd solara-test-portal; pip install -e .)
120
- ```
121
-
122
- Run it with
123
- ```bash
124
- $ solara run solara_test_portal.pages
125
- Solara server is starting at http://localhost:8765
126
- ```
127
-
128
- Go to http://localhost:8765 ([or click here](http://localhost:8765)), explore the source code, edit it, save it, and watch the web app reload instantly.
129
-
130
-
131
- ## In a single script
132
-
133
- If you want to setup a multipage app in a single script, you do not need to define a `Page` component, but you can define a list of routes.
134
-
135
- ```python
136
- import solara
137
-
138
-
139
- @solara.component
140
- def Home():
141
- solara.Markdown("Home")
142
-
143
-
144
- @solara.component
145
- def About():
146
- solara.Markdown("About")
147
-
148
-
149
- routes = [
150
- solara.Route(path="/", component=Home, label="home"),
151
- solara.Route(path="about", component=About, label="about"),
152
- ]
153
- ```
154
-
155
- See more details in the [Route section](/documentation/advanced/understanding/routing).
156
-
157
- ## Dynamic pages
158
-
159
- In the previous section we created the example portal app. Taking a look at
160
- tabular.py, we see the `Page` component takes an additional arguments.
161
-
162
- ```python
163
- @solara.component
164
- def Page(name: str):
165
- ...
166
- ```
167
-
168
-
169
- Solara recognizes this and will pass all routes such as `/tabular/foo` and `/tabular/bar` to this Page component passing for instance `"foo"` or `"bar"` as an argument, such that you can dynamically render a page based on the URL.
170
-
171
- An example Page component could look like this:
172
-
173
- ```python
174
- @solara.component
175
- def Page(name: str = "foo"):
176
- subpages = ["foo", "bar", "solara", "react-ipywidgets"]
177
- solara.Markdown(f"You are at: {name}")
178
- # bunch of buttons which navigate to our dynamic route
179
- with solara.Row():
180
- for subpage in subpages:
181
- with solara.Link(subpage):
182
- solara.Button(label=f"Go to: {subpage}")
183
- ```
184
-
185
- By giving the name argument a default value of `"foo"`, Solara will also accept the `/tabular` url.
186
-
187
- # What you have learned
188
-
189
- * Putting multiple Solara app script into a directory allows Solara to show a multipage app.
190
- * If no `Layout` component is provided, Solara adds a default navigation sidebar.
191
- * Large application can benefit from setting up a Python package, use `solara create portal my-name` to create one.
192
- * By adding an argument to the `Page` component, routes like `/tabular` will turn into dynamic routes (e.g. `/tabular/dynamic-name`) and pass the argument (`"dynamic-name"` in this case) to the `Page` component to implement dynamic pages.
193
-
194
- # What next?
195
-
196
- * Also check out the [Multipage example](/documentation/examples/fullscreen/multipage) for more inspiration.
@@ -1,125 +0,0 @@
1
- ---
2
- title: Making different layouts in Solara
3
- description: Solara comes with a layout system ideal for data apps. Learn how to use them in this short guide.
4
- ---
5
-
6
- # Layout
7
-
8
- Solara comes with a layout system ideal for data apps.
9
-
10
- The following example shows 80% of what you need to know to lay out your app.
11
-
12
- ```solara
13
- import solara
14
-
15
- @solara.component
16
- def Page():
17
- with solara.Column():
18
- solara.Title("I'm in the browser tab and the toolbar")
19
- with solara.Sidebar():
20
- solara.Markdown("## I am in the sidebar")
21
- solara.SliderInt(label="Ideal for placing controls")
22
- solara.Info("I'm in the main content area, put your main content here")
23
- with solara.Card("Use solara.Columns([1, 2]) to create relatively sized columns"):
24
- with solara.Columns([1, 2]):
25
- solara.Success("I'm in the first column")
26
- solara.Warning("I'm in the second column, I am twice as wide")
27
- solara.Info("I am like the first column")
28
-
29
- with solara.Card("Use solara.Column() to create a full width column"):
30
- with solara.Column():
31
- solara.Success("I'm first in this full with column")
32
- solara.Warning("I'm second in this full with column")
33
- solara.Error("I'm third in this full with column")
34
-
35
- with solara.Card("Use solara.ColumnsResponsive(6, large=4) to response to screen size"):
36
- with solara.ColumnsResponsive(6, large=4):
37
- for i in range(6):
38
- solara.Info("two per column on small screens, three per column on large screens")
39
- ```
40
-
41
- [Navigate here to watch this layout in a full browser window](/documentation/examples/fullscreen/layout-demo)
42
-
43
- The key takeaways are:
44
-
45
- * By default, Solara will wrap your component in an [AppLayout](/documentation/components/layout/app_layout), which will give you:
46
- * Room for a sidebar, that you can populate using the [Sidebar](/documentation/components/layout/sidebar) component.
47
- * A toolbar showing the [Title](/documentation/components/page/title).
48
- * Not visible here: In the case of [multiple pages](/documentation/advanced/howto/multipage) will include page navigation tabs. See [The multipage demo app](/documentation/examples/fullscreen/multipage) for an example.
49
- * Use [Card](/documentation/components/layout/card) to put related components together with a title.
50
- * Use [Column](/documentation/components/layout/column) to simply layout components under each other.
51
- * Use [Columns](/documentation/components/layout/columns) if you want to have a few columns with relative sizes next to each other.
52
- * Use [ColumnsResponsive](/documentation/components/layout/columns_responsive) to have the column widths respond to screen size.
53
-
54
-
55
-
56
- ## Changing the default layout
57
-
58
- While [AppLayout](/documentation/components/layout/app_layout) may be sufficient in 80% of the cases. Solara provides a way to change this default layout in [Solara server](/documentation/advanced/understanding/solara-server).
59
-
60
- You can define your own `Layout` component in the `__init__.py` file in the same directory of your app script.
61
-
62
-
63
- For instance, putting the following `Layout` component in `__init__.py` will give you effectively the same [AppLayout](/documentation/components/layout/app_layout):
64
- ```python
65
- @solara.component
66
- def Layout(children=[]):
67
- print("I get called before the Page component gets rendered")
68
- return solara.AppLayout(children=children)
69
- ```
70
-
71
-
72
- ### No Layout
73
- If you do not want to have any layout, you can disable it using:
74
-
75
- ```python
76
- @solara.component
77
- def Layout(children=[]):
78
- # there will only be 1 child, which is the Page()
79
- return children[0]
80
- ```
81
-
82
- This layout leaves every page responsible for creating its own header, footer, and/or menu structure for navigation.
83
-
84
-
85
- ### Layout with navigation
86
-
87
- In case you want to set up your own layout system, which sets up navigation as well, this example may get you started. It may help
88
- to [understand routing](/documentation/advanced/understanding/routing).
89
- ```python
90
- @solara.component
91
- def Layout(children=[]):
92
- # Note that children being passed here for this example will be a Page() element.
93
- route_current, routes_all = solara.use_route()
94
- with solara.Column():
95
- # put all buttons in a single row
96
- with solara.Row():
97
- for route in routes_all:
98
- with solara.Link(route):
99
- solara.Button(route.path, color="red" if route_current == route else None)
100
- # under the navigation buttons, we add our children (the single Page())
101
- solara.Column(children=children)
102
- ```
103
-
104
-
105
- ### Nested Layouts
106
-
107
- Each subdirectory (or subpackage) can define a `Layout` component in its own `__init__.py`, which then is embedded into the parent Layout to provide a hierarchical
108
- nested layout tree.
109
-
110
- This is useful for larger apps where each subdirectory may add a bit of layout/chrome around your page.
111
-
112
-
113
-
114
- ## Components
115
-
116
- The following [Container components](/documentation/advanced/understanding/containers) can be used to define the layout of you app.
117
-
118
- * [Row](/documentation/components/layout/row)
119
- * [Column](/documentation/components/layout/column)
120
- * [ColumnsResponsive](/documentation/components/layout/columns_responsive)
121
- * [GridFixed](/documentation/components/layout/gridfixed)
122
- * [GridDraggable](/documentation/components/layout/griddraggable)
123
- * [VBox](/documentation/components/layout/vbox) (kept for ipywidgets compatibility, please use Column)
124
- * [HBox](/documentation/components/layout/hbox) (kept for ipywidgets compatibility, please use Row)
125
- * [AppLayout](/documentation/components/layout/app_layout) Not often used directly, since Solara will already wrap your page in it. Sometimes re-used in a new `Layout` component.
@@ -1,154 +0,0 @@
1
- ---
2
- title: Testing your Solara application, both front and back end
3
- description: Using solara you can test both the front and back end functionalities of your application.
4
- ---
5
-
6
- # Testing with Solara
7
- # Testing Application Logic
8
-
9
- We recommend using pytest to test the application logic of your Solara components. To get inspiration for writing tests that cover component logic and their interactions with existing components, refer to the [tests in the Solara repository](https://github.com/widgetti/solara/tree/master/tests).
10
-
11
- # Testing with a Browser
12
-
13
- If you have custom components that depend on a connected browser because it is using JavaScript, we recommend using the Solara pytest plugin, which is installed by default when you install Solara. The plugin provides a fixture called `solara_test` that you can use to test your components. Here's an example:
14
-
15
- ```python
16
- import ipywidgets as widgets
17
- import playwright.sync_api
18
- from IPython.display import display
19
-
20
- def test_widget_button_solara(solara_test, page_session: playwright.sync_api.Page):
21
- # this all runs in process, which only works with solara
22
- # also, this test is only with pure ipywidgets
23
- button = widgets.Button(description="Click Me!")
24
-
25
- def change_description(obj):
26
- button.description = "Tested event"
27
-
28
- button.on_click(change_description)
29
- display(button)
30
- button_sel = page_session.locator("text=Click Me!")
31
- button_sel.wait_for()
32
- button_sel.click()
33
- page_session.locator("text=Tested event").wait_for()
34
- ```
35
-
36
- Run this test with pytest:
37
-
38
- ```bash
39
- pytest tests/ui/test_widget_button.py --headed # remove --headed to run headless
40
- ```
41
-
42
- This require playwright to be installed:
43
-
44
- ```
45
- $ pip install playwright pytest-playwright
46
- # $ pip install "solara[pytest]" # if you haven't installed solara already
47
- $ playwright install chromium
48
- ```
49
-
50
-
51
- In this example, use the standard IPython display call to add your widget to the page.
52
-
53
- # Testing in the main Jupyter Environments
54
-
55
- In case you want to test your component in the main Jupyter environments (e.g., Jupyter Notebook, Jupyter Lab, Voila, and Solara) to ensure it renders correctly, use the `ipywidgets_runner` fixture to run code snippets. Here's an example:
56
-
57
- ```python
58
- import ipywidgets as widgets
59
- import playwright.sync_api
60
- from IPython.display import display
61
-
62
-
63
- def test_solara_button_all(ipywidgets_runner, page_session: playwright.sync_api.Page, assert_solara_snapshot):
64
- # this function (or rather its lines) will be executed in the kernel
65
- # voila, lab, classic notebook and solara will all execute it
66
- def kernel_code():
67
- import solara
68
-
69
- @solara.component
70
- def Button():
71
- text, set_text = solara.use_state("Click Me!")
72
-
73
- def on_click():
74
- set_text("Tested event")
75
-
76
- solara.Button(text, on_click=on_click)
77
-
78
- display(Button())
79
-
80
- ipywidgets_runner(kernel_code)
81
- button_sel = page_session.locator("button >> text=Click Me!")
82
- assert_solara_snapshot(button_sel.screenshot())
83
- button_sel.wait_for()
84
- button_sel.click()
85
- page_session.locator("button >> text=Tested event").wait_for()
86
- page_session.wait_for_timeout(1000)
87
- ```
88
-
89
- Note that the function in the code will be executed in a different process (a Jupyter kernel), which will make it harder to debug and slower to run.
90
- Because the function code executes in the kernel, you do not have access to local variables. However, by passing a dictionary as second argument
91
- to `ipywidgets_runner` we can pass in extra local variables (e.g. `ipywidgets_runner(kernel_code, {"extra_argument": extra_argument})`).
92
-
93
- ## Limiting the Jupyter Environments
94
- To limit the ipywidgets_runner fixture to only run in a specific environment, use the `SOLARA_TEST_RUNNERS` environment variable:
95
-
96
- * `SOLARA_TEST_RUNNERS=solara pytest tests/ui`
97
- * `SOLARA_TEST_RUNNERS=voila pytest tests/ui`
98
- * `SOLARA_TEST_RUNNERS=jupyter_lab pytest tests/ui`
99
- * `SOLARA_TEST_RUNNERS=jupyter_notebook pytest tests/ui`
100
- * `SOLARA_TEST_RUNNERS=solara,voila pytest tests/ui`
101
-
102
-
103
-
104
- # Organizing Tests and Managing Snapshots
105
- We recommend organizing your visual tests in a separate directory, such as `tests/ui`. This allows you to run fast tests (`test/unit`) separately from slow tests (t`est/ui`). Use the `solara_snapshots_directory` fixture to change the default directory for storing snapshots, which is `tests/ui/snapshots` by default.
106
-
107
- ```bash
108
- $ pytest tests/unit # run fast test
109
- $ pytest tests/ui # run slow test
110
- $ pytest tests # run all tests
111
- ```
112
-
113
- To compare a captured image from a part of your page with the reference image, use the `assert_solara_snapshot` fixture. For example, `assert_solara_snapshot(button_sel.screenshot())` will take a screenshot of the button and compare it to the reference image. If the images are different, the test will fail.
114
-
115
- For local development, you can use the --solara-update-snapshots flag to update the reference images. This will overwrite the existing reference images with the new ones generated during the test run. However, you should carefully review the changes before committing them to your repository to ensure the updates are accurate and expected.
116
-
117
-
118
- # Continuous Integration Recommendations
119
-
120
- When a test fails, the output will be placed in a directory structure similar to what would be put in the `solara_snapshots_directory` directory but under the test-results directory in the root of your project (unless changed by passing `--output=someotherdirectory` to pytest).
121
-
122
- In CI, we recommend downloading this directory using, for example, GitHub Actions:
123
-
124
- ```yaml
125
- - name: Download test results
126
- uses: actions/download-artifact@v2
127
- with:
128
- name: myproject-test-results
129
- path: test-results
130
- ```
131
-
132
-
133
- After inspecting and approving the screenshots, you can copy them to the `solara_snapshots_directory` directory and commit them to your repository. This way, you ensure that the reference images are up-to-date and accurate for future tests.
134
-
135
-
136
- # Note about the Playwright
137
-
138
- Visual testing with solara is based on [Playwright for Python](https://playwright.dev/python/), which provides a `page` fixture. However, this fixture will make a new page for each test, which is not what we want. Therefore, we provide a `page_session` fixture that will reuse the same page for all tests. This is important because it will make the tests faster.
139
-
140
- By following these recommendations and guidelines, you can efficiently test your Solara applications and ensure a smooth developer experience.
141
-
142
- # Configuration
143
-
144
- ## Changing the Hostname
145
-
146
- To configure the hostname the socket is bound to when starting the test server, use the `HOST` or `SOLARA_HOST` environment variable (e.g. `SOLARA_HOST=0.0.0.0`). This hostname is also used for the jupyter server and voila. Alternatively the `--solara-host` argument can be passed on the command line for pytest.
147
-
148
- ## Changing the Port
149
-
150
- To configure the ports the socket is bound to when starting the test servers, use the `PORT` environment variable (e.g. `PORT=18865`). This port and subsequent port will be used for solara-server, jupyter-server and voila. Alternatively the `--solara-port` argument can be passed on the command line for pytest for the solara server, and `--jupyter-port` and `--voila-port` for the ports of jupyter server and voila respectively.
151
-
152
- ## Vuetify warmup
153
-
154
- By default, we insert an ipyvuetify widget with an icon into the frontend to force loading all the vuetify assets, such as CSS and fonts. However, if you are using the solara test plugin to test pure ipywidgets or a 3rd ipywidget based party library you might not need this. Disable this vuetify warmup phase by passing the `--no-solara-vuetify-warmup` argument to pytest, or setting the environment variable `SOLARA_TEST_VUETIFY_WARMUP` to a falsey value (e.g. `SOLARA_TEST_VUETIFY_WARMUP=0`).
@@ -1,69 +0,0 @@
1
- ---
2
- title: Debugging Solara applications
3
- description: You can use the Python debugger to debug your Solara app.
4
- ---
5
- # Debugging
6
-
7
- ## PDB
8
-
9
- You can use the [python debugger](https://docs.python.org/3/library/pdb.html) to debug your Solara app.
10
-
11
- Simply add `breakpoint()` to your code, and trigger the code, and you will enter the debugger.
12
-
13
- ```python
14
- import solara
15
-
16
- clicks = solara.reactive(0)
17
-
18
-
19
- @solara.component
20
- def Page():
21
- color = "green"
22
- if clicks.value >= 5:
23
- color = "red"
24
-
25
- def increment():
26
- clicks.value += 1
27
- # this will trigger the debugger
28
- breakpoint()
29
- print("clicks", clicks) # noqa
30
-
31
- solara.Button(label=f"Clicked: {clicks}", on_click=increment, color=color)
32
- ```
33
-
34
- ## PyCharm or IntelliJ
35
-
36
- You can also use the debugger of PyCharm or IntelliJ to debug your Solara app.
37
- The following settings works for PyCharm or IntelliJ:
38
-
39
- ![](https://dxhl76zpt6fap.cloudfront.net/public/docs/howto/debugger-intellij.webp)
40
-
41
- ## VSCode
42
-
43
-
44
- In VSCode, you can use the following launch.json to debug your Solara app:
45
-
46
- ```json
47
- {
48
- // Use IntelliSense to learn about possible attributes.
49
- // Hover to view descriptions of existing attributes.
50
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
51
- "version": "0.2.0",
52
- "configurations": [
53
- {
54
- "name": "Solara: Launch",
55
- "type": "python",
56
- "request": "launch",
57
- "program": "/Users/maartenbreddels/miniconda3/envs/dev/bin/solara",
58
- "args": [
59
- "run",
60
- "${file}"
61
- ],
62
- "console": "integratedTerminal",
63
- "justMyCode": true,
64
- }
65
- ]
66
- }
67
- ```
68
-
69
- Now keep your script tab open, and press F5 to start debugging (or click the play icon in the UI).
@@ -1,49 +0,0 @@
1
- ---
2
- title: Embedding Solara applications into existing websites
3
- description: Solara can be embedded into existing websites. Although it is technically possible to embed a Solara app into an existing webpage,
4
- we currently support embedding primarily via iframes.
5
- ---
6
-
7
- # Embedding in existing websites
8
-
9
- Solara can be embedded into existing websites. Although it is technically possible to embed a Solara app into an existing webpage, we currently support embedding primarily via iframes.
10
-
11
-
12
- ## Embed via iframe
13
-
14
- Here we demonstrate how to embed Solara into an existing webpage via an iframe. Let's start by creating a simple HTML page (here we choose the filename embed.html):
15
-
16
- ```html
17
- <html>
18
- <body>
19
- <h1>This is on the main page</h1>
20
- <iframe src="http://localhost:8765" width="100%" height="100%"></iframe>
21
- </body>
22
- </html>
23
- ```
24
-
25
- Now, start an http server (in this example we use the standard Python http server):
26
- ```bash
27
- $ python -m http.server
28
- Serving HTTP on :: port 8000 (http://[::]:8000/) ...
29
- ```
30
-
31
- Additionally, start the Solara server:
32
-
33
- ```bash
34
- $ solara run my-solara-app.py
35
- Solara server is starting at http://localhost:8765
36
- ```
37
-
38
- Ensure the port number matches that of the iframe in `embed.html`. Now open `http://localhost:8000/embed.html` in your browser, and you should see the Solara app embedded in the page.
39
-
40
- If you do not see your app, you can open the browser developer tools in your browser and look for errors in the console. If you use the Brave browser, you might want to disable the Brave shields for your local server.
41
-
42
- ### Security considerations
43
-
44
- Solara uses a cookie to implement sessions. To support cookies settings in an iframe, we set the session cookie using `Secure`, and `SameSite=Strict`. See [https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies](MDN) for more details. This means that we can only support loading via iframes via https or localhost.
45
-
46
-
47
- ## Embed into an existing page
48
-
49
- If embedding into an iframe does not suit your needs (for example, dialogs not being fullscreen), [please contact us](/contact) and we can discuss other options.