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

Commit 67e0064

Browse files
committed
Fix #260, allow '{}' as Graph.figure
1 parent de74f62 commit 67e0064

File tree

9 files changed

+24
-31
lines changed

9 files changed

+24
-31
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [0.28.1]
6+
### Fixed
7+
- Fix bug where front-end error was thrown when setting `Graph.figure = {}` (fixes [#260]).
8+
59
## [0.28.0]
610
- Upgraded Plotly.js, the underlying library behind the
711
`dash_core_components.Graph` component, to [version 1.40.1](https://github.com/plotly/plotly.js/releases/tag/v1.40.1).

dash_core_components/bundle.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash_core_components/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@
27032703
"required": false,
27042704
"description": "Overrides the default (inline) styles when disabled",
27052705
"defaultValue": {
2706-
"value": "{\n color: '#d6d6d6',\n}",
2706+
"value": "{\n color: '#d6d6d6'\n}",
27072707
"computed": false
27082708
}
27092709
},
@@ -2864,7 +2864,7 @@
28642864
"required": false,
28652865
"description": "Holds the colors used by the Tabs and Tab components. If you set these, you should specify colors for all properties, so:\ncolors: {\n border: '#d6d6d6',\n primary: '#1975FA',\n background: '#f9f9f9'\n }",
28662866
"defaultValue": {
2867-
"value": "{\n border: '#d6d6d6',\n primary: '#1975FA',\n background: '#f9f9f9',\n}",
2867+
"value": "{\n border: '#d6d6d6',\n primary: '#1975FA',\n background: '#f9f9f9'\n}",
28682868
"computed": false
28692869
}
28702870
}

dash_core_components/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.28.0'
1+
__version__ = '0.28.1'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "0.28.0",
3+
"version": "0.28.1",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",

src/components/Graph.react.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
3-
import {contains, intersection, filter, has, isNil, type, pluck} from 'ramda';
3+
import {contains, filter, has, isNil, type} from 'ramda';
44
/* global Plotly:true */
55

66
const filterEventData = (gd, eventData, event) => {
@@ -77,18 +77,7 @@ export default class PlotlyGraph extends Component {
7777
if (animate && this._hasPlotted && figure.data.length === gd.data.length) {
7878
return Plotly.animate(id, figure, animation_options);
7979
} else {
80-
81-
let PlotMethod;
82-
if (intersection(
83-
pluck('type', figure.data),
84-
['candlestick', 'ohlc']).length
85-
) {
86-
PlotMethod = Plotly.newPlot;
87-
} else {
88-
PlotMethod = Plotly.react;
89-
}
90-
91-
return PlotMethod(id, figure.data, figure.layout, config).then(
80+
return Plotly.react(id, figure.data, figure.layout, config).then(
9281
() => {
9382
if (!this._hasPlotted) {
9483
this.bindEvents();

src/components/Tab.react.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ Tab.propTypes = {
6363
/**
6464
* Overrides the default (inline) styles for the Tab component when it is selected.
6565
*/
66-
selected_style: PropTypes.object,
66+
selected_style: PropTypes.object
6767
};
6868

6969
Tab.defaultProps = {
7070
disabled: false,
7171
disabled_style: {
72-
color: '#d6d6d6',
73-
},
72+
color: '#d6d6d6'
73+
}
7474
};
7575

7676
export default Tab;

src/components/Tabs.react.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const EnhancedTab = ({
1717
disabled_className,
1818
mobile_breakpoint,
1919
amountOfTabs,
20-
colors,
20+
colors
2121
}) => {
2222
let tabStyle = style;
2323
if (disabled) {
@@ -110,14 +110,14 @@ export default class Tabs extends Component {
110110
constructor(props) {
111111
super(props);
112112
this.state = {
113-
selected: this.props.value || 'tab-1',
113+
selected: this.props.value || 'tab-1'
114114
};
115115

116116
this.selectHandler = this.selectHandler.bind(this);
117117
}
118118
selectHandler(value) {
119119
this.setState({
120-
selected: value,
120+
selected: value
121121
});
122122
if (this.props.setProps) {
123123
this.props.setProps({value: value});
@@ -126,7 +126,7 @@ export default class Tabs extends Component {
126126
componentWillReceiveProps(newProps) {
127127
const value = newProps.value;
128128
this.setState({
129-
selected: value,
129+
selected: value
130130
});
131131
}
132132
render() {
@@ -270,8 +270,8 @@ Tabs.defaultProps = {
270270
colors: {
271271
border: '#d6d6d6',
272272
primary: '#1975FA',
273-
background: '#f9f9f9',
274-
},
273+
background: '#f9f9f9'
274+
}
275275
};
276276

277277
Tabs.propTypes = {
@@ -343,6 +343,6 @@ Tabs.propTypes = {
343343
colors: PropTypes.shape({
344344
border: PropTypes.string,
345345
primary: PropTypes.string,
346-
background: PropTypes.string,
347-
}),
346+
background: PropTypes.string
347+
})
348348
};

test.py

Whitespace-only changes.

0 commit comments

Comments
 (0)