[BUG]: percentTotal not shown as percentage
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Anfängerfreundlichkeit
- 93/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- data-visualization, frontend
Rechercherichtung
Lies src/traces/bar/plot.js, wo der Issue auf einen Tippfehler im Eigenschaftsnamen hinweist, und prüfe die Funnel-Abdeckung in test/jasmine/tests/funnel_test.js. Führe die Funnel-Tests aus und bestätige, dass %{percentTotal} für die angegebenen Werte als 50%, 33% und 17% dargestellt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
This issue is related to plotly.py#4368, which was addressed in Plotly.py 5.17.0. However, the issue is still reproducible with Plotly.py 7.1.0 and Plotly.js 4.1.2.
The root cause is a typo in src/traces/bar/plot.js. Plotly.js correctly computes percentTotal, but assigns the formatted percentage to percenTotalLabel instead of percentTotalLabel (missing "t").
As a result, funnel text templates using %{percentTotal} display the raw ratio rather than the formatted percentage.
Screenshots/Video
Before :
After :
Steps to reproduce
python
import plotly
import plotly.graph_objects as go
print("Plotly version:", plotly.__version__)
fig = go.Figure(
go.Funnel(
name="X",
y=["A", "B", "C"],
x=[40, 30, 20],
textposition="inside",
texttemplate=(
"%{value}<br>"
"%{percentPrevious}<br>"
"%{percentTotal}"
),
)
)
fig.show()
Solution
The issue was fixed by correcting the property name in src/traces/bar/plot.js.
A regression test was also added to test/jasmine/tests/funnel_test.js to verify that %{percentTotal} renders as 50%, 33%, and 17% for the corresponding funnel values.
Validation
The funnel test suite failed before the fix because the labels contained raw ratios.
All 63 funnel tests passed after the fix.
Linting and type checking passed.
To validate the fix locally in Plotly.py, the build issue was worked around, Plotly.js was built and packed, and the resulting local bundle was imported in Plotly.py 4.1.0.
The local test ran successfully and confirmed that the percentage labels were formatted correctly.
Notes
I'm new in contributing on open source project, any advice are welcome !
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.4k
- Forks
- 2k
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 15
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus plotly/plotly.js
-
bug P3 size: 3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
plotly/plotly.js#8108 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
chore P3 plotly-internal size: 3 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
plotly/plotly.js#8064 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
chore P1 plotly-internal size: 1 task
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 2 Tagen
-
chore P3 plotly-internal size: 1 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[mkdocs] Update link in Edit this Page buttonEvtl. wieder frei @AbhinavKumar-Jha hat das vor 154 Tagen übernommen, und es ist kein Pull Request offen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
plotly/plotly.js#7648 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in plotly/plotly.js
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
bluerobotics/Cockpit-docs#48 ·
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PhyberApex/slds-json-schema-renderer#372 ·
Maintainer antworten meist innerhalb von 1 Tag
-
usage: a custom provider's balance meters ("…%" in the balance path) ignore the Left/Used switchOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] rag: sentence content can cross the reported sentence boundariesEvtl. vergeben @LJK-ikun hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag