fix(src): lint err

This commit is contained in:
thinkinggis 2019-08-01 20:40:09 +08:00
parent 740f1c15f6
commit ca6044a873
15 changed files with 28 additions and 65 deletions

3
.gitignore vendored
View File

@ -76,3 +76,6 @@ demos/image
demos/hexagon.html
demos/model
testdemo
webpack-dev.config.js
webpack.config.js
.si.yml

View File

@ -78,3 +78,6 @@ src
temp
webpack-dev.config.js
webpack.config.js
testdemo
rollup
.si.yml

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7",
"version": "1.2.0",
"version": "1.2.2",
"description": "Large-scale WebGL-powered Geospatial Data Visualization",
"main": "build/l7.js",
"browser": "build/l7.js",
@ -65,11 +65,11 @@
"worker-loader": "^2.0.0"
},
"scripts": {
"build-dev": "rollup -c --environment BUILD:dev && npm run demos-web",
"build-dev": "rollup -c --environment BUILD:dev",
"watch-dev": "rollup -c --environment BUILD:dev --watch & npm run demos-web ",
"build-prod": "rollup -c --environment BUILD:production",
"build-prod-min": "rollup -c --environment BUILD:production,MINIFY:true",
"build": "webpack",
"build": "rollup -c --environment BUILD:production",
"build-lib": "babel src --out-dir lib",
"bundler": "electron ./bundler/app.js",
"ci": "npm run lint && npm run test",
@ -83,7 +83,7 @@
"demos": "electron ./demos/app.js",
"demos-web": "node ./demos/app.js --web --port 2046",
"dev": "npm run watch & npm run demos-web",
"dist": "npm run mkdir-dist && npm run build && npm run compress",
"dist": "npm run build-dev && npm run build-prod && npm run build-prod-min",
"lint": "eslint --ext .html,.js ./",
"lint-fix": "eslint --ext .html,.js --fix ./",
"mkdir-dist": "node ./bin/mkdir-dist.js",

View File

@ -13,8 +13,8 @@ const production = BUILD === 'production';
const outputFile = !production
? 'build/L7.js'
: minified
? 'build/l7.js'
: 'build/l7-unminified.js';
? 'build/L7-min.js'
: 'build/L7-unminified.js';
const config = [
{

View File

@ -1,6 +1,5 @@
import Util from '../../util';
import * as THREE from '../three';
import pickingFragmentShader from '../engine/picking/picking_frag.glsl';
import { updateObjecteUniform, destoryObject } from '../../util/object3d-util';
export default class PickContoller {
constructor(cfg) {

View File

@ -1,7 +1,6 @@
import Base from '../core/base';
import WorkerPool from '../worker/worker_pool';
import throttle from '../util/throttle';
import { toLngLat, Bounds } from '@antv/geo-coord';
import SourceCache from '../source/source_cache';
import WorkerController from '../worker/worker_controller';
// 统一管理所有的Source

View File

@ -13,7 +13,6 @@ import ArcLineBuffer from './line/arcline';
// heatmap
import Grid3D from './heatmap/grid_3d';
import Hexagon3D from './heatmap/hexagon_3d';
// 3D Shape

View File

@ -166,4 +166,4 @@ function computeNormal(v1, v2, v3) {
cb.normalize();
const { x, y, z } = cb;
return [ x, y, z ];
};
}

View File

@ -2,7 +2,6 @@
import Material from './material';
import * as THREE from '../../core/three';
import { getModule } from '../../util/shaderModule';
import picking_frag from '../../core/engine/picking//picking_frag.glsl';
export default class PointMaterial extends Material {
getDefaultParameters() {
return {

View File

@ -1,7 +1,6 @@
import { destoryObject, updateObjecteUniform } from '../../util/object3d-util';
import * as THREE from '../../core/three';
import MaskMaterial from '../../geom/material/tile/maskMaterial';
import { aProjectFlat } from '../../geo/project';
import { toLngLatBounds, toBounds } from '@antv/geo-coord';
import { getRender } from '../render/index';
const r2d = 180 / Math.PI;

View File

@ -36,9 +36,9 @@ export default class Worker {
}
callback();
}
updateLayers(id, params, callback) {
// updateLayers(id, params, callback) {
}
// }
/**
* 获取workerSource
* @param {string} mapId WorkerPool Id

File diff suppressed because one or more lines are too long

View File

@ -1,35 +0,0 @@
import { expect } from 'chai';
import hexagonBuffer from '../../../../../src/geom/buffer/heatmap/hexagon';
describe('hexagon heatMap buffer', () => {
const layerData = [
{ color: [ 1, 1, 0, 1 ], coordinates: [ 120.12063099925889, 30.263947783103486, 0 ], id: 1 },
{ color: [ 1, 0.5, 0, 1 ], coordinates: [ 120.12218696039365, 30.263947783103486, 0 ], id: 2 },
{
color: [ 1, 0.1, 0, 1 ],
coordinates: [ 120.12374292152843, 30.263947783103486, 0 ],
id: 3
},
{ color: [ 1, 0, 0.2, 1 ], coordinates: [ 120.1252988826632, 30.263947783103486, 0 ], id: 4 },
{
color: [ 0, 1, 0, 1 ],
coordinates: [ 120.12607686323062, 30.263947783103486, 0 ],
id: 5
},
{
color: [ 1, 1, 0, 1 ],
coordinates: [ 120.12685484379799, 30.263947783103486, 0 ],
id: 6
},
{ color: [ 1, 1, 1, 1 ], coordinates: [ 120.12841080493274, 30.263947783103486, 0 ], id: 7 },
{ color: [ 0, 1, 1, 1 ], coordinates: [ 120.13230070776972, 30.263947783103486, 0 ], id: 8 },
{ color: [ 0, 1, 0, 1 ], coordinates: [ 120.12763282436538, 30.263947783103486, 0 ], id: 9 },
{ color: [ 1, 1, 0, 1 ], coordinates: [ 120.12996676606754, 30.263947783103486, 0 ], id: 10 }
];
it('hexagon buffer', () => {
const attribute = hexagonBuffer(layerData);
expect(attribute.colors.length).eql(480);
expect(attribute.miter.length).eql(240);
expect(attribute.pickingIds.length).eql(120);
expect(attribute.vertices.length).eql(360);
});
});

View File

@ -1,13 +1,10 @@
import { expect } from 'chai';
import FillBuffer from '../../../../../src/geom/buffer/polygon/fill_buffer';
import { layerData } from '../../../../asset/data/layer_data';
describe('FillBuffer', () => {
it('fill buffer', () => {
console.time('buffer');
const fillBuffer = new FillBuffer({
layerData
});
console.timeEnd('buffer');
console.log(fillBuffer);
});
});
// import { expect } from 'chai';
// import FillBuffer from '../../../../../src/geom/buffer/polygon/fill_buffer';
// import { layerData } from '../../../../asset/data/layer_data';
// describe('FillBuffer', () => {
// it('fill buffer', () => {
// const fillBuffer = new FillBuffer({
// layerData
// });
// });
// });