[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edge
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
src/coord/cartesian/Grid.ts の layOutGridByOuterBounds から始めて、目盛りラベルの位置がグリッドの境界にどう影響するかを追ってください。リンクされた再現例を使って、逆向き軸と非逆向き軸の場合を比較してください。どちらの場合もグリッドが潰れることなく同じ高さになれば、issue は完了です。
索引モデルが issue の本文から書いたものです。
説明
Version
6.1.0
Link to Minimal Reproduction
Steps to Reproduce
- Open the link above. The right y-axis has
inverse: true,min: 0.4498,max: 0.6824, and the grid usesouterBoundsMode: 'same'withouterBoundsContain: 'axisLabel'. - Compare with the same option without
inverse: true.
option = {
grid: { outerBoundsMode: 'same', outerBoundsContain: 'axisLabel' },
xAxis: { type: 'category', data: ['A', 'B', 'C', 'D'] },
yAxis: [
{ type: 'value' },
{ type: 'value', inverse: true, min: 0.4498, max: 0.6824 }
],
series: [
{ type: 'line', data: [10, 20, 30, 40] },
{ type: 'line', yAxisIndex: 1, data: [0.5, 0.55, 0.6, 0.65] }
]
};
Current Behavior
The grid collapses to the bottom of the chart. In a 600×400 container it is 64px tall.
Expected Behavior
The grid is the same height as without inverse: true (229px in a 600×400 container).
Environment
- OS: macOS
- Browser: Chrome
- Framework: React
Any additional comments?
layOutGridByOuterBounds in src/coord/cartesian/Grid.ts computes each label's proportion with axis.scale.normalize(...) but doesn't account for axis.inverse. On the inverted axis above, the 0.45 tick sits ~0.1% from the top edge but is treated as ~0.1% from the bottom, so applyProportion divides its few px of overhang by ~0.001 and the grid shrinks to its minimum.
Flipping the proportion for inverted axes fixes it (we ship this as a local patch):
let proportion = axis.scale.normalize(
getTickValueOutermost(axis.scale, getLabelInner(labelInfo.label).labelInfo.tick)
);
if (axis.inverse) {
proportion = 1 - proportion;
}
proportion = xyIdx === 1 ? 1 - proportion : proportion;
Also reproduces on 6.0.0, and the code is unchanged on master.
- 主要言語
- TypeScript
- スター
- 67.7k
- フォーク
- 19.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/echarts のほかの issue
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンen pending
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
-
en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug] The zoom cursor in the toolbox area is incorrect対応中かも @waterWang が 98 日前に担当しました。 オープンbug en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
pollen-robotics/reachy-mini-desktop-app#341 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
mike-north/AgentMonitors#648 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vercel-labs/ui#700 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信