solara-ui 1.45.0__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 +765 -0
- solara/_stores.py +297 -0
- solara/alias.py +6 -0
- solara/autorouting.py +555 -0
- solara/cache.py +305 -0
- solara/checks.html +71 -0
- solara/checks.py +227 -0
- solara/comm.py +28 -0
- solara/components/__init__.py +77 -0
- solara/components/alert.py +155 -0
- solara/components/applayout.py +397 -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 +134 -0
- solara/components/cross_filter.py +335 -0
- solara/components/dataframe.py +546 -0
- solara/components/datatable.py +214 -0
- solara/components/datatable.vue +175 -0
- solara/components/details.py +56 -0
- solara/components/download.vue +35 -0
- solara/components/echarts.py +86 -0
- solara/components/echarts.vue +139 -0
- solara/components/figure_altair.py +39 -0
- solara/components/file_browser.py +181 -0
- solara/components/file_download.py +199 -0
- solara/components/file_drop.py +159 -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 +456 -0
- solara/components/input_text_area.py +86 -0
- solara/components/link.py +55 -0
- solara/components/markdown.py +441 -0
- solara/components/markdown_editor.py +33 -0
- solara/components/markdown_editor.vue +359 -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 +45 -0
- solara/components/sql_code.py +41 -0
- solara/components/sql_code.vue +125 -0
- solara/components/style.py +105 -0
- solara/components/switch.py +71 -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/core.py +42 -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 +151 -0
- solara/hooks/use_thread.py +129 -0
- solara/kitchensink.py +8 -0
- solara/lab/__init__.py +34 -0
- solara/lab/components/__init__.py +7 -0
- solara/lab/components/chat.py +215 -0
- solara/lab/components/confirmation_dialog.py +163 -0
- solara/lab/components/cross_filter.py +7 -0
- solara/lab/components/input_date.py +339 -0
- solara/lab/components/input_time.py +133 -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 +2 -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 +165 -0
- solara/lab/utils/headers.py +5 -0
- solara/layout.py +44 -0
- solara/lifecycle.py +46 -0
- solara/minisettings.py +141 -0
- solara/py.typed +0 -0
- solara/reactive.py +99 -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 +527 -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 +1681 -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 +91 -0
- solara/server/esm.py +71 -0
- solara/server/fastapi.py +5 -0
- solara/server/flask.py +297 -0
- solara/server/jupyter/__init__.py +2 -0
- solara/server/jupyter/cdn_handler.py +28 -0
- solara/server/jupyter/server_extension.py +40 -0
- solara/server/jupyter/solara.py +91 -0
- solara/server/jupytertools.py +46 -0
- solara/server/kernel.py +388 -0
- solara/server/kernel_context.py +467 -0
- solara/server/patch.py +564 -0
- solara/server/pyinstaller/__init__.py +9 -0
- solara/server/pyinstaller/hook-ipyreact.py +5 -0
- solara/server/pyinstaller/hook-ipyvuetify.py +5 -0
- solara/server/pyinstaller/hook-solara.py +9 -0
- solara/server/qt.py +113 -0
- solara/server/reload.py +251 -0
- solara/server/server.py +484 -0
- solara/server/settings.py +249 -0
- solara/server/shell.py +269 -0
- solara/server/starlette.py +770 -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 +272 -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 +486 -0
- solara/server/threaded.py +84 -0
- solara/server/utils.py +44 -0
- solara/server/websocket.py +45 -0
- solara/settings.py +86 -0
- solara/tasks.py +893 -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 +783 -0
- solara/toestand.py +998 -0
- solara/util.py +348 -0
- solara/validate_hooks.py +258 -0
- solara/website/__init__.py +0 -0
- solara/website/assets/custom.css +444 -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.py +6 -0
- solara/website/components/algolia.vue +24 -0
- solara/website/components/algolia_api.vue +202 -0
- solara/website/components/breadcrumbs.py +28 -0
- solara/website/components/contact.py +144 -0
- solara/website/components/docs.py +143 -0
- solara/website/components/header.py +75 -0
- solara/website/components/mailchimp.py +12 -0
- solara/website/components/mailchimp.vue +47 -0
- solara/website/components/markdown.py +99 -0
- solara/website/components/markdown_nav.vue +34 -0
- solara/website/components/notebook.py +171 -0
- solara/website/components/sidebar.py +105 -0
- solara/website/pages/__init__.py +370 -0
- solara/website/pages/about/__init__.py +9 -0
- solara/website/pages/about/about.md +3 -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/careers/__init__.py +27 -0
- solara/website/pages/changelog/__init__.py +10 -0
- solara/website/pages/changelog/changelog.md +372 -0
- solara/website/pages/contact/__init__.py +34 -0
- solara/website/pages/doc_use_download.py +85 -0
- solara/website/pages/documentation/__init__.py +90 -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 +417 -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 +50 -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 +72 -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 +192 -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 +256 -0
- solara/website/pages/documentation/advanced/content/20-understanding/50-solara-server.md +108 -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 +7 -0
- solara/website/pages/documentation/advanced/content/30-enterprise/10-oauth.md +187 -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 +22 -0
- solara/website/pages/documentation/api/cross_filter/cross_filter_report.py +20 -0
- solara/website/pages/documentation/api/cross_filter/cross_filter_select.py +20 -0
- solara/website/pages/documentation/api/cross_filter/cross_filter_slider.py +20 -0
- solara/website/pages/documentation/api/hooks/__init__.py +9 -0
- solara/website/pages/documentation/api/hooks/use_cross_filter.py +23 -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 +31 -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 +30 -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 +66 -0
- solara/website/pages/documentation/api/hooks/use_thread.md +64 -0
- solara/website/pages/documentation/api/hooks/use_thread.py +42 -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 +29 -0
- solara/website/pages/documentation/api/routing/use_route.py +76 -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 +44 -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 +25 -0
- solara/website/pages/documentation/components/advanced/meta.py +17 -0
- solara/website/pages/documentation/components/advanced/style.py +43 -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 +30 -0
- solara/website/pages/documentation/components/input/file_drop.py +76 -0
- solara/website/pages/documentation/components/input/input.py +43 -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/input_time.py +15 -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 +74 -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 +66 -0
- solara/website/pages/documentation/components/layout/details.py +13 -0
- solara/website/pages/documentation/components/layout/griddraggable.py +62 -0
- solara/website/pages/documentation/components/layout/gridfixed.py +19 -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 +19 -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 +83 -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 +15 -0
- solara/website/pages/documentation/components/page/title.py +25 -0
- solara/website/pages/documentation/components/status/__init__.py +9 -0
- solara/website/pages/documentation/components/status/error.py +39 -0
- solara/website/pages/documentation/components/status/info.py +39 -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 +77 -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 +54 -0
- solara/website/pages/documentation/examples/ai/__init__.py +11 -0
- solara/website/pages/documentation/examples/ai/chatbot.py +113 -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 +32 -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 +65 -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 +62 -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 +67 -0
- solara/website/pages/documentation/examples/visualization/linked_views.py +81 -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 +112 -0
- solara/website/pages/documentation/getting_started/__init__.py +9 -0
- solara/website/pages/documentation/getting_started/content/00-quickstart.md +107 -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 +65 -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 +1021 -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 +228 -0
- solara/website/pages/documentation/getting_started/content/05-fundamentals/50-state-management.md +278 -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 +305 -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/home.vue +1199 -0
- solara/website/pages/our_team/__init__.py +83 -0
- solara/website/pages/pricing/__init__.py +31 -0
- solara/website/pages/roadmap/__init__.py +11 -0
- solara/website/pages/roadmap/roadmap.md +47 -0
- solara/website/pages/scale_ipywidgets.py +45 -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 +107 -0
- solara/widgets/vue/html.vue +4 -0
- solara/widgets/vue/navigator.vue +134 -0
- solara/widgets/vue/vegalite.vue +130 -0
- solara/widgets/widgets.py +74 -0
- solara_ui-1.45.0.data/data/etc/jupyter/jupyter_notebook_config.d/solara.json +7 -0
- solara_ui-1.45.0.data/data/etc/jupyter/jupyter_server_config.d/solara.json +7 -0
- solara_ui-1.45.0.dist-info/METADATA +162 -0
- solara_ui-1.45.0.dist-info/RECORD +464 -0
- solara_ui-1.45.0.dist-info/WHEEL +4 -0
- solara_ui-1.45.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import math
|
|
2
|
+
import os
|
|
3
|
+
from datetime import date, datetime, timedelta
|
|
4
|
+
from typing import Callable, List, Optional, Tuple, TypeVar, Union, cast
|
|
5
|
+
|
|
6
|
+
import ipyvue
|
|
7
|
+
import ipyvuetify
|
|
8
|
+
import reacton.core
|
|
9
|
+
import traitlets
|
|
10
|
+
from typing_extensions import Literal
|
|
11
|
+
|
|
12
|
+
import solara
|
|
13
|
+
from solara.alias import rv
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@solara.value_component(int)
|
|
19
|
+
def SliderInt(
|
|
20
|
+
label: str,
|
|
21
|
+
value: Union[int, solara.Reactive[int]] = 0,
|
|
22
|
+
min: int = 0,
|
|
23
|
+
max: int = 10,
|
|
24
|
+
step: int = 1,
|
|
25
|
+
on_value: Optional[Callable[[int], None]] = None,
|
|
26
|
+
thumb_label: Union[bool, Literal["always"]] = True,
|
|
27
|
+
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
|
|
28
|
+
disabled: bool = False,
|
|
29
|
+
):
|
|
30
|
+
"""Slider for controlling an integer value.
|
|
31
|
+
|
|
32
|
+
### Basic example:
|
|
33
|
+
|
|
34
|
+
```solara
|
|
35
|
+
import solara
|
|
36
|
+
|
|
37
|
+
int_value = solara.reactive(42)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@solara.component
|
|
41
|
+
def Page():
|
|
42
|
+
solara.SliderInt("Some integer", value=int_value, min=-10, max=120)
|
|
43
|
+
solara.Markdown(f"**Int value**: {int_value.value}")
|
|
44
|
+
with solara.Row():
|
|
45
|
+
solara.Button("Reset", on_click=lambda: int_value.set(42))
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Arguments
|
|
50
|
+
|
|
51
|
+
* `label`: Label to display next to the slider.
|
|
52
|
+
* `value`: The currently selected value.
|
|
53
|
+
* `min`: Minimum value.
|
|
54
|
+
* `max`: Maximum value.
|
|
55
|
+
* `step`: Step size.
|
|
56
|
+
* `on_value`: Callback to call when the value changes.
|
|
57
|
+
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
|
|
58
|
+
* `tick_labels`: Show tick labels corresponding to the values (True),
|
|
59
|
+
custom tick labels by passing a list of strings, only end_points ("end_points"),
|
|
60
|
+
or no labels at all (False, the default).
|
|
61
|
+
* `disabled`: Whether the slider is disabled.
|
|
62
|
+
"""
|
|
63
|
+
reactive_value = solara.use_reactive(value, on_value)
|
|
64
|
+
del value, on_value
|
|
65
|
+
|
|
66
|
+
def set_value_cast(value):
|
|
67
|
+
reactive_value.value = int(value)
|
|
68
|
+
|
|
69
|
+
updated_tick_labels = _produce_tick_labels(tick_labels, min, max, step)
|
|
70
|
+
|
|
71
|
+
return rv.Slider(
|
|
72
|
+
v_model=reactive_value.value,
|
|
73
|
+
on_v_model=set_value_cast,
|
|
74
|
+
label=label,
|
|
75
|
+
min=min,
|
|
76
|
+
max=max,
|
|
77
|
+
step=step,
|
|
78
|
+
thumb_label=thumb_label,
|
|
79
|
+
tick_labels=updated_tick_labels,
|
|
80
|
+
dense=False,
|
|
81
|
+
hide_details=True,
|
|
82
|
+
disabled=disabled,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@solara.value_component(None)
|
|
87
|
+
def SliderRangeInt(
|
|
88
|
+
label: str,
|
|
89
|
+
value: Union[Tuple[int, int], solara.Reactive[Tuple[int, int]]] = (1, 3),
|
|
90
|
+
min: int = 0,
|
|
91
|
+
max: int = 10,
|
|
92
|
+
step: int = 1,
|
|
93
|
+
on_value: Callable[[Tuple[int, int]], None] = None,
|
|
94
|
+
thumb_label: Union[bool, Literal["always"]] = True,
|
|
95
|
+
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
|
|
96
|
+
disabled: bool = False,
|
|
97
|
+
) -> reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[int, int]]:
|
|
98
|
+
"""Slider for controlling a range of integer values.
|
|
99
|
+
|
|
100
|
+
### Basic example:
|
|
101
|
+
|
|
102
|
+
```solara
|
|
103
|
+
import solara
|
|
104
|
+
|
|
105
|
+
int_range = solara.reactive((0, 42))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@solara.component
|
|
109
|
+
def Page():
|
|
110
|
+
solara.SliderRangeInt("Some integer range", value=int_range, min=-10, max=120)
|
|
111
|
+
solara.Markdown(f"**Int range value**: {int_range.value}")
|
|
112
|
+
with solara.Row():
|
|
113
|
+
solara.Button("Reset", on_click=lambda: int_range.set((0, 42)))
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Arguments
|
|
117
|
+
* `label`: Label to display next to the slider.
|
|
118
|
+
* `value`: The currently selected value.
|
|
119
|
+
* `min`: Minimum value.
|
|
120
|
+
* `max`: Maximum value.
|
|
121
|
+
* `step`: Step size.
|
|
122
|
+
* `on_value`: Callback to call when the value changes.
|
|
123
|
+
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
|
|
124
|
+
* `tick_labels`: Show tick labels corresponding to the values (True),
|
|
125
|
+
custom tick labels by passing a list of strings, only end_points ("end_points"),
|
|
126
|
+
or no labels at all (False, the default).
|
|
127
|
+
* `disabled`: Whether the slider is disabled.
|
|
128
|
+
"""
|
|
129
|
+
reactive_value = solara.use_reactive(value, on_value)
|
|
130
|
+
del value, on_value
|
|
131
|
+
|
|
132
|
+
def set_value_cast(value):
|
|
133
|
+
v1, v2 = value
|
|
134
|
+
reactive_value.set((int(v1), int(v2)))
|
|
135
|
+
|
|
136
|
+
updated_tick_labels = _produce_tick_labels(tick_labels, min, max, step)
|
|
137
|
+
|
|
138
|
+
return cast(
|
|
139
|
+
reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[int, int]],
|
|
140
|
+
rv.RangeSlider(
|
|
141
|
+
v_model=reactive_value.value,
|
|
142
|
+
on_v_model=set_value_cast,
|
|
143
|
+
label=label,
|
|
144
|
+
min=min,
|
|
145
|
+
max=max,
|
|
146
|
+
step=step,
|
|
147
|
+
thumb_label=thumb_label,
|
|
148
|
+
tick_labels=updated_tick_labels,
|
|
149
|
+
dense=False,
|
|
150
|
+
hide_details=True,
|
|
151
|
+
disabled=disabled,
|
|
152
|
+
),
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@solara.value_component(float)
|
|
157
|
+
def SliderFloat(
|
|
158
|
+
label: str,
|
|
159
|
+
value: Union[float, solara.Reactive[float]] = 0,
|
|
160
|
+
min: float = 0,
|
|
161
|
+
max: float = 10.0,
|
|
162
|
+
step: float = 0.1,
|
|
163
|
+
on_value: Callable[[float], None] = None,
|
|
164
|
+
thumb_label: Union[bool, Literal["always"]] = True,
|
|
165
|
+
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
|
|
166
|
+
disabled: bool = False,
|
|
167
|
+
):
|
|
168
|
+
"""Slider for controlling a float value.
|
|
169
|
+
|
|
170
|
+
### Basic example:
|
|
171
|
+
|
|
172
|
+
```solara
|
|
173
|
+
import solara
|
|
174
|
+
|
|
175
|
+
float_value = solara.reactive(42.4)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@solara.component
|
|
179
|
+
def Page():
|
|
180
|
+
solara.SliderFloat("Some integer", value=float_value, min=-10, max=120)
|
|
181
|
+
solara.Markdown(f"**Float value**: {float_value.value}")
|
|
182
|
+
with solara.Row():
|
|
183
|
+
solara.Button("Reset", on_click=lambda: float_value.set(42.5))
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Arguments
|
|
187
|
+
* `label`: Label to display next to the slider.
|
|
188
|
+
* `value`: The current value.
|
|
189
|
+
* `min`: The minimum value.
|
|
190
|
+
* `max`: The maximum value.
|
|
191
|
+
* `step`: The step size.
|
|
192
|
+
* `on_value`: Callback to call when the value changes.
|
|
193
|
+
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
|
|
194
|
+
* `tick_labels`: Show tick labels corresponding to the values (True),
|
|
195
|
+
custom tick labels by passing a list of strings, only end_points ("end_points"),
|
|
196
|
+
or no labels at all (False, the default).
|
|
197
|
+
* `disabled`: Whether the slider is disabled.
|
|
198
|
+
"""
|
|
199
|
+
reactive_value = solara.use_reactive(value, on_value)
|
|
200
|
+
del value, on_value
|
|
201
|
+
|
|
202
|
+
def set_value_cast(value):
|
|
203
|
+
reactive_value.set(float(value))
|
|
204
|
+
|
|
205
|
+
updated_tick_labels = _produce_tick_labels(tick_labels, min, max, step)
|
|
206
|
+
|
|
207
|
+
return rv.Slider(
|
|
208
|
+
v_model=reactive_value.value,
|
|
209
|
+
on_v_model=set_value_cast,
|
|
210
|
+
label=label,
|
|
211
|
+
min=min,
|
|
212
|
+
max=max,
|
|
213
|
+
step=step,
|
|
214
|
+
thumb_label=thumb_label,
|
|
215
|
+
tick_labels=updated_tick_labels,
|
|
216
|
+
dense=False,
|
|
217
|
+
hide_details=True,
|
|
218
|
+
disabled=disabled,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
@solara.value_component(None)
|
|
223
|
+
def SliderRangeFloat(
|
|
224
|
+
label: str,
|
|
225
|
+
value: Union[Tuple[float, float], solara.Reactive[Tuple[float, float]]] = (1.0, 3.0),
|
|
226
|
+
min: float = 0.0,
|
|
227
|
+
max: float = 10.0,
|
|
228
|
+
step: float = 0.1,
|
|
229
|
+
on_value: Callable[[Tuple[float, float]], None] = None,
|
|
230
|
+
thumb_label: Union[bool, Literal["always"]] = True,
|
|
231
|
+
tick_labels: Union[List[str], Literal["end_points"], bool] = False,
|
|
232
|
+
disabled: bool = False,
|
|
233
|
+
) -> reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[float, float]]:
|
|
234
|
+
"""Slider for controlling a range of float values.
|
|
235
|
+
|
|
236
|
+
### Basic example:
|
|
237
|
+
|
|
238
|
+
```solara
|
|
239
|
+
import solara
|
|
240
|
+
|
|
241
|
+
float_range = solara.reactive((0.1, 42.4))
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
@solara.component
|
|
245
|
+
def Page():
|
|
246
|
+
solara.SliderRangeFloat("Some float range", value=float_range, min=-10, max=120)
|
|
247
|
+
solara.Markdown(f"**Float range value**: {float_range.value}")
|
|
248
|
+
with solara.Row():
|
|
249
|
+
solara.Button("Reset", on_click=lambda: float_range.set((0.1, 42.4)))
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Arguments
|
|
253
|
+
* `label`: Label to display next to the slider.
|
|
254
|
+
* `value`: The current value.
|
|
255
|
+
* `min`: The minimum value.
|
|
256
|
+
* `max`: The maximum value.
|
|
257
|
+
* `step`: The step size.
|
|
258
|
+
* `on_value`: Callback to call when the value changes.
|
|
259
|
+
* `thumb_label`: Show a thumb label when sliding (True), always ("always"), or never (False).
|
|
260
|
+
* `tick_labels`: Show tick labels corresponding to the values (True),
|
|
261
|
+
custom tick labels by passing a list of strings, only end_points ("end_points"),
|
|
262
|
+
or no labels at all (False, the default).
|
|
263
|
+
* `disabled`: Whether the slider is disabled.
|
|
264
|
+
"""
|
|
265
|
+
reactive_value = solara.use_reactive(value, on_value)
|
|
266
|
+
del value, on_value
|
|
267
|
+
|
|
268
|
+
def set_value_cast(value):
|
|
269
|
+
v1, v2 = value
|
|
270
|
+
reactive_value.set((float(v1), float(v2)))
|
|
271
|
+
|
|
272
|
+
updated_tick_labels = _produce_tick_labels(tick_labels, min, max, step)
|
|
273
|
+
|
|
274
|
+
return cast(
|
|
275
|
+
reacton.core.ValueElement[ipyvuetify.RangeSlider, Tuple[float, float]],
|
|
276
|
+
rv.RangeSlider(
|
|
277
|
+
v_model=reactive_value.value,
|
|
278
|
+
on_v_model=set_value_cast,
|
|
279
|
+
label=label,
|
|
280
|
+
min=min,
|
|
281
|
+
max=max,
|
|
282
|
+
step=step,
|
|
283
|
+
thumb_label=thumb_label,
|
|
284
|
+
tick_labels=updated_tick_labels,
|
|
285
|
+
dense=False,
|
|
286
|
+
hide_details=True,
|
|
287
|
+
disabled=disabled,
|
|
288
|
+
),
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
@solara.value_component(None)
|
|
293
|
+
def SliderValue(
|
|
294
|
+
label: str,
|
|
295
|
+
value: Union[T, solara.Reactive[T]],
|
|
296
|
+
values: List[T],
|
|
297
|
+
on_value: Callable[[T], None] = None,
|
|
298
|
+
disabled: bool = False,
|
|
299
|
+
) -> reacton.core.ValueElement[ipyvuetify.Slider, T]:
|
|
300
|
+
"""Slider for selecting a value from a list of values.
|
|
301
|
+
|
|
302
|
+
### Basic example:
|
|
303
|
+
|
|
304
|
+
```solara
|
|
305
|
+
import solara
|
|
306
|
+
|
|
307
|
+
foods = ["Kiwi", "Banana", "Apple"]
|
|
308
|
+
food = solara.reactive("Banana")
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
@solara.component
|
|
312
|
+
def Page():
|
|
313
|
+
solara.SliderValue(label="Food", value=food, values=foods)
|
|
314
|
+
solara.Markdown(f"**Selected**: {food.value}")
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Arguments
|
|
318
|
+
* `label`: Label to display next to the slider.
|
|
319
|
+
* `value`: The currently selected value.
|
|
320
|
+
* `values`: List of values to select from.
|
|
321
|
+
* `on_value`: Callback to call when the value changes.
|
|
322
|
+
* `disabled`: Whether the slider is disabled.
|
|
323
|
+
|
|
324
|
+
"""
|
|
325
|
+
reactive_value = solara.use_reactive(value, on_value)
|
|
326
|
+
del value, on_value
|
|
327
|
+
index, set_index = solara.use_state(values.index(reactive_value.value), key="index")
|
|
328
|
+
|
|
329
|
+
def on_index(index):
|
|
330
|
+
set_index(index)
|
|
331
|
+
value = values[index]
|
|
332
|
+
reactive_value.set(value)
|
|
333
|
+
|
|
334
|
+
return cast(
|
|
335
|
+
reacton.core.ValueElement[ipyvuetify.Slider, T],
|
|
336
|
+
rv.Slider(
|
|
337
|
+
v_model=index,
|
|
338
|
+
on_v_model=on_index,
|
|
339
|
+
ticks=True,
|
|
340
|
+
tick_labels=values,
|
|
341
|
+
label=label,
|
|
342
|
+
min=0,
|
|
343
|
+
max=len(values) - 1,
|
|
344
|
+
dense=False,
|
|
345
|
+
hide_details=True,
|
|
346
|
+
disabled=disabled,
|
|
347
|
+
),
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
class DateSliderWidget(ipyvue.VueTemplate):
|
|
352
|
+
template_file = os.path.realpath(os.path.join(os.path.dirname(__file__), "slider_date.vue"))
|
|
353
|
+
|
|
354
|
+
min = traitlets.CFloat(0).tag(sync=True)
|
|
355
|
+
days = traitlets.CFloat(0).tag(sync=True)
|
|
356
|
+
value = traitlets.Any(0).tag(sync=True)
|
|
357
|
+
|
|
358
|
+
label = traitlets.Unicode("").tag(sync=True)
|
|
359
|
+
disabled = traitlets.Bool(False).tag(sync=True)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
@solara.value_component(date)
|
|
363
|
+
def SliderDate(
|
|
364
|
+
label: str,
|
|
365
|
+
value: Union[date, solara.Reactive[date]] = date(2010, 7, 28),
|
|
366
|
+
min: date = date(1981, 1, 1),
|
|
367
|
+
max: date = date(2050, 12, 30),
|
|
368
|
+
on_value: Callable[[date], None] = None,
|
|
369
|
+
disabled: bool = False,
|
|
370
|
+
):
|
|
371
|
+
"""Slider for controlling a date value.
|
|
372
|
+
|
|
373
|
+
### Basic example:
|
|
374
|
+
|
|
375
|
+
```solara
|
|
376
|
+
import solara
|
|
377
|
+
import datetime
|
|
378
|
+
|
|
379
|
+
date_value = solara.reactive(datetime.date(2010, 7, 28))
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
@solara.component
|
|
383
|
+
def Page():
|
|
384
|
+
solara.SliderDate("Some date", value=date_value)
|
|
385
|
+
solara.Markdown(f"**Date value**: {date_value.value.strftime('%Y-%b-%d')}")
|
|
386
|
+
with solara.Row():
|
|
387
|
+
solara.Button("Reset", on_click=lambda: date_value.set(datetime.date(2010, 7, 28)))
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## Arguments
|
|
391
|
+
* `label`: Label to display next to the slider.
|
|
392
|
+
* `value`: The current value.
|
|
393
|
+
* `min`: The minimum value.
|
|
394
|
+
* `max`: The maximum value.
|
|
395
|
+
* `on_value`: Callback to call when the value changes.
|
|
396
|
+
* `disabled`: Whether the slider is disabled.
|
|
397
|
+
"""
|
|
398
|
+
reactive_value = solara.use_reactive(value, on_value)
|
|
399
|
+
del value, on_value
|
|
400
|
+
|
|
401
|
+
def format(d: date):
|
|
402
|
+
return float(datetime(d.year, d.month, d.day).timestamp())
|
|
403
|
+
|
|
404
|
+
dt_min = format(min)
|
|
405
|
+
delta: timedelta = max - min
|
|
406
|
+
days = delta.days
|
|
407
|
+
|
|
408
|
+
delta_value: timedelta = reactive_value.value - min
|
|
409
|
+
days_value = delta_value.days
|
|
410
|
+
if days_value < 0:
|
|
411
|
+
days_value = 0
|
|
412
|
+
|
|
413
|
+
def set_value_cast(value):
|
|
414
|
+
date = min + timedelta(days=value)
|
|
415
|
+
reactive_value.set(date)
|
|
416
|
+
|
|
417
|
+
return DateSliderWidget.element(label=label, min=dt_min, days=days, on_value=set_value_cast, value=days_value, disabled=disabled)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
def _produce_tick_labels(tick_labels: Union[List[str], Literal["end_points"], bool], min: float, max: float, step: float) -> Optional[List[str]]:
|
|
421
|
+
if tick_labels == "end_points":
|
|
422
|
+
num_repeats = int(math.ceil((max - min) / step)) - 1
|
|
423
|
+
_tick_labels = [str(min), *([""] * num_repeats), str(max)]
|
|
424
|
+
elif tick_labels is False:
|
|
425
|
+
_tick_labels = None
|
|
426
|
+
elif tick_labels is True:
|
|
427
|
+
_tick_labels, start = [], min
|
|
428
|
+
|
|
429
|
+
while start < max:
|
|
430
|
+
_tick_labels.append(str(start))
|
|
431
|
+
start += step
|
|
432
|
+
_tick_labels.append(str(max))
|
|
433
|
+
else:
|
|
434
|
+
_tick_labels = tick_labels
|
|
435
|
+
|
|
436
|
+
return _tick_labels
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
FloatSlider = SliderFloat
|
|
440
|
+
IntSlider = SliderInt
|
|
441
|
+
ValueSlider = SliderValue
|
|
442
|
+
DateSlider = SliderDate
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-slider :label="label" :min="0" :max="days" v-model="value" :disabled="disabled">
|
|
4
|
+
<template v-slot:append>
|
|
5
|
+
<!-- give it a fixed with so the slider doesn't move around -->
|
|
6
|
+
<div class="solara-fixedwidth">
|
|
7
|
+
<div class="solara-makespace">2000-mmm-99</div>
|
|
8
|
+
<div class="solara-realvalue">
|
|
9
|
+
{{ valueDate }}
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
</v-slider>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
module.exports = {
|
|
18
|
+
mounted() {},
|
|
19
|
+
computed: {
|
|
20
|
+
startDate() {
|
|
21
|
+
return new Date(this.min * 1000);
|
|
22
|
+
},
|
|
23
|
+
date() {
|
|
24
|
+
const date = new Date(this.startDate);
|
|
25
|
+
date.setDate(date.getDate() + this.value);
|
|
26
|
+
return date;
|
|
27
|
+
},
|
|
28
|
+
valueDate() {
|
|
29
|
+
const date = this.date;
|
|
30
|
+
if (date) {
|
|
31
|
+
const year = date.toLocaleDateString(undefined, { year: "numeric" });
|
|
32
|
+
const month = date.toLocaleDateString(undefined, { month: "short" });
|
|
33
|
+
const day = date.toLocaleDateString(undefined, { day: "numeric" });
|
|
34
|
+
return `${year}-${month}-${day}`;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
watch: {},
|
|
39
|
+
};
|
|
40
|
+
</script>
|
|
41
|
+
<style id="solara-slider-date">
|
|
42
|
+
.v-input__append-outer {
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
}
|
|
45
|
+
.solara-fixedwidth {
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
.solara-makespace {
|
|
49
|
+
visibility: hidden;
|
|
50
|
+
}
|
|
51
|
+
.solara-realvalue {
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 0;
|
|
54
|
+
top: 0;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="solara-sun-spinner-container">
|
|
3
|
+
<!-- <img id="sun-spinner" height="100px" src="static/assets/favicon.svg" /> -->
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
5
|
+
xmlns:svgjs="http://svgjs.com/svgjs" :width="size" :height="size" viewBox="0 0 65 65" fill="none">
|
|
6
|
+
<path id="sun-spinner1" style="transform-origin: center;"
|
|
7
|
+
d="M57.11 30.64L61.47 17.87L48.7 13.51L42.76 1.39999L30.65 7.34999L17.87 2.97999L13.51 15.75L1.40002 21.7L7.35002 33.81L2.99002 46.58L15.76 50.94L21.71 63.06L33.82 57.11L46.59 61.47L50.95 48.7L63.06 42.75L57.11 30.64ZM54.26 34.39L34.39 54.26C33.19 55.46 31.25 55.46 30.05 54.26L10.2 34.4C9.00002 33.2 9.00002 31.26 10.2 30.07L30.06 10.2C31.26 8.99999 33.2 8.99999 34.4 10.2L54.27 30.07C55.47 31.27 55.47 33.21 54.27 34.4L54.26 34.39Z"
|
|
8
|
+
:fill="color_back"></path>
|
|
9
|
+
<path id="sun-spinner2" style="transform-origin: center;"
|
|
10
|
+
d="M53.62 19.42L51.65 6.07L38.3 8.04L27.46 0L19.42 10.84L6.07 12.82L8.04 26.17L0 37L10.84 45.04L12.81 58.39L26.16 56.42L37 64.46L45.04 53.62L58.39 51.64L56.42 38.29L64.46 27.45L53.62 19.4V19.42ZM52.8 24.06L44.24 50.82C43.72 52.43 42 53.32 40.39 52.81L13.63 44.25C12.02 43.74 11.13 42.01 11.64 40.4L20.21 13.64C20.72 12.03 22.45 11.14 24.06 11.65L50.82 20.21C52.43 20.72 53.32 22.45 52.81 24.06H52.8Z"
|
|
11
|
+
:fill="color_front"></path>
|
|
12
|
+
</svg>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style id="solara-spinner">
|
|
17
|
+
@keyframes spin {
|
|
18
|
+
0% {
|
|
19
|
+
transform: rotate(0deg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
100% {
|
|
23
|
+
transform: rotate(359deg);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes oscillate {
|
|
28
|
+
0% {
|
|
29
|
+
transform: scale(0.8);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
50% {
|
|
33
|
+
transform: scale(1.0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
100% {
|
|
37
|
+
transform: scale(0.8);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#sun-spinner1 {
|
|
42
|
+
animation: spin 6s linear infinite;
|
|
43
|
+
padding: 10px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#sun-spinner2 {
|
|
47
|
+
animation: spin 2s cubic-bezier(.79, .14, .15, .86) infinite;
|
|
48
|
+
padding: 10px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.solara-sun-spinner-container {
|
|
52
|
+
animation: oscillate 2s linear infinite;
|
|
53
|
+
display: inline-block;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes bounce-in {
|
|
57
|
+
0% {
|
|
58
|
+
transform: scale(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
100% {
|
|
62
|
+
transform: scale(1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@keyframes bounce-out {
|
|
67
|
+
0% {
|
|
68
|
+
transform: translateZ(0) scale(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
100% {
|
|
72
|
+
transform: translateZ(0) scale(50);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.solara-transition-enter-active {
|
|
77
|
+
transition: opacity 0.5s ease;
|
|
78
|
+
/* animation: bounce-in 0.5s ease; */
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.solara-transition-leave-active {
|
|
82
|
+
transition: opacity 0.5s ease;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.solara-transition-leave-active .solara-loader {
|
|
86
|
+
animation: bounce-out 0.5s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.solara-transition-leave-active .solara-sun-spinner-container {
|
|
90
|
+
animation: unset;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.solara-transition-leave-active h1 {
|
|
94
|
+
visibility: hidden;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.solara-transition-enter,
|
|
98
|
+
.solara-transition-leave-to {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.solara-sun-spinner-container {
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import ipyvue
|
|
2
|
+
import traitlets
|
|
3
|
+
|
|
4
|
+
import solara
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SpinnerSolaraWidget(ipyvue.VueTemplate):
|
|
8
|
+
template_file = (__file__, "spinner-solara.vue")
|
|
9
|
+
|
|
10
|
+
size = traitlets.Unicode("64px").tag(sync=True)
|
|
11
|
+
color_back = traitlets.Unicode("#FFCF64").tag(sync=True)
|
|
12
|
+
color_front = traitlets.Unicode("#FF8C3E").tag(sync=True)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@solara.component
|
|
16
|
+
def SpinnerSolara(size="64px", color_back="#FFCF64", color_front="#FF8C3E"):
|
|
17
|
+
"""Spinner component with the Solara logo to indicate the app is busy.
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
### Basic example
|
|
21
|
+
|
|
22
|
+
```solara
|
|
23
|
+
import solara
|
|
24
|
+
|
|
25
|
+
@solara.component
|
|
26
|
+
def Page():
|
|
27
|
+
solara.SpinnerSolara(size="100px")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Changing the colors
|
|
31
|
+
```solara
|
|
32
|
+
import solara
|
|
33
|
+
|
|
34
|
+
@solara.component
|
|
35
|
+
def Page():
|
|
36
|
+
solara.SpinnerSolara(size="100px", color_back="Grey", color_front="Lime")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Arguments
|
|
41
|
+
* `size`: Size of the spinner.
|
|
42
|
+
* `color_back`: Color of the spinner in the background.
|
|
43
|
+
* `color_front`: Color of the spinner in the foreground.
|
|
44
|
+
"""
|
|
45
|
+
return SpinnerSolaraWidget.element(size=size, color_back=color_back, color_front=color_front)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from typing import Dict, List
|
|
2
|
+
|
|
3
|
+
import ipyvue
|
|
4
|
+
import traitlets
|
|
5
|
+
|
|
6
|
+
import solara
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SqlCodeWidget(ipyvue.VueTemplate):
|
|
10
|
+
template_file = (__file__, "sql_code.vue")
|
|
11
|
+
|
|
12
|
+
label = traitlets.Unicode("").tag(sync=True)
|
|
13
|
+
query = traitlets.Unicode(allow_none=True, default_value=None).tag(sync=True)
|
|
14
|
+
tables = traitlets.Dict(allow_none=True, default_value=None).tag(sync=True)
|
|
15
|
+
height = traitlets.Unicode("180px").tag(sync=True)
|
|
16
|
+
cdn = traitlets.Unicode(None, allow_none=True).tag(sync=True)
|
|
17
|
+
|
|
18
|
+
@traitlets.default("cdn")
|
|
19
|
+
def _cdn(self):
|
|
20
|
+
import solara.settings
|
|
21
|
+
|
|
22
|
+
if not solara.settings.assets.proxy:
|
|
23
|
+
return solara.settings.assets.cdn
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@solara.component
|
|
27
|
+
def SqlCode(label="Query", query: str = None, tables: Dict[str, List[str]] = None, on_query=None, height="180px"):
|
|
28
|
+
"""SQL textfield input with auto complete and SQL syntax highlighting.
|
|
29
|
+
|
|
30
|
+
To get auto complete for the column names, prefix it with the table name, i.e. "titanic.sur ctrl+space"
|
|
31
|
+
|
|
32
|
+
## Arguments
|
|
33
|
+
|
|
34
|
+
* `label`: Label for the textfield.
|
|
35
|
+
* `query`: SQL query.
|
|
36
|
+
* `tables`: Dictionary with table names as keys and list of column names as values (used for auto complete).
|
|
37
|
+
* `on_query`: Callback function that is called when the query is changed
|
|
38
|
+
* `height`: Height of the textfield
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
return SqlCodeWidget.element(label=label, query=query, tables=tables, on_query=on_query, height=height)
|