Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Check if figure has 'data' member set #224

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.23.1]
### Fixed
- Fixed bug where Graph wouldn't render if figure.data wasn't set (#223)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here - let's use the full link to the issue #223


## [0.23.0]
### Added
- Upgraded Plotly.js, the underlying library behind the
Expand Down
4 changes: 2 additions & 2 deletions dash_core_components/bundle.js

Large diffs are not rendered by default.

67 changes: 0 additions & 67 deletions dash_core_components/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,73 +139,6 @@
}
}
},
"src/components/Confirm.react.js": {
"description": "Confirm wraps window.confirm",
"displayName": "Confirm",
"methods": [],
"props": {
"id": {
"type": {
"name": "string"
},
"required": false,
"description": ""
},
"message": {
"type": {
"name": "string"
},
"required": false,
"description": ""
},
"init": {
"type": {
"name": "shape",
"value": {
"value": {
"name": "any",
"required": false
},
"ask": {
"name": "bool",
"required": false
}
}
},
"required": false,
"description": ""
},
"result": {
"type": {
"name": "shape",
"value": {
"timestamp": {
"name": "custom",
"raw": "PropTypes.integer",
"required": false
},
"value": {
"name": "any",
"required": false
}
}
},
"required": false,
"description": "",
"defaultValue": {
"value": "{\n timestamp: -1\n}",
"computed": false
}
},
"setProps": {
"type": {
"name": "func"
},
"required": false,
"description": "Dash-assigned callback that gets fired when the value changes."
}
}
},
"src/components/DatePickerRange.react.js": {
"description": "DatePickerRange is a tailor made component designed for selecting\ntimespan across multiple days off of a calendar.\n\nThe DatePicker integrates well with the Python datetime module with the\nstartDate and endDate being returned in a string format suitable for\ncreating datetime objects.\n\nThis component is based off of Airbnb's react-dates react component\nwhich can be found here: https://github.com/airbnb/react-dates",
"displayName": "DatePickerRange",
Expand Down
2 changes: 1 addition & 1 deletion dash_core_components/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.23.0'
__version__ = '0.23.1'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-core-components",
"version": "0.23.0",
"version": "0.23.1",
"description": "Core component suite for Dash",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class PlotlyGraph extends Component {
} else {

let PlotMethod;
if (intersection(
if (has('data')(figure) && intersection(
pluck('type', figure.data),
['candlestick', 'ohlc']).length
) {
Expand Down
24 changes: 24 additions & 0 deletions test/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
import dash_core_components as dcc
import dash_table_experiments as dt
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import InvalidElementStateException
import time
from textwrap import dedent

from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait

try:
from urlparse import urlparse
except ImportError:
Expand Down Expand Up @@ -528,3 +533,22 @@ def update_graph(n_clicks):
button.click()
time.sleep(2)
self.snapshot('candlestick - 2 click')

def test_graph_without_data(self):
app = dash.Dash(__name__)

app.layout = html.Div([
dcc.Graph(id='graph', figure={
})
])

self.startServer(app=app)

graph_rendered = WebDriverWait(self.driver, 10).until(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried bumping this up to like, 20?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, didn't change, should put a percy snapshot before the wait so we can see if the graph is actually there.

expected_conditions.presence_of_element_located((By.ID, 'graph'))
)

self.assertTrue(graph_rendered)

self.snapshot('graph without figure.data')