d3#GeoPermissibleObjects TypeScript Examples

The following examples show how to use d3#GeoPermissibleObjects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MapChart.ts    From anichart.js with MIT License 6 votes vote down vote up
private initPathMap(map: any, geoGener: GeoPath<any, GeoPermissibleObjects>) {
    this.labelComponentMap = new Map<string, Component>();
    for (const feature of map.features) {
      const mapId = feature.properties[this.mapIdField];
      const path = geoGener(feature);
      this.pathMap.set(mapId, path);
      const txt = new Text({
        position: { x: 4, y: 6 },
        text: this.labelFormat(
          feature.properties[this.mapIdField],
          this.meta,
          this.dataGroupByID
        ),
        textAlign: "left",
        textBaseline: "top",
        fillStyle: this.strokeStyle,
        fontSize: this.labelSize,
      });
      const width = canvasHelper.measure(txt).width;
      const label = new Rect({
        position: { x: 0, y: 0 },
        fillStyle: "#2225",
        strokeStyle: this.strokeStyle,
        shape: {
          width: width + this.labelPadding,
          height: this.labelSize + this.labelPadding,
        },
      });
      label.addChild(txt);
      this.labelComponentMap.set(mapId, label);
    }
  }
Example #2
Source File: MapChart.ts    From anichart.js with MIT License 5 votes vote down vote up
geoGener: GeoPath<any, GeoPermissibleObjects>;
Example #3
Source File: MapChart.d.ts    From anichart.js with MIT License 5 votes vote down vote up
geoGener: GeoPath<any, GeoPermissibleObjects>;