• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript d3-geo.geoPath函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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
 }
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:8,代码来源:MapProjections.ts


示例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
 }
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:8,代码来源:MapProjections.ts


示例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
 }
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:10,代码来源:MapProjections.ts


示例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
 }
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:9,代码来源:MapProjections.ts


示例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
 }
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:9,代码来源:MapProjections.ts


示例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*/
 }
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:13,代码来源:MapProjections.ts


示例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();
    }
开发者ID:GordonSmith,项目名称:Visualization,代码行数:43,代码来源:Path.ts


示例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);
开发者ID:Dru89,项目名称:DefinitelyTyped,代码行数:30,代码来源:d3-contour-tests.ts


示例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();
开发者ID:ArtemZag,项目名称:DefinitelyTyped,代码行数:31,代码来源:d3-geo-tests.ts


示例10: World

 @computed get World(): GeoPath<any, any> {
     const projection = geoRobinson() as GeoProjection
     const path = geoPath().projection(projection)
     return path
 }
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:5,代码来源:MapProjections.ts



注:本文中的d3-geo.geoPath函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript d3-geo.geoTransform函数代码示例发布时间:2022-05-25
下一篇:
TypeScript d3-geo.geoMercator函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap