patternfly / patternfly/patternfly-react
Bug - Tooltips on Charts - Tooltips for non-Latin character code pages are too narrow
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 862
- フォーク
- 392
- 平均マージ
- 4日 8時間
- マージ済み PR(30日)
- 9
説明
Describe the problem
By default the @patternfly/react-charts chart tooltips use the same text width estimation as is used in the Victory charts. This estimation works ok for ASCII characters, but underestimate sizes for other non-Latin character code pages.
How do you reproduce the problem?
Have a chart tooltip is any non-Latin character language. Japanese is a good example.
Expected behavior
The tooltips for Latin character languages have their text's width estimated well, but for non-Latin character language (such as Japanese), the text width is vastly underestimated.
Is this issue blocking you?
No, but could be very common in non-Latin languages. It was first detected in a Japanese translation.
The workaround used was to force the tooltip to a constant width wide enough to display the tooltip in every translation.
For example, in (https://github.com/oVirt/ovirt-engine-ui-extensions/blob/0642c73c45dc084bd841e1928884dd1fa61bb0b0/src/components/patternfly/DonutChart.js#L40-L52), the ChartTooltip's flyoutWidth is set to a constant value:
<ChartDonutUtilization
title={donutChartText}
subTitle={donutChartSubtitle}
themeColor={ChartThemeColor.green}
labelComponent={<ChartTooltip flyoutWidth={180} />}
data={{ x: 'Capacity', y: percentUsed * 100 }}
labels={({ datum }) => datum.x ? usedLabel : availableLabel}
thresholds={colors}
events={[{ target: 'data', eventHandlers: { onClick: onDataClick } }]}
height={200}
width={200}
padding={{ top: 15 }}
/>
Screenshots
Example 1:

Example 2:

What is your environment?
- OS: Any
- Browser: Any
- Version:
"@patternfly/react-charts": "^6.74.3"
What is your product and what release date are you targeting?
oVirt
Any other information?
See:
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
@patternfly/react-charts の ChartTooltip エントリーポイントから始め、Victory charts の動作をもとに flyout テキストの幅がどのように推定されているかを調べます。日本語または別の非ラテン語の翻訳で問題を再現し、比較対象として報告されている flyoutWidth workaround を使用します。非ラテン語の言語で tooltip テキストの幅が大幅に過小評価されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript
- 領域
- frontend, internationalization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100