Skip to content

Commit 5e52fb0

Browse files
committed
add plotly version to data sent to server
1 parent 5f3199c commit 5e52fb0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

dash/dash-renderer/src/components/error/menu/VersionInfo.react.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ async function requestDashVersionInfo(config) {
2424
dash_version: currentDashVersion,
2525
dash_version_url: dashVersionUrl,
2626
python_version: pythonVersion,
27-
ddk_version: ddkVersion
27+
ddk_version: ddkVersion,
28+
plotly_version: plotlyVersion
2829
} = config;
2930
const cachedVersionInfo = localStorage.getItem('cachedNewDashVersion');
3031
const cachedNewDashVersionLink = localStorage.getItem(
@@ -46,7 +47,8 @@ async function requestDashVersionInfo(config) {
4647
body: JSON.stringify({
4748
dash_version: currentDashVersion,
4849
python_version: pythonVersion,
49-
ddk_version: ddkVersion
50+
ddk_version: ddkVersion,
51+
plotly_version: plotlyVersion
5052
}),
5153
headers: {
5254
'Content-Type': 'application/json'

dash/dash.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@
8585
except ImportError:
8686
pass
8787

88+
plotly_version = None
89+
try:
90+
import plotly
91+
92+
plotly_version = plotly.__version__
93+
except ImportError:
94+
pass
95+
8896
# Add explicit mapping for map files
8997
mimetypes.add_type("application/json", ".map", True)
9098

@@ -780,6 +788,7 @@ def _config(self):
780788
"python_version": sys.version,
781789
"dash_version_url": DASH_VERSION_URL,
782790
"ddk_version": dash_design_kit_version,
791+
"plotly_version": plotly_version,
783792
}
784793
if not self.config.serve_locally:
785794
config["plotlyjs_url"] = self._plotlyjs_url

0 commit comments

Comments
 (0)