Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaskruchten committed Jan 11, 2021
1 parent b666924 commit fccdfea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/python/plotly/plotly/express/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,14 @@ def infer_config(args, constructor, trace_patch, layout_patch):
):
args["facet_col_wrap"] = 0

if "norm" in args:
if args.get("norm", None) not in [None, "percent", "probability"]:
raise ValueError(
"`norm` must be one of None, 'percent' or 'probability'. "
+ "'%s' was provided." % args["norm"]
)
args["histnorm"] = args["norm"]

# Compute applicable grouping attributes
for k in group_attrables:
if k in args:
Expand Down Expand Up @@ -2040,8 +2048,6 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
group[var] = group[var] / group_sum
elif args["norm"] == "percent":
group[var] = 100.0 * group[var] / group_sum
args["histnorm"] = args["norm"]
# TODO norm, including histnorm-like naming

patch, fit_results = make_trace_kwargs(
args, trace_spec, group, mapping_labels.copy(), sizeref
Expand Down

0 comments on commit fccdfea

Please sign in to comment.