数据驱动的拉伸

尝试一下在线预览

此示例演示如何应用大小可视变量以基于数字字段值以主题方式拉伸要素。 使用连续的尺寸渐变以主题方式可视化要素 主题中审查的尺寸视觉变量的相同基本原则也适用于 3D 主题可视化。

但是,在使用诸如  ExtrudeSymbol3DLayer ,  PathSymbol3DLayer 和  ObjectSymbol3DLayer  等体积符号图层时,大小值始终以实际单位(米)表示。

                                        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const renderer = {
  type: "simple", // autocasts as new SimpleRenderer()
  symbol: {
    type: "polygon-3d", // autocasts as new PolygonSymbol3D()
    symbolLayers: [{ type: "extrude" }] // autocasts as new ExtrudeSymbol3DLayer()
  },
  label: "% population in poverty by county",
  visualVariables: [
    {
      type: "size", // indicates this is a size visual variable
      field: "POP_POVERTY", // total population in poverty
      normalizationField: "TOTPOP_CY", // total population
      stops: [
        {
          value: 0.1, // features where < 10% of the pop in poverty
          size: 10000 // will be extruded by this height in meters
        },
        {
          value: 0.5, // features where > 50% of the pop in poverty
          size: 500000 // will be extruded by this height in meters
        }
      ]
    },
    {
      type: "color",
      field: "POP_POVERTY",
      normalizationField: "TOTPOP_CY",
      stops: [
        {
          value: 0.1,
          color: "#FFFCD4"
        },
        {
          value: 0.35,
          color: [153, 83, 41]
        }
      ]
    }
  ]
};

在 3D 中,尝试从不同距离区分不同大小的要素可能会出现问题。 由于透视,很难感知要素之间的空间大小差异。 出于这个原因,在按主题拉伸要素时,为同一字段添加颜色视觉变量是一个好主意。

其他可视化示例和资源

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.