patternfly / patternfly/patternfly-react
Bug - Tooltips on Charts - Tooltips for non-Latin character code pages are too narrow
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 862
- Fork
- 392
- Merge trung bình
- 4 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
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:
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với entry point ChartTooltip của @patternfly/react-charts và kiểm tra cách ước tính chiều rộng văn bản flyout dựa trên hành vi của các biểu đồ Victory. Tái hiện vấn đề bằng bản dịch tiếng Nhật hoặc một ngôn ngữ không dùng chữ Latinh khác, sử dụng workaround flyoutWidth đã được báo cáo để so sánh. Hoàn thành khi chiều rộng văn bản tooltip không còn bị ước tính thấp đáng kể đối với các ngôn ngữ không dùng chữ Latinh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend, internationalization
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100