本文整理汇总了TypeScript中d3-geo.geoPath函数的典型用法代码示例。如果您正苦于以下问题:TypeScript geoPath函数的具体用法?TypeScript geoPath怎么用?TypeScript geoPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了geoPath函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Oceania
@computed get Oceania(): GeoPath<any, any> {
const projection = geoConicConformal()
.rotate([-135, 0])
.center([0, -20])
.parallels([-10, -30])
const path = geoPath().projection(projection)
return path
}
示例2: NorthAmerica
@computed get NorthAmerica(): GeoPath<any, any> {
const projection = geoConicConformal()
.rotate([98, 0])
.center([0, 38])
.parallels([29.5, 45.5])
const path = geoPath().projection(projection)
return path
}
示例3: Asia
// From http://bl.ocks.org/dhoboy/ff8448ace9d5d567390a
@computed get Asia(): GeoPath<any, any> {
const projection = geoPatterson()
.center([58,54])
.scale(150)
.translate([0,0])
.precision(.1)
const path = geoPath().projection(projection)
return path
}
示例4: SouthAmerica
@computed get SouthAmerica(): GeoPath<any, any> {
//empiric
const projection = geoConicConformal()
.rotate([68, 0])
.center([0, -14])
.parallels([10, -30])
const path = geoPath().projection(projection)
return path
}
示例5: Africa
@computed get Africa(): GeoPath<any, any> {
//empiric
const projection = geoConicConformal()
.rotate([-25, 0])
.center([0, 0])
.parallels([30, -20])
const path = geoPath().projection(projection)
return path
}
示例6: Europe
// From http://bl.ocks.org/espinielli/10587361
@computed get Europe(): GeoPath<any, any> {
const projection = geoAzimuthalEqualArea().scale(200).translate([262, 1187]).clipAngle(180 - 1e-3).precision(1)
const path = geoPath().projection(projection)
return path
//empiric
/*const projection = geoConicConformal()
.rotate([-15, 0])
.center([0, 55])
.parallels([60, 40])
const path = geoPath().projection(projection)
return path*/
}
示例7: layerUpdate
layerUpdate(map: Map, projection?) {
super.layerUpdate(map, projection);
const element = this._lfd3._rootGroup;
projection = projection || this._lfd3.projection;
const updateDefs = this._lfd3.svg().selectAll("defs").data([undefined]);
updateDefs.enter().append("defs").append("marker")
.attr("class", "marker")
.attr("id", this._id + "_arrowHead")
.attr("viewBox", "0 0 10 10")
.attr("refX", 10)
.attr("refY", 5)
.attr("markerWidth", 12)
.attr("markerHeight", 12)
.attr("markerUnits", "strokeWidth")
.attr("orient", "auto")
.append("polyline")
.attr("points", "0,0 10,5 0,10 1,5")
;
this._lfd3.svg().select("defs > marker")
.style("fill", this.strokeColor())
.style("stroke", null)
;
const center = projection.latLngToLayerPoint({ lat: 0, lng: 0 });
const geoTransform = resolve("Mercator")
.scale(projectionFactor)
.translate([center.x, center.y])
;
const geoPath = d3GeoPath().projection(geoTransform);
const updateSelection = element.selectAll(".dataEdge").data(this.lineData().filter(row => !this.isNull2(row.coordinates)));
updateSelection.enter().append("path")
.attr("class", "dataEdge")
.attr("marker-end", "url(#" + this._id + "_arrowHead)")
.merge(updateSelection)
.attr("d", geoPath)
.style("stroke", this.strokeColor())
.style("fill", "none")
.attr("stroke-width", 1 / projection.scale)
;
updateSelection.exit().remove();
}
示例8:
* (30 + Math.pow(2 * x - 3 * y, 2) * (18 - 32 * x + 12 * x * x + 48 * y - 36 * x * y + 27 * y * y));
}
let size: [number, number];
let boolFlag: boolean;
const thresholdArrayGen: ThresholdArrayGenerator<number> = (values: ArrayLike<number>, min?: number, max?: number) => {
let thresholds: number[];
thresholds = [values[1], values[2], values[4]];
return thresholds;
};
let thresholdGenerator: ThresholdArrayGenerator<number> | ThresholdCountGenerator;
let pathStringMaybe: string | null;
let num: number;
const pathSolo = geoPath<any, d3Contour.ContourMultiPolygon>();
// -----------------------------------------------------------------------------
// Test Contour Generator
// -----------------------------------------------------------------------------
// Get contour generator -------------------------------------------------------
let contGen: d3Contour.Contours = d3Contour.contours();
// Configure contour generator =================================================
// size(...) -------------------------------------------------------------------
const multiPolygon: d3Contour.ContourMultiPolygon = contGen.contour(values, 5);
示例9:
// ----------------------------------------------------------------------
// GeoPath Generator
// ----------------------------------------------------------------------
let minimalRenderingContextMockUp: d3Geo.GeoContext = {
beginPath: () => { return; },
moveTo: (x: number, y: number) => { return; },
lineTo: (x: number, y: number) => { return; },
arc: (x, y, radius, startAngle, endAngle) => { return; },
closePath: () => { return; }
};
// Create geoPath Generator =============================================
let geoPathCanvas: d3Geo.GeoPath<any, d3Geo.GeoPermissibleObjects>;
geoPathCanvas = d3Geo.geoPath();
geoPathCanvas = d3Geo.geoPath(null);
geoPathCanvas = d3Geo.geoPath(null, null);
geoPathCanvas = d3Geo.geoPath(d3Geo.geoAzimuthalEqualArea());
geoPathCanvas = d3Geo.geoPath(d3Geo.geoAzimuthalEqualArea(), minimalRenderingContextMockUp);
let geoPathSVG: d3Geo.GeoPath<SVGPathElement, d3Geo.ExtendedFeature<GeoJSON.Polygon, SampleProperties1>>;
geoPathSVG = d3Geo.geoPath<SVGPathElement, d3Geo.ExtendedFeature<GeoJSON.Polygon, SampleProperties1>>();
geoPathSVG = d3Geo.geoPath<SVGPathElement, d3Geo.ExtendedFeature<GeoJSON.Polygon, SampleProperties1>>(d3Geo.geoAzimuthalEqualArea());
geoPathSVG = d3Geo.geoPath<SVGPathElement, d3Geo.ExtendedFeature<GeoJSON.Polygon, SampleProperties1>>(d3Geo.geoAzimuthalEqualArea(), null);
// Configure geoPath Generator ==========================================
// projection(...) ------------------------------------------------------
geoPathCanvas = geoPathCanvas.projection(azimuthalEqualArea);
let geoPathProjectionMinimal: d3Geo.GeoStreamWrapper = geoPathCanvas.projection();
示例10: World
@computed get World(): GeoPath<any, any> {
const projection = geoRobinson() as GeoProjection
const path = geoPath().projection(projection)
return path
}