[BUG]: percentTotal not shown as percentage
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 93/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- data-visualization, frontend
Direzione di ricerca
Leggi src/traces/bar/plot.js, dove l’issue segnala un errore di battitura nel nome di una proprietà, e controlla la copertura di funnel in test/jasmine/tests/funnel_test.js. Esegui i test di funnel e conferma che %{percentTotal} viene visualizzato come 50%, 33% e 17% per i valori indicati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 !
- Lingua principale
- JavaScript
- Stelle
- 18.4k
- Fork
- 2k
- Merge medio
- 3g 2h
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/plotly.js
-
bug P3 size: 3
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
plotly/plotly.js#8108 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
chore P3 plotly-internal size: 3 task
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
plotly/plotly.js#8064 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
chore P1 plotly-internal size: 1 task
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
chore P3 plotly-internal size: 1 task
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 2 giorni
-
[mkdocs] Update link in Edit this Page buttonForse di nuovo libera @AbhinavKumar-Jha l’ha presa 154 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
plotly/plotly.js#7648 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di plotly/plotly.js
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bluerobotics/Cockpit-docs#48 ·
-
README is out of date: broken badge, wrong command name, wrong Node version, placeholder URLsApertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PhyberApex/slds-json-schema-renderer#372 ·
I maintainer di solito rispondono entro 1 giorno
-
usage: a custom provider's balance meters ("…%" in the balance path) ignore the Left/Used switchAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] rag: sentence content can cross the reported sentence boundariesForse già presa @LJK-ikun l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno