[Bug] themeRiver layout is wrong after `resize()`: `boundaryGap` keeps the pixel values of the first layout
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
- Ambito
- data-visualization
Direzione di ricerca
Il segnalatore indica themeRiverLayout come il punto in cui seriesModel.get('boundaryGap') viene risolto sul posto, quindi inizia da lì e verifica se l'array delle opzioni viene modificato. Riproduci con lo snippet: esegui resize, poi confronta con un grafico nuovo alla dimensione finale, e ispeziona getOption().series[0].boundaryGap prima e dopo. È completato quando i layout ripetuti danno lo stesso risultato di un grafico nuovo e l'array delle opzioni mantiene le stringhe percentuali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
6.1.0 (also current master 34f4d927e)
Link to Minimal Reproduction
option = {
animation: false,
singleAxis: { type: 'time', top: 20, bottom: 30 },
series: [{
type: 'themeRiver',
data: [
['2015/11/08', 10, 'a'], ['2015/11/09', 15, 'a'], ['2015/11/10', 35, 'a'],
['2015/11/08', 35, 'b'], ['2015/11/09', 36, 'b'], ['2015/11/10', 20, 'b']
]
}]
};
// 1 s: make the chart shorter. The streams keep the top/bottom gaps of the original height:
setTimeout(() => myChart.resize({ height: 200 }), 1000);
// 3 s: set the same option again (notMerge). Nothing changes, yet the streams jump to the correct layout:
setTimeout(() => myChart.setOption(option, true), 3000);
Steps to Reproduce
- Create the chart with the option above in a 240x390 container.
- Call
myChart.resize({ width: 400, height: 300 })(or resize the browser window when the container height is responsive). - Compare with a chart created directly at 400x300. Setting the same option again with
notMerge: truealso fixes the layout.
Current Behavior
After the resize, the streams are laid out with the top and bottom gaps of the initial size. For example, when a 240x390 chart
is resized to 400x300, the streams are squeezed or shifted instead of filling the area like a fresh 400x300 chart.
myChart.getOption().series[0].boundaryGap also returns pixel numbers instead of the default ['10%', '10%'] ([34, 34] for the
240x390 chart, before and after the resize).
A setOption that only changes the size of the singleAxis (top, bottom, left or right) shows the same problem.
Expected Behavior
The layout after resize() is the same as a fresh chart at the final size, and boundaryGap in the option is left unchanged.
Environment
- OS: any (also reproduced with the SVG renderer in Node.js SSR)
- Browser: any
- Framework: none
Any additional comments?
Cause: themeRiverLayout gets the array with seriesModel.get('boundaryGap') and then resolves the percentages in place
(boundaryGap[0] = parsePercent(boundaryGap[0], rect.height)). This overwrites the option array, so every later layout reuses
the pixel values from the first one. Copying the array before resolving fixes it; I can send a PR.
- Lingua principale
- TypeScript
- Stelle
- 67.8k
- Fork
- 19.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 apache/echarts
-
en pending
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] chord `lineStyle.color: 'gradient'` uses the previous layout after resize or setOptionForse già presa @yqtian-se l’ha presa oggi. Apertaen pending
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/echarts#21854 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaen pending
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
apache/echarts#21843 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgeForse già presa @schizophrenicmaniac l’ha presa 3 giorni fa. Apertaen pending
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/echarts#21839 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
en pending
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/echarts#21813 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/echarts
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
cursor/community-plugins#583 ·
I maintainer di solito rispondono entro 1 giorno
-
afk-ok importer size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
enorm-labs/event-junkie#5404 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Wavvon/Wavvon-clients#493 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
answerLoops/answerLoops#679 ·
I maintainer di solito rispondono entro 1 giorno