Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 90352b3

Browse filesBrowse files
emmanuellejonmmease
authored andcommitted
create_choropleth figure factory returns go.Figure (plotly#1600)
1 parent e840a9f commit 90352b3
Copy full SHA for 90352b3

File tree

2 files changed

+4
-3
lines changed
Filter options

2 files changed

+4
-3
lines changed

‎plotly-package/plotly/figure_factory/_county_choropleth.py

Copy file name to clipboardExpand all lines: plotly-package/plotly/figure_factory/_county_choropleth.py
+2-1Lines changed: 2 additions & 1 deletion
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)

‎plotly-package/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py

Copy file name to clipboardExpand all lines: plotly-package/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py
+2-2Lines changed: 2 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.