Skip to content

Commit 1916166

Browse files
committed
hovertemplate
1 parent 78ed0f2 commit 1916166

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

packages/python/plotly/plotly/express/_chart_types.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,24 +1137,21 @@ def pie(
11371137
In a pie plot, each row of `data_frame` is represented as a sector of a pie.
11381138
"""
11391139
return make_figure(
1140-
args=locals(),
1141-
constructor=go.Pie,
1142-
trace_patch=dict(showlegend=True, hole=hole)
1143-
)
1140+
args=locals(), constructor=go.Pie, trace_patch=dict(showlegend=True, hole=hole)
1141+
)
11441142

11451143

1146-
pie.__doc__ = make_docstring(pie,
1147-
override_dict=dict(
1148-
textinfo=[
1149-
"str",
1150-
"Determines which trace information appear on the graph.",
1151-
],
1144+
pie.__doc__ = make_docstring(
1145+
pie,
1146+
override_dict=dict(
1147+
textinfo=["str", "Determines which trace information appear on the graph.",],
11521148
hole=[
11531149
"float",
11541150
"Sets the fraction of the radius to cut out of the pie."
1155-
"Use this to make a donut chart."
1156-
],
1157-
),)
1151+
"Use this to make a donut chart.",
1152+
],
1153+
),
1154+
)
11581155

11591156

11601157
def sunburst(

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,20 +307,25 @@ def make_trace_kwargs(args, trace_spec, g, mapping_labels, sizeref):
307307
mapping_labels[v_label] = "%{location}"
308308
elif k == "values":
309309
result[k] = g[v]
310-
_label = "value" if v_label == 'values' else v_label
310+
_label = "value" if v_label == "values" else v_label
311311
mapping_labels[_label] = "%{value}"
312312
elif k == "parents":
313313
result[k] = g[v]
314-
_label = "parent" if v_label == 'parents' else v_label
314+
_label = "parent" if v_label == "parents" else v_label
315315
mapping_labels[_label] = "%{parent}"
316316
elif k == "ids":
317317
result[k] = g[v]
318-
_label = "id" if v_label == 'ids' else v_label
318+
_label = "id" if v_label == "ids" else v_label
319319
mapping_labels[_label] = "%{id}"
320320
elif k == "names":
321-
if trace_spec.constructor in [go.Sunburst, go.Treemap, go.Pie, go.Funnelarea]:
321+
if trace_spec.constructor in [
322+
go.Sunburst,
323+
go.Treemap,
324+
go.Pie,
325+
go.Funnelarea,
326+
]:
322327
result["labels"] = g[v]
323-
_label = "label" if v_label == 'names' else v_label
328+
_label = "label" if v_label == "names" else v_label
324329
mapping_labels[_label] = "%{label}"
325330
else:
326331
result[k] = g[v]
@@ -331,8 +336,6 @@ def make_trace_kwargs(args, trace_spec, g, mapping_labels, sizeref):
331336
if trace_spec.constructor not in [
332337
go.Parcoords,
333338
go.Parcats,
334-
go.Sunburst,
335-
go.Treemap,
336339
]:
337340
hover_lines = [k + "=" + v for k, v in mapping_labels.items()]
338341
result["hovertemplate"] = hover_header + "<br>".join(hover_lines)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@
188188
colref_desc,
189189
"Values from this column or array_like are used as labels for sectors.",
190190
],
191-
192191
locationmode=[
193192
"str",
194193
"One of 'ISO-3', 'USA-states', or 'country names'",

0 commit comments

Comments
 (0)