Merge pull request #223 from antvis/tapable

替换apable 为async-hook
This commit is contained in:
@thinkinggis 2020-02-23 22:31:19 +08:00 committed by GitHub
commit 6f52cc3868
43 changed files with 803 additions and 200 deletions

View File

@ -45,7 +45,7 @@ module.exports = api => {
{
// https://babeljs.io/docs/en/babel-preset-env#usebuiltins
// useBuiltIns: 'usage',
// corejs: '3.0.0',
corejs: '3.0.0',
useBuiltIns: isCDNBundle ? 'usage' : false,
// set `modules: false` when building CDN bundle, let rollup do commonjs works
// @see https://github.com/rollup/rollup-plugin-babel#modules
@ -70,6 +70,7 @@ module.exports = api => {
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-syntax-async-generators',
'@babel/plugin-transform-parameters',
[
'@babel/plugin-proposal-decorators',
{
@ -115,7 +116,6 @@ module.exports = api => {
// isCDNBundle ? 'inline-webgl-constants' : {},
],
ignore: [
'node_modules',
// /node_modules\/(?![d3*])/,
...!isTest ? [
'**/*.test.tsx',

View File

@ -41,6 +41,10 @@ module.exports = [
{
resolve: [ '.tsx', '.ts' ],
entries: [
{
find: /^@antv\/async-hook$/,
replacement: resolveFile('packages/async-hook/src'),
},
{
find: /^@antv\/l7-(.*)/,
replacement: resolveFile('packages/$1/src'),

View File

@ -28,7 +28,8 @@ module.exports = {
moduleFileExtensions: [ 'ts', 'tsx', 'js' ],
modulePathIgnorePatterns: [ 'dist' ],
moduleNameMapper: {
'@antv/l7-(.+)$': '<rootDir>packages/$1/src'
'@antv/l7-(.+)$': '<rootDir>packages/$1/src',
'@antv/async-hook$': '<rootDir>packages/async-hook/src'
},
notify: true,
notifyMode: 'always',

View File

@ -15,6 +15,7 @@
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-syntax-async-generators": "^7.7.4",
"@babel/plugin-transform-parameters": "^7.8.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
@ -26,6 +27,7 @@
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-node-resolve": "^6.0.0",
"@storybook/react": "^5.1.9",
"@types/async": "^3.0.8",
"@types/dat.gui": "^0.7.1",
"@types/enzyme": "^3.1.14",
"@types/enzyme-adapter-react-16": "^1.0.3",
@ -104,7 +106,6 @@
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.3.2",
"svg-inline-loader": "^0.8.0",
"tapable": "^1.1.3",
"ts-jest": "^24.0.2",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
@ -148,7 +149,7 @@
"coveralls": "jest --coverage && cat ./tests/coverage/lcov.info | coveralls",
"tsc": "tsc",
"watch": "yarn clean && lerna exec --parallel -- cross-env BABEL_ENV=cjs babel --watch src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
"bundle": "cross-env BABEL_ENV=bundle rollup -c ./build/rollup.config.js --environment BUILD:production,MINIFY:true",
"bundle": "cross-env BABEL_ENV=bundle node_modules/.bin/rollup -c ./build/rollup.config.js --environment BUILD:production,MINIFY:true",
"bundle-dev": "cross-env BABEL_ENV=bundle node_modules/.bin/rollup -c ./build/rollup.config.js --environment 'BUILD:production,MINIFY:false'",
"bundle:watch": "cross-env BABEL_ENV=bundle node_modules/.bin/rollup -c ./build/rollup.config.js --watch",
"glsl-minify": "node_modules/.bin/glsl-minifier -i ./build/example.frag -o ./build/example.min.frag",
@ -174,7 +175,8 @@
}
},
"resolutions": {
"../core-js": "3"
"../core-js": "3",
"d3-array": "2.3.3"
},
"tnpm": {
"mode": "yarn"

View File

@ -0,0 +1,11 @@
# `async-hook`
> TODO: description
## Usage
```
const asyncHook = require('async-hook');
// TODO: DEMONSTRATE API
```

View File

@ -0,0 +1,36 @@
{
"name": "@antv/async-hook",
"version": "2.0.25",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"sideEffects": true,
"files": [
"lib",
"es",
"README.md"
],
"scripts": {
"tsc": "tsc --project tsconfig.build.json",
"clean": "rimraf dist; rimraf es; rimraf lib;",
"build": "run-p build:*",
"build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
"build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
"watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
"lint:ts": "run-p -c lint:ts-*",
"test": "jest"
},
"author": "lzxue",
"license": "ISC",
"bugs": {
"url": "https://github.com/antvis/L7/issues"
},
"homepage": "https://github.com/antvis/L7#readme",
"dependencies": {
"async": "^3.1.1"
},
"devDependencies": {
"@types/async": "^3.0.8"
}
}

View File

@ -0,0 +1,20 @@
// @ts-ignore
// tslint:disable-next-line:no-submodule-imports
import parallel from 'async/parallel';
import { CallBack } from './IHook';
export default class AsyncParallelHook {
private tasks: any[];
constructor(...args: any[]) {
this.tasks = [];
}
public promise(...args: any[]) {
return parallel(this.tasks);
}
public tapPromise(name: string, cb: CallBack) {
this.tasks.push(async (callback: any) => {
await cb();
callback(null, name);
});
}
}

View File

@ -0,0 +1,5 @@
export type CallBack = (...args: any[]) => any;
export interface IHook {
call: (...args: any[]) => void;
tap(name: string, task: CallBack): void;
}

View File

@ -0,0 +1,20 @@
// @ts-ignore
// tslint:disable-next-line:no-submodule-imports
import series from 'async/series';
import { CallBack, IHook } from './IHook';
export default class SyncBailHook implements IHook {
private tasks: any[];
constructor(...args: any[]) {
this.tasks = [];
}
public call(...args: any[]) {
return series(this.tasks);
}
public tap(name: string, cb: CallBack) {
this.tasks.push((callback: any) => {
const err = cb();
callback(err, name);
});
}
}

View File

@ -0,0 +1,22 @@
// @ts-ignore
// tslint:disable-next-line: no-submodule-imports
import series from 'async/series';
import { CallBack, IHook } from './IHook';
export default class SyncHook implements IHook {
private tasks: any[];
private args: any[];
constructor(...args: any[]) {
this.tasks = [];
}
public call(...args: any[]) {
this.args = args;
return series(this.tasks);
}
public tap(name: string, cb: CallBack) {
this.tasks.push((callback: any) => {
cb(...this.args);
callback(null, name);
});
}
}

View File

@ -0,0 +1,27 @@
// @ts-ignore
// tslint:disable-next-line:no-submodule-imports
import waterfall from 'async/waterfall';
import { CallBack, IHook } from './IHook';
export default class SyncWaterfallHook implements IHook {
private tasks: any[];
constructor(...args: any[]) {
this.tasks = [];
}
public call(...args: any[]) {
return waterfall(this.tasks);
}
public tap(name: string, cb: CallBack) {
if (this.tasks.length === 0) {
this.tasks.push((callback: any) => {
const value = cb();
callback(value ? null : false, value);
});
} else {
this.tasks.push((arg: any, callback: any) => {
const value = cb();
callback(value ? null : false, name);
});
}
}
}

View File

@ -0,0 +1,4 @@
export { default as SyncHook } from './core/SyncHook';
export { default as AsyncParallelHook } from './core/AsyncParallelHook';
export { default as SyncWaterfallHook } from './core/SyncWaterfallHook';
export { default as SyncBailHook } from './core/SyncBailHook';

View File

@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"declarationDir": "./es",
"rootDir": "./src",
"baseUrl": "./",
"target": "es6",
},
"include": ["./src"]
}

View File

@ -22,6 +22,7 @@
"author": "xiaoiver",
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.0.25",
"@antv/l7-utils": "^2.0.27-alpha.0",
"@babel/runtime": "^7.7.7",
"@mapbox/tiny-sdf": "^1.1.1",
@ -36,7 +37,6 @@
"merge-json-schemas": "^1.0.0",
"probe.gl": "^3.1.1",
"reflect-metadata": "^0.1.13",
"tapable": "^2.0.0-beta.8",
"viewport-mercator-project": "^6.2.1"
},
"devDependencies": {

View File

@ -1,5 +1,6 @@
// @ts-ignore
import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
import { Container } from 'inversify';
import { SyncBailHook, SyncHook, SyncWaterfallHook } from 'tapable';
import Clock from '../../utils/clock';
import { ISceneConfig } from '../config/IConfigService';
import { IMapService } from '../map/IMapService';
@ -85,19 +86,19 @@ export interface ILayer {
dataState: IDataState; // 数据流状态
pickedFeatureID: number;
hooks: {
init: SyncBailHook<void, boolean | void>;
afterInit: SyncBailHook<void, boolean | void>;
beforeRenderData: SyncWaterfallHook<boolean | void>;
beforeRender: SyncBailHook<void, boolean | void>;
afterRender: SyncHook<void>;
beforePickingEncode: SyncHook<void>;
afterPickingEncode: SyncHook<void>;
beforeHighlight: SyncHook<[number[]]>;
beforeSelect: SyncHook<[number[]]>;
afterSelect: SyncHook<void>;
afterHighlight: SyncHook<void>;
beforeDestroy: SyncHook<void>;
afterDestroy: SyncHook<void>;
init: SyncBailHook;
afterInit: SyncBailHook;
beforeRenderData: SyncWaterfallHook;
beforeRender: SyncBailHook;
afterRender: SyncHook;
beforePickingEncode: SyncHook;
afterPickingEncode: SyncHook;
beforeHighlight: SyncHook;
beforeSelect: SyncHook;
afterSelect: SyncHook;
afterHighlight: SyncHook;
beforeDestroy: SyncHook;
afterDestroy: SyncHook;
};
models: IModel[];
sourceOption: {

View File

@ -80,7 +80,7 @@ export default class LayerService implements ILayerService {
.filter((layer) => layer.isVisible())
.forEach((layer) => {
// trigger hooks
layer.hooks.beforeRenderData.call(true);
layer.hooks.beforeRenderData.call();
layer.hooks.beforeRender.call();
layer.render();
layer.hooks.afterRender.call();

View File

@ -1,8 +1,9 @@
// @ts-ignore
import { AsyncParallelHook } from '@antv/async-hook';
import { DOM } from '@antv/l7-utils';
import elementResizeEvent, { unbind } from 'element-resize-event';
import { EventEmitter } from 'eventemitter3';
import { inject, injectable } from 'inversify';
import { AsyncParallelHook } from 'tapable';
import { TYPES } from '../../types';
import { createRendererContainer } from '../../utils/dom';
import { IFontService } from '../asset/IFontService';
@ -92,7 +93,7 @@ export default class Scene extends EventEmitter implements ISceneService {
private $container: HTMLDivElement | null;
private hooks: {
init: AsyncParallelHook<unknown>;
init: AsyncParallelHook;
};
public constructor() {
@ -105,7 +106,7 @@ export default class Scene extends EventEmitter implements ISceneService {
* 2. initRenderer
* 3. initWorker Worker
*/
init: new AsyncParallelHook(['config']),
init: new AsyncParallelHook(),
};
}

View File

@ -16,13 +16,13 @@
#define SHIFT_LEFT23 8388608.0
#define SHIFT_LEFT24 16777216.0
vec2 unpack_float(const float packedValue) {
vec2 unpack_float(float packedValue) {
int packedIntValue = int(packedValue);
int v0 = packedIntValue / 256;
return vec2(v0, packedIntValue - v0 * 256);
}
vec4 decode_color(const vec2 encodedColor) {
vec4 decode_color(vec2 encodedColor) {
return vec4(
unpack_float(encodedColor[0]) / 255.0,
unpack_float(encodedColor[1]) / 255.0

View File

@ -56,7 +56,7 @@ vec3 project_normal(vec3 normal) {
}
vec3 project_offset_normal(vec3 vector) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01
|| u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// normals generated by the polygon tesselator are in lnglat offsets instead of meters
return normalize(vector * u_PixelsPerDegree);
@ -73,14 +73,16 @@ vec3 reverse_offset_normal(vec3 vector) {
}
vec4 project_position(vec4 position) {
float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;
float b = COORDINATE_SYSTEM_P20_OFFSET;
float c = COORDINATE_SYSTEM_LNGLAT;
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET
|| u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
float X = position.x - u_ViewportCenter.x;
float Y = position.y - u_ViewportCenter.y;
return project_offset(vec4(X, Y, position.z, position.w));
}
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {
return vec4(
project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,
project_scale(position.z),
@ -95,6 +97,7 @@ vec4 project_position(vec4 position) {
position.w
);
}
return position;
// TODO: 瓦片坐标系 & 常规世界坐标系
}
@ -146,3 +149,9 @@ vec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjec
}
return pos;
}
bool isEqual( float a, float b) {
return a< b + 0.001 && a > b - 0.001;
}

View File

@ -10,7 +10,7 @@ float sdCircle(vec2 p, float r) {
}
float sdEquilateralTriangle(vec2 p) {
const float k = sqrt(3.0);
float k = sqrt(3.0);
p.x = abs(p.x) - 1.0;
p.y = p.y + 1.0/k;
if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;
@ -24,7 +24,7 @@ float sdBox(vec2 p, vec2 b) {
}
float sdPentagon(vec2 p, float r) {
const vec3 k = vec3(0.809016994,0.587785252,0.726542528);
vec3 k = vec3(0.809016994,0.587785252,0.726542528);
p.x = abs(p.x);
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
@ -33,7 +33,7 @@ float sdPentagon(vec2 p, float r) {
}
float sdHexagon(vec2 p, float r) {
const vec3 k = vec3(-0.866025404,0.5,0.577350269);
vec3 k = vec3(-0.866025404,0.5,0.577350269);
p = abs(p);
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
@ -41,7 +41,7 @@ float sdHexagon(vec2 p, float r) {
}
float sdOctogon(vec2 p, float r) {
const vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
p = abs(p);
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
@ -50,7 +50,7 @@ float sdOctogon(vec2 p, float r) {
}
float sdHexagram(vec2 p, float r) {
const vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
p = abs(p);
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;

View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>L7 IE</title>
<style>
html,
body {
overflow: hidden;
margin: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
<link
href="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.css"
rel="stylesheet"
/>
</head>
<body>
<div id="map"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.8.3/polyfill.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/symbol-es6@0.1.2/symbol-es6.min.js"></script> -->
<script src="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js"></script>
<script src="../dist/l7-dev.js"></script>
<script>
console.log(L7);
const scene = new L7.Scene({
id: "map",
map: new L7.Mapbox({
style: "dark", // 样式URL
center: [108.6167, 19.1000],
pitch: 0,
zoom: 13
})
});
const data = {"list":[{"w":19.1000,"t":24.6000,"s":"海南","l":11,"m":"东方","j":108.6167,"h":"59838"},{"w":20.0000,"t":23.8000,"s":"海南","l":11,"m":"海口","j":110.2500,"h":"59758"},{"w":22.2750,"t":23.6000,"s":"广东","l":12,"m":"珠海","j":113.5669,"h":"59488"},{"w":20.3372,"t":23.4000,"s":"广东","l":12,"m":"徐闻","j":110.1794,"h":"59754"},{"w":19.2089,"t":23.2000,"s":"海南","l":12,"m":"琼海","j":110.4819,"h":"59855"},{"w":21.7358,"t":23.2000,"s":"广东","l":11,"m":"上川岛","j":112.7731,"h":"59673"},{"w":23.3853,"t":23.0000,"s":"广东","l":11,"m":"汕头","j":116.6792,"h":"59316"},{"w":22.5417,"t":23.0000,"s":"广东","l":12,"m":"深圳","j":114.0033,"h":"59493"},{"w":19.5167,"t":22.9000,"s":"海南","l":12,"m":"儋州","j":109.5833,"h":"59845"},{"w":21.1547,"t":22.7000,"s":"广东","l":12,"m":"湛江","j":110.3022,"h":"59658"},{"w":21.4500,"t":22.7000,"s":"广西","l":12,"m":"北海","j":109.1333,"h":"59644"},{"w":22.5000,"t":22.6000,"s":"广东","l":12,"m":"中山","j":113.4000,"h":"59485"},{"w":21.8453,"t":22.6000,"s":"广东","l":12,"m":"阳江","j":111.9783,"h":"59663"},{"w":22.3469,"t":22.6000,"s":"广东","l":12,"m":"信宜","j":110.9250,"h":"59456"},{"w":22.8000,"t":22.5000,"s":"广东","l":12,"m":"汕尾","j":115.3667,"h":"59501"},{"w":23.4275,"t":22.3000,"s":"广东","l":12,"m":"南澳","j":117.0292,"h":"59324"},{"w":22.7100,"t":22.3000,"s":"广东","l":12,"m":"罗定","j":111.6000,"h":"59462"},{"w":19.0333,"t":22.3000,"s":"海南","l":12,"m":"琼中","j":109.8333,"h":"59849"},{"w":21.5458,"t":22.2000,"s":"广东","l":11,"m":"电白","j":110.9886,"h":"59664"},{"w":22.9661,"t":21.9000,"s":"广东","l":12,"m":"东莞","j":113.7389,"h":"59289"},{"w":22.2472,"t":21.8000,"s":"广东","l":12,"m":"台山","j":112.7858,"h":"59478"},{"w":22.9836,"t":21.6000,"s":"广东","l":12,"m":"惠来","j":116.3014,"h":"59317"},{"w":22.9906,"t":21.0000,"s":"广东","l":12,"m":"高要","j":112.4786,"h":"59278"},{"w":23.9000,"t":20.8000,"s":"广西","l":12,"m":"百色","j":106.6000,"h":"59211"},{"w":23.0711,"t":20.4000,"s":"广东","l":12,"m":"惠阳","j":114.3744,"h":"59298"},{"w":23.4497,"t":20.4000,"s":"广东","l":12,"m":"揭西","j":115.8492,"h":"59306"},{"w":23.3353,"t":20.4000,"s":"广东","l":11,"m":"增城","j":113.8275,"h":"59294"},{"w":23.4167,"t":19.9000,"s":"广西","l":12,"m":"那坡","j":105.8333,"h":"59209"},{"w":24.9000,"t":19.7000,"s":"福建","l":11,"m":"崇武","j":118.9167,"h":"59133"},{"w":24.4833,"t":19.7000,"s":"福建","l":12,"m":"厦门","j":118.0667,"h":"59134"},{"w":23.7936,"t":19.6000,"s":"广东","l":12,"m":"河源","j":114.7297,"h":"59293"},{"w":23.7106,"t":19.4000,"s":"广东","l":12,"m":"清远","j":113.0850,"h":"59280"},{"w":23.1000,"t":19.4000,"s":"广西","l":12,"m":"靖西","j":106.4500,"h":"59218"},{"w":23.6000,"t":19.4000,"s":"广西","l":13,"m":"田东","j":107.1167,"h":"59224"},{"w":25.5167,"t":19.2000,"s":"福建","l":12,"m":"平潭","j":119.7833,"h":"58944"},{"w":25.0500,"t":19.2000,"s":"福建","l":12,"m":"龙岩","j":117.0167,"h":"58927"},{"w":23.2100,"t":19.0000,"s":"广东","l":12,"m":"广州","j":113.4822,"h":"59287"},{"w":21.9833,"t":18.9000,"s":"广西","l":12,"m":"钦州","j":108.6000,"h":"59632"}]}
const pointLayer = new L7.PointLayer({})
.source(data.list, {
parser: {
type: "json",
x: "j",
y: "w"
}
})
.shape("circle")
.size(15)
.color("t", [
"#094D4A",
"#146968",
"#1D7F7E",
"#289899",
"#34B6B7",
"#4AC5AF",
"#5FD3A6",
"#7BE39E",
"#A1EDB8",
"#CEF8D6"
])
.style({
opacity: 1.0
});
scene.addLayer(pointLayer);
</script>
</body>
</html>

View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>L7 IE</title>
<style>
html,
body {
overflow: hidden;
margin: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
<link
href="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.css"
rel="stylesheet"
/>
</head>
<body>
<div id="map"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.8.3/polyfill.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/symbol-es6@0.1.2/symbol-es6.min.js"></script> -->
<script src="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js"></script>
<script src="../dist/l7-dev.js"></script>
<script>
console.log(L7);
const scene = new L7.Scene({
id: "map",
map: new L7.Mapbox({
style: "dark", // 样式URL
center: [108.6167, 19.1000],
pitch: 0,
zoom: 8
})
});
const data = {"list":[{"w":19.1000,"t":24.6000,"s":"海南","l":11,"m":"东方","j":108.6167,"h":"59838"},{"w":20.0000,"t":23.8000,"s":"海南","l":11,"m":"海口","j":110.2500,"h":"59758"},{"w":22.2750,"t":23.6000,"s":"广东","l":12,"m":"珠海","j":113.5669,"h":"59488"},{"w":20.3372,"t":23.4000,"s":"广东","l":12,"m":"徐闻","j":110.1794,"h":"59754"},{"w":19.2089,"t":23.2000,"s":"海南","l":12,"m":"琼海","j":110.4819,"h":"59855"},{"w":21.7358,"t":23.2000,"s":"广东","l":11,"m":"上川岛","j":112.7731,"h":"59673"},{"w":23.3853,"t":23.0000,"s":"广东","l":11,"m":"汕头","j":116.6792,"h":"59316"},{"w":22.5417,"t":23.0000,"s":"广东","l":12,"m":"深圳","j":114.0033,"h":"59493"},{"w":19.5167,"t":22.9000,"s":"海南","l":12,"m":"儋州","j":109.5833,"h":"59845"},{"w":21.1547,"t":22.7000,"s":"广东","l":12,"m":"湛江","j":110.3022,"h":"59658"},{"w":21.4500,"t":22.7000,"s":"广西","l":12,"m":"北海","j":109.1333,"h":"59644"},{"w":22.5000,"t":22.6000,"s":"广东","l":12,"m":"中山","j":113.4000,"h":"59485"},{"w":21.8453,"t":22.6000,"s":"广东","l":12,"m":"阳江","j":111.9783,"h":"59663"},{"w":22.3469,"t":22.6000,"s":"广东","l":12,"m":"信宜","j":110.9250,"h":"59456"},{"w":22.8000,"t":22.5000,"s":"广东","l":12,"m":"汕尾","j":115.3667,"h":"59501"},{"w":23.4275,"t":22.3000,"s":"广东","l":12,"m":"南澳","j":117.0292,"h":"59324"},{"w":22.7100,"t":22.3000,"s":"广东","l":12,"m":"罗定","j":111.6000,"h":"59462"},{"w":19.0333,"t":22.3000,"s":"海南","l":12,"m":"琼中","j":109.8333,"h":"59849"},{"w":21.5458,"t":22.2000,"s":"广东","l":11,"m":"电白","j":110.9886,"h":"59664"},{"w":22.9661,"t":21.9000,"s":"广东","l":12,"m":"东莞","j":113.7389,"h":"59289"},{"w":22.2472,"t":21.8000,"s":"广东","l":12,"m":"台山","j":112.7858,"h":"59478"},{"w":22.9836,"t":21.6000,"s":"广东","l":12,"m":"惠来","j":116.3014,"h":"59317"},{"w":22.9906,"t":21.0000,"s":"广东","l":12,"m":"高要","j":112.4786,"h":"59278"},{"w":23.9000,"t":20.8000,"s":"广西","l":12,"m":"百色","j":106.6000,"h":"59211"},{"w":23.0711,"t":20.4000,"s":"广东","l":12,"m":"惠阳","j":114.3744,"h":"59298"},{"w":23.4497,"t":20.4000,"s":"广东","l":12,"m":"揭西","j":115.8492,"h":"59306"},{"w":23.3353,"t":20.4000,"s":"广东","l":11,"m":"增城","j":113.8275,"h":"59294"},{"w":23.4167,"t":19.9000,"s":"广西","l":12,"m":"那坡","j":105.8333,"h":"59209"},{"w":24.9000,"t":19.7000,"s":"福建","l":11,"m":"崇武","j":118.9167,"h":"59133"},{"w":24.4833,"t":19.7000,"s":"福建","l":12,"m":"厦门","j":118.0667,"h":"59134"},{"w":23.7936,"t":19.6000,"s":"广东","l":12,"m":"河源","j":114.7297,"h":"59293"},{"w":23.7106,"t":19.4000,"s":"广东","l":12,"m":"清远","j":113.0850,"h":"59280"},{"w":23.1000,"t":19.4000,"s":"广西","l":12,"m":"靖西","j":106.4500,"h":"59218"},{"w":23.6000,"t":19.4000,"s":"广西","l":13,"m":"田东","j":107.1167,"h":"59224"},{"w":25.5167,"t":19.2000,"s":"福建","l":12,"m":"平潭","j":119.7833,"h":"58944"},{"w":25.0500,"t":19.2000,"s":"福建","l":12,"m":"龙岩","j":117.0167,"h":"58927"},{"w":23.2100,"t":19.0000,"s":"广东","l":12,"m":"广州","j":113.4822,"h":"59287"},{"w":21.9833,"t":18.9000,"s":"广西","l":12,"m":"钦州","j":108.6000,"h":"59632"}]}
const pointLayer = new L7.PointLayer({})
.source(data.list, {
parser: {
type: "json",
x: "j",
y: "w"
}
})
.shape("cylinder")
.size([5,5,10])
.color("t", [
"#094D4A",
"#146968",
"#1D7F7E",
"#289899",
"#34B6B7",
"#4AC5AF",
"#5FD3A6",
"#7BE39E",
"#A1EDB8",
"#CEF8D6"
])
.style({
opacity: 1.0
});
scene.addLayer(pointLayer);
</script>
</body>
</html>

74
packages/l7/demo/dot.html Normal file
View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>L7 IE</title>
<style>
html,
body {
overflow: hidden;
margin: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
<link
href="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.css"
rel="stylesheet"
/>
</head>
<body>
<div id="map"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.8.3/polyfill.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/symbol-es6@0.1.2/symbol-es6.min.js"></script> -->
<script src="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js"></script>
<script src="../dist/l7-dev.js"></script>
<script>
console.log(L7);
const scene = new L7.Scene({
id: "map",
map: new L7.Mapbox({
style: "dark", // 样式URL
center: [108.6167, 19.1000],
pitch: 0,
zoom: 8
})
});
const data = {"list":[{"w":19.1000,"t":24.6000,"s":"海南","l":11,"m":"东方","j":108.6167,"h":"59838"},{"w":20.0000,"t":23.8000,"s":"海南","l":11,"m":"海口","j":110.2500,"h":"59758"},{"w":22.2750,"t":23.6000,"s":"广东","l":12,"m":"珠海","j":113.5669,"h":"59488"},{"w":20.3372,"t":23.4000,"s":"广东","l":12,"m":"徐闻","j":110.1794,"h":"59754"},{"w":19.2089,"t":23.2000,"s":"海南","l":12,"m":"琼海","j":110.4819,"h":"59855"},{"w":21.7358,"t":23.2000,"s":"广东","l":11,"m":"上川岛","j":112.7731,"h":"59673"},{"w":23.3853,"t":23.0000,"s":"广东","l":11,"m":"汕头","j":116.6792,"h":"59316"},{"w":22.5417,"t":23.0000,"s":"广东","l":12,"m":"深圳","j":114.0033,"h":"59493"},{"w":19.5167,"t":22.9000,"s":"海南","l":12,"m":"儋州","j":109.5833,"h":"59845"},{"w":21.1547,"t":22.7000,"s":"广东","l":12,"m":"湛江","j":110.3022,"h":"59658"},{"w":21.4500,"t":22.7000,"s":"广西","l":12,"m":"北海","j":109.1333,"h":"59644"},{"w":22.5000,"t":22.6000,"s":"广东","l":12,"m":"中山","j":113.4000,"h":"59485"},{"w":21.8453,"t":22.6000,"s":"广东","l":12,"m":"阳江","j":111.9783,"h":"59663"},{"w":22.3469,"t":22.6000,"s":"广东","l":12,"m":"信宜","j":110.9250,"h":"59456"},{"w":22.8000,"t":22.5000,"s":"广东","l":12,"m":"汕尾","j":115.3667,"h":"59501"},{"w":23.4275,"t":22.3000,"s":"广东","l":12,"m":"南澳","j":117.0292,"h":"59324"},{"w":22.7100,"t":22.3000,"s":"广东","l":12,"m":"罗定","j":111.6000,"h":"59462"},{"w":19.0333,"t":22.3000,"s":"海南","l":12,"m":"琼中","j":109.8333,"h":"59849"},{"w":21.5458,"t":22.2000,"s":"广东","l":11,"m":"电白","j":110.9886,"h":"59664"},{"w":22.9661,"t":21.9000,"s":"广东","l":12,"m":"东莞","j":113.7389,"h":"59289"},{"w":22.2472,"t":21.8000,"s":"广东","l":12,"m":"台山","j":112.7858,"h":"59478"},{"w":22.9836,"t":21.6000,"s":"广东","l":12,"m":"惠来","j":116.3014,"h":"59317"},{"w":22.9906,"t":21.0000,"s":"广东","l":12,"m":"高要","j":112.4786,"h":"59278"},{"w":23.9000,"t":20.8000,"s":"广西","l":12,"m":"百色","j":106.6000,"h":"59211"},{"w":23.0711,"t":20.4000,"s":"广东","l":12,"m":"惠阳","j":114.3744,"h":"59298"},{"w":23.4497,"t":20.4000,"s":"广东","l":12,"m":"揭西","j":115.8492,"h":"59306"},{"w":23.3353,"t":20.4000,"s":"广东","l":11,"m":"增城","j":113.8275,"h":"59294"},{"w":23.4167,"t":19.9000,"s":"广西","l":12,"m":"那坡","j":105.8333,"h":"59209"},{"w":24.9000,"t":19.7000,"s":"福建","l":11,"m":"崇武","j":118.9167,"h":"59133"},{"w":24.4833,"t":19.7000,"s":"福建","l":12,"m":"厦门","j":118.0667,"h":"59134"},{"w":23.7936,"t":19.6000,"s":"广东","l":12,"m":"河源","j":114.7297,"h":"59293"},{"w":23.7106,"t":19.4000,"s":"广东","l":12,"m":"清远","j":113.0850,"h":"59280"},{"w":23.1000,"t":19.4000,"s":"广西","l":12,"m":"靖西","j":106.4500,"h":"59218"},{"w":23.6000,"t":19.4000,"s":"广西","l":13,"m":"田东","j":107.1167,"h":"59224"},{"w":25.5167,"t":19.2000,"s":"福建","l":12,"m":"平潭","j":119.7833,"h":"58944"},{"w":25.0500,"t":19.2000,"s":"福建","l":12,"m":"龙岩","j":117.0167,"h":"58927"},{"w":23.2100,"t":19.0000,"s":"广东","l":12,"m":"广州","j":113.4822,"h":"59287"},{"w":21.9833,"t":18.9000,"s":"广西","l":12,"m":"钦州","j":108.6000,"h":"59632"}]}
const pointLayer = new L7.PointLayer({})
.source(data.list, {
parser: {
type: "json",
x: "j",
y: "w"
}
})
.shape("dot")
.size(15)
.color("t", [
"#094D4A",
"#146968",
"#1D7F7E",
"#289899",
"#34B6B7",
"#4AC5AF",
"#5FD3A6",
"#7BE39E",
"#A1EDB8",
"#CEF8D6"
])
.style({
opacity: 1.0
});
scene.addLayer(pointLayer);
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>L7 IE</title>
<style>
html,
body {
overflow: hidden;
margin: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
<link
href="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.css"
rel="stylesheet"
/>
</head>
<body>
<div id="map"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.8.3/polyfill.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/symbol-es6@0.1.2/symbol-es6.min.js"></script> -->
<script src="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js"></script>
<script src="../dist/l7-dev.js"></script>
<script>
console.log(L7);
const scene = new L7.Scene({
id: "map",
map: new L7.Mapbox({
style: "dark", // 样式URL
center: [108.6167, 19.1000],
pitch: 0,
zoom: 8
})
});
const data = {"list":[{"w":19.1000,"t":24.6000,"s":"海南","l":11,"m":"东方","j":108.6167,"h":"59838"},{"w":20.0000,"t":23.8000,"s":"海南","l":11,"m":"海口","j":110.2500,"h":"59758"},{"w":22.2750,"t":23.6000,"s":"广东","l":12,"m":"珠海","j":113.5669,"h":"59488"},{"w":20.3372,"t":23.4000,"s":"广东","l":12,"m":"徐闻","j":110.1794,"h":"59754"},{"w":19.2089,"t":23.2000,"s":"海南","l":12,"m":"琼海","j":110.4819,"h":"59855"},{"w":21.7358,"t":23.2000,"s":"广东","l":11,"m":"上川岛","j":112.7731,"h":"59673"},{"w":23.3853,"t":23.0000,"s":"广东","l":11,"m":"汕头","j":116.6792,"h":"59316"},{"w":22.5417,"t":23.0000,"s":"广东","l":12,"m":"深圳","j":114.0033,"h":"59493"},{"w":19.5167,"t":22.9000,"s":"海南","l":12,"m":"儋州","j":109.5833,"h":"59845"},{"w":21.1547,"t":22.7000,"s":"广东","l":12,"m":"湛江","j":110.3022,"h":"59658"},{"w":21.4500,"t":22.7000,"s":"广西","l":12,"m":"北海","j":109.1333,"h":"59644"},{"w":22.5000,"t":22.6000,"s":"广东","l":12,"m":"中山","j":113.4000,"h":"59485"},{"w":21.8453,"t":22.6000,"s":"广东","l":12,"m":"阳江","j":111.9783,"h":"59663"},{"w":22.3469,"t":22.6000,"s":"广东","l":12,"m":"信宜","j":110.9250,"h":"59456"},{"w":22.8000,"t":22.5000,"s":"广东","l":12,"m":"汕尾","j":115.3667,"h":"59501"},{"w":23.4275,"t":22.3000,"s":"广东","l":12,"m":"南澳","j":117.0292,"h":"59324"},{"w":22.7100,"t":22.3000,"s":"广东","l":12,"m":"罗定","j":111.6000,"h":"59462"},{"w":19.0333,"t":22.3000,"s":"海南","l":12,"m":"琼中","j":109.8333,"h":"59849"},{"w":21.5458,"t":22.2000,"s":"广东","l":11,"m":"电白","j":110.9886,"h":"59664"},{"w":22.9661,"t":21.9000,"s":"广东","l":12,"m":"东莞","j":113.7389,"h":"59289"},{"w":22.2472,"t":21.8000,"s":"广东","l":12,"m":"台山","j":112.7858,"h":"59478"},{"w":22.9836,"t":21.6000,"s":"广东","l":12,"m":"惠来","j":116.3014,"h":"59317"},{"w":22.9906,"t":21.0000,"s":"广东","l":12,"m":"高要","j":112.4786,"h":"59278"},{"w":23.9000,"t":20.8000,"s":"广西","l":12,"m":"百色","j":106.6000,"h":"59211"},{"w":23.0711,"t":20.4000,"s":"广东","l":12,"m":"惠阳","j":114.3744,"h":"59298"},{"w":23.4497,"t":20.4000,"s":"广东","l":12,"m":"揭西","j":115.8492,"h":"59306"},{"w":23.3353,"t":20.4000,"s":"广东","l":11,"m":"增城","j":113.8275,"h":"59294"},{"w":23.4167,"t":19.9000,"s":"广西","l":12,"m":"那坡","j":105.8333,"h":"59209"},{"w":24.9000,"t":19.7000,"s":"福建","l":11,"m":"崇武","j":118.9167,"h":"59133"},{"w":24.4833,"t":19.7000,"s":"福建","l":12,"m":"厦门","j":118.0667,"h":"59134"},{"w":23.7936,"t":19.6000,"s":"广东","l":12,"m":"河源","j":114.7297,"h":"59293"},{"w":23.7106,"t":19.4000,"s":"广东","l":12,"m":"清远","j":113.0850,"h":"59280"},{"w":23.1000,"t":19.4000,"s":"广西","l":12,"m":"靖西","j":106.4500,"h":"59218"},{"w":23.6000,"t":19.4000,"s":"广西","l":13,"m":"田东","j":107.1167,"h":"59224"},{"w":25.5167,"t":19.2000,"s":"福建","l":12,"m":"平潭","j":119.7833,"h":"58944"},{"w":25.0500,"t":19.2000,"s":"福建","l":12,"m":"龙岩","j":117.0167,"h":"58927"},{"w":23.2100,"t":19.0000,"s":"广东","l":12,"m":"广州","j":113.4822,"h":"59287"},{"w":21.9833,"t":18.9000,"s":"广西","l":12,"m":"钦州","j":108.6000,"h":"59632"}]}
const pointLayer = new L7.PointLayer({})
.source(data.list, {
parser: {
type: "json",
x: "j",
y: "w"
}
})
.shape("s",'text')
.size(15)
.color("t", [
"#094D4A",
"#146968",
"#1D7F7E",
"#289899",
"#34B6B7",
"#4AC5AF",
"#5FD3A6",
"#7BE39E",
"#A1EDB8",
"#CEF8D6"
])
.style({
opacity: 1.0
});
scene.addLayer(pointLayer);
</script>
</body>
</html>

View File

@ -22,13 +22,14 @@
"author": "xiaoiver",
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.0.25",
"@antv/l7-core": "^2.0.27-alpha.0",
"@antv/l7-source": "^2.0.27-alpha.0",
"@antv/l7-utils": "^2.0.27-alpha.0",
"@babel/runtime": "^7.7.7",
"@mapbox/martini": "^0.1.0",
"@turf/meta": "^6.0.2",
"d3-array": "^2.3.1",
"d3-array": "2.3.3",
"d3-color": "^1.4.0",
"d3-scale": "^3.1.0",
"earcut": "^2.2.1",
@ -38,8 +39,7 @@
"inversify": "^5.0.1",
"lodash": "^4.17.15",
"merge-json-schemas": "1.0.0",
"reflect-metadata": "^0.1.13",
"tapable": "^2.0.0-beta.8"
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
"@types/d3-array": "^2.0.0",

View File

@ -1,3 +1,5 @@
// @ts-ignore
import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
import {
BlendType,
gl,
@ -45,7 +47,6 @@ import { Container } from 'inversify';
import { isFunction, isObject } from 'lodash';
// @ts-ignore
import mergeJsonSchemas from 'merge-json-schemas';
import { SyncBailHook, SyncHook, SyncWaterfallHook } from 'tapable';
import { normalizePasses } from '../plugins/MultiPassRendererPlugin';
import { BlendTypes } from '../utils/blend';
import baseLayerSchema from './schema';
@ -76,19 +77,19 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
};
// 生命周期钩子
public hooks = {
init: new SyncBailHook<void, boolean | void>(),
afterInit: new SyncBailHook<void, boolean | void>(),
beforeRender: new SyncBailHook<void, boolean | void>(),
beforeRenderData: new SyncWaterfallHook<void | boolean>(['data']),
afterRender: new SyncHook<void>(),
beforePickingEncode: new SyncHook<void>(),
afterPickingEncode: new SyncHook<void>(),
beforeHighlight: new SyncHook<[number[]]>(['pickedColor']),
afterHighlight: new SyncHook<void>(),
beforeSelect: new SyncHook<[number[]]>(['pickedColor']),
afterSelect: new SyncHook<void>(),
beforeDestroy: new SyncHook<void>(),
afterDestroy: new SyncHook<void>(),
init: new SyncBailHook(),
afterInit: new SyncBailHook(),
beforeRender: new SyncBailHook(),
beforeRenderData: new SyncWaterfallHook(),
afterRender: new SyncHook(),
beforePickingEncode: new SyncHook(),
afterPickingEncode: new SyncHook(),
beforeHighlight: new SyncHook(['pickedColor']),
afterHighlight: new SyncHook(),
beforeSelect: new SyncHook(['pickedColor']),
afterSelect: new SyncHook(),
beforeDestroy: new SyncHook(),
afterDestroy: new SyncHook(),
};
// 待渲染 model 列表
@ -522,14 +523,13 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
? options.color
: this.getLayerConfig().highlightColor,
});
this.hooks.beforeSelect.callAsync(
encodePickingColor(id as number) as number[],
() => {
this.hooks.beforeSelect
.call(encodePickingColor(id as number) as number[])
.then(() => {
setTimeout(() => {
this.reRender();
}, 1);
},
);
});
}
}
@ -567,14 +567,13 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
? options.color
: this.getLayerConfig().selectColor,
});
this.hooks.beforeSelect.callAsync(
encodePickingColor(id as number) as number[],
() => {
this.hooks.beforeSelect
.call(encodePickingColor(id as number) as number[])
.then(() => {
setTimeout(() => {
this.reRender();
}, 1);
},
);
});
}
}
public setBlend(type: keyof typeof BlendType): void {
@ -849,7 +848,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
}
public renderModels() {
if (this.layerModelNeedUpdate) {
if (this.layerModelNeedUpdate && this.layerModel) {
this.models = this.layerModel.buildModels();
this.hooks.beforeRender.call();
this.layerModelNeedUpdate = false;

View File

@ -31,17 +31,10 @@ export default class DataMappingPlugin implements ILayerPlugin {
this.generateMaping(layer, { styleAttributeService });
});
layer.hooks.beforeRenderData.tap('DataMappingPlugin', (flag) => {
if (
flag ||
layer.dataState.dataMappingNeedUpdate ||
layer.layerModelNeedUpdate
) {
layer.hooks.beforeRenderData.tap('DataMappingPlugin', () => {
layer.dataState.dataMappingNeedUpdate = false;
this.generateMaping(layer, { styleAttributeService });
return true;
}
return false;
});
// remapping before render

View File

@ -17,7 +17,7 @@ export default class DataSourcePlugin implements ILayerPlugin {
});
// 检测数据不否需要更新
layer.hooks.beforeRenderData.tap('DataSourcePlugin', (flag) => {
layer.hooks.beforeRenderData.tap('DataSourcePlugin', () => {
const neeUpdate1 = this.updateClusterData(layer);
const neeUpdate2 = layer.dataState.dataSourceNeedUpdate;
layer.dataState.dataSourceNeedUpdate = false;

View File

@ -65,15 +65,12 @@ export default class FeatureScalePlugin implements ILayerPlugin {
});
// 检测数据是否需要更新
layer.hooks.beforeRenderData.tap('FeatureScalePlugin', (flag) => {
if (flag) {
layer.hooks.beforeRenderData.tap('FeatureScalePlugin', () => {
this.scaleOptions = layer.getScaleOptions();
const attributes = styleAttributeService.getLayerStyleAttributes();
const { dataArray } = layer.getSource().data;
this.caculateScalesForAttributes(attributes || [], dataArray);
return true;
}
return false;
});
layer.hooks.beforeRender.tap('FeatureScalePlugin', () => {

View File

@ -13,14 +13,12 @@ export default class LayerModelPlugin implements ILayerPlugin {
layer.buildModels();
});
layer.hooks.beforeRenderData.tap('DataSourcePlugin', (flag) => {
layer.hooks.beforeRenderData.tap('DataSourcePlugin', () => {
// 更新Model 配置项
if (flag) {
layer.prepareBuildModel();
// 初始化 Model
layer.buildModels();
layer.layerModelNeedUpdate = false;
}
return false;
});
}

View File

@ -34,7 +34,6 @@ export default class ShaderUniformPlugin implements ILayerPlugin {
this.coordinateSystemService.refresh();
const { width, height } = this.rendererService.getViewportSize();
layer.models.forEach((model) =>
model.addUniforms({
// 相机参数,包含 VP 矩阵、缩放等级

View File

@ -25,15 +25,9 @@ export default class UpdateStyleAttributePlugin implements ILayerPlugin {
this.updateStyleAtrribute(layer, { styleAttributeService });
});
layer.hooks.beforeRenderData.tap('styleAttributeService', (flag) => {
if (flag) {
// styleAttributeService.createAttributesAndIndices(
// layer.getEncodedData(),
// );
layer.hooks.beforeRenderData.tap('styleAttributeService', () => {
layer.layerModelNeedUpdate = true;
return true;
}
return false;
});
layer.hooks.beforeRender.tap('UpdateStyleAttributePlugin', () => {

View File

@ -1,12 +1,10 @@
uniform float u_opacity : 1;
varying vec4 v_color;
#pragma include "picking"
void main() {
gl_FragColor = v_color;
gl_FragColor.a = u_opacity;
gl_FragColor.a =gl_FragColor.a * u_opacity;
gl_FragColor = filterColor(gl_FragColor);
}

View File

@ -4,10 +4,8 @@ uniform mat4 u_ModelMatrix;
attribute float a_Size;
attribute vec4 a_Color;
varying vec4 v_color;
#pragma include "projection"
#pragma include "picking"
void main() {
v_color = a_Color;
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);

View File

@ -32,7 +32,7 @@ export default class ReglTexture2D implements ITexture2D {
premultiplyAlpha = false,
mag = gl.NEAREST,
min = gl.NEAREST,
colorSpace = gl.NONE,
colorSpace = gl.BROWSER_DEFAULT_WEBGL,
} = options;
const textureOptions: regl.Texture2DOptions = {

View File

@ -53,15 +53,15 @@ export default class ReglRendererService implements IRendererService {
// TODO: use extensions
extensions: [
'OES_element_index_uint',
'EXT_blend_minmax',
'OES_standard_derivatives', // wireframe
'WEBGL_depth_texture',
'angle_instanced_arrays', // VSM shadow map
],
optionalExtensions: [
'oes_texture_float_linear',
'OES_texture_float',
'EXT_texture_filter_anisotropic',
'EXT_blend_minmax',
'WEBGL_depth_texture',
],
profile: true,
onDone: (err: Error | null, r?: regl.Regl | undefined): void => {

View File

@ -24,6 +24,7 @@
"author": "lzxue",
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.0.25",
"@antv/l7-core": "^2.0.27-alpha.0",
"@antv/l7-utils": "^2.0.27-alpha.0",
"@babel/runtime": "^7.7.7",
@ -36,8 +37,7 @@
"eventemitter3": "^4.0.0",
"inversify": "^5.0.1",
"lodash": "^4.17.15",
"supercluster": "^6.0.2",
"tapable": "^2.0.0-beta.8"
"supercluster": "^6.0.2"
},
"devDependencies": {
"@types/d3-dsv": "^1.0.36",

View File

@ -1,3 +1,5 @@
// @ts-ignore
import { SyncHook } from '@antv/async-hook';
import {
IClusterOptions,
IMapService,
@ -21,7 +23,6 @@ import { EventEmitter } from 'eventemitter3';
import { Container } from 'inversify';
import { cloneDeep, isFunction, isString } from 'lodash';
import Supercluster from 'supercluster';
import { SyncHook } from 'tapable';
import { getParser, getTransform } from './';
import { statMap } from './utils/statistics';
import { getColumn } from './utils/util';
@ -32,9 +33,7 @@ export default class Source extends EventEmitter {
public extent: BBox;
// 生命周期钩子
public hooks = {
init: new SyncHook(['source']),
layout: new SyncHook(['source']),
update: new SyncHook(['source']),
init: new SyncHook(),
};
public parser: IParserCfg = { type: 'geojson' };
public transforms: ITransform[] = [];

View File

@ -37,7 +37,7 @@ export default class PointImage extends React.Component {
);
let i = 0;
const data = await response.json();
while (i < 1) {
while (i < 50) {
const imageLayer = new PointLayer()
.source(data, {
parser: {
@ -46,10 +46,10 @@ export default class PointImage extends React.Component {
y: 'latitude',
},
})
// .shape('name', ['00', '01', '02'])
.shape('triangle')
.color('red')
.active(false)
.shape('name', ['00', '01', '02'])
// .shape('triangle')
// .color('red')
.active(true)
.size(20);
// imageLayer.on('click', (e) => {
// console.log(e);

View File

@ -7,6 +7,7 @@
"rootDir": "./",
"baseUrl": "./",
"paths": {
"@antv/async-hook": ["packages/async-hook/src"],
"@antv/l7-*": ["packages/*/src"],
"@antv/l7": ["packages/l7/src"],
"*": ["node_modules", "packages"]

182
yarn.lock
View File

@ -2789,13 +2789,13 @@
"@octokit/types" "^2.0.0"
"@octokit/endpoint@^5.5.0":
version "5.5.2"
resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.2.tgz#ed19d01fe85ac58bc2b774661658f9e5429b8164"
integrity sha512-ICDcRA0C2vtTZZGud1nXRrBLXZqFayodXAKZfo3dkdcLNqcHsgaz3YSTupbURusYeucSVRjjG+RTcQhx6HPPcg==
version "5.5.3"
resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.3.tgz#0397d1baaca687a4c8454ba424a627699d97c978"
integrity sha512-EzKwkwcxeegYYah5ukEeAI/gYRLv2Y9U5PpIsseGSFDk+G3RbipQGBs8GuYS1TLCtQaqoO66+aQGtITPalxsNQ==
dependencies:
"@octokit/types" "^2.0.0"
is-plain-object "^3.0.0"
universal-user-agent "^4.0.0"
universal-user-agent "^5.0.0"
"@octokit/plugin-enterprise-rest@^3.6.1":
version "3.6.2"
@ -2832,9 +2832,9 @@
once "^1.4.0"
"@octokit/request@^5.2.0":
version "5.3.1"
resolved "https://registry.npmjs.org/@octokit/request/-/request-5.3.1.tgz#3a1ace45e6f88b1be4749c5da963b3a3b4a2f120"
integrity sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==
version "5.3.2"
resolved "https://registry.npmjs.org/@octokit/request/-/request-5.3.2.tgz#1ca8b90a407772a1ee1ab758e7e0aced213b9883"
integrity sha512-7NPJpg19wVQy1cs2xqXjjRq/RmtSomja/VSWnptfYwuBxLdbYh2UjhGi0Wx7B1v5Iw5GKhfFDQL7jM7SSp7K2g==
dependencies:
"@octokit/endpoint" "^5.5.0"
"@octokit/request-error" "^1.0.1"
@ -2843,7 +2843,7 @@
is-plain-object "^3.0.0"
node-fetch "^2.3.0"
once "^1.4.0"
universal-user-agent "^4.0.0"
universal-user-agent "^5.0.0"
"@octokit/rest@16.43.1", "@octokit/rest@^16.28.4":
version "16.43.1"
@ -2868,9 +2868,9 @@
universal-user-agent "^4.0.0"
"@octokit/types@^2.0.0", "@octokit/types@^2.0.1":
version "2.1.1"
resolved "https://registry.npmjs.org/@octokit/types/-/types-2.1.1.tgz#77e80d1b663c5f1f829e5377b728fa3c4fe5a97d"
integrity sha512-89LOYH+d/vsbDX785NOfLxTW88GjNd0lWRz1DVPVsZgg9Yett5O+3MOvwo7iHgvUwbFz0mf/yPIjBkUbs4kxoQ==
version "2.2.0"
resolved "https://registry.npmjs.org/@octokit/types/-/types-2.2.0.tgz#ddb0a90cf3e9624ae97e09d16f21f4c4a682d3be"
integrity sha512-iEeW3XlkxeM/CObeoYvbUv24Oe+DldGofY+3QyeJ5XKKA6B+V94ePk14EDCarseWdMs6afKZPv3dFq8C+SY5lw==
dependencies:
"@types/node" ">= 8"
@ -3419,6 +3419,11 @@
resolved "https://registry.npmjs.org/@types/amap-js-api/-/amap-js-api-1.4.7.tgz#565342799c14c0b112cfea237aaa4b700360f406"
integrity sha512-YWU1cWVtZ3d25/0rLiVH1ecJfEPRh+WiCShOsDbOa4woW7oP55OCoxKXuvkD+GjePv9Ye7dKR78HtDuF6s+OFQ==
"@types/async@^3.0.8":
version "3.0.8"
resolved "https://registry.npmjs.org/@types/async/-/async-3.0.8.tgz#8c183f149d8cc91f944d58e5594d2a614ceb33ff"
integrity sha512-wIM8bCrHeQHCUyDqJYXyvG8P98YeERaOB1NeOvcjnjlM32pn21S13j6tZqhiWX+nkpU3EvhtE/nuO1ItCpZ+HQ==
"@types/babel__core@^7.1.0":
version "7.1.5"
resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.5.tgz#e4d84704b4df868b3ad538365a13da2fa6dbc023"
@ -3802,9 +3807,9 @@
"@types/react" "*"
"@types/react@*", "@types/react@^16.9.2":
version "16.9.21"
resolved "https://registry.npmjs.org/@types/react/-/react-16.9.21.tgz#99e274e2ecfab6bb93920e918341daa3198b348d"
integrity sha512-xpmenCMeBwJRct8vmIfczlgdOXWIWASoOM857kxKfHlVQvDltRh7IFRVfGws79iO2jkNPXOeWREyKoClzhBaQA==
version "16.9.22"
resolved "https://registry.npmjs.org/@types/react/-/react-16.9.22.tgz#f0288c92d94e93c4b43e3f5633edf788b2c040ae"
integrity sha512-7OSt4EGiLvy0h5R7X+r0c7S739TCU/LvWbkNOrm10lUwNHe7XPz5OLhLOSZeCkqO9JSCly1NkYJ7ODTUqVnHJQ==
dependencies:
"@types/prop-types" "*"
csstype "^2.2.0"
@ -4288,9 +4293,9 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1:
integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==
ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5:
version "6.11.0"
resolved "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz#c3607cbc8ae392d8a5a536f25b21f8e5f3f87fe9"
integrity sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==
version "6.12.0"
resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7"
integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==
dependencies:
fast-deep-equal "^3.1.1"
fast-json-stable-stringify "^2.0.0"
@ -4830,6 +4835,11 @@ async@^2.6.1, async@^2.6.2, async@^2.6.3:
dependencies:
lodash "^4.17.14"
async@^3.1.1:
version "3.1.1"
resolved "https://registry.npmjs.org/async/-/async-3.1.1.tgz#dd3542db03de837979c9ebbca64ca01b06dc98df"
integrity sha512-X5Dj8hK1pJNC2Wzo2Rcp9FBVdJMGRR/S7V+lH46s8GVFhtbo5O4Le5GECCF/8PISVdkUA6mMPvgz7qTTD1rf1g==
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@ -7234,9 +7244,9 @@ copy-descriptor@^0.1.0:
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
copy-to-clipboard@^3.0.8, copy-to-clipboard@^3.2.0:
version "3.2.1"
resolved "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.2.1.tgz#b1a1137100e5665d5a96015cb579e30e90e07c44"
integrity sha512-btru1Q6RD9wbonIvEU5EfnhIRGHLo//BGXQ1hNAD2avIs/nBZlpbOeKtv3mhoUByN4DB9Cb6/vXBymj1S43KmA==
version "3.3.1"
resolved "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae"
integrity sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==
dependencies:
toggle-selection "^1.0.6"
@ -7874,10 +7884,10 @@ cz-conventional-changelog@^3.0.2:
optionalDependencies:
"@commitlint/load" ">6.1.1"
"d3-array@1.2.0 - 2", d3-array@^2.3.1:
version "2.4.0"
resolved "https://registry.npmjs.org/d3-array/-/d3-array-2.4.0.tgz#87f8b9ad11088769c82b5ea846bcb1cc9393f242"
integrity sha512-KQ41bAF2BMakf/HdKT865ALd4cgND6VcIztVQZUTt0+BH3RWy6ZYnHghVXf6NFjt2ritLr8H1T8LreAAlfiNcw==
"d3-array@1.2.0 - 2", d3-array@2.3.3:
version "2.3.3"
resolved "https://registry.npmjs.org/d3-array/-/d3-array-2.3.3.tgz#e90c39fbaedccedf59fc30473092f99a0e14efa2"
integrity sha512-syv3wp0U5aB6toP2zb2OdBkhTy1MWDsCAaYk6OXJZv+G4u7bSWEmYgxLoFyc88RQUhZYGCebW9a9UD1gFi5+MQ==
d3-color@1, d3-color@^1.4.0:
version "1.4.0"
@ -8336,7 +8346,7 @@ detect-indent@^5.0.0:
resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d"
integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50=
detect-libc@^1.0.3:
detect-libc@^1.0.2, detect-libc@^1.0.3:
version "1.0.3"
resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
@ -8794,14 +8804,14 @@ electron-download@^4.1.0:
sumchecker "^2.0.2"
electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.349, electron-to-chromium@^1.3.47:
version "1.3.356"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.356.tgz#fb985ee0f3023e6e11b97547ff3f738bdd8643d2"
integrity sha512-qW4YHMfOFjvx0jkSK2vjaHoLjk1+uJIV5tqtLDo7P5y3/kM8KQP23YBU0Y5fCSW4jIbDvEzeHDaY4+4vEaqqOw==
version "1.3.359"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.359.tgz#198d44baf90a432c0afab9c1edec87a3031ddec9"
integrity sha512-ewZp4BQftbLclBwmFYoTrlyiLMXQTiYeqh1hn24sWao9bGhUHzQtpytymN8JsenWlQ9SbBWynTPvfghb0Ipn1Q==
electron@^6.0.7:
version "6.1.7"
resolved "https://registry.npmjs.org/electron/-/electron-6.1.7.tgz#a67695f81f5cb771e395bcf9711560520e347c54"
integrity sha512-QhBA/fcYJit2XJGkD2xEfxlWTtTaWYu7qkKVohtVWXpELFqkpel2DCDxet5BTo0qs8ukuZHxlQPnIonODnl2bw==
version "6.1.8"
resolved "https://registry.npmjs.org/electron/-/electron-6.1.8.tgz#5bc8e4db4f860526f9a98db00597a6fc7c57ecea"
integrity sha512-crrWUBTfGbNYh7riijx+SYLOj6j6R1M+OnP0p5tGhb4bUFBt3Xaf2oATTLIeJlCRD8CRRMUgxwsVkHVqBKmP2Q==
dependencies:
"@types/node" "^10.12.18"
electron-download "^4.1.0"
@ -9879,9 +9889,9 @@ fast-glob@^2.0.2, fast-glob@^2.2.6:
micromatch "^3.1.10"
fast-glob@^3.0.3:
version "3.2.1"
resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.1.tgz#c5aaea632f92543b744bdcb19f11efd49e56c7b3"
integrity sha512-XObtOQLTl4EptWcBbO9O6wd17VlVf9YXYY/zuzuu7nZfTsv4BL3KupMAMUVzH88CUwWkI3uNHBfxtfU8PveVTQ==
version "3.2.2"
resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz#ade1a9d91148965d4bf7c51f72e1ca662d32e63d"
integrity sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
@ -10202,12 +10212,12 @@ find-cache-dir@^2.0.0, find-cache-dir@^2.1.0:
pkg-dir "^3.0.0"
find-cache-dir@^3.0.0, find-cache-dir@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz#e7fe44c1abc1299f516146e563108fd1006c1874"
integrity sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==
version "3.3.0"
resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.0.tgz#4d74ed1fe9ef1731467ca24378e8f8f5c8b6ed11"
integrity sha512-PtXtQb7IrD8O+h6Cq1dbpJH5NzD8+9keN1zZ0YlpDzl1PwXEJEBj6u1Xa92t1Hwluoozd9TNKul5Hi2iqpsWwg==
dependencies:
commondir "^1.0.1"
make-dir "^3.0.0"
make-dir "^3.0.2"
pkg-dir "^4.1.0"
find-file-up@^0.1.2:
@ -11436,9 +11446,9 @@ github-from-package@0.0.0:
integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=
github-slugger@^1.2.1:
version "1.2.1"
resolved "https://registry.npmjs.org/github-slugger/-/github-slugger-1.2.1.tgz#47e904e70bf2dccd0014748142d31126cfd49508"
integrity sha512-SsZUjg/P03KPzQBt7OxJPasGw6NRO5uOgiZ5RGXVud5iSIZ0eNZeNp5rTwCxtavrRUa/A77j8mePVc5lEvk0KQ==
version "1.3.0"
resolved "https://registry.npmjs.org/github-slugger/-/github-slugger-1.3.0.tgz#9bd0a95c5efdfc46005e82a906ef8e2a059124c9"
integrity sha512-gwJScWVNhFYSRDvURk/8yhcFBee6aFjye2a7Lhb2bUyRulpIoek9p0I9Kt7PT67d/nUlZbFu8L9RLiA0woQN8Q==
dependencies:
emoji-regex ">=6.0.0 <=6.1.1"
@ -12570,7 +12580,7 @@ i18next@^19.0.0:
dependencies:
"@babel/runtime" "^7.3.1"
iconv-lite@0.4, iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@~0.4.13:
iconv-lite@0.4, iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
version "0.4.24"
resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
@ -15246,7 +15256,7 @@ make-dir@^2.0.0, make-dir@^2.1.0:
pify "^4.0.1"
semver "^5.6.0"
make-dir@^3.0.0:
make-dir@^3.0.0, make-dir@^3.0.2:
version "3.0.2"
resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392"
integrity sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==
@ -15462,14 +15472,14 @@ mdast-util-to-nlcst@^3.2.0:
vfile-location "^2.0.0"
mdast-util-to-string@^1.0.5, mdast-util-to-string@^1.0.7:
version "1.0.7"
resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.0.7.tgz#62d8e9c6b2113070d8b497c7dc35bf12796f06ee"
integrity sha512-P+gdtssCoHOX+eJUrrC30Sixqao86ZPlVjR5NEAoy0U79Pfxb1Y0Gntei0+GrnQD4T04X9xA8tcugp90cSmNow==
version "1.0.8"
resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.0.8.tgz#a414cee45ad4bef93a60f32f48266d43e263d88f"
integrity sha512-GBracya0dOzckEEizUBzfrkWRLCHMsppuU97LPUriY9kWnYyGFWTx4VDW+sUcj2LneBz/Tp1aYp3aUCibzjtWg==
mdast-util-toc@^5.0:
version "5.0.1"
resolved "https://registry.npmjs.org/mdast-util-toc/-/mdast-util-toc-5.0.1.tgz#5b218b8eedcf1668537bd0f6f65f8b6a6abfa50e"
integrity sha512-icdxfPSLPJuK0Qd7w2+X9qcsPl9fVdpiEAjhS4zBp7WbNhpkorodXPUG0ZG4N5E++q4+IidV2boJpcCF985xlA==
version "5.0.2"
resolved "https://registry.npmjs.org/mdast-util-toc/-/mdast-util-toc-5.0.2.tgz#5d16eeb4e4af8d9d8d9f6837d012a6334eeffd97"
integrity sha512-IeihbQLXrnCs/427dVzCp3ffvSPpdx/Mc2WWYAdVaS+MFqdKZHlJylGWAA1cGPewhEVyITsWrlXJ/b2d80Wsnw==
dependencies:
"@types/mdast" "^3.0.3"
"@types/unist" "^2.0.3"
@ -16153,6 +16163,15 @@ nearley@^2.7.10:
randexp "0.4.6"
semver "^5.4.1"
needle@^2.2.1:
version "2.3.2"
resolved "https://registry.npmjs.org/needle/-/needle-2.3.2.tgz#3342dea100b7160960a450dc8c22160ac712a528"
integrity sha512-DUzITvPVDUy6vczKKYTnWc/pBZ0EnjMJnQ3y+Jo5zfKFimJs7S3HFCxCRZYB9FUZcrzUQr3WsmvZgddMEIZv6w==
dependencies:
debug "^3.2.6"
iconv-lite "^0.4.4"
sax "^1.2.4"
negotiator@0.6.2:
version "0.6.2"
resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
@ -16368,10 +16387,26 @@ node-object-hash@^2.0.0:
resolved "https://registry.npmjs.org/node-object-hash/-/node-object-hash-2.0.0.tgz#9971fcdb7d254f05016bd9ccf508352bee11116b"
integrity sha512-VZR0zroAusy1ETZMZiGeLkdu50LGjG5U1KHZqTruqtTyQ2wfWhHG2Ow4nsUbfTFGlaREgNHcCWoM/OzEm6p+NQ==
node-pre-gyp@*:
version "0.14.0"
resolved "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==
dependencies:
detect-libc "^1.0.2"
mkdirp "^0.5.1"
needle "^2.2.1"
nopt "^4.0.1"
npm-packlist "^1.1.6"
npmlog "^4.0.2"
rc "^1.2.7"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^4.4.2"
node-releases@^1.1.29, node-releases@^1.1.49:
version "1.1.49"
resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.49.tgz#67ba5a3fac2319262675ef864ed56798bb33b93e"
integrity sha512-xH8t0LS0disN0mtRCh+eByxFPie+msJUBL/lJDBuap53QGiYPa9joh83K4pCZgWJ+2L4b9h88vCVdXQ60NO2bg==
version "1.1.50"
resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.50.tgz#803c40d2c45db172d0410e4efec83aa8c6ad0592"
integrity sha512-lgAmPv9eYZ0bGwUYAKlr8MG6K4CvWliWqnkcT2P8mMAgVrH3lqfBPorFlxiG1pHQnqmavJZ9vbMXUTNyMLbrgQ==
dependencies:
semver "^6.3.0"
@ -16553,7 +16588,7 @@ npm-package-arg@^5.1.2:
semver "^5.1.0"
validate-npm-package-name "^3.0.0"
npm-packlist@^1.4.4:
npm-packlist@^1.1.6, npm-packlist@^1.4.4:
version "1.4.8"
resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e"
integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==
@ -16615,7 +16650,7 @@ npm-run-path@^4.0.0:
dependencies:
path-key "^3.0.0"
"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.1, npmlog@^4.1.2:
"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.1, npmlog@^4.0.2, npmlog@^4.1.2:
version "4.1.2"
resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
@ -19280,13 +19315,14 @@ rc-upload@~2.9.1:
warning "4.x"
rc-util@^4.0.4, rc-util@^4.1.1, rc-util@^4.13.0, rc-util@^4.15.3, rc-util@^4.15.7, rc-util@^4.16.1, rc-util@^4.3.0, rc-util@^4.4.0, rc-util@^4.5.0, rc-util@^4.5.1, rc-util@^4.6.0:
version "4.19.0"
resolved "https://registry.npmjs.org/rc-util/-/rc-util-4.19.0.tgz#f3b5e3a02cc0a667d127784068e1236c095dbcbf"
integrity sha512-mptALlLwpeczS3nrv83DbwJNeupolbuvlIEjcvimSiWI8NUBjpF0HgG3kWp1RymiuiRCNm9yhaXqDz0a99dpgQ==
version "4.20.0"
resolved "https://registry.npmjs.org/rc-util/-/rc-util-4.20.0.tgz#fb601c59bb48cbee38538e0d5b628addda6a8c30"
integrity sha512-rUqk4RqtDe4OfTsSk2GpbvIQNVtfmmebw4Rn7ZAA1TO1zLMLfyOF78ZyrEKqs8RDwoE3S1aXp0AX0ogLfSxXrQ==
dependencies:
add-dom-event-listener "^1.1.0"
babel-runtime "6.x"
prop-types "^15.5.10"
react-is "^16.12.0"
react-lifecycles-compat "^3.0.4"
shallowequal "^1.1.0"
@ -20079,9 +20115,9 @@ relateurl@0.2.x, relateurl@^0.2.7:
integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=
release-it@^12.4.3:
version "12.6.0"
resolved "https://registry.npmjs.org/release-it/-/release-it-12.6.0.tgz#5b86870e84badb4b5992a54ba0f821719c2c66e2"
integrity sha512-5Q8cb1Md7CcBwMEARpTXPJdsAV6AGnxYMrURK4L91+vEQ5LK7MBn3LTijvcrhhLnvf7Lti7kUp3DmRiN790geg==
version "12.6.1"
resolved "https://registry.npmjs.org/release-it/-/release-it-12.6.1.tgz#85136c07751308d67225da16c4dc6ff5db9b683f"
integrity sha512-6sXt4TkmYuOnp2IY3DUKW2L/XEy+Xh9ylLtqmRWe5SIimvDLufGwQ1iPVjUvEaOdLrUV/mnGT5Vvuf6TcfgDQw==
dependencies:
"@iarna/toml" "2.2.3"
"@octokit/rest" "16.43.1"
@ -20556,9 +20592,9 @@ rollup-plugin-babel@^4.3.3:
rollup-pluginutils "^2.8.1"
rollup-plugin-postcss@^2.0.3:
version "2.0.6"
resolved "https://registry.npmjs.org/rollup-plugin-postcss/-/rollup-plugin-postcss-2.0.6.tgz#7e1c4e299e42cca170de7b789ecdd405a154c5a6"
integrity sha512-DTfIoKoC6ljQA4MmrPVbjnumWFx9tZAylDnduIhwJy9JQsq0iiVFmHy0c4cM//h7Auhf1RGB3FLqFuyNUcnExQ==
version "2.1.1"
resolved "https://registry.npmjs.org/rollup-plugin-postcss/-/rollup-plugin-postcss-2.1.1.tgz#39b9b7c5da91741631b3a07ad1622a3477b307f4"
integrity sha512-A9G3VGnWwfjlb5REp992+9NEosY0KdrysXYytNFCy107+QlZaRzIgHQYwBQ67BYlV8K4t0Yk2ukySFQceneUKA==
dependencies:
chalk "^2.4.2"
concat-with-sourcemaps "^1.0.5"
@ -22439,11 +22475,6 @@ tapable@^1.0.0, tapable@^1.1.3:
resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
tapable@^2.0.0-beta.8:
version "2.0.0-beta.9"
resolved "https://registry.npmjs.org/tapable/-/tapable-2.0.0-beta.9.tgz#638496fb27b53e69c21a0e6a4435afbe805845cb"
integrity sha512-+VBUuZXh+WIHnKOeo+A27SB/1sHTVWozcKweDIAhB/XOGnr8cy6ULZjU+qpGxO/G4xEyWCCaWTX/HPEkGg3Xrg==
tape@^4.5.1:
version "4.13.0"
resolved "https://registry.npmjs.org/tape/-/tape-4.13.0.tgz#e2f581ff5f12a7cbd787e9f83c76c2851782fce2"
@ -22518,7 +22549,7 @@ tar@^2.0.0:
fstream "^1.0.12"
inherits "2"
tar@^4.4.10, tar@^4.4.12, tar@^4.4.8:
tar@^4.4.10, tar@^4.4.12, tar@^4.4.2, tar@^4.4.8:
version "4.4.13"
resolved "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==
@ -23464,9 +23495,16 @@ unist-util-visit@^2.0.0:
unist-util-visit-parents "^3.0.0"
universal-user-agent@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz#27da2ec87e32769619f68a14996465ea1cb9df16"
integrity sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==
version "4.0.1"
resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz#fd8d6cb773a679a709e967ef8288a31fcc03e557"
integrity sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==
dependencies:
os-name "^3.1.0"
universal-user-agent@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz#a3182aa758069bf0e79952570ca757de3579c1d9"
integrity sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==
dependencies:
os-name "^3.1.0"