-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minor test fixes for ipyplotly_integration #975
Changes from 42 commits
77b50f3
fafcabf
cbf037d
065e59c
9502440
f2ba912
a15b744
5818d2b
6a7e7f2
6319d63
c7bff98
3d8cd07
cb71b64
1b09e21
b149e0d
9705dde
c26b763
38f88ef
1991c7f
35716d6
004bbb0
c3682d3
8f557c7
a85cb8b
8517f3f
3c0d337
8def60c
524a8a0
b091aaf
14a6a02
e994e55
85d7549
f898892
2c07b12
736c42d
7f08843
97213c9
0482dce
edbd796
8e7c112
c43c436
e406bef
fbaaba2
8c7eb17
8bde810
d6d777b
56de411
98feab6
cbc1779
2f59570
70f82c4
1d4f440
f39a85b
f3f6811
07c0977
36ed3aa
425c36a
b2f5064
de95849
c611a23
e714499
9ce82b4
234b979
55969d9
6f822cd
bb90864
41a63ff
871341c
7a9aa99
d2ca807
de5d242
183a6fa
53d57ca
2260054
0bde4e1
4a977cd
c154dd6
f332e29
4397815
6988d08
0ea9e14
0f04191
274b003
f982427
77cf63f
588f7dd
24ef193
8386272
b256334
b8d04a6
e890a4a
100ef19
89c4d38
51cd9bc
9f85771
c4d1795
cff0312
399c2dc
98e2f54
330d99b
760b36a
9ffc488
0d96800
cbd1304
efd4c2a
f87a8b8
924501b
c90fe9c
0bf48c2
8fd5985
a4d6c5d
0505070
c937f8e
3e53c10
7a0ad41
d93772d
1d5db95
56d0e5f
46c9186
3140f29
7fa119a
a3e3508
3aaa3ed
f6f7aaf
35bf539
06fec5c
0e53bd0
a59c0c2
8f1e212
365edce
e932378
b981e72
23646ca
5740d73
eeb7f7e
ec5cc2c
a561275
02ad817
2d9cc9e
41b0d03
46051e9
499f29f
de4e6c6
5b0d607
42e2462
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,9 @@ | |
|
||
from plotly import colors, exceptions, optional_imports | ||
from plotly.figure_factory import utils | ||
from plotly.graph_objs import graph_objs | ||
from plotly.tools import make_subplots | ||
|
||
import math | ||
import copy | ||
from numbers import Number | ||
|
||
pd = optional_imports.get_module('pandas') | ||
|
@@ -108,7 +106,7 @@ def _annotation_dict(text, lane, num_of_lanes, SUBPLOT_SPACING, row_col='col', | |
showarrow=False, | ||
xref='paper', | ||
yref='paper', | ||
text=text, | ||
text=str(text), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this change necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Context: Do we want to support any string coercions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like it should be an addition to the plotly.js schema. I'll make an issue There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tracking in plotly/plotly.js#2523 |
||
font=dict( | ||
size=13, | ||
color=AXIS_TITLE_COLOR | ||
|
@@ -331,10 +329,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name, | |
row_col='row', flipped=flipped_rows) | ||
) | ||
|
||
# add annotations | ||
fig['layout']['annotations'] = annotations | ||
|
||
return fig | ||
return fig, annotations | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this change made? was it for this? https://github.com/plotly/plotly.py/pull/975/files#diff-83b399f13d8b361d38016264ed1ce589R987 If so, why does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Context: Object array properties like (e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Jon for jumping in on Chris' comments. You definitely know the code changes better than I do. @chriddyp I reworked facet_grid to accommodate annotations being tuples and not lists There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. So if I do
then Marking this one as a 🚨 - Breaking Change |
||
|
||
|
||
def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name, | ||
|
@@ -474,10 +469,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name, | |
row_col='row', flipped=flipped_rows) | ||
) | ||
|
||
# add annotations | ||
fig['layout']['annotations'] = annotations | ||
|
||
return fig | ||
return fig, annotations | ||
|
||
|
||
def _facet_grid(df, x, y, facet_row, facet_col, num_of_rows, | ||
|
@@ -600,10 +592,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, num_of_rows, | |
row_col='row', flipped=flipped_rows) | ||
) | ||
|
||
# add annotations | ||
fig['layout']['annotations'] = annotations | ||
|
||
return fig | ||
return fig, annotations | ||
|
||
|
||
def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | ||
|
@@ -905,7 +894,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
j = 0 | ||
colormap[val] = default_colors[j] | ||
j += 1 | ||
fig = _facet_grid_color_categorical( | ||
fig, annotations = _facet_grid_color_categorical( | ||
df, x, y, facet_row, facet_col, color_name, colormap, | ||
num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, | ||
trace_type, flipped_rows, flipped_cols, show_boxes, | ||
|
@@ -924,7 +913,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
"all the values of the colormap column are in " | ||
"the keys of your dictionary." | ||
) | ||
fig = _facet_grid_color_categorical( | ||
fig, annotations = _facet_grid_color_categorical( | ||
df, x, y, facet_row, facet_col, color_name, colormap, | ||
num_of_rows, num_of_cols, facet_row_labels, | ||
facet_col_labels, trace_type, flipped_rows, | ||
|
@@ -936,7 +925,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
colorscale_list = colormap | ||
utils.validate_colorscale(colorscale_list) | ||
|
||
fig = _facet_grid_color_numerical( | ||
fig, annotations = _facet_grid_color_numerical( | ||
df, x, y, facet_row, facet_col, color_name, | ||
colorscale_list, num_of_rows, num_of_cols, | ||
facet_row_labels, facet_col_labels, trace_type, | ||
|
@@ -952,7 +941,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
"of a Plotly Colorscale. The available colorscale " | ||
"names are {}".format(colors.PLOTLY_SCALES.keys()) | ||
) | ||
fig = _facet_grid_color_numerical( | ||
fig, annotations = _facet_grid_color_numerical( | ||
df, x, y, facet_row, facet_col, color_name, | ||
colorscale_list, num_of_rows, num_of_cols, | ||
facet_row_labels, facet_col_labels, trace_type, | ||
|
@@ -961,7 +950,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
) | ||
else: | ||
colorscale_list = colors.PLOTLY_SCALES['Reds'] | ||
fig = _facet_grid_color_numerical( | ||
fig, annotations = _facet_grid_color_numerical( | ||
df, x, y, facet_row, facet_col, color_name, | ||
colorscale_list, num_of_rows, num_of_cols, | ||
facet_row_labels, facet_col_labels, trace_type, | ||
|
@@ -970,7 +959,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
) | ||
|
||
else: | ||
fig = _facet_grid( | ||
fig, annotations = _facet_grid( | ||
df, x, y, facet_row, facet_col, num_of_rows, num_of_cols, | ||
facet_row_labels, facet_col_labels, trace_type, flipped_rows, | ||
flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, | ||
|
@@ -992,8 +981,10 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
# axis titles | ||
x_title_annot = _axis_title_annotation(x, 'x') | ||
y_title_annot = _axis_title_annotation(y, 'y') | ||
fig['layout']['annotations'].append(x_title_annot) | ||
fig['layout']['annotations'].append(y_title_annot) | ||
|
||
# annotations | ||
annotations.append(x_title_annot) | ||
annotations.append(y_title_annot) | ||
|
||
# legend | ||
fig['layout']['showlegend'] = show_legend | ||
|
@@ -1008,9 +999,12 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, | |
if ggplot2: | ||
if color_name: | ||
legend_annot = _legend_annotation(color_name) | ||
fig['layout']['annotations'].append(legend_annot) | ||
annotations.append(legend_annot) | ||
fig['layout']['margin']['r'] = 150 | ||
|
||
# assign annotations to figure | ||
fig['layout']['annotations'] = annotations | ||
|
||
# add shaded boxes behind axis titles | ||
if show_boxes and ggplot2: | ||
_add_shapes_to_fig(fig, ANNOT_RECT_COLOR, flipped_rows, flipped_cols) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,7 +160,7 @@ def trisurf(x, y, z, simplices, show_colorbar, edges_color, scale, | |
color=[min_mean_dists, max_mean_dists], | ||
colorscale=colorscale, | ||
showscale=True), | ||
hoverinfo='None', | ||
hoverinfo='none', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this change made? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Context: here is the schema for
The string Should we be more generous and coerce case-insensitive matches to the form in the schema? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see. I wonder if plotly.js accepted Nice to see that this new validation is improving our own code 😉 |
||
showlegend=False | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from plotly.graph_objs import * | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change seems odd to me, seems like something that should exist (if necessary) in #942. What's the rational behind this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually did add this in #942 as well. It is a bit weird, but some tests (and examples I've seen online) have something like It's an easy enough thing to keep backward compatible, but do we want to keep it around or deprecate it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's odd. It seems like the more semantic way to write this would be
or, the way we've been doing it all along
In those examples (https://plot.ly/python/scatterplot-matrix/) OK, well let's keep it for backwards compatibility but I'd be OK with deprecating it. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,8 @@ | |
'Histogram2d': {'object_name': 'histogram2d', 'base_type': dict}, | ||
'Histogram2dContour': {'object_name': 'histogram2dcontour', | ||
'base_type': dict}, | ||
'Histogram2dcontour': {'object_name': 'histogram2dcontour', | ||
'base_type': dict}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change seems odd to me, seems like something that should exist (if necessary) in #942. What's the rational behind this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should be able to delete There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK yeah, this seems like something we can delete. I forgot all about @Kully - Can you chime in here? Do we still need |
||
'Layout': {'object_name': 'layout', 'base_type': dict}, | ||
'Legend': {'object_name': 'legend', 'base_type': dict}, | ||
'Line': {'object_name': 'line', 'base_type': dict}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
from plotly.graph_objs import Annotation, Annotations, Data, Figure, Layout | ||
|
||
|
||
|
||
def setup(): | ||
import warnings | ||
warnings.filterwarnings('ignore') | ||
|
@@ -25,33 +24,28 @@ def test_trivial(): | |
assert Annotations() == list() | ||
|
||
|
||
@raises(PlotlyError) | ||
def test_weird_instantiation(): # Python allows this, but nonsensical for us. | ||
print(Annotations({})) | ||
assert Annotations({}) == list() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 - Breaking Change |
||
|
||
|
||
def test_dict_instantiation(): | ||
Annotations([{'text': 'annotation text'}]) | ||
|
||
|
||
@raises(PlotlyDictKeyError) | ||
def test_dict_instantiation_key_error(): | ||
print(Annotations([{'not-a-key': 'anything'}])) | ||
assert Annotations([{'not-a-key': 'anything'}]) == [{'not-a-key': 'anything'}] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 - Breaking Change However, this one seems like the proper behavior. How do we instantiate a list of dictionaries with the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK I see, the new way to do this would be to just use a regular list of
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, we should probably update this test name as well (we can do that in the end, once we've gone through the rest of the tests) |
||
|
||
|
||
@raises(PlotlyDictValueError) | ||
def test_dict_instantiation_key_error(): | ||
print(Annotations([{'font': 'not-a-dict'}])) | ||
def test_dict_instantiation_key_error_2(): | ||
assert Annotations([{'font': 'not-a-dict'}]) == [{'font': 'not-a-dict'}] | ||
|
||
|
||
@raises(PlotlyListEntryError) | ||
def test_dict_instantiation_graph_obj_error_0(): | ||
Annotations([Data()]) | ||
assert Annotations([Data()]) == [[]] | ||
|
||
|
||
@raises(PlotlyListEntryError) | ||
def test_dict_instantiation_graph_obj_error_2(): | ||
Annotations([Annotations()]) | ||
assert Annotations([Annotations()]) == [[]] | ||
|
||
|
||
def test_validate(): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,42 +25,42 @@ def test_trivial(): | |
assert Data() == list() | ||
|
||
|
||
@raises(PlotlyError) | ||
#@raises(PlotlyError) | ||
def test_weird_instantiation(): # Python allows this... | ||
print(Data({})) | ||
assert Data({}) == [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 - Breaking Change |
||
|
||
|
||
def test_default_scatter(): | ||
assert Data([{}]) == list([{'type': 'scatter'}]) | ||
assert Data([{}]) == list([{}]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 - Breaking Change |
||
|
||
|
||
def test_dict_instantiation(): | ||
Data([{'type': 'scatter'}]) | ||
|
||
|
||
@raises(PlotlyDictKeyError) | ||
# @raises(PlotlyDictKeyError) | ||
def test_dict_instantiation_key_error(): | ||
print(Data([{'not-a-key': 'anything'}])) | ||
assert Data([{'not-a-key': 'anything'}]) == [{'not-a-key': 'anything'}] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 - Breaking Change |
||
|
||
|
||
@raises(PlotlyDictValueError) | ||
def test_dict_instantiation_key_error(): | ||
print(Data([{'marker': 'not-a-dict'}])) | ||
# @raises(PlotlyDictValueError) | ||
def test_dict_instantiation_key_error_2(): | ||
assert Data([{'marker': 'not-a-dict'}]) == [{'marker': 'not-a-dict'}] | ||
|
||
|
||
@raises(PlotlyDataTypeError) | ||
# @raises(PlotlyDataTypeError) | ||
def test_dict_instantiation_type_error(): | ||
Data([{'type': 'invalid_type'}]) | ||
assert Data([{'type': 'invalid_type'}]) == [{'type': 'invalid_type'}] | ||
|
||
|
||
@raises(PlotlyListEntryError) | ||
# @raises(PlotlyListEntryError) | ||
def test_dict_instantiation_graph_obj_error_0(): | ||
Data([Data()]) | ||
assert Data([Data()]) == [[]] | ||
|
||
|
||
@raises(PlotlyListEntryError) | ||
# raises(PlotlyListEntryError) | ||
def test_dict_instantiation_graph_obj_error_2(): | ||
Data([Annotations()]) | ||
assert Data([Annotations()]) == [[]] | ||
|
||
|
||
def test_validate(): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,5 @@ def test_instantiate_error_y(): | |
width=5) | ||
|
||
|
||
@raises(PlotlyDictKeyError) | ||
def test_key_error(): | ||
ErrorX(value=0.1, typ='percent', color='red') | ||
assert ErrorX(value=0.1, typ='percent', color='red') == {'color': 'red', 'typ': 'percent', 'value': 0.1} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, if we're deprecating
And we should verify that the error that is raised remains There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 - Breaking Change |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ def test_instantiation(self): | |
'frames': [] | ||
} | ||
|
||
Figure(native_figure) | ||
Figure(**native_figure) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 - Breaking Change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK sounds good, let's revert back to the previous test then (cc @Kully ) |
||
Figure() | ||
|
||
def test_access_top_level(self): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
from unittest import TestCase | ||
|
||
from plotly import exceptions | ||
from plotly.graph_objs import Bar, Frames | ||
from plotly.graph_objs import Bar, Frames, Frame | ||
|
||
import re | ||
|
||
|
||
class FramesTest(TestCase): | ||
|
@@ -56,20 +58,37 @@ def test_deeply_nested_layout_attributes(self): | |
) | ||
|
||
def test_deeply_nested_data_attributes(self): | ||
frames = Frames() | ||
frames.append({}) | ||
frames[0].data = [Bar()] | ||
frames[0].data[0].marker.color = 'red' | ||
#frames = Frames() | ||
#frames.append({}) | ||
#frames[0].data = [Bar()] | ||
#frames[0].data[0].marker.color = 'red' | ||
|
||
frames = Frame | ||
frames.data = [Bar()] | ||
frames.data[0].marker.color = 'red' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem right to me. The new syntax is replacing this with a list of
So, this test should be:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although
Am I doing something wrong here? cc @jmmease There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, I just broke it :-) Fixed in 8a7b476 |
||
|
||
# parse out valid attrs from ._prop_descriptions | ||
prop_descrip = frames.data[0].marker.line._prop_descriptions | ||
prop_descrip | ||
|
||
raw_matches = re.findall( | ||
"\n [a-z]+| [a-z]+\n", prop_descrip | ||
) | ||
matches = [] | ||
for r in raw_matches: | ||
r = r.replace(' ', '') | ||
r = r.replace('\n', '') | ||
matches.append(r) | ||
|
||
# It's OK if this needs to change, but we should check *something*. | ||
self.assertEqual( | ||
frames[0].data[0].marker.line._get_valid_attributes(), | ||
set(matches), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of a regex, a better way to do this might be to assert on all_attributes = dir(frames[0].data[0].marker.line)
public_attributes = [d for d in all_attributes if d[0] != '_' and d[:1] != 'on']
assertEqual(set(public_attributes), {'cliponaxis',
'connectgaps',
'customdata',
'customdatasrc',
'dx',
'dy',
'error_x',
'error_y',
'figure',
'fill',
'fillcolor',
'hoverinfo',
'hoverinfosrc',
'hoverlabel',
'hoveron',
'hovertext',
'hovertextsrc',
'ids',
'idssrc',
'legendgroup',
'line',
'marker',
'mode',
'name',
'opacity',
'parent',
'plotly_name',
'r',
'rsrc',
'selected',
'selectedpoints',
'showlegend',
'stream',
't',
'text',
'textfont',
'textposition',
'textpositionsrc',
'textsrc',
'to_plotly_json',
'tsrc',
'type',
'uid',
'unselected',
'update',
'visible',
'x',
'x0',
'xaxis',
'xcalendar',
'xsrc',
'y',
'y0',
'yaxis',
'ycalendar',
'ysrc'}) |
||
{'colorsrc', 'autocolorscale', 'cmin', 'colorscale', 'color', | ||
'reversescale', 'width', 'cauto', 'widthsrc', 'cmax'} | ||
) | ||
|
||
def test_frame_only_attrs(self): | ||
frames = Frames() | ||
frames = Frame | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/plotly/plotly.py/pull/975/files#r178922227 applies here as well |
||
frames.append({}) | ||
|
||
# It's OK if this needs to change, but we should check *something*. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems odd to me: infinite width?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context: The string '100%' is forbidden by the number
valType
ofwidth
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I wonder what
width="100%"
was doing before. I don't think that it doesn't anything in plotly.js aswidth='100%'
andheight='100%'
should correspond toautosize=True
.Maybe the better setting would be to:
width=None
andheight=None
width
orheight
is notNone
, apply it in the figureautosize=True