npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gooin/yzt-datavis-mapbox

v0.0.3

Published

manage deck.gl,antV-L7,THREE datavis layers for mapbox

Downloads

2

Readme

mapbox datavis mapbox

主要功能:

  • 适配 mapbox 原生、deck.glantV-L7THREE 不同可视化图层加载,最终返回一个 MapBoxLayer ,用于添加到地图中
  • 额外扩展可视化图层

todo

  • [ ] 适配 mapbox 原生、deck.glantV-L7 不同图层加载
    • [x] mapbox 原生
    • [x] deck.gl
    • [ ] antV-L7 因为图层加载在其内建的Scene对象中,需要额外处理
    • [ ] THREEmapboxcustom-layer 方式
    • [ ] 支持接口原生参数传入及额外自定义选项
  • [ ] 可用的地理图层补充
    • [x] HeatMap (mapbox)
    • [x] ArcLayer (deck.gl)
    • [x] GeoJSONLayer (deck.gl)
    • [x] RouteLineLayer (antV)
  • [ ] 不上地图的表格图表扩充
  • [ ] 统一图层管理,事件管理
  • [ ] 通用数据转换

    不同库的大部分图层都支持GeoJSON数据,但是个别的图层所需数据格式不尽相同,需要统一数据入口的数据结构,内部做转换以适配不同的库

  • [ ] 测试用例编写
  • [ ] 入参参数校验
  • [ ] 打包体积优化

用法

yarn add git地址...
import { ArcLayer,GeoJsonLayer } from 'fantasy-datavis-mapbox';
import mapboxgl from 'mapbox-gl';

mapboxgl.accessToken = 'pk.eyJ1IjoiZ29vaW4iLCJhIjoiY2ppY3RjcGd5MDRqcjNrbWFlanEyazk2OCJ9.-v6OvStrPvVwu2-Tx9Uogg';
const AIR_PORTS =
    'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_airports.geojson';

let map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v9',
    center: [0.45,51.47],
    zoom: 4,
    pitch: 30,
    bearing:0
});

const myArcLayer = ArcLayer({
    id: 'arcs1',
    data: AIR_PORTS,    
    dataTransform: d =>
        d.features.filter(f =>
            f.properties.scalerank < 4),
    // // Styles
    getSourcePosition: f =>
        [-0.4531566, 51.4709959], // London
    getTargetPosition: f =>
        f.geometry.coordinates,
    getSourceColor: [0, 128, 200, 100],
    getTargetColor: [200, 0, 80, 150],
    getWidth: 2
});

    const myJsonLayer = GeoJsonLayer({
    id: "geojson",
    data: AIR_PORTS,
    onClick: info =>
        // eslint-disable-next-line
        info.object && alert(`extra fun=> ${info.object.properties.name} (${info.object.properties.abbrev})`)
});


map.addLayer(myArcLayer);
map.addLayer(myJsonLayer);