Skip to content

Commit 6c5313b

Browse files
committed
doc
1 parent 1b06d3a commit 6c5313b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/python/plotly/plotly/express/_doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@
7474
parents=[
7575
colref_type,
7676
colref_desc,
77-
"Values from this column or array_like are used to set values associated to sectors.",
77+
"Values from this column or array_like are used as parents in sunburst and treemap charts.",
7878
],
7979
ids=[
8080
colref_type,
8181
colref_desc,
82-
"Values from this column or array_like are used to set values associated to sectors.",
82+
"Values from this column or array_like are used to set ids of sectors",
8383
],
8484
lat=[
8585
colref_type,

packages/python/plotly/plotly/tests/test_core/test_px/test_px_functions.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import plotly.graph_objects as go
33
from numpy.testing import assert_array_equal
44

5+
56
def _compare_figures(go_trace, px_fig):
67
"""Compare a figure created with a go trace and a figure created with
78
a px function call. Check that all values inside the go Figure are the
@@ -12,23 +13,23 @@ def _compare_figures(go_trace, px_fig):
1213
px_fig = px_fig.to_plotly_json()
1314
del go_fig["layout"]["template"]
1415
del px_fig["layout"]["template"]
15-
for key in go_fig['data'][0]:
16-
assert_array_equal(go_fig['data'][0][key], px_fig['data'][0][key])
17-
for key in go_fig['layout']:
18-
assert go_fig['layout'][key] == px_fig['layout'][key]
16+
for key in go_fig["data"][0]:
17+
assert_array_equal(go_fig["data"][0][key], px_fig["data"][0][key])
18+
for key in go_fig["layout"]:
19+
assert go_fig["layout"][key] == px_fig["layout"][key]
1920

2021

2122
def test_pie_like_px():
2223
# Pie
23-
labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']
24+
labels = ["Oxygen", "Hydrogen", "Carbon_Dioxide", "Nitrogen"]
2425
values = [4500, 2500, 1053, 500]
2526

2627
fig = px.pie(names=labels, values=values)
2728
trace = go.Pie(labels=labels, values=values)
2829
_compare_figures(trace, fig)
2930

3031
labels = ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"]
31-
parents = ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ]
32+
parents = ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"]
3233
values = [10, 14, 12, 10, 2, 6, 6, 4, 4]
3334
# Sunburst
3435
fig = px.sunburst(names=labels, parents=parents, values=values)
@@ -40,7 +41,7 @@ def test_pie_like_px():
4041
_compare_figures(trace, fig)
4142

4243
# Funnel
43-
x = ['A', 'B', 'C']
44+
x = ["A", "B", "C"]
4445
y = [3, 2, 1]
4546
fig = px.funnel(y=y, x=x)
4647
trace = go.Funnel(y=y, x=x)
@@ -49,4 +50,3 @@ def test_pie_like_px():
4950
fig = px.funnel_area(values=y, names=x)
5051
trace = go.Funnelarea(values=y, labels=x)
5152
_compare_figures(trace, fig)
52-

0 commit comments

Comments
 (0)