Skip to content

d3-scale

比例尺将抽象数据的一个维度映射到视觉表示上。虽然最常用于将数据编码为位置,例如将时间和温度映射到散点图中的水平和垂直位置,但比例尺几乎可以表示任何视觉编码,例如颜色、线条宽度或符号大小。比例尺也几乎可以与任何类型的数据一起使用,例如命名的分类数据或需要合理分隔的离散数据。

🌐 Scales map a dimension of abstract data to a visual representation. Although most often used for encoding data as position, say to map time and temperature to a horizontal and vertical position in a scatterplot, scales can represent virtually any visual encoding, such as color, stroke width, or symbol size. Scales can also be used with virtually any type of data, such as named categorical data or discrete data that requires sensible breaks.

请参阅以下之一:

🌐 See one of:

有关可视化比例的编码,请参见 d3-axis,以及 scale.ticksscale.tickFormat。有关配色方案,请参见 d3-scale-chromatic

🌐 For visualizing the scale’s encoding, see d3-axis, as well as scale.ticks and scale.tickFormat. For color schemes, see d3-scale-chromatic.