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

Marks & anatomy / 图元与构造

The quiet, considered look is a few fixed specs plus two pieces of negative space.
The data is the only thing allowed to be loud.

这种沉静、克制的外观来自几条固定规格加上两处留白。
数据是唯一被允许"抢眼"的元素。

Mark specs (fixed across every chart) / 图元规格(所有图表统一)

Mark Spec
Bar / column <= 24px thick (cap it - never fill the slot; let the band's leftover be air); 4px rounded data-end, square at the baseline; grows from a single baseline
Line 2px, round join/cap
Marker / end-dot >= 8px (r >= 4), filled with the series color
Area fill the series hue at ~10% opacity (a wash, never a saturated block)
Gridlines / axes one-step-off-surface gray, hairline (1px), solid (never dashed), recessive
图元 规格
条形 / 柱形 粗细 <= 24px(设上限 —— 不要填满整个槽位;让分带的剩余空间保持透气);数据端 4px 圆角,基线端直角;从单一基线生长
线条 2px,圆角连接/端帽
标记 / 端点 >= 8px(r >= 4),以系列色填充
面积填充 系列色相、约 10% 不透明度(一层淡染,绝不做饱和色块)
网格线 / 坐标轴 比底色深一档的灰色,发丝线(1px)、实线(绝不用虚线),保持低调

The two spacers (white doing the separating) / 两种间隔物(用底色完成分隔)

Never draw a border around a mark to separate it. The gap and the ring are the
mechanism; a stroke adds data-weight ink that isn't data.

绝不要用给图元加边框的方式来分隔。间隙和底色环才是机制;描边会增加并非数据本身的"数据级重量"墨迹。

Labels & legend / 标签与图例

A legend is always present for two or more series - the dependable identity
channel; never make the reader rely on color-matching alone. Direct labels then ride
the marks to supplement it. A single series needs no legend box: there is only
one color, so the chart's title or subtitle already says what is plotted. A box with
one swatch restates the title and costs space.

两个及以上的系列必须始终有图例 —— 这是最可靠的身份识别通道;绝不让读者仅靠颜色比对。直接标签附着在图元上,起补充作用。单一系列不需要图例框:只有一个颜色,图表的标题或副标题已经说明了所绘内容。只有一个色块的图例框是在重复标题并浪费空间。

Figures - when the form is a number / 数字型图示 —— 当形态本身是一个数字

Texture - the backup channel (opt-in) / 纹理 —— 备用通道(需主动启用)

Where hue fails - full-severity CVD, grayscale print, forced-colors - texture
carries identity. One directional hand-drawn fill, used at 45° and its 135° mirror
only
(never horizontal/vertical - those read as gridlines/bars). Inked tone-on-tone
(a step from the fill's own ramp), equal loudness across slots. On value scales the
texture is ordered (rotation steps with magnitude; arm angle carries the diverging
sign) so it never misstates the value. Triggered by an accessibility setting, print,
or forced-colors - never on by default. (See palette.md.)

在色相失效的场合 —— 重度色觉障碍(CVD)、灰度打印、forced-colors —— 由纹理承载身份识别。使用一种方向性手绘填充,且只用 45° 及其 135° 镜像(绝不用水平/垂直 —— 那会被看成网格线/条形)。以同色调描线(取自填充色自身色阶的一档),各槽位浓淡一致。在数值色标上,纹理是有序的(旋转级数随数值大小变化;臂角承载发散符号),因此绝不会误述数值。由无障碍设置、打印或 forced-colors 触发 —— 绝不默认开启。(参见 palette.md。)

【评论】这份规格把"留白"(间隙与底色环)而非描边作为唯一的分隔机制,是典型的设计系统约束式提示词:用少数固定数值换取跨图表的一致性。