Skip to content

⚡️ Speed up function _return_label by 8% #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions plotly/figure_factory/_facet_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ def _is_flipped(num):


def _return_label(original_label, facet_labels, facet_var):
if isinstance(facet_labels, dict):
label = facet_labels[original_label]
elif isinstance(facet_labels, str):
label = "{}: {}".format(facet_var, original_label)
if type(facet_labels) is dict:
return facet_labels[original_label]
elif type(facet_labels) is str:
return f"{facet_var}: {original_label}"
else:
label = original_label
return label
return original_label


def _legend_annotation(color_name):
Expand Down