Skip to content

Commit 90352b3

Browse files
emmanuellejonmmease
authored andcommitted
create_choropleth figure factory returns go.Figure (#1600)
1 parent e840a9f commit 90352b3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: plotly-package/plotly/figure_factory/_county_choropleth.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import plotly.colors as clrs
1212
from plotly.figure_factory import utils
1313
from plotly.exceptions import PlotlyError
14+
import plotly.graph_objs as go
1415

1516
pd.options.mode.chained_assignment = None
1617

@@ -950,4 +951,4 @@ def create_choropleth(fips, values, scope=['usa'], binning_endpoints=None,
950951
fig['layout']['yaxis']['range'][0] = center[1] - new_height * 0.5
951952
fig['layout']['yaxis']['range'][1] = center[1] + new_height * 0.5
952953

953-
return fig
954+
return go.Figure(fig)

Diff for: plotly-package/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,7 @@ def test_full_choropleth(self):
28172817
simplify_county=1
28182818
)
28192819

2820-
exp_fig_head = [
2820+
exp_fig_head = (
28212821
-88.053375,
28222822
-88.02916499999999,
28232823
-88.02432999999999,
@@ -2868,7 +2868,7 @@ def test_full_choropleth(self):
28682868
-85.142567,
28692869
-85.113329,
28702870
-85.10533699999999
2871-
]
2871+
)
28722872

28732873
self.assertEqual(fig['data'][2]['x'][:50], exp_fig_head)
28742874

0 commit comments

Comments
 (0)