diff --git a/CHANGELOG.md b/CHANGELOG.md index 28cb1c9850..0e19c01341 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,13 @@ This project adheres to [Semantic Versioning](https://semver.org/). - [#3395](https://github.com/plotly/dash/pull/3396) Add position argument to hooks.devtool - [#3403](https://github.com/plotly/dash/pull/3403) Add app_context to get_app, allowing to get the current app in routes. - [#3407](https://github.com/plotly/dash/pull/3407) Add `hidden` to callback arguments, hiding the callback from appearing in the devtool callback graph. +- [#3397](https://github.com/plotly/dash/pull/3397) Add optional callbacks, suppressing callback warning for missing component ids for a single callback. - [#3424](https://github.com/plotly/dash/pull/3424) Adds support for `Patch` on clientside callbacks class `dash_clientside.Patch`, as well as supporting side updates, eg: (Running, SetProps). - [#3347](https://github.com/plotly/dash/pull/3347) Added 'api_endpoint' to `callback` to expose api endpoints at the provided path for use to be executed directly without dash. +- [#3465](https://github.com/plotly/dash/pull/3465) Plotly cloud integrations, add devtool API, placeholder plotly cloud CLI & publish button, `dash[cloud]` extra dependencies. ## Fixed - [#3395](https://github.com/plotly/dash/pull/3395) Fix Components added through set_props() cannot trigger related callback functions. Fix [#3316](https://github.com/plotly/dash/issues/3316) -- [#3397](https://github.com/plotly/dash/pull/3397) Add optional callbacks, suppressing callback warning for missing component ids for a single callback. - [#3415](https://github.com/plotly/dash/pull/3415) Fix the error triggered when only a single no_update is returned for client-side callback functions with multiple Outputs. Fix [#3366](https://github.com/plotly/dash/issues/3366) - [#3416](https://github.com/plotly/dash/issues/3416) Fix DeprecationWarning in dash/_jupyter.py by migrating from deprecated ipykernel.comm.Comm to comm module diff --git a/dash/_plotly_cli.py b/dash/_plotly_cli.py new file mode 100644 index 0000000000..9974cd23b9 --- /dev/null +++ b/dash/_plotly_cli.py @@ -0,0 +1,15 @@ +import sys + + +def cli(): + try: + from plotly_cloud.cli import main # pylint: disable=import-outside-toplevel + + main() + except ImportError: + print( + "Plotly cloud is not installed," + " install it with `pip install dash[cloud]` to use the plotly command", + file=sys.stderr, + ) + sys.exit(-1) diff --git a/dash/background_callback/managers/diskcache_manager.py b/dash/background_callback/managers/diskcache_manager.py index 094485ad71..9c939306df 100644 --- a/dash/background_callback/managers/diskcache_manager.py +++ b/dash/background_callback/managers/diskcache_manager.py @@ -287,10 +287,14 @@ async def async_run(): } }, ) + if asyncio.iscoroutine(user_callback_output): user_callback_output = await user_callback_output if not errored: - cache.set(result_key, user_callback_output) + try: + cache.set(result_key, user_callback_output) + except Exception as err: # pylint: disable=broad-except + print(f"Diskcache manager couldn't save output: {err}") if asyncio.iscoroutinefunction(fn): func = partial(ctx.run, async_run) diff --git a/dash/dash-renderer/src/components/error/icons/CloudSlashIcon.svg b/dash/dash-renderer/src/components/error/icons/CloudSlashIcon.svg new file mode 100644 index 0000000000..a3b62a12df --- /dev/null +++ b/dash/dash-renderer/src/components/error/icons/CloudSlashIcon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dash/dash-renderer/src/components/error/icons/ErrorIcon.svg b/dash/dash-renderer/src/components/error/icons/ErrorIcon.svg index 6ba3a3735a..91398f8256 100644 --- a/dash/dash-renderer/src/components/error/icons/ErrorIcon.svg +++ b/dash/dash-renderer/src/components/error/icons/ErrorIcon.svg @@ -1,3 +1 @@ - + \ No newline at end of file diff --git a/dash/dash-renderer/src/components/error/icons/GraphIcon.svg b/dash/dash-renderer/src/components/error/icons/GraphIcon.svg index 0e4cf42f29..870a16a732 100644 --- a/dash/dash-renderer/src/components/error/icons/GraphIcon.svg +++ b/dash/dash-renderer/src/components/error/icons/GraphIcon.svg @@ -1,3 +1 @@ - + \ No newline at end of file diff --git a/dash/dash-renderer/src/components/error/menu/DebugMenu.css b/dash/dash-renderer/src/components/error/menu/DebugMenu.css index 78b71d9f0e..c0643d07db 100644 --- a/dash/dash-renderer/src/components/error/menu/DebugMenu.css +++ b/dash/dash-renderer/src/components/error/menu/DebugMenu.css @@ -112,7 +112,7 @@ } .dash-debug-menu:hover { - background-color: #108de4; + background-color: #7f4bc4; } .dash-debug-menu__outer { @@ -208,13 +208,12 @@ align-items: center; transition: background-color 0.2s; font-family: Verdana, sans-serif !important; - font-weight: bold; - color: black; + color: #7f4bc4; } .dash-debug-menu__button.dash-debug-menu__button--selected { color: #7f4bc4; - box-shadow: 0 2px #0071c2; + box-shadow: 0 2px #7f4bc4; } .dash-debug-menu__button.dash-debug-menu__button--selected:hover { color: #5806c4; @@ -253,3 +252,9 @@ font-size: 14px; margin-left: 3px; } +.dash-debug-menu__icon { + color: #9ca3af; +} +.dash-debug-menu__button:hover .dash-debug-menu__icon { + color: #5806c4; +} diff --git a/dash/dash-renderer/src/components/error/menu/DebugMenu.react.js b/dash/dash-renderer/src/components/error/menu/DebugMenu.react.js index 5395251d7e..0a432d0af1 100644 --- a/dash/dash-renderer/src/components/error/menu/DebugMenu.react.js +++ b/dash/dash-renderer/src/components/error/menu/DebugMenu.react.js @@ -1,6 +1,7 @@ import React, {useEffect, useState} from 'react'; import PropTypes from 'prop-types'; import {concat} from 'ramda'; +import {useSelector} from 'react-redux'; import './DebugMenu.css'; @@ -14,7 +15,8 @@ import {VersionInfo} from './VersionInfo.react'; import {CallbackGraphContainer} from '../CallbackGraph/CallbackGraphContainer.react'; import {FrontEndErrorContainer} from '../FrontEnd/FrontEndErrorContainer.react'; import ExternalWrapper from '../../../wrapper/ExternalWrapper'; -import {useSelector} from 'react-redux'; +import PlotlyCloud from './PlotlyCloud'; +import {DevtoolProvider, useDevtool} from './DevtoolContext'; const classes = (base, variant, variant2) => `${base} ${base}--${variant}` + (variant2 ? ` ${base}--${variant2}` : ''); @@ -75,6 +77,7 @@ const MenuContent = ({ return (