Home

Awesome

<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> English | 简体中文

<h1 align="center">L7Plot</h1> <div align="center">

🌍 基于 <a href="https://github.com/antvis/L7">L7</a> 的地理空间可视化图表库。

<!-- [![NPM downloads](https://img.shields.io/npm/dm/@antv/l7plot.svg)](https://npmjs.com/@antv/l7plot) --> <!-- ![Latest commit](https://badgen.net/github/last-commit/antvis/L7Plot) -->

Version Status Release Status Coverage Status Percentage of issues still open Average time to resolve an issue

<p align="center"> <a href="https://l7plot.antv.antgroup.com/zh">网站</a> • <a href="https://l7plot.antv.antgroup.com/zh/docs/manual/quick-start">快速开始</a> • <a href="https://l7plot.antv.antgroup.com/zh/docs/api/plot-api">API</a> • <a href="https://l7plot.antv.antgroup.com/zh/examples/gallery">图表示例</a> </p> </div> <div align="center"> <img src="https://user-images.githubusercontent.com/26923747/160286530-aec01c97-a56b-4ea9-9fc6-f245d8f7b871.png" width="800"> </div>

✨ 特性

📦 安装

$ npm install @antv/l7 @antv/l7plot

🔨 使用

<div align="center"> <img src="https://gw.alipayobjects.com/zos/antfincdn/Yn%24QslMAWP/20220326145659.jpg" width="600" /> </div>
<div id="container"></div>
import { Dot } from '@antv/l7plot';

const data = [
  { lng: 103.715, lat: 31.211, depth: 10, mag: 5.8, title: 'M 5.8 - eastern Sichuan, China' },
  { lng: 104.682, lat: 31.342, depth: 10, mag: 5.7, title: 'M 5.7 - eastern Sichuan, China' },
  // ...
];

const dot = new Dot('container', {
  map: {
    type: 'mapbox',
    style: 'light',
    center: [103.447303, 31.753574],
    zoom: 7,
  },
  autoFit: true,
  source: {
    data: data,
    parser: { type: 'json', x: 'lng', y: 'lat' },
  },
  color: {
    field: 'mag',
    value: ['#82cf9c', '#10b3b0', '#2033ab'],
    scale: { type: 'quantize' },
  },
  size: {
    field: 'mag',
    value: ({ mag }) => (mag - 4.3) * 10,
  },
  state: { active: true },
  scale: { position: 'bottomright' },
  legend: { position: 'bottomleft' },
  tooltip: {
    items: ['title', 'mag', 'depth'],
  },
});

本地开发

# 全局安装 yarn
$ npm install yarn -g

# 安装项目依赖
$ yarn bootstrap

# 实时编译各 package 并启动 storybook
$ yarn dev

# 运行网站
$ yarn dev-website

# 运行单元测试
$ yarn test

# 打开 electron 运行单元测试,并监听测试文件
$ yarn test-live

🤝 如何贡献

如果您在使用的过程中碰到问题,可以先通过 issues 看看有没有类似的 bug 或者建议。

如需提交代码,请遵从我们的贡献指南

许可证

MIT