solara-ui 1.31.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.
- prefix/etc/jupyter/jupyter_notebook_config.d/solara.json +7 -0
- prefix/etc/jupyter/jupyter_server_config.d/solara.json +7 -0
- solara/__init__.py +124 -0
- solara/__main__.py +734 -0
- solara/alias.py +6 -0
- solara/autorouting.py +546 -0
- solara/cache.py +303 -0
- solara/checks.html +71 -0
- solara/checks.py +224 -0
- solara/comm.py +28 -0
- solara/components/__init__.py +59 -0
- solara/components/alert.py +155 -0
- solara/components/applayout.py +393 -0
- solara/components/button.py +85 -0
- solara/components/card.py +87 -0
- solara/components/checkbox.py +50 -0
- solara/components/code_highlight_css.py +11 -0
- solara/components/code_highlight_css.vue +63 -0
- solara/components/columns.py +159 -0
- solara/components/component_vue.py +110 -0
- solara/components/cross_filter.py +335 -0
- solara/components/dataframe.py +546 -0
- solara/components/datatable.py +221 -0
- solara/components/datatable.vue +175 -0
- solara/components/details.py +21 -0
- solara/components/download.vue +35 -0
- solara/components/echarts.py +75 -0
- solara/components/echarts.vue +128 -0
- solara/components/figure_altair.py +39 -0
- solara/components/file_browser.py +182 -0
- solara/components/file_download.py +199 -0
- solara/components/file_drop.py +139 -0
- solara/components/file_drop.vue +83 -0
- solara/components/file_list_widget.vue +78 -0
- solara/components/head.py +27 -0
- solara/components/head_tag.py +49 -0
- solara/components/head_tag.vue +60 -0
- solara/components/image.py +173 -0
- solara/components/input.py +436 -0
- solara/components/link.py +55 -0
- solara/components/markdown.py +378 -0
- solara/components/markdown_editor.py +25 -0
- solara/components/markdown_editor.vue +362 -0
- solara/components/matplotlib.py +74 -0
- solara/components/meta.py +47 -0
- solara/components/misc.py +333 -0
- solara/components/pivot_table.py +258 -0
- solara/components/pivot_table.vue +158 -0
- solara/components/progress.py +47 -0
- solara/components/select.py +182 -0
- solara/components/select.vue +27 -0
- solara/components/slider.py +442 -0
- solara/components/slider_date.vue +56 -0
- solara/components/spinner-solara.vue +105 -0
- solara/components/spinner.py +30 -0
- solara/components/sql_code.py +33 -0
- solara/components/sql_code.vue +128 -0
- solara/components/style.py +105 -0
- solara/components/switch.py +68 -0
- solara/components/tab_navigation.py +37 -0
- solara/components/title.py +90 -0
- solara/components/title.vue +38 -0
- solara/components/togglebuttons.py +200 -0
- solara/components/tooltip.py +61 -0
- solara/datatypes.py +143 -0
- solara/express.py +241 -0
- solara/hooks/__init__.py +4 -0
- solara/hooks/dataframe.py +99 -0
- solara/hooks/misc.py +263 -0
- solara/hooks/use_reactive.py +129 -0
- solara/hooks/use_thread.py +129 -0
- solara/kitchensink.py +8 -0
- solara/lab/__init__.py +34 -0
- solara/lab/components/__init__.py +6 -0
- solara/lab/components/chat.py +203 -0
- solara/lab/components/confirmation_dialog.py +163 -0
- solara/lab/components/cross_filter.py +7 -0
- solara/lab/components/input_date.py +298 -0
- solara/lab/components/menu.py +181 -0
- solara/lab/components/menu.vue +38 -0
- solara/lab/components/tabs.py +274 -0
- solara/lab/components/theming.py +98 -0
- solara/lab/components/theming.vue +72 -0
- solara/lab/hooks/__init__.py +0 -0
- solara/lab/hooks/dataframe.py +12 -0
- solara/lab/toestand.py +3 -0
- solara/lab/utils/__init__.py +2 -0
- solara/lab/utils/cookies.py +5 -0
- solara/lab/utils/dataframe.py +115 -0
- solara/lab/utils/headers.py +5 -0
- solara/layout.py +44 -0
- solara/lifecycle.py +46 -0
- solara/minisettings.py +133 -0
- solara/py.typed +0 -0
- solara/reactive.py +93 -0
- solara/routing.py +268 -0
- solara/scope/__init__.py +88 -0
- solara/scope/types.py +55 -0
- solara/server/__init__.py +0 -0
- solara/server/app.py +491 -0
- solara/server/assets/custom.css +1 -0
- solara/server/assets/custom.js +1 -0
- solara/server/assets/favicon.png +0 -0
- solara/server/assets/favicon.svg +5 -0
- solara/server/assets/style.css +1665 -0
- solara/server/assets/theme-dark.css +437 -0
- solara/server/assets/theme-light.css +420 -0
- solara/server/assets/theme.js +3 -0
- solara/server/cdn_helper.py +77 -0
- solara/server/esm.py +69 -0
- solara/server/fastapi.py +5 -0
- solara/server/flask.py +286 -0
- solara/server/jupyter/__init__.py +2 -0
- solara/server/jupyter/cdn_handler.py +28 -0
- solara/server/jupyter/server_extension.py +29 -0
- solara/server/jupytertools.py +46 -0
- solara/server/kernel.py +338 -0
- solara/server/kernel_context.py +357 -0
- solara/server/patch.py +552 -0
- solara/server/reload.py +242 -0
- solara/server/server.py +456 -0
- solara/server/settings.py +215 -0
- solara/server/shell.py +251 -0
- solara/server/starlette.py +601 -0
- solara/server/static/ansi.js +270 -0
- solara/server/static/highlight-dark.css +82 -0
- solara/server/static/highlight.css +43 -0
- solara/server/static/main-vuetify.js +260 -0
- solara/server/static/main.js +163 -0
- solara/server/static/solara_bootstrap.py +129 -0
- solara/server/static/sun.svg +23 -0
- solara/server/static/webworker.js +42 -0
- solara/server/telemetry.py +212 -0
- solara/server/templates/index.html.j2 +1 -0
- solara/server/templates/loader-plain.css +11 -0
- solara/server/templates/loader-plain.html +20 -0
- solara/server/templates/loader-solara.css +111 -0
- solara/server/templates/loader-solara.html +40 -0
- solara/server/templates/plain.html +82 -0
- solara/server/templates/solara.html.j2 +446 -0
- solara/server/threaded.py +75 -0
- solara/server/utils.py +30 -0
- solara/server/websocket.py +45 -0
- solara/settings.py +56 -0
- solara/tasks.py +837 -0
- solara/template/button.py +16 -0
- solara/template/markdown.py +42 -0
- solara/template/portal/.flake8 +6 -0
- solara/template/portal/.pre-commit-config.yaml +28 -0
- solara/template/portal/LICENSE +21 -0
- solara/template/portal/Procfile +7 -0
- solara/template/portal/mypy.ini +3 -0
- solara/template/portal/pyproject.toml +26 -0
- solara/template/portal/solara_portal/__init__.py +4 -0
- solara/template/portal/solara_portal/components/__init__.py +2 -0
- solara/template/portal/solara_portal/components/article.py +28 -0
- solara/template/portal/solara_portal/components/data.py +28 -0
- solara/template/portal/solara_portal/components/header.py +6 -0
- solara/template/portal/solara_portal/components/layout.py +6 -0
- solara/template/portal/solara_portal/content/articles/equis-in-vidi.md +85 -0
- solara/template/portal/solara_portal/content/articles/substiterat-vati.md +70 -0
- solara/template/portal/solara_portal/data.py +60 -0
- solara/template/portal/solara_portal/pages/__init__.py +67 -0
- solara/template/portal/solara_portal/pages/article/__init__.py +26 -0
- solara/template/portal/solara_portal/pages/tabular.py +29 -0
- solara/template/portal/solara_portal/pages/viz/__init__.py +70 -0
- solara/template/portal/solara_portal/pages/viz/overview.py +14 -0
- solara/test/__init__.py +0 -0
- solara/test/pytest_plugin.py +697 -0
- solara/toestand.py +772 -0
- solara/util.py +308 -0
- solara/website/__init__.py +0 -0
- solara/website/assets/custom.css +468 -0
- solara/website/assets/images/logo-small.png +0 -0
- solara/website/assets/images/logo.svg +17 -0
- solara/website/assets/images/logo_white.svg +50 -0
- solara/website/assets/theme.js +8 -0
- solara/website/components/__init__.py +5 -0
- solara/website/components/algolia.vue +24 -0
- solara/website/components/algolia_api.vue +187 -0
- solara/website/components/docs.py +118 -0
- solara/website/components/header.py +72 -0
- solara/website/components/hero.py +15 -0
- solara/website/components/mailchimp.py +12 -0
- solara/website/components/mailchimp.vue +47 -0
- solara/website/components/markdown.py +30 -0
- solara/website/components/notebook.py +171 -0
- solara/website/pages/__init__.py +575 -0
- solara/website/pages/apps/__init__.py +16 -0
- solara/website/pages/apps/authorization/__init__.py +119 -0
- solara/website/pages/apps/authorization/admin.py +12 -0
- solara/website/pages/apps/authorization/users.py +12 -0
- solara/website/pages/apps/jupyter-dashboard-1.py +116 -0
- solara/website/pages/apps/layout-demo.py +40 -0
- solara/website/pages/apps/multipage/__init__.py +38 -0
- solara/website/pages/apps/multipage/page1.py +26 -0
- solara/website/pages/apps/multipage/page2.py +34 -0
- solara/website/pages/apps/scatter.py +136 -0
- solara/website/pages/apps/scrolling.py +63 -0
- solara/website/pages/apps/tutorial-streamlit.py +18 -0
- solara/website/pages/changelog/__init__.py +8 -0
- solara/website/pages/changelog/changelog.md +204 -0
- solara/website/pages/contact/__init__.py +8 -0
- solara/website/pages/contact/contact.md +17 -0
- solara/website/pages/doc_use_download.py +85 -0
- solara/website/pages/documentation/__init__.py +184 -0
- solara/website/pages/documentation/advanced/__init__.py +9 -0
- solara/website/pages/documentation/advanced/content/00-overview.md +1 -0
- solara/website/pages/documentation/advanced/content/10-howto/00-overview.md +6 -0
- solara/website/pages/documentation/advanced/content/10-howto/10-multipage.md +196 -0
- solara/website/pages/documentation/advanced/content/10-howto/20-layout.md +125 -0
- solara/website/pages/documentation/advanced/content/10-howto/30-testing.md +162 -0
- solara/website/pages/documentation/advanced/content/10-howto/31-debugging.md +69 -0
- solara/website/pages/documentation/advanced/content/10-howto/40-embed.md +49 -0
- solara/website/pages/documentation/advanced/content/10-howto/50-ipywidget_libraries.md +124 -0
- solara/website/pages/documentation/advanced/content/15-reference/00-overview.md +3 -0
- solara/website/pages/documentation/advanced/content/15-reference/40-static_files.md +31 -0
- solara/website/pages/documentation/advanced/content/15-reference/41-asset-files.md +36 -0
- solara/website/pages/documentation/advanced/content/15-reference/60-static-site-generation.md +59 -0
- solara/website/pages/documentation/advanced/content/15-reference/70-search.md +34 -0
- solara/website/pages/documentation/advanced/content/15-reference/80-reloading.md +34 -0
- solara/website/pages/documentation/advanced/content/15-reference/90-notebook-support.md +7 -0
- solara/website/pages/documentation/advanced/content/15-reference/95-caching.md +148 -0
- solara/website/pages/documentation/advanced/content/20-understanding/00-introduction.md +10 -0
- solara/website/pages/documentation/advanced/content/20-understanding/05-ipywidgets.md +35 -0
- solara/website/pages/documentation/advanced/content/20-understanding/06-ipyvuetify.md +42 -0
- solara/website/pages/documentation/advanced/content/20-understanding/10-reacton.md +28 -0
- solara/website/pages/documentation/advanced/content/20-understanding/12-reacton-basics.md +108 -0
- solara/website/pages/documentation/advanced/content/20-understanding/15-anatomy.md +23 -0
- solara/website/pages/documentation/advanced/content/20-understanding/17-rules-of-hooks.md +7 -0
- solara/website/pages/documentation/advanced/content/20-understanding/18-containers.md +166 -0
- solara/website/pages/documentation/advanced/content/20-understanding/20-solara.md +18 -0
- solara/website/pages/documentation/advanced/content/20-understanding/40-routing.md +240 -0
- solara/website/pages/documentation/advanced/content/20-understanding/50-solara-server.md +97 -0
- solara/website/pages/documentation/advanced/content/20-understanding/60-voila.md +12 -0
- solara/website/pages/documentation/advanced/content/30-enterprise/00-overview.md +1 -0
- solara/website/pages/documentation/advanced/content/30-enterprise/10-oauth.md +171 -0
- solara/website/pages/documentation/advanced/content/40-development/00-overview.md +0 -0
- solara/website/pages/documentation/advanced/content/40-development/01-contribute.md +45 -0
- solara/website/pages/documentation/advanced/content/40-development/10-setup.md +76 -0
- solara/website/pages/documentation/api/__init__.py +19 -0
- solara/website/pages/documentation/api/cross_filter/__init__.py +9 -0
- solara/website/pages/documentation/api/cross_filter/cross_filter_dataframe.py +23 -0
- solara/website/pages/documentation/api/cross_filter/cross_filter_report.py +22 -0
- solara/website/pages/documentation/api/cross_filter/cross_filter_select.py +22 -0
- solara/website/pages/documentation/api/cross_filter/cross_filter_slider.py +22 -0
- solara/website/pages/documentation/api/hooks/__init__.py +9 -0
- solara/website/pages/documentation/api/hooks/use_cross_filter.py +25 -0
- solara/website/pages/documentation/api/hooks/use_dark_effective.py +12 -0
- solara/website/pages/documentation/api/hooks/use_effect.md +43 -0
- solara/website/pages/documentation/api/hooks/use_effect.py +9 -0
- solara/website/pages/documentation/api/hooks/use_exception.py +33 -0
- solara/website/pages/documentation/api/hooks/use_memo.md +16 -0
- solara/website/pages/documentation/api/hooks/use_memo.py +9 -0
- solara/website/pages/documentation/api/hooks/use_previous.py +33 -0
- solara/website/pages/documentation/api/hooks/use_reactive.py +16 -0
- solara/website/pages/documentation/api/hooks/use_state.py +10 -0
- solara/website/pages/documentation/api/hooks/use_state_or_update.py +69 -0
- solara/website/pages/documentation/api/hooks/use_thread.md +58 -0
- solara/website/pages/documentation/api/hooks/use_thread.py +44 -0
- solara/website/pages/documentation/api/hooks/use_trait_observe.py +12 -0
- solara/website/pages/documentation/api/routing/__init__.py +9 -0
- solara/website/pages/documentation/api/routing/generate_routes.py +10 -0
- solara/website/pages/documentation/api/routing/generate_routes_directory.py +10 -0
- solara/website/pages/documentation/api/routing/resolve_path.py +35 -0
- solara/website/pages/documentation/api/routing/route.py +31 -0
- solara/website/pages/documentation/api/routing/use_route.py +80 -0
- solara/website/pages/documentation/api/routing/use_router.py +16 -0
- solara/website/pages/documentation/api/utilities/__init__.py +9 -0
- solara/website/pages/documentation/api/utilities/component_vue.py +10 -0
- solara/website/pages/documentation/api/utilities/computed.py +16 -0
- solara/website/pages/documentation/api/utilities/display.py +16 -0
- solara/website/pages/documentation/api/utilities/get_kernel_id.py +16 -0
- solara/website/pages/documentation/api/utilities/get_session_id.py +16 -0
- solara/website/pages/documentation/api/utilities/memoize.py +35 -0
- solara/website/pages/documentation/api/utilities/on_kernel_start.py +27 -0
- solara/website/pages/documentation/api/utilities/reactive.py +16 -0
- solara/website/pages/documentation/api/utilities/widget.py +104 -0
- solara/website/pages/documentation/components/__init__.py +12 -0
- solara/website/pages/documentation/components/advanced/__init__.py +9 -0
- solara/website/pages/documentation/components/advanced/link.py +27 -0
- solara/website/pages/documentation/components/advanced/meta.py +20 -0
- solara/website/pages/documentation/components/advanced/style.py +45 -0
- solara/website/pages/documentation/components/common.py +9 -0
- solara/website/pages/documentation/components/data/__init__.py +9 -0
- solara/website/pages/documentation/components/data/dataframe.py +44 -0
- solara/website/pages/documentation/components/data/pivot_table.py +81 -0
- solara/website/pages/documentation/components/enterprise/__init__.py +9 -0
- solara/website/pages/documentation/components/enterprise/avatar.py +24 -0
- solara/website/pages/documentation/components/enterprise/avatar_menu.py +25 -0
- solara/website/pages/documentation/components/input/__init__.py +9 -0
- solara/website/pages/documentation/components/input/button.py +23 -0
- solara/website/pages/documentation/components/input/checkbox.py +10 -0
- solara/website/pages/documentation/components/input/file_browser.py +32 -0
- solara/website/pages/documentation/components/input/file_drop.py +76 -0
- solara/website/pages/documentation/components/input/input.py +19 -0
- solara/website/pages/documentation/components/input/select.py +22 -0
- solara/website/pages/documentation/components/input/slider.py +29 -0
- solara/website/pages/documentation/components/input/switch.py +10 -0
- solara/website/pages/documentation/components/input/togglebuttons.py +21 -0
- solara/website/pages/documentation/components/lab/__init__.py +9 -0
- solara/website/pages/documentation/components/lab/chat.py +109 -0
- solara/website/pages/documentation/components/lab/confirmation_dialog.py +55 -0
- solara/website/pages/documentation/components/lab/cookies_headers.py +48 -0
- solara/website/pages/documentation/components/lab/input_date.py +20 -0
- solara/website/pages/documentation/components/lab/menu.py +22 -0
- solara/website/pages/documentation/components/lab/tab.py +25 -0
- solara/website/pages/documentation/components/lab/tabs.py +45 -0
- solara/website/pages/documentation/components/lab/task.py +11 -0
- solara/website/pages/documentation/components/lab/theming.py +72 -0
- solara/website/pages/documentation/components/lab/use_task.py +11 -0
- solara/website/pages/documentation/components/layout/__init__.py +9 -0
- solara/website/pages/documentation/components/layout/app_bar.py +16 -0
- solara/website/pages/documentation/components/layout/app_bar_title.py +16 -0
- solara/website/pages/documentation/components/layout/app_layout.py +24 -0
- solara/website/pages/documentation/components/layout/card.py +15 -0
- solara/website/pages/documentation/components/layout/card_actions.py +16 -0
- solara/website/pages/documentation/components/layout/column.py +30 -0
- solara/website/pages/documentation/components/layout/columns.py +27 -0
- solara/website/pages/documentation/components/layout/columns_responsive.py +68 -0
- solara/website/pages/documentation/components/layout/griddraggable.py +62 -0
- solara/website/pages/documentation/components/layout/gridfixed.py +21 -0
- solara/website/pages/documentation/components/layout/hbox.py +18 -0
- solara/website/pages/documentation/components/layout/row.py +30 -0
- solara/website/pages/documentation/components/layout/sidebar.py +24 -0
- solara/website/pages/documentation/components/layout/vbox.py +19 -0
- solara/website/pages/documentation/components/output/__init__.py +9 -0
- solara/website/pages/documentation/components/output/file_download.py +11 -0
- solara/website/pages/documentation/components/output/html.py +21 -0
- solara/website/pages/documentation/components/output/image.py +11 -0
- solara/website/pages/documentation/components/output/markdown.py +57 -0
- solara/website/pages/documentation/components/output/markdown_editor.py +51 -0
- solara/website/pages/documentation/components/output/sql_code.py +85 -0
- solara/website/pages/documentation/components/output/tooltip.py +11 -0
- solara/website/pages/documentation/components/page/__init__.py +9 -0
- solara/website/pages/documentation/components/page/head.py +18 -0
- solara/website/pages/documentation/components/page/title.py +27 -0
- solara/website/pages/documentation/components/status/__init__.py +9 -0
- solara/website/pages/documentation/components/status/error.py +40 -0
- solara/website/pages/documentation/components/status/info.py +40 -0
- solara/website/pages/documentation/components/status/progress.py +10 -0
- solara/website/pages/documentation/components/status/spinner.py +11 -0
- solara/website/pages/documentation/components/status/success.py +40 -0
- solara/website/pages/documentation/components/status/warning.py +47 -0
- solara/website/pages/documentation/components/viz/__init__.py +9 -0
- solara/website/pages/documentation/components/viz/altair.py +42 -0
- solara/website/pages/documentation/components/viz/echarts.py +75 -0
- solara/website/pages/documentation/components/viz/matplotlib.py +30 -0
- solara/website/pages/documentation/components/viz/plotly.py +63 -0
- solara/website/pages/documentation/components/viz/plotly_express.py +41 -0
- solara/website/pages/documentation/examples/__init__.py +52 -0
- solara/website/pages/documentation/examples/ai/__init__.py +11 -0
- solara/website/pages/documentation/examples/ai/chatbot.py +95 -0
- solara/website/pages/documentation/examples/ai/tokenizer.py +107 -0
- solara/website/pages/documentation/examples/basics/__init__.py +10 -0
- solara/website/pages/documentation/examples/basics/sine.py +28 -0
- solara/website/pages/documentation/examples/fullscreen/__init__.py +10 -0
- solara/website/pages/documentation/examples/fullscreen/authorization.py +3 -0
- solara/website/pages/documentation/examples/fullscreen/layout_demo.py +3 -0
- solara/website/pages/documentation/examples/fullscreen/multipage.py +3 -0
- solara/website/pages/documentation/examples/fullscreen/scatter.py +3 -0
- solara/website/pages/documentation/examples/fullscreen/scrolling.py +3 -0
- solara/website/pages/documentation/examples/fullscreen/tutorial_streamlit.py +3 -0
- solara/website/pages/documentation/examples/general/__init__.py +10 -0
- solara/website/pages/documentation/examples/general/custom_storage.py +70 -0
- solara/website/pages/documentation/examples/general/deploy_model.py +115 -0
- solara/website/pages/documentation/examples/general/live_update.py +38 -0
- solara/website/pages/documentation/examples/general/login_oauth.py +81 -0
- solara/website/pages/documentation/examples/general/mycard.vue +58 -0
- solara/website/pages/documentation/examples/general/pokemon_search.py +51 -0
- solara/website/pages/documentation/examples/general/vue_component.py +50 -0
- solara/website/pages/documentation/examples/ipycanvas.py +49 -0
- solara/website/pages/documentation/examples/libraries/__init__.py +10 -0
- solara/website/pages/documentation/examples/libraries/altair.py +64 -0
- solara/website/pages/documentation/examples/libraries/bqplot.py +39 -0
- solara/website/pages/documentation/examples/libraries/ipyleaflet.py +33 -0
- solara/website/pages/documentation/examples/libraries/ipyleaflet_advanced.py +66 -0
- solara/website/pages/documentation/examples/utilities/__init__.py +10 -0
- solara/website/pages/documentation/examples/utilities/calculator.py +157 -0
- solara/website/pages/documentation/examples/utilities/countdown_timer.py +64 -0
- solara/website/pages/documentation/examples/utilities/todo.py +196 -0
- solara/website/pages/documentation/examples/visualization/__init__.py +6 -0
- solara/website/pages/documentation/examples/visualization/annotator.py +69 -0
- solara/website/pages/documentation/examples/visualization/linked_views.py +84 -0
- solara/website/pages/documentation/examples/visualization/plotly.py +44 -0
- solara/website/pages/documentation/faq/__init__.py +12 -0
- solara/website/pages/documentation/faq/content/99-faq.md +76 -0
- solara/website/pages/documentation/getting_started/__init__.py +9 -0
- solara/website/pages/documentation/getting_started/content/00-quickstart.md +89 -0
- solara/website/pages/documentation/getting_started/content/01-introduction.md +125 -0
- solara/website/pages/documentation/getting_started/content/02-installing.md +134 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/00-overview.md +14 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/10_data_science.py +13 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/20-web-app.md +89 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/30-ipywidgets.md +124 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/40-streamlit.md +146 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/50-dash.md +144 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/60-jupyter-dashboard-part1.py +64 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/SF_crime_sample.csv.gz +0 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/_data_science.ipynb +445 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/_jupyter_dashboard_1.ipynb +1000 -0
- solara/website/pages/documentation/getting_started/content/05-fundamentals/00-overview.md +11 -0
- solara/website/pages/documentation/getting_started/content/05-fundamentals/10-components.md +223 -0
- solara/website/pages/documentation/getting_started/content/05-fundamentals/50-state-management.md +88 -0
- solara/website/pages/documentation/getting_started/content/07-deploying/00-overview.md +7 -0
- solara/website/pages/documentation/getting_started/content/07-deploying/10-self-hosted.md +273 -0
- solara/website/pages/documentation/getting_started/content/07-deploying/20-cloud-hosted.md +80 -0
- solara/website/pages/documentation/getting_started/content/80-what-is-lab.md +7 -0
- solara/website/pages/documentation/getting_started/content/90-troubleshoot.md +26 -0
- solara/website/pages/docutils.py +38 -0
- solara/website/pages/showcase/__init__.py +105 -0
- solara/website/pages/showcase/domino_code_assist.py +60 -0
- solara/website/pages/showcase/planeto_tessa.py +19 -0
- solara/website/pages/showcase/solara_dev.py +54 -0
- solara/website/pages/showcase/solarathon_2023_team_2.py +22 -0
- solara/website/pages/showcase/solarathon_2023_team_4.py +22 -0
- solara/website/pages/showcase/solarathon_2023_team_5.py +23 -0
- solara/website/pages/showcase/solarathon_2023_team_6.py +34 -0
- solara/website/pages/showcase/wanderlust.py +27 -0
- solara/website/public/beach.jpeg +0 -0
- solara/website/public/logo.svg +6 -0
- solara/website/public/social/discord.svg +1 -0
- solara/website/public/social/github.svg +1 -0
- solara/website/public/social/twitter.svg +3 -0
- solara/website/public/success.html +25 -0
- solara/website/templates/index.html.j2 +117 -0
- solara/website/utils.py +51 -0
- solara/widgets/__init__.py +1 -0
- solara/widgets/vue/gridlayout.vue +110 -0
- solara/widgets/vue/html.vue +4 -0
- solara/widgets/vue/navigator.vue +104 -0
- solara/widgets/vue/vegalite.vue +115 -0
- solara/widgets/widgets.py +66 -0
- solara_ui-1.31.0.data/data/etc/jupyter/jupyter_notebook_config.d/solara.json +7 -0
- solara_ui-1.31.0.data/data/etc/jupyter/jupyter_server_config.d/solara.json +7 -0
- solara_ui-1.31.0.dist-info/METADATA +158 -0
- solara_ui-1.31.0.dist-info/RECORD +439 -0
- solara_ui-1.31.0.dist-info/WHEEL +5 -0
- solara_ui-1.31.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
function connectWatchdog() {
|
|
4
|
+
var path = '';
|
|
5
|
+
WSURL = 'ws://' + window.location.host
|
|
6
|
+
var wsWatchdog = new WebSocket(WSURL + '/solara/watchdog/' + path);
|
|
7
|
+
wsWatchdog.onopen = () => {
|
|
8
|
+
console.log('connected with watchdog')
|
|
9
|
+
}
|
|
10
|
+
wsWatchdog.onmessage = (evt) => {
|
|
11
|
+
var msg = JSON.parse(evt.data)
|
|
12
|
+
if (msg.type == 'reload') {
|
|
13
|
+
var timeout = 0;
|
|
14
|
+
// if(msg.delay == 'long')
|
|
15
|
+
// timeout = 1000;
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
location.href = location.href;
|
|
18
|
+
}, timeout)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
wsWatchdog.onclose = () => {
|
|
22
|
+
timeout = 100
|
|
23
|
+
console.log('disconnected watchdog, reconnecting in ', timeout / 1000, 'seconds')
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
connectWatchdog();
|
|
26
|
+
}, timeout)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getCookiesMap(cookiesString) {
|
|
32
|
+
return cookiesString.split(";")
|
|
33
|
+
.map(function (cookieString) {
|
|
34
|
+
return cookieString.trim().split("=");
|
|
35
|
+
})
|
|
36
|
+
.reduce(function (acc, curr) {
|
|
37
|
+
acc[curr[0]] = curr[1];
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
}
|
|
41
|
+
const COOKIE_KEY_CONTEXT_ID = 'solara-context-id'
|
|
42
|
+
|
|
43
|
+
// var app = new Vue({
|
|
44
|
+
// vuetify: new Vuetify({
|
|
45
|
+
// theme: { dark: false },
|
|
46
|
+
// }),
|
|
47
|
+
// el: '#app',
|
|
48
|
+
// mounted() {
|
|
49
|
+
// // document.querySelector('#app').removeAttribute("style");
|
|
50
|
+
// },
|
|
51
|
+
// data() {
|
|
52
|
+
// return {
|
|
53
|
+
// loading_text: "Loading page",
|
|
54
|
+
// loadingPercentage: -1,
|
|
55
|
+
// loading: true,
|
|
56
|
+
// title: ""
|
|
57
|
+
// }
|
|
58
|
+
// }
|
|
59
|
+
// });
|
|
60
|
+
|
|
61
|
+
function websocket() {
|
|
62
|
+
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function solaraMount(model_id) {
|
|
66
|
+
// define("vue", [], () => Vue);
|
|
67
|
+
// define("vuetify", [], { framework: app.$vuetify });
|
|
68
|
+
console.log(document.cookie)
|
|
69
|
+
cookies = getCookiesMap(document.cookie);
|
|
70
|
+
const contextId = cookies[COOKIE_KEY_CONTEXT_ID]
|
|
71
|
+
console.log('contextId', contextId)
|
|
72
|
+
connectWatchdog()
|
|
73
|
+
// var path = window.location.pathname.substr(14);
|
|
74
|
+
console.log("will mount", model_id)
|
|
75
|
+
// NOTE: this file is not transpiled, async/await is the only modern feature we use here
|
|
76
|
+
require([window.voila_js_url || '/static/dist/voila.js'], function (voila) {
|
|
77
|
+
// requirejs doesn't like to be passed an async function, so create one inside
|
|
78
|
+
(async function () {
|
|
79
|
+
var kernel = await voila.connectKernel('jupyter', null, websocket)
|
|
80
|
+
if (!kernel) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const context = {
|
|
85
|
+
sessionContext: {
|
|
86
|
+
session: {
|
|
87
|
+
kernel,
|
|
88
|
+
kernelChanged: {
|
|
89
|
+
connect: () => { }
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
statusChanged: {
|
|
93
|
+
connect: () => { }
|
|
94
|
+
},
|
|
95
|
+
kernelChanged: {
|
|
96
|
+
connect: () => { }
|
|
97
|
+
},
|
|
98
|
+
connectionStatusChanged: {
|
|
99
|
+
connect: () => { }
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
saveState: {
|
|
103
|
+
connect: () => { }
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const settings = {
|
|
108
|
+
saveState: false
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const rendermime = new voila.RenderMimeRegistry({
|
|
112
|
+
initialFactories: voila.extendedRendererFactories
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
var widgetManager = new voila.WidgetManager(context, rendermime, settings);
|
|
116
|
+
|
|
117
|
+
async function init() {
|
|
118
|
+
// it seems if we attach this to early, it will not be called
|
|
119
|
+
const matches = document.cookie.match('\\b_xsrf=([^;]*)\\b');
|
|
120
|
+
const xsrfToken = (matches && matches[1]) || '';
|
|
121
|
+
const configData = JSON.parse(document.getElementById('jupyter-config-data').textContent);
|
|
122
|
+
const baseUrl = 'jupyter';
|
|
123
|
+
window.addEventListener('beforeunload', function (e) {
|
|
124
|
+
const data = new FormData();
|
|
125
|
+
data.append("_xsrf", xsrfToken);
|
|
126
|
+
window.navigator.sendBeacon(`${baseUrl}voila/api/shutdown/${kernel.id}`, data);
|
|
127
|
+
kernel.dispose();
|
|
128
|
+
});
|
|
129
|
+
await widgetManager.build_widgets();
|
|
130
|
+
voila.renderMathJax();
|
|
131
|
+
await Promise.all(Object.values(widgetManager._models)
|
|
132
|
+
.map(async (modelPromise) => {
|
|
133
|
+
const model = await modelPromise;
|
|
134
|
+
// console.log(model)
|
|
135
|
+
if (model.model_id == model_id) {
|
|
136
|
+
console.log("yeah, got it!", model_id)
|
|
137
|
+
const view = await widgetManager.create_view(model);
|
|
138
|
+
el = document.getElementById("content");
|
|
139
|
+
while (el.lastChild) {
|
|
140
|
+
el.removeChild(el.lastChild);
|
|
141
|
+
}
|
|
142
|
+
// el.appendChild(view.el);
|
|
143
|
+
requirejs(['@jupyter-widgets/base'], widgets =>
|
|
144
|
+
// widgets.JupyterPhosphorWidget.attach(widgetView.pWidget, this.$el)
|
|
145
|
+
widgets.JupyterPhosphorWidget.attach(view.pWidget, el)
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
console.log('el')
|
|
149
|
+
// provideWidget(mountId, view);
|
|
150
|
+
}
|
|
151
|
+
}));
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (document.readyState === 'complete') {
|
|
156
|
+
init()
|
|
157
|
+
} else {
|
|
158
|
+
window.addEventListener('load', init);
|
|
159
|
+
}
|
|
160
|
+
})()
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
import micropip
|
|
4
|
+
import micropip._micropip
|
|
5
|
+
import micropip.package
|
|
6
|
+
import solara_bootstrap
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class IOLoop:
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ZMQStream:
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class MessageTracker:
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Context:
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Socket:
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Message:
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
NOBLOCK = 1
|
|
34
|
+
REQ = None
|
|
35
|
+
DEALER = 2
|
|
36
|
+
SUB = 3
|
|
37
|
+
POLLOUT = 4
|
|
38
|
+
|
|
39
|
+
sugar = solara_bootstrap
|
|
40
|
+
socket = solara_bootstrap
|
|
41
|
+
asyncio = solara_bootstrap
|
|
42
|
+
core = solara_bootstrap
|
|
43
|
+
error = solara_bootstrap
|
|
44
|
+
ioloop = solara_bootstrap
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ProfileDir:
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class StdinNotImplementedError(Exception):
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class Queue:
|
|
56
|
+
pass
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class QueueEmpty:
|
|
60
|
+
pass
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class InteractiveShell:
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def display(*args, **kwargs):
|
|
68
|
+
raise NotImplementedError
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def clear_output(*args, **kwargs):
|
|
72
|
+
raise NotImplementedError
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def get_ipython():
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class Process:
|
|
80
|
+
pass
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
async def main():
|
|
84
|
+
# fake some packages we don't need
|
|
85
|
+
micropip.install("numpy")
|
|
86
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["debugpy"] = micropip.package.PackageMetadata(name="debugpy", version="1.6", source="")
|
|
87
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["notebook"] = micropip.package.PackageMetadata(name="notebook", version="6.5", source="")
|
|
88
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["pyzmq"] = micropip.package.PackageMetadata(name="pyzmq", version="23.0", source="")
|
|
89
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["psutil"] = micropip.package.PackageMetadata(name="psutil", version="22.3", source="")
|
|
90
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["tornado"] = micropip.package.PackageMetadata(name="tornado", version="6.2", source="")
|
|
91
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["argon2-cffi-bindings"] = micropip.package.PackageMetadata(
|
|
92
|
+
name="argon2-cffi-bindings", version="22.3", source=""
|
|
93
|
+
)
|
|
94
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["ipython"] = micropip.package.PackageMetadata(name="ipython", version="8.3", source="")
|
|
95
|
+
micropip._micropip.PACKAGE_MANAGER.installed_packages["jupyter_client"] = micropip.package.PackageMetadata(name="jupyter_client", version="7.3", source="")
|
|
96
|
+
|
|
97
|
+
sys.modules["zmq"] = solara_bootstrap
|
|
98
|
+
sys.modules["zmq.asyncio"] = solara_bootstrap
|
|
99
|
+
sys.modules["zmq.eventloop"] = solara_bootstrap
|
|
100
|
+
sys.modules["zmq.eventloop.ioloop"] = solara_bootstrap
|
|
101
|
+
sys.modules["zmq.eventloop.zmqstream"] = solara_bootstrap
|
|
102
|
+
|
|
103
|
+
for fake in (
|
|
104
|
+
"psutil IPython IPython.core IPython.core.interactiveshell IPython.core.getipython IPython.core.error "
|
|
105
|
+
"IPython.core.profiledir IPython.display tornado tornado.ioloop tornado.queues".split()
|
|
106
|
+
):
|
|
107
|
+
sys.modules[fake] = solara_bootstrap
|
|
108
|
+
|
|
109
|
+
requirements = [
|
|
110
|
+
"Pygments==2.13.0",
|
|
111
|
+
"ipywidgets<8",
|
|
112
|
+
"pydantic",
|
|
113
|
+
"jinja2",
|
|
114
|
+
"bqplot",
|
|
115
|
+
"altair",
|
|
116
|
+
"vega_datasets",
|
|
117
|
+
"plotly",
|
|
118
|
+
"ipycanvas",
|
|
119
|
+
]
|
|
120
|
+
for dep in requirements:
|
|
121
|
+
await micropip.install(dep, keep_going=True)
|
|
122
|
+
await micropip.install("/wheels/solara-1.31.0-py2.py3-none-any.whl", keep_going=True)
|
|
123
|
+
import solara
|
|
124
|
+
|
|
125
|
+
el = solara.Warning("lala")
|
|
126
|
+
import solara
|
|
127
|
+
|
|
128
|
+
solara.render_fixed(el)
|
|
129
|
+
return el
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg width="230.74mm" height="237.76mm" version="1.1" viewBox="0 0 230.74 237.76" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g transform="translate(5.2977 -29.112)">
|
|
3
|
+
<g transform="matrix(2.3074 0 0 2.3074 -140.7 130.49)">
|
|
4
|
+
<g transform="matrix(1.0518 0 0 1.0518 55.605 -45.028)" fill="#f8b500" featureKey="symbolFeature-0">
|
|
5
|
+
<g fill="#f8b500">
|
|
6
|
+
<path d="m77.067 50.035c0 15.113-11.912 27.361-26.611 27.361-14.683 0-26.595-12.248-26.595-27.361 0-15.114 11.912-27.361 26.595-27.361 14.699 0 26.611 12.247 26.611 27.361z"/>
|
|
7
|
+
<path d="m51.542 18.25c0.687 0.088 1.333 0.16 2.012 0.16 0.319 0 0.647-0.016 0.99-0.064 1.038-0.135 1.709-0.503 2.028-1.109 0.934-1.717-0.767-5.245-2.132-8.088-0.811-1.692-1.513-3.146-1.669-4.184-0.176-0.423-0.279-0.926-0.391-1.461-0.32-1.541-0.596-2.467-1.653-2.467h-0.159c-0.918 0.071-1.529 1.892-1.853 2.866l-0.399 1.182c-0.503 1.524-0.978 2.97-1.9 4.359-0.167 0.255-0.343 0.494-0.519 0.758-1.146 1.677-2.34 3.409-2.12 5.317 0.24 2.188 1.665 3.306 3.602 2.803 1.297-0.327 2.798-0.231 4.163-0.072z"/>
|
|
8
|
+
<path d="m45.897 89.828c0.176 0.263 0.352 0.511 0.519 0.758 0.923 1.39 1.397 2.835 1.9 4.359l0.399 1.182c0.323 0.982 0.935 2.795 1.853 2.866l0.159 9e-3c1.058 0 1.333-0.935 1.653-2.468 0.111-0.543 0.215-1.038 0.391-1.469 0.156-1.03 0.858-2.491 1.669-4.184 1.365-2.835 3.065-6.371 2.132-8.088-0.319-0.606-0.99-0.966-2.028-1.11s-1.988-0.023-3.002 0.096c-1.361 0.16-2.866 0.256-4.163-0.071-0.316-0.088-0.619-0.12-0.902-0.12-1.489 0-2.495 1.086-2.699 2.923-0.22 1.916 0.974 3.64 2.119 5.317z"/>
|
|
9
|
+
<path d="m19.693 45.468c-0.271-2.1-1.337-2.371-2.235-2.371-1.824 0-4.384 1.31-6.643 2.459-1.645 0.839-3.062 1.565-4.072 1.725-0.415 0.184-0.91 0.288-1.425 0.399-1.688 0.375-2.467 0.687-2.388 1.9 0.068 0.974 1.841 1.597 2.782 1.932l1.143 0.407c1.429 0.503 2.89 1.015 4.247 1.965 0.239 0.167 0.487 0.351 0.734 0.534 1.617 1.174 3.29 2.396 5.13 2.18 1.066-0.127 1.889-0.551 2.363-1.245 0.463-0.655 0.579-1.525 0.348-2.507-0.375-1.549-0.216-2.923-0.076-4.264 0.117-1.046 0.232-2.044 0.092-3.114z"/>
|
|
10
|
+
<path d="m81.594 55.353c0.479 0.694 1.294 1.118 2.363 1.245 1.86 0.216 3.521-0.998 5.13-2.18 0.252-0.184 0.499-0.367 0.739-0.534 1.353-0.95 2.826-1.462 4.247-1.973l1.142-0.399c0.942-0.335 2.715-0.958 2.778-1.932 0.088-1.214-0.702-1.525-2.379-1.9-0.519-0.111-1.014-0.216-1.438-0.399-1.002-0.159-2.427-0.886-4.063-1.725-2.26-1.149-4.818-2.459-6.646-2.459-0.898 0-1.961 0.271-2.231 2.371-0.14 1.07-0.028 2.068 0.096 3.114 0.14 1.341 0.287 2.715-0.08 4.264-0.236 0.981-0.113 1.851 0.342 2.507z"/>
|
|
11
|
+
<path d="m27.666 17.651c-0.184 2.036-0.371 4.152 0.738 5.701 0.702 0.966 1.572 1.501 2.451 1.509 0.694 0 1.397-0.336 2.016-0.958 1.122-1.11 2.363-1.661 3.557-2.196 0.95-0.423 1.837-0.822 2.651-1.469 0.858-0.687 1.261-1.357 1.229-2.067-0.064-1.965-3.218-4.128-5.761-5.869-1.521-1.037-2.838-1.947-3.469-2.762-0.371-0.28-0.703-0.663-1.062-1.062-0.603-0.702-1.293-1.484-1.972-1.484-0.243 0-0.491 0.096-0.767 0.287-0.782 0.543-0.423 2.443-0.231 3.465l0.231 1.229c0.3 1.581 0.591 3.082 0.463 4.743-0.014 0.303-0.043 0.614-0.074 0.933z"/>
|
|
12
|
+
<path d="m74.808 87.561c-0.371-0.967-0.471-2.604-0.583-4.479-0.239-3.713-0.522-8.335-2.974-8.335-0.403 0-0.866 0.111-1.386 0.327-0.954 0.415-1.729 1.006-2.555 1.637-1.054 0.798-2.14 1.629-3.637 2.076-0.898 0.263-1.553 0.767-1.88 1.469-0.376 0.782-0.336 1.788 0.104 2.843 0.742 1.756 2.603 2.643 4.411 3.505 0.275 0.127 0.547 0.255 0.814 0.391 1.469 0.727 2.639 1.78 3.769 2.795l0.922 0.814c0.774 0.702 2.172 1.932 2.971 1.524 1.062-0.535 0.926-1.389 0.391-3.09-0.159-0.527-0.32-1.022-0.367-1.477z"/>
|
|
13
|
+
<path d="m73.702 7.424c-0.831 0-1.952 1.014-2.623 1.613l-0.91 0.806c-1.126 1.022-2.3 2.076-3.769 2.803-0.264 0.128-0.535 0.264-0.814 0.392-1.805 0.854-3.673 1.74-4.411 3.497-0.443 1.054-0.483 2.067-0.107 2.85 0.335 0.695 0.981 1.206 1.884 1.47 1.501 0.438 2.583 1.27 3.633 2.084 0.822 0.622 1.601 1.213 2.555 1.62 0.52 0.224 0.986 0.336 1.386 0.336 2.459 0 2.742-4.631 2.966-8.344 0.12-1.876 0.224-3.505 0.591-4.471 0.052-0.464 0.208-0.959 0.371-1.478 0.527-1.7 0.667-2.562-0.387-3.09-0.114-0.056-0.233-0.088-0.365-0.088z"/>
|
|
14
|
+
<path d="m27.326 92.646c0.671 0 1.357-0.791 1.973-1.478 0.351-0.407 0.69-0.79 1.05-1.069 0.635-0.822 1.956-1.725 3.473-2.771 2.543-1.741 5.696-3.904 5.769-5.86 0.032-0.711-0.379-1.39-1.229-2.068-0.822-0.654-1.709-1.046-2.65-1.469-1.202-0.535-2.443-1.086-3.562-2.204-0.622-0.622-1.321-0.941-2.008-0.941-0.891 0-1.761 0.534-2.455 1.501-1.117 1.549-0.926 3.656-0.742 5.7 0.02 0.319 0.056 0.623 0.071 0.935 0.128 1.66-0.176 3.226-0.459 4.734l-0.231 1.237c-0.195 1.014-0.555 2.914 0.228 3.465 0.273 0.193 0.525 0.288 0.772 0.288z"/>
|
|
15
|
+
<path d="m11.478 29.029c0.99 1.157 2.005 2.363 2.715 3.872 0.124 0.271 0.247 0.551 0.375 0.838 0.835 1.86 1.693 3.793 3.394 4.551 0.551 0.24 1.078 0.368 1.577 0.368 1.257 0 2.167-0.791 2.566-2.212 0.432-1.533 1.237-2.651 2.013-3.729 0.614-0.854 1.193-1.653 1.588-2.643 0.42-1.055 0.432-1.86 0.049-2.468-1.03-1.62-4.779-1.868-7.801-2.06-1.824-0.12-3.405-0.224-4.359-0.606-0.447-0.057-0.93-0.224-1.438-0.392-0.61-0.199-1.241-0.407-1.772-0.407-0.566 0-0.906 0.231-1.182 0.814-0.415 0.887 0.818 2.339 1.481 3.122z"/>
|
|
16
|
+
<path d="m75.438 68.127c-0.663 0.711-0.986 1.509-0.918 2.308 0.071 0.854 0.583 1.685 1.461 2.355 0.798 0.606 1.832 0.894 3.262 0.894 0.738 0 1.497-0.071 2.235-0.144 0.299-0.032 0.606-0.063 0.902-0.08 0.26-0.023 0.515-0.031 0.771-0.031 1.337 0 2.614 0.263 3.856 0.511l1.193 0.239c0.579 0.12 1.293 0.256 1.952 0.256 1.042 0 1.289-0.367 1.365-0.487 0.663-1.006 0.132-1.692-1.149-2.89-0.399-0.359-0.775-0.711-1.042-1.086-0.795-0.647-1.673-2.013-2.687-3.577-1.617-2.507-3.833-5.933-5.717-5.933-0.663 0-1.286 0.415-1.916 1.262-0.639 0.847-1.022 1.765-1.43 2.738-0.516 1.238-1.059 2.508-2.138 3.665z"/>
|
|
17
|
+
<path d="m13.753 66.395c-1.002 1.564-1.884 2.93-2.674 3.577-0.28 0.375-0.651 0.727-1.038 1.086-1.29 1.197-1.828 1.884-1.158 2.89 0.08 0.12 0.319 0.487 1.357 0.487 0.667 0 1.39-0.136 1.964-0.256l1.19-0.239c1.477-0.296 3.006-0.615 4.631-0.479 0.295 0.017 0.59 0.048 0.894 0.08 0.738 0.072 1.493 0.144 2.231 0.144 1.441 0 2.472-0.287 3.27-0.894 0.87-0.671 1.394-1.501 1.461-2.355 0.072-0.799-0.247-1.597-0.926-2.308-1.07-1.157-1.613-2.436-2.132-3.665-0.407-0.974-0.79-1.892-1.429-2.738-0.631-0.847-1.258-1.262-1.917-1.262-1.883-1e-3 -4.099 3.433-5.724 5.932z"/>
|
|
18
|
+
<path d="m85.826 33.747c0.127-0.287 0.255-0.574 0.391-0.846 0.703-1.518 1.717-2.715 2.703-3.881l0.798-0.941c0.667-0.783 1.896-2.235 1.481-3.122-0.275-0.583-0.615-0.814-1.182-0.814-0.531 0-1.162 0.208-1.776 0.407-0.503 0.168-0.986 0.335-1.434 0.383-0.95 0.392-2.535 0.495-4.355 0.615-3.021 0.191-6.771 0.439-7.796 2.06-0.392 0.607-0.375 1.413 0.044 2.468 0.396 0.989 0.97 1.788 1.593 2.643 0.774 1.077 1.581 2.195 2.008 3.729 0.555 1.988 2.208 2.698 4.14 1.844 1.7-0.76 2.563-2.685 3.385-4.545z"/>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// webworker.js
|
|
2
|
+
|
|
3
|
+
// synchronously loads pyodide
|
|
4
|
+
importScripts("https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js");
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
async function loadSolara() {
|
|
8
|
+
self.pyodide = await loadPyodide()
|
|
9
|
+
await self.pyodide.loadPackage('micropip');
|
|
10
|
+
await self.pyodide.runPythonAsync(`
|
|
11
|
+
from pyodide.http import pyfetch
|
|
12
|
+
response = await pyfetch("/static/solara_bootstrap.py")
|
|
13
|
+
with open("solara_bootstrap.py", "wb") as f:
|
|
14
|
+
f.write(await response.bytes())
|
|
15
|
+
import solara_bootstrap
|
|
16
|
+
await solara_bootstrap.main()
|
|
17
|
+
import solara.server.pyodide`)
|
|
18
|
+
self.model_id = self.pyodide.runPython('import solara.server.pyodide as p; p.start("solara.website.pages:Page")')
|
|
19
|
+
self.postMessage({ 'type': 'opened' })
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
solara = loadSolara()
|
|
23
|
+
|
|
24
|
+
// this will be called from solara.server.pyodide
|
|
25
|
+
self.sendToPage = function (msg) {
|
|
26
|
+
// console.log('send to page', msg)
|
|
27
|
+
msg = { 'type': 'send', 'value': msg }
|
|
28
|
+
// forward to the page
|
|
29
|
+
self.postMessage(msg)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// when we get a msg from the page
|
|
33
|
+
self.onmessage = async (event) => {
|
|
34
|
+
// console.log("send to solara", event)
|
|
35
|
+
// make sure the bootstrapping ran
|
|
36
|
+
solara_ = await solara;
|
|
37
|
+
solaraPyodide = self.pyodide.runPython('import solara.server.pyodide as p; p');
|
|
38
|
+
msg = event.data
|
|
39
|
+
if (msg.type == 'send') {
|
|
40
|
+
await solaraPyodide.processKernelMessage(event.data['value'])
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import platform
|
|
5
|
+
import threading
|
|
6
|
+
import time
|
|
7
|
+
import uuid
|
|
8
|
+
from collections import defaultdict
|
|
9
|
+
from typing import Dict, Optional
|
|
10
|
+
from urllib.parse import quote
|
|
11
|
+
|
|
12
|
+
import ipyvue
|
|
13
|
+
import ipyvuetify
|
|
14
|
+
import ipywidgets
|
|
15
|
+
import requests
|
|
16
|
+
|
|
17
|
+
import solara
|
|
18
|
+
import solara.util
|
|
19
|
+
|
|
20
|
+
from . import settings
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger("solara.server.telemetry")
|
|
23
|
+
|
|
24
|
+
_auto_restart_enabled = False
|
|
25
|
+
_server_user_id_override = None
|
|
26
|
+
_server_start_time = time.time()
|
|
27
|
+
# Privacy note: mixpanel does not store the IP, only the region
|
|
28
|
+
_server_ip = None
|
|
29
|
+
_platform_system = platform.system()
|
|
30
|
+
_platform_release = platform.release()
|
|
31
|
+
_python_version = platform.python_version()
|
|
32
|
+
_connections_per_session_daily: Dict[str, int] = defaultdict(int)
|
|
33
|
+
_connections_per_session_cumulative: Dict[str, int] = defaultdict(int)
|
|
34
|
+
|
|
35
|
+
_seconds_per_day = 60 * 60 * 24
|
|
36
|
+
_report_timeout = _seconds_per_day
|
|
37
|
+
|
|
38
|
+
solara_props = {
|
|
39
|
+
"solara_version": solara.__version__,
|
|
40
|
+
"ipywidgets_version": ipywidgets.__version__,
|
|
41
|
+
"ipyvuetify_version": ipyvuetify.__version__,
|
|
42
|
+
"ipyvue_version": ipyvue.__version__,
|
|
43
|
+
}
|
|
44
|
+
_docker = False
|
|
45
|
+
_compute_platform = "unknown"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def is_running_on_domino():
|
|
49
|
+
return "DOMINO_PROJECT_OWNER" in os.environ
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def is_running_on_sagemaker_notebook():
|
|
53
|
+
return "AWS_EXECUTION_ENV" in os.environ and "SageMaker" in os.environ["AWS_EXECUTION_ENV"]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def is_running_on_azure():
|
|
57
|
+
return "AZURE_NOTEBOOKS_VM" in os.environ or "AZUREML_RUN_ID" in os.environ
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if solara.util.is_running_in_colab():
|
|
61
|
+
_compute_platform = "colab"
|
|
62
|
+
elif is_running_on_domino():
|
|
63
|
+
_compute_platform = "domino"
|
|
64
|
+
elif is_running_on_sagemaker_notebook():
|
|
65
|
+
_compute_platform = "sagemaker"
|
|
66
|
+
elif is_running_on_azure():
|
|
67
|
+
_compute_platform = "azure"
|
|
68
|
+
|
|
69
|
+
_vscode = solara.util.is_running_in_vscode()
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
path = "/proc/self/cgroup"
|
|
73
|
+
_docker = os.path.exists("/.dockerenv") or os.path.isfile(path) and any("docker" in line for line in open(path))
|
|
74
|
+
except: # noqa
|
|
75
|
+
logger.exception("Failed to detect docker")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _get_ip():
|
|
79
|
+
global _server_ip
|
|
80
|
+
try:
|
|
81
|
+
_server_ip = requests.get("https://api.ipify.org").text
|
|
82
|
+
except Exception:
|
|
83
|
+
_server_ip = "failed to get IP"
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def override_server_user_id(server_user_id: str):
|
|
87
|
+
global _server_user_id_override
|
|
88
|
+
_server_user_id_override = server_user_id
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def get_server_user_id():
|
|
92
|
+
return _server_user_id_override or settings.telemetry.server_user_id
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def track(event: str, props: Optional[Dict] = None):
|
|
96
|
+
if _auto_restart_enabled:
|
|
97
|
+
return
|
|
98
|
+
if not settings.telemetry.mixpanel_enable:
|
|
99
|
+
return
|
|
100
|
+
event_item = {
|
|
101
|
+
"event": event,
|
|
102
|
+
"properties": {
|
|
103
|
+
"token": settings.telemetry.mixpanel_token,
|
|
104
|
+
"fingerprint": settings.telemetry.server_fingerprint,
|
|
105
|
+
"time": int(time.time() * 1000),
|
|
106
|
+
"distinct_id": get_server_user_id(),
|
|
107
|
+
# can be useful to get of session duration
|
|
108
|
+
"session_id": settings.telemetry.server_session_id,
|
|
109
|
+
"$insert_id": str(uuid.uuid4()), # to de-duplicate events
|
|
110
|
+
# Privacy note: mixpanel does not store the IP, only the region
|
|
111
|
+
"ip": _server_ip,
|
|
112
|
+
"platform_system": _platform_system,
|
|
113
|
+
"platform_release": _platform_release,
|
|
114
|
+
"python_version": _python_version,
|
|
115
|
+
"docker": _docker,
|
|
116
|
+
"compute_platform": _compute_platform,
|
|
117
|
+
"vscode": _vscode,
|
|
118
|
+
"solara_mode": settings.main.mode,
|
|
119
|
+
**(solara_props or {}),
|
|
120
|
+
**(props or {}),
|
|
121
|
+
},
|
|
122
|
+
}
|
|
123
|
+
try:
|
|
124
|
+
requests.post(
|
|
125
|
+
"https://api.mixpanel.com/track/",
|
|
126
|
+
headers={"content-type": "application/x-www-form-urlencoded"},
|
|
127
|
+
data=f"data={quote(json.dumps([event_item]))}",
|
|
128
|
+
timeout=1,
|
|
129
|
+
)
|
|
130
|
+
except Exception:
|
|
131
|
+
pass
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def _usage_stats():
|
|
135
|
+
unique_session_daily = len(_connections_per_session_daily)
|
|
136
|
+
unique_session_cumulative = len(_connections_per_session_cumulative)
|
|
137
|
+
avg_connections_daily = sum(_connections_per_session_daily.values()) / unique_session_daily if unique_session_daily else 0
|
|
138
|
+
avg_connections_cumulative = sum(_connections_per_session_cumulative.values()) / unique_session_cumulative if unique_session_cumulative else 0
|
|
139
|
+
uptime_days = (time.time() - _server_start_time) / (_seconds_per_day)
|
|
140
|
+
return {
|
|
141
|
+
"uptime_days": uptime_days,
|
|
142
|
+
"unique_session_daily": unique_session_daily,
|
|
143
|
+
"avg_connections_daily": avg_connections_daily,
|
|
144
|
+
"unique_session_cumulative": unique_session_cumulative,
|
|
145
|
+
"avg_connections_cumulative": avg_connections_cumulative,
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _track():
|
|
150
|
+
global _server_start_time
|
|
151
|
+
_server_start_time = time.time()
|
|
152
|
+
_get_ip()
|
|
153
|
+
track("Solara server start")
|
|
154
|
+
while True:
|
|
155
|
+
try:
|
|
156
|
+
time.sleep(_report_timeout)
|
|
157
|
+
track("Solara report", _usage_stats())
|
|
158
|
+
_connections_per_session_daily.clear()
|
|
159
|
+
except Exception:
|
|
160
|
+
pass
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
_thread = threading.Thread(target=_track, daemon=True)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def server_start():
|
|
167
|
+
if _auto_restart_enabled:
|
|
168
|
+
return
|
|
169
|
+
if not settings.telemetry.mixpanel_enable:
|
|
170
|
+
return
|
|
171
|
+
try:
|
|
172
|
+
_thread.start()
|
|
173
|
+
except RuntimeError:
|
|
174
|
+
pass
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def server_stop():
|
|
178
|
+
duration = time.time() - _server_start_time
|
|
179
|
+
track("Solara server stop", {"duration_seconds": duration, **_usage_stats()})
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
_jupyter_start_event_send = False
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def jupyter_start():
|
|
186
|
+
# track the usage once
|
|
187
|
+
global _jupyter_start_event_send
|
|
188
|
+
if _jupyter_start_event_send:
|
|
189
|
+
return
|
|
190
|
+
_jupyter_start_event_send = True
|
|
191
|
+
|
|
192
|
+
def jupyter_track():
|
|
193
|
+
_get_ip()
|
|
194
|
+
track("Solara Jupyter use")
|
|
195
|
+
|
|
196
|
+
try:
|
|
197
|
+
threading.Thread(target=jupyter_track, daemon=True).start()
|
|
198
|
+
except: # noqa
|
|
199
|
+
pass
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def connection_open(session_id):
|
|
203
|
+
_connections_per_session_daily[session_id] += 1
|
|
204
|
+
_connections_per_session_cumulative[session_id] += 1
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def connection_close(session_id):
|
|
208
|
+
pass
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
if __name__ == "__main__":
|
|
212
|
+
track("Solara test event", {"where": "command line"})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% extends "solara.html.j2" %}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% raw -%}
|
|
2
|
+
<v-fade-y-transition name="solara-transition">
|
|
3
|
+
<div v-if="loading" id="loader-container">
|
|
4
|
+
<v-card style="width: 600px">
|
|
5
|
+
<v-progress-linear :indeterminate="loadingPercentage < 0" v-model="loadingPercentage" height="15"
|
|
6
|
+
color="#2d71c7">
|
|
7
|
+
</v-progress-linear>
|
|
8
|
+
|
|
9
|
+
<v-card-title primary-title class="py-8">
|
|
10
|
+
<h1>{{ loading_text }}</h1>
|
|
11
|
+
</v-card-title>
|
|
12
|
+
</v-card>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-else>
|
|
15
|
+
<jupyter-widget-mount-point v-if="!loading" mount-id="solara-main">
|
|
16
|
+
A widget with mount-id="solara-main" should go here
|
|
17
|
+
</jupyter-widget-mount-point>
|
|
18
|
+
</div>
|
|
19
|
+
</v-fade-y-transition>
|
|
20
|
+
{% endraw -%}
|