Skip to content

Commit 7a14376

Browse files
committed
moved changes into infer_config
1 parent 052e2c1 commit 7a14376

File tree

1 file changed

+4
-4
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+4
-4
lines changed

packages/python/plotly/plotly/express/_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,10 @@ def infer_config(args, constructor, trace_patch, layout_patch):
18751875
args[position] = args["marginal"]
18761876
args[other_position] = None
18771877

1878+
# Ignore facet rows and columns when data frame is empty so as to prevent nrows/ncols equaling 0
1879+
if len(args["data_frame"]) == 0:
1880+
args["facet_row"] = args["facet_col"] = None
1881+
18781882
# If both marginals and faceting are specified, faceting wins
18791883
if args.get("facet_col") is not None and args.get("marginal_y") is not None:
18801884
args["marginal_y"] = None
@@ -1988,10 +1992,6 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
19881992
layout_patch = layout_patch or {}
19891993
apply_default_cascade(args)
19901994

1991-
# Ignore facet rows and columns when data frame is empty so as to prevent nrows/ncols equaling 0
1992-
if len(args["data_frame"]) == 0:
1993-
args["facet_row"] = args["facet_col"] = None
1994-
19951995
args = build_dataframe(args, constructor)
19961996
if constructor in [go.Treemap, go.Sunburst, go.Icicle] and args["path"] is not None:
19971997
args = process_dataframe_hierarchy(args)

0 commit comments

Comments
 (0)