Skip to content

Commit 79ac151

Browse files
committed
added test
1 parent 3697d41 commit 79ac151

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,25 @@ def test_sunburst_treemap_with_path_color():
250250
assert np.all(np.array(colors[:8]) == np.array(calls))
251251

252252

253+
def test_sunburst_treemap_column_parent():
254+
vendors = ["A", "B", "C", "D", "E", "F", "G", "H"]
255+
sectors = [
256+
"Tech",
257+
"Tech",
258+
"Finance",
259+
"Finance",
260+
"Tech",
261+
"Tech",
262+
"Finance",
263+
"Finance",
264+
]
265+
regions = ["North", "North", "North", "North", "South", "South", "South", "South"]
266+
values = [1, 3, 2, 4, 2, 2, 1, 4]
267+
df = pd.DataFrame(dict(id=vendors, sectors=sectors, parent=regions, values=values,))
268+
path = ["parent", "sectors", "id"]
269+
fig = px.sunburst(df, path=path, values="values")
270+
271+
253272
def test_sunburst_treemap_with_path_non_rectangular():
254273
vendors = ["A", "B", "C", "D", None, "E", "F", "G", "H", None]
255274
sectors = [

0 commit comments

Comments
 (0)