← 提示词库 Anthropic/claude-code/skills/dataviz/references/interaction.md 原文 md
🌐 中英双语对照

Interaction - tooltips & filters / 交互 - 工具提示与筛选器

An HTML chart is interactive by default - the hover layer is part of the deliverable,
not an upgrade. Omitting it is the exception (a bare stat tile), never the default.
Design it with the same care as the static render.

HTML 图表默认即是交互式的——悬停层是交付物的一部分,而非可选升级。省略它是例外(如纯数字统计磁贴),绝不是默认做法。请以与静态渲染同等的用心来设计它。

Tooltips & hover / 工具提示与悬停

Tooltips enhance, they never gate: every value a tooltip shows is also reachable
without it, through direct labels or the table view. Same details on keyboard focus
as on hover.

工具提示只做增强,绝不做门槛:工具提示展示的每个数值,无需它也能通过直接标注或表格视图获取。键盘聚焦时展示的细节与悬停时相同。

Filters & time ranges / 筛选器与时间范围

Every monitoring dashboard needs the same controls. These are standard UI, not
chart marks
- build them with ordinary HTML form controls styled to match the
chart chrome. Dataviz only adds composition rules:

每个监控仪表盘都需要同样的控件。它们是标准 UI,而非图表图形——用普通 HTML 表单控件构建,样式与图表外观相匹配。Dataviz 只补充构图规则:

A good date picker lists presets as rows (nobody fights a calendar grid for "last 30
days"), marks selection with a 16px bold check, keeps hover a ghost wash so it never
competes with selection, and tucks the custom range behind a hairline in the footer.
(See palette.md for the reference spec.)

一个好的日期选择器把预设项列成行(没有谁会为了"最近 30 天"去折腾日历网格),用 16px 的加粗对勾标记选中项,让悬停只是一层极淡的底色从而绝不与选中态争夺注意力,并把自定义范围收进页脚的一条细线之后。(参考规范见 palette.md。)