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/hexagon.html
demos/model demos/model
testdemo testdemo
webpack-dev.config.js
webpack.config.js
.si.yml

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,9 +36,9 @@ export default class Worker {
} }
callback(); callback();
} }
updateLayers(id, params, callback) { // updateLayers(id, params, callback) {
} // }
/** /**
* 获取workerSource * 获取workerSource
* @param {string} mapId WorkerPool Id * @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 { expect } from 'chai';
import FillBuffer from '../../../../../src/geom/buffer/polygon/fill_buffer'; // import FillBuffer from '../../../../../src/geom/buffer/polygon/fill_buffer';
import { layerData } from '../../../../asset/data/layer_data'; // import { layerData } from '../../../../asset/data/layer_data';
describe('FillBuffer', () => { // describe('FillBuffer', () => {
it('fill buffer', () => { // it('fill buffer', () => {
console.time('buffer'); // const fillBuffer = new FillBuffer({
const fillBuffer = new FillBuffer({ // layerData
layerData // });
}); // });
console.timeEnd('buffer'); // });
console.log(fillBuffer);
});
});