Charts: port the tooltip and hover behaviour of the ECharts module
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js, react
- Lĩnh vực
- data-visualization, frontend, testing
Hướng nghiên cứu
Start with packages/pivotkit-core/src/chart.js, chart-style.js, packages/pivotkit-react/src/chart.jsx and chart-tooltip.js; compare the tooltip state flow with the linked ECharts module files. Add pure tooltip reduction tests with node --test, then run the browser tests in all three engines with real pointer input and the strict CSP page. Done when the listed hover cases pass, empty series are omitted, pie and donut tooltips remain unchanged, and the report SVG golden output is unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The ECharts module of powershell-universal-components got a better tooltip in 0.3.0 (#80, review fixes in #85, decision in #79). pivotkit still lists every series at the category, wherever the pointer is: on the sales playground's stacked bars, pointing at the Software segment of Austria shows all three series and no total. I want the same behaviour here.
Today: chart.js sets tooltip.trigger: "axis" for bar, line and area; chart-style.js sets emphasis.focus: "series" for bars and lines; chart-tooltip.js prints one line per series, also for series without a value (an empty value).
Behaviour to port
- The element under the pointer wins (bar, line, area): a bar, a stacked segment or a line point shows that element alone. How the module does it: trigger stays
axis;mouseover/mouseoutwith adataIndexset a per-instance hover state, thenhideTip+showTipat the pointer (ECharts does not call the formatter again at the same axis position otherwise); the formatter reduces the axis items to the hovered one (tooltipMode.js,EChart.jsx). - A stacked segment shows its value plus a "Total" row for its stack.
- Between elements (the gap between bars, the line or the area fill itself, which have no
dataIndex): every series at the category. Between stacked bars: the total only. - Stacked area and stacked line: every series plus the total.
- Series without a value at that category are left out instead of an empty line.
- A hovered bar lights up alone:
emphasis.focus: "self"for bars andaxisPointer.triggerEmphasis: false, so the axis position does not light up every bar. Lines keepfocus: "series". - Pie, donut and heatmap keep the item tooltip; no hover tracking there.
What differs in pivotkit
- The tooltip stays DOM nodes from
chart-tooltip.js(no inlinestyleattributes, text astextContent), so the strict CSP pages keep passing. The total row is a node like the others; its weight and its rule line come from--pk-*tokens (--pk-weight-strong,--pk-border), text at--pk-chart-text-size, no new literal (tokens.test.js). - The hover state lives per chart instance in
chart.jsxand reaches the formatter throughdecorate(); the reduction (hovered item, gap, totals) is a pure function inchart-tooltip.js, tested withnode --test. - Only category axes and at most 50 categories, so the module's fixes for time/value axes (totals by x value), lines above 200 points,
-SecondaryY,-Group, the toolbox's line/bar/stack switch and-TooltipTemplatehave nothing to port. When 100 % stacked (#36) lands, the total adds the original values, as the module's-Normalizedoes. - The HTML report's SVG has no hover:
decorateOptionis called there without a tooltip formatter; the emphasis change must leave pivotkit-report's golden output unchanged. - Keyboard: the chart has no keyboard tooltip, the text summary and the table stay the way to read every value. The totals per category are in the table; nothing new is reachable by hover only.
- A switch between this and "every series" is #106's Display setting (
chart.tooltip); this issue makes the default. #106's proposed default (item only for grouped bars) is replaced by the element-under-the-pointer rule above. docs/use/charts.md(the tooltip paragraph) and its screenshots.
Tests
Browser tests in the three engines with real pointer input (page.mouse.move onto the drawn element, positions from the chart's own pixel conversion, not fixed fractions):
- Stacked bar: a segment shows its series and the total; the gap between two bars the total only; the hovered segment lights up alone.
- Grouped bar: a bar shows its series only.
- Stacked area (a view with
type: "area", stacked: true): the fill shows every series and the total; a point shows that point and the total. - Line: a point shows that point; the line between points shows every series; a series without a value is left out.
- Pie and donut: a slice shows that slice, as today.
- Every case on the strict CSP page without a CSP violation, and the markup test in
usability.spec.jsstill passes.
- Ngôn ngữ chính
- JavaScript
- Star
- 1
- Fork
- 1
- Merge trung bình
- 3 giờ 34 phút
- Pull request đã merge (30 ngày)
- 213
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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.
Issue khác của eizedev/pivotkit
-
area:server enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:server bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:server enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation idea
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:tests idea
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eizedev/pivotkit
Issue tương tự
-
入群码过期Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
aliyun/ai-agent-handbook#29 · 1 bình luận ·
-
docs documentation need-triage SaaS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/cloudstack#14719 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày