修复所有eslint报错。

This commit is contained in:
tengge1 2020-03-07 21:11:25 +08:00
parent 25e1a75110
commit 1900250df7
63 changed files with 164 additions and 128 deletions

View File

@ -5,8 +5,10 @@
"plugin:react/recommended"
],
"parser": "babel-eslint",
"ecmaFeatures": {
"jsx": true
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react"
@ -19,6 +21,11 @@
"es6": true,
"worker": true
},
"settings": {
"react": {
"version": "16.8.6"
}
},
"rules": {
"eqeqeq": 2,
"comma-dangle": 1,

View File

@ -113,16 +113,18 @@ Object.assign(History.prototype, {
history.undos = [];
history.redos = [];
var i;
// Append Undos to History
for (var i = 0; i < this.undos.length; i++) {
if (this.undos[i].hasOwnProperty("json")) {
for (i = 0; i < this.undos.length; i++) {
if (Object.prototype.hasOwnProperty.call(this.undos[i], "json")) {
history.undos.push(this.undos[i].json);
}
}
// Append Redos to History
for (var i = 0; i < this.redos.length; i++) {
if (this.redos[i].hasOwnProperty("json")) {
for (i = 0; i < this.redos.length; i++) {
if (Object.prototype.hasOwnProperty.call(this.redos[i], "json")) {
history.redos.push(this.redos[i].json);
}
}
@ -133,9 +135,11 @@ Object.assign(History.prototype, {
fromJSON: function (json) {
if (json === undefined) return;
for (var i = 0; i < json.undos.length; i++) {
var cmdJSON = json.undos[i];
var cmd = new window[cmdJSON.type](); // creates a new object of type "json.type"
var i = 0, cmdJSON, cmd;
for (i = 0; i < json.undos.length; i++) {
cmdJSON = json.undos[i];
cmd = new window[cmdJSON.type](); // creates a new object of type "json.type"
cmd.json = cmdJSON;
cmd.id = cmdJSON.id;
cmd.name = cmdJSON.name;
@ -143,9 +147,9 @@ Object.assign(History.prototype, {
this.idCounter = cmdJSON.id > this.idCounter ? cmdJSON.id : this.idCounter; // set last used idCounter
}
for (var i = 0; i < json.redos.length; i++) {
var cmdJSON = json.redos[i];
var cmd = new window[cmdJSON.type](); // creates a new object of type "json.type"
for (i = 0; i < json.redos.length; i++) {
cmdJSON = json.redos[i];
cmd = new window[cmdJSON.type](); // creates a new object of type "json.type"
cmd.json = cmdJSON;
cmd.id = cmdJSON.id;
cmd.name = cmdJSON.name;
@ -174,13 +178,15 @@ Object.assign(History.prototype, {
cmd = this.redo();
}
} else {
while (true) {
while (true) { // eslint-disable-line
cmd = this.undos[this.undos.length - 1]; // next cmd to pop
if (cmd === undefined || id === cmd.id) break;
if (cmd === undefined || id === cmd.id) {
break;
}
cmd = this.undo();
}
}
app.call('historyChanged', this, cmd);
},
@ -197,7 +203,7 @@ Object.assign(History.prototype, {
var cmd = this.redo();
while (cmd !== undefined) {
if (!cmd.hasOwnProperty("json")) {
if (!Object.prototype.hasOwnProperty.call(cmd, "json")) {
cmd.json = cmd.toJSON();
}
cmd = this.redo();

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 移动物体命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param newParent THREE.Object3D
* @param newBefore THREE.Object3D
* @param {THREE.Object3D} object 当前物体
* @param {THREE.Object3D} newParent 新的父要素
* @param {THREE.Object3D} newBefore 旧的父要素
* @constructor
*/
function MoveObjectCommand(object, newParent, newBefore) {

View File

@ -4,7 +4,7 @@ import Command from './Command';
* 同时执行多种命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param cmdArray array containing command objects
* @param {Array} cmdArray array containing command objects
* @constructor
*/
function MultiCmdsCommand(cmdArray) {

View File

@ -4,7 +4,7 @@ import Command from './Command';
* 移除物体命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param {THREE.Object3D} object 物体
* @constructor
*/
function RemoveObjectCommand(object) {
@ -28,7 +28,7 @@ Object.assign(RemoveObjectCommand.prototype, {
constructor: RemoveObjectCommand,
execute: function () {
var scope = this.editor;
// var scope = this.editor;
this.parent.remove(this.object);
@ -40,7 +40,7 @@ Object.assign(RemoveObjectCommand.prototype, {
},
undo: function () {
var scope = this.editor;
// var scope = this.editor;
this.parent.children.splice(this.index, 0, this.object);
this.object.parent = this.parent;

View File

@ -4,8 +4,8 @@ import Command from './Command';
* 移除脚本命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param script javascript object
* @param {THREE.Object3D} object 物体
* @param {String} script 脚本
* @constructor
*/
function RemoveScriptCommand(object, script) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置颜色命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param attributeName string
* @param newValue integer representing a hex color value
* @param {THREE.Object3D} object 物体
* @param {String} attributeName 属性名称
* @param {Object} newValue HEX颜色值
* @constructor
*/
function SetColorCommand(object, attributeName, newValue) {

View File

@ -4,8 +4,8 @@ import Command from './Command';
* 设置几何体命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param newGeometry THREE.Geometry
* @param {THREE.Object3D} object 物体
* @param {THREE.Geometry} newGeometry 几何体
* @constructor
*/
function SetGeometryCommand(object, newGeometry) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置几何体值命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param attributeName string
* @param newValue number, string, boolean or object
* @param {THREE.Object3D} object 物体
* @param {String} attributeName 属性名称
* @param {Object} newValue number, string, boolean or object
* @constructor
*/
function SetGeometryValueCommand(object, attributeName, newValue) {

View File

@ -6,9 +6,9 @@ let color = new THREE.Color();
* 设置材质颜色命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param attributeName string
* @param newValue integer representing a hex color value or a hex string startsWith `#`
* @param {THREE.Object3D} object 物体
* @param {String} attributeName 属性名称
* @param {String} newValue integer representing a hex color value or a hex string startsWith `#`
* @constructor
*/
function SetMaterialColorCommand(object, attributeName, newValue) {

View File

@ -4,8 +4,8 @@ import Command from './Command';
* 设置材质命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param newMaterial THREE.Material
* @param {THREE.Object3D} object 物体
* @param {THREE.Material} newMaterial 新材质
* @constructor
*/
function SetMaterialCommand(object, newMaterial) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置材质纹理命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param mapName string
* @param newMap THREE.Texture
* @param {THREE.Object3D} object 物体
* @param {String} mapName 属性名称
* @param {THREE.Texture} newMap 新纹理
* @constructor
*/
function SetMaterialMapCommand(object, mapName, newMap) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置材质值命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param attributeName string
* @param newValue number, string, boolean or object
* @param {THREE.Object3D} object 物体
* @param {String} attributeName 属性名称
* @param {String} newValue number, string, boolean or object
* @constructor
*/
function SetMaterialValueCommand(object, attributeName, newValue) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置位置命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param newPosition THREE.Vector3
* @param optionalOldPosition THREE.Vector3
* @param {THREE.Object3D} object 物体
* @param {THREE.Vector3} newPosition 新位置
* @param {THREE.Vector3} optionalOldPosition 可选旧位置
* @constructor
*/
function SetPositionCommand(object, newPosition, optionalOldPosition) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置旋转命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param newRotation THREE.Euler
* @param optionalOldRotation THREE.Euler
* @param {THREE.Object3D} object 物体
* @param {THREE.Euler} newRotation 新欧拉角
* @param {THREE.Euler} optionalOldRotation 可选旧欧拉角
* @constructor
*/
function SetRotationCommand(object, newRotation, optionalOldRotation) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置缩放命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param newScale THREE.Vector3
* @param optionalOldScale THREE.Vector3
* @param {THREE.Object3D} object 物体
* @param {THREE.Vector3} newScale 新缩放
* @param {THREE.Vector3} optionalOldScale 可选旧缩放
* @constructor
*/
function SetScaleCommand(object, newScale, optionalOldScale) {

View File

@ -7,7 +7,7 @@ import AddObjectCommand from './AddObjectCommand';
* 设置场景命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param scene containing children to import
* @param {THREE.Scene} scene containing children to import
* @constructor
*/
function SetSceneCommand(scene) {

View File

@ -4,12 +4,12 @@ import Command from './Command';
* 设置脚本值命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param script javascript object
* @param attributeName string
* @param newValue string, object
* @param cursorPosition javascript object with format {line: 2, ch: 3}
* @param scrollInfo javascript object with values {left, top, width, height, clientWidth, clientHeight}
* @param {THREE.Object3D} object THREE.Object3D
* @param {String} script javascript object
* @param {String} attributeName string
* @param {Object} newValue string, object
* @param {Object} cursorPosition javascript object with format {line: 2, ch: 3}
* @param {Object} scrollInfo javascript object with values {left, top, width, height, clientWidth, clientHeight}
* @constructor
*/
function SetScriptValueCommand(object, script, attributeName, newValue, cursorPosition, scrollInfo) {

View File

@ -4,8 +4,8 @@ import Command from './Command';
* 设置uuid命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param newUuid string
* @param {THREE.Object3D} object 物体
* @param {String} newUuid 新的UUID
* @constructor
*/
function SetUuidCommand(object, newUuid) {

View File

@ -4,9 +4,9 @@ import Command from './Command';
* 设置值命令
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
* @param object THREE.Object3D
* @param attributeName string
* @param newValue number, string, boolean or object
* @param {THREE.Object3D} object 物体
* @param {String} attributeName 属性名称
* @param {String} newValue number, string, boolean or object
* @constructor
*/
function SetValueCommand(object, attributeName, newValue) {

View File

@ -55,7 +55,7 @@ OrthographicCameraControls.prototype.onMouseMove = function (event) {
return;
}
let camera = this.camera;
// let camera = this.camera;
let width = this.domElement.clientWidth;
let height = this.domElement.clientHeight;
@ -73,7 +73,7 @@ OrthographicCameraControls.prototype.onMouseMove = function (event) {
this.offsetXY.set(event.offsetX, event.offsetY);
};
OrthographicCameraControls.prototype.onMouseUp = function (event) {
OrthographicCameraControls.prototype.onMouseUp = function () {
this.isDown = false;
};

View File

@ -159,7 +159,7 @@ PhysicsEngine.prototype.updatePhysicsWorld = function () {
PhysicsEngine.prototype.createRigidBody = function (obj) {
let position = obj.position;
let quaternion = obj.quaternion;
let scale = obj.scale;
// let scale = obj.scale;
let physics = obj.userData.physics;
let shape = physics.shape;

View File

@ -3,10 +3,9 @@ import BaseEvent from '../BaseEvent';
/**
* 拖动事件
* @author tengge / https://github.com/tengge1
* @param {*} app
*/
function DraggableEvent(app) {
BaseEvent.call(this, app);
function DraggableEvent() {
BaseEvent.call(this);
}
DraggableEvent.prototype = Object.create(BaseEvent.prototype);

View File

@ -2,7 +2,7 @@ import Renderer from './Renderer';
import BackgroundRenderer from './BackgroundRenderer';
import SunRenderer from './SunRenderer';
import TiledLayerRenderer from './TiledLayerRenderer';
import AtmosphereRenderer from './AtmosphereRenderer';
// import AtmosphereRenderer from './AtmosphereRenderer';
/**
* 所有渲染器

View File

@ -1,7 +1,7 @@
import Renderer from './Renderer';
import SunVertex from './shader/sun_vertex.glsl';
import SunFragment from './shader/sun_fragment.glsl';
import WGS84 from '../core/WGS84';
// import WGS84 from '../core/WGS84';
/**
* 太阳渲染器

View File

@ -2,7 +2,7 @@ import Renderer from './Renderer';
import SphereTileCreator from '../tile/SphereTileCreator';
import TiledVertex from './shader/tiled_vertex.glsl';
import TiledFragment from './shader/tiled_fragment.glsl';
import WGS84 from '../core/WGS84';
// import WGS84 from '../core/WGS84';
/**
* 瓦片图层渲染器

View File

@ -1,4 +1,4 @@
import WGS84 from '../core/WGS84';
// import WGS84 from '../core/WGS84';
import GeoUtils from '../utils/GeoUtils';
/**

View File

@ -1,5 +1,5 @@
import HeightmapFragmentShader from './shader/heightmap_fragment.glsl';
import SmoothFragmentShader from './shader/smooth_fragment.glsl';
// import SmoothFragmentShader from './shader/smooth_fragment.glsl';
import WaterVertexShader from './shader/water_vertex.glsl';
/**
@ -76,11 +76,11 @@ function Water(renderer) {
console.error(error);
}
var smoothShader = gpuCompute.createShaderMaterial(SmoothFragmentShader, {
texture: {
value: null
}
});
// var smoothShader = gpuCompute.createShaderMaterial(SmoothFragmentShader, {
// texture: {
// value: null
// }
// });
this.heightmapVariable = heightmapVariable;
this.gpuCompute = gpuCompute;
@ -99,7 +99,7 @@ Water.prototype.fillTexture = function (texture, WIDTH) {
var waterMaxHeight = 30;
function noise(x, y, z) {
function noise(x, y) {
var multR = waterMaxHeight;
var mult = 0.025;
var r = 0;

View File

@ -3,8 +3,8 @@ import PlayerComponent from '../PlayerComponent';
/**
* 按z键扔球事件
* @param {*} app 播放器
* @param {*} world
* @param {*} rigidBodies
* @param {*} world 物理世界
* @param {*} rigidBodies 刚体
*/
function ThrowBallEvent(app, world, rigidBodies) {
PlayerComponent.call(this, app);

View File

@ -2,7 +2,8 @@
* The ANGLE_instanced_arrays extension is part of the WebGL API and
* allows to draw the same object, or groups of similar objects multiple
* times, if they share the same vertex data, primitive count and type.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays
*/
function ANGLE_instanced_arrays(gl) {

View File

@ -2,7 +2,8 @@
* The EXT_blend_minmax extension is part of the WebGL API and
* extends blending capabilities by adding two new blend equations:
* the minimum or maximum color components of the source and destination colors.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_blend_minmax
*/
function EXT_blend_minmax(gl) {

View File

@ -1,7 +1,8 @@
/**
* The EXT_color_buffer_half_float extension is part of the WebGL API and
* adds the ability to render to 16-bit floating-point color buffers.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_color_buffer_half_float
*/
function EXT_color_buffer_half_float(gl) {

View File

@ -2,7 +2,8 @@
* The EXT_disjoint_timer_query extension is part of the WebGL API and
* provides a way to measure the duration of a set of GL commands, without
* stalling the rendering pipeline.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_disjoint_timer_query
*/
function EXT_disjoint_timer_query(gl) {

View File

@ -2,7 +2,8 @@
* The EXT_frag_depth extension is part of the WebGL API and
* enables to set a depth value of a fragment from within the
* fragment shader.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth
*/
function EXT_frag_depth(gl) {

View File

@ -1,7 +1,8 @@
/**
* The EXT_sRGB extension is part of the WebGL API and
* adds sRGB support to textures and framebuffer objects.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_sRGB
*/
function EXT_sRGB(gl) {

View File

@ -2,7 +2,8 @@
* The EXT_shader_texture_lod extension is part of the WebGL API and
* adds additional texture functions to the OpenGL ES Shading Language
* which provide the shader writer with explicit control of LOD (Level of detail).
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_shader_texture_lod
*/
function EXT_shader_texture_lod(gl) {

View File

@ -1,7 +1,8 @@
/**
* The EXT_texture_filter_anisotropic extension is part of the WebGL API and
* exposes two constants for anisotropic filtering (AF).
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_filter_anisotropic
*/
function EXT_texture_filter_anisotropic(gl) {

View File

@ -1,7 +1,8 @@
/**
* The OES_element_index_uint extension is part of the WebGL API and
* adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements().
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/OES_element_index_uint
*/
function OES_element_index_uint(gl) {

View File

@ -1,7 +1,8 @@
/**
* The OES_standard_derivatives extension is part of the WebGL API and
* adds the GLSL derivative functions dFdx, dFdy, and fwidth.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/OES_standard_derivatives
*/
function OES_standard_derivatives(gl) {

View File

@ -1,7 +1,8 @@
/**
* The OES_texture_float extension is part of the WebGL API and
* exposes floating-point pixel types for textures.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float
*/
function OES_texture_float(gl) {

View File

@ -1,7 +1,8 @@
/**
* The OES_texture_float_linear extension is part of the WebGL API and
* allows linear filtering with floating-point pixel types for textures.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float_linear
*/
function OES_texture_float_linear(gl) {

View File

@ -2,7 +2,8 @@
* The OES_texture_half_float extension is part of the WebGL API and
* adds texture formats with 16- (aka half float) and 32-bit floating-point
* components.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_half_float
*/
function OES_texture_half_float(gl) {

View File

@ -1,7 +1,8 @@
/**
* The OES_texture_half_float_linear extension is part of the WebGL API and
* allows linear filtering with half floating-point pixel types for textures.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_half_float_linear
*/
function OES_texture_half_float_linear(gl) {

View File

@ -3,7 +3,8 @@
* provides vertex array objects (VAOs) which encapsulate vertex array states.
* These objects keep pointers to vertex data and provide names for different
* sets of vertex data.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/OES_vertex_array_object
*/
function OES_vertex_array_object(gl) {

View File

@ -1,7 +1,8 @@
/**
* The WEBGL_color_buffer_float extension is part of the WebGL API and
* adds the ability to render to 32-bit floating-point color buffers.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_color_buffer_float
*/
function WEBGL_color_buffer_float(gl) {

View File

@ -1,7 +1,8 @@
/**
* The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and
* exposes four S3TC compressed texture formats.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc
*/
function WEBGL_compressed_texture_s3tc(gl) {

View File

@ -1,7 +1,8 @@
/**
* The WEBGL_compressed_texture_s3tc_srgb extension is part of the WebGL API and
* exposes four S3TC compressed texture formats for the sRGB colorspace.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_compressed_texture_s3tc_srgb
*/
function WEBGL_compressed_texture_s3tc_srgb(gl) {

View File

@ -2,7 +2,8 @@
* The WEBGL_debug_renderer_info extension is part of the WebGL API and
* exposes two constants with information about the graphics driver for
* debugging purposes.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info
*/
function WEBGL_debug_renderer_info(gl) {

View File

@ -1,7 +1,8 @@
/**
* The WEBGL_debug_shaders extension is part of the WebGL API and
* exposes a method to debug shaders from privileged contexts.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_shaders
*/
function WEBGL_debug_shaders(gl) {

View File

@ -1,7 +1,8 @@
/**
* The WEBGL_depth_texture extension is part of the WebGL API and
* defines 2D depth and depth-stencil textures.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_depth_texture
*/
function WEBGL_depth_texture(gl) {

View File

@ -2,7 +2,8 @@
* The WEBGL_draw_buffers extension is part of the WebGL API and
* enables a fragment shader to write to several textures, which
* is useful for deferred shading, for example.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_draw_buffers
*/
function WEBGL_draw_buffers(gl) {

View File

@ -1,7 +1,8 @@
/**
* The WEBGL_lose_context extension is part of the WebGL API and
* exposes functions to simulate losing and restoring a WebGLRenderingContext.
* @param {*} gl
* @param {*} gl WebGL
* @returns {*} Extension
* @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context
*/
function WEBGL_lose_context(gl) {

View File

@ -19,7 +19,7 @@ BaseComponent.prototype.setTranslate = null;
* 渲染组件
* @param {SVGElement} parent 父组件
*/
BaseComponent.prototype.render = function (parent) {
BaseComponent.prototype.render = function (parent) { // eslint-disable-line
};
@ -34,7 +34,7 @@ BaseComponent.prototype.toJSON = function () {
* json转组件
* @param {Object} json JSON字符串反序列化后的对象
*/
BaseComponent.prototype.fromJSON = function (json) {
BaseComponent.prototype.fromJSON = function (json) { // eslint-disable-line
};

View File

@ -155,8 +155,8 @@ ChordGraph.prototype.render = function (parent) {
return function (g, i) {
gInner.selectAll('.innerPath')
.filter(function (d) {
return d.source.index != i &&
d.target.index != i;
return d.source.index !== i &&
d.target.index !== i;
})
.transition()
.style('opacity', opacity);

View File

@ -68,7 +68,7 @@ Histogram.prototype.render = function (parent) {
.attr('y', function (d) {
return 133.6 - d;
})
.attr('width', function (d) {
.attr('width', function () {
return 10;
})
.attr('height', function (d) {

View File

@ -61,7 +61,7 @@ Histogram2.prototype.render = function (parent) {
.domain([0, d3.max(dataset)])
.range([0, yAxisWidth]);
var rect = g.selectAll('rect')
g.selectAll('rect')
.data(dataset)
.enter()
.append('rect')
@ -78,7 +78,7 @@ Histogram2.prototype.render = function (parent) {
return yScale(d);
});
var text = g.selectAll('text')
g.selectAll('text')
.data(dataset)
.enter()
.append('text')

View File

@ -79,7 +79,7 @@ PackDiagram.prototype.render = function (parent) {
var pack = d3.pack()
.size([width, height])
.radius(function (d) {
.radius(function () {
return 30;
})
.padding(5);

View File

@ -89,8 +89,8 @@ PartitionDiagram.prototype.render = function (parent) {
}]
};
var width = 800;
var height = 500;
// var width = 800;
// var height = 500;
var hierarchy = d3.hierarchy(city);

View File

@ -86,10 +86,10 @@ ScatterPlot.prototype.render = function (parent) {
left: 40
};
var width = xAxisWidth + padding.left + padding.right;
// var width = xAxisWidth + padding.left + padding.right;
var height = yAxisWidth + padding.top + padding.bottom;
var circle = g.selectAll('circle')
g.selectAll('circle')
.data(center)
.enter()
.append('circle')

View File

@ -2,7 +2,7 @@ import Component from './Component';
/**
* 条形图
* @param {*} options
* @param {*} options 配置
*/
function BarChart(options) {
Component.call(this, options);

View File

@ -2,7 +2,7 @@ import Component from './Component';
/**
* 面板
* @param {*} options
* @param {*} options 配置
*/
function Panel(options) {
Component.call(this, options);

View File

@ -2,7 +2,7 @@ import Component from './Component';
/**
* 侧边栏
* @param {*} options
* @param {*} options 配置
*/
function Sidebar(options) {
Component.call(this, options);
@ -70,12 +70,12 @@ Sidebar.prototype.render = function () {
.attr('fill', 'none');
// 选项卡
var tabDef = defs.append('path')
defs.append('path')
.attr('id', 'tabDef')
.attr('d', 'M0,0 L32,22 L32,60 L0,38 Z')
.attr('fill', '#6c6f6e');
var tabSelectDef = defs.append('path')
defs.append('path')
.attr('id', 'tabSelectDef')
.attr('d', 'M0,0 L32,22 L32,60 L0,38 Z')
.attr('fill', '#356899');
@ -299,7 +299,7 @@ Sidebar.prototype.render = function () {
.attr('font-size', 14);
// 中等面板
var mediumPanelDef = defs.append('path')
defs.append('path')
.attr('id', 'mediumPanelDef')
.attr('d', 'M5,0 L160,0 L166,6 L166,33 L158,38 L158,91 L166,96 L166,125 L158,130 L5,130 L0,125 L0,96 L5,91 L5,36 L0,33 L0,6 Z')
.attr('fill', 'rgba(0,0,0,0.5)');
@ -510,7 +510,7 @@ Sidebar.prototype.render = function () {
.attr('fill', 'rgba(0,0,0,0.5)');
// 标签
var labelDef = defs.append('path')
defs.append('path')
.attr('id', 'labelDef')
.attr('d', 'M11,0 L72,0 L85,12 L72,24 L11,24 L0,12 Z')
.attr('fill', 'rgba(23,29,48,0.5)');
@ -535,7 +535,7 @@ Sidebar.prototype.render = function () {
.attr('y', function (d) {
return 133.6 - d;
})
.attr('width', function (d) {
.attr('width', function () {
return 10;
})
.attr('height', function (d) {
@ -601,7 +601,7 @@ Sidebar.prototype.render = function () {
.attr('stroke-width', 2)
.attr('fill', 'none');
var label = linechart.append('g')
label = linechart.append('g')
.attr('transform', 'translate(117,140)');
label.append('use')

View File

@ -1,5 +1,6 @@
/**
* 通用拖动事件
* @returns {Object} 拖动事件
*/
function Drag() {
var drag = d3.drag()