[Bug] themeRiver layout is wrong after `resize()`: `boundaryGap` keeps the pixel values of the first layout
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
調査の方向性
報告者は themeRiverLayout が seriesModel.get('boundaryGap') をその場で解決している箇所だと指摘しているので、まずそこから確認し、オプション配列が変更されているかを調べてください。スニペットで再現します。resize を実行してから、最終サイズの新しいチャートと比較し、getOption().series[0].boundaryGap を変更前後で確認してください。繰り返しのレイアウトが新しいチャートと同じ結果になり、オプション配列がパーセント文字列を保持していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 67.8k
- フォーク
- 19.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/echarts のほかの issue
-
en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
[Bug] chord `lineStyle.color: 'gradient'` uses the previous layout after resize or setOption対応中かも @yqtian-se が今日担当しました。 オープンen pending
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/echarts#21854 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンen pending
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
apache/echarts#21843 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edge対応中かも @schizophrenicmaniac が 3 日前に担当しました。 オープンen pending
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/echarts#21839 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/echarts#21813 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
cursor/community-plugins#583 ·
メンテナーはふだん 1 日以内に返信
-
afk-ok importer size:S
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
enorm-labs/event-junkie#5404 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Wavvon/Wavvon-clients#493 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
answerLoops/answerLoops#679 ·
メンテナーはふだん 1 日以内に返信