[Bug] themeRiver layout is wrong after `resize()`: `boundaryGap` keeps the pixel values of the first layout
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
- Área
- data-visualization
Línea de trabajo
El reportero indica que themeRiverLayout es el lugar donde seriesModel.get('boundaryGap') se resuelve en el sitio, así que empieza ahí y comprueba si el array de opciones se muta. Reproduce con el fragmento: haz resize y luego compara con un gráfico nuevo al tamaño final, e inspecciona getOption().series[0].boundaryGap antes y después. Está listo cuando los layouts repetidos dan el mismo resultado que un gráfico nuevo y el array de opciones conserva sus cadenas de porcentaje.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 67.8k
- Forks
- 19.9k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/echarts
-
en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
[Bug] chord `lineStyle.color: 'gradient'` uses the previous layout after resize or setOptionPosiblemente ocupada @yqtian-se la tomó hoy. Abiertoen pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/echarts#21854 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoen pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
apache/echarts#21843 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgePosiblemente ocupada @schizophrenicmaniac la tomó hace 3 días. Abiertoen pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/echarts#21839 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
en pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/echarts#21813 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/echarts
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
cursor/community-plugins#583 ·
Los mantenedores suelen responder en 1 día
-
afk-ok importer size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
enorm-labs/event-junkie#5404 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Wavvon/Wavvon-clients#493 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
answerLoops/answerLoops#679 ·
Los mantenedores suelen responder en 1 día