Skip to content

Commit 2b1b814

Browse files
authored
Merge pull request #3737 from plotly/cam/3736/add-displayNotifier-Graph-config
fix: Add `displayNotifier` to Graph config
2 parents 4fe351e + 982e238 commit 2b1b814

File tree

2 files changed

+5
-41
lines changed

2 files changed

+5
-41
lines changed

components/dash-core-components/src/components/Graph.react.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,11 @@ PlotlyGraph.propTypes = {
550550
* plot rather than registering them globally.
551551
*/
552552
locales: PropTypes.object,
553+
554+
/**
555+
* Determines whether or not notifier is displayed
556+
*/
557+
displayNotifier: PropTypes.bool,
553558
}),
554559

555560
/**

components/dash-core-components/tests/integration/tab/test_tabs_with_graphs.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from dash import Dash, Input, Output, dcc, html
22
from dash.exceptions import PreventUpdate
3-
import json
4-
import os
53
import pytest
64
from selenium.webdriver.common.by import By
75
from selenium.webdriver.support import expected_conditions as EC
@@ -185,43 +183,4 @@ def on_click_update_graph(n_clicks):
185183
time.sleep(1)
186184
dash_dcc.percy_snapshot(f"Tabs-2 rendered ({is_eager})")
187185

188-
# do some extra tests while we're here
189-
# and have access to Graph and plotly.js
190-
check_graph_config_shape(dash_dcc)
191-
192-
assert dash_dcc.get_logs() == []
193-
194-
195-
def check_graph_config_shape(dash_dcc):
196-
config_schema = dash_dcc.driver.execute_script(
197-
"return Plotly.PlotSchema.get().config;"
198-
)
199-
with open(os.path.join(dcc.__path__[0], "metadata.json")) as meta:
200-
graph_meta = json.load(meta)["src/components/Graph.react.js"]
201-
config_prop_shape = graph_meta["props"]["config"]["type"]["value"]
202-
203-
ignored_config = [
204-
"setBackground",
205-
"showSources",
206-
"logging",
207-
"globalTransforms",
208-
"notifyOnLogging",
209-
"role",
210-
"typesetMath",
211-
]
212-
213-
def crawl(schema, props):
214-
for prop_name in props:
215-
assert prop_name in schema
216-
217-
for item_name, item in schema.items():
218-
if item_name in ignored_config:
219-
continue
220-
221-
assert item_name in props
222-
if "valType" not in item:
223-
crawl(item, props[item_name]["value"])
224-
225-
crawl(config_schema, config_prop_shape)
226-
227186
assert dash_dcc.get_logs() == []

0 commit comments

Comments
 (0)