Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zrender

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zrender - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

src/.eslintrc.yaml

7

lib/config.js

@@ -13,6 +13,5 @@ var dpr = 1; // If in browser environment

/**
* debug日志选项:catchBrushException为true下有效
* 0 : 不生成debug数据,发布用
* 1 : 异常抛出,调试用
* 2 : 控制台输出,调试用
* Debug log mode:
* 0: Do nothing, for release.
* 1: console.error, for debug.
*/

@@ -19,0 +18,0 @@

@@ -8,2 +8,4 @@ /**

*/
/* global wx */
var env = {};

@@ -10,0 +12,0 @@

@@ -5,19 +5,9 @@ var _config = require("../config");

var log = function () {};
var logError = function () {};
if (debugMode === 1) {
log = function () {
for (var k in arguments) {
throw new Error(arguments[k]);
}
};
} else if (debugMode > 1) {
log = function () {
for (var k in arguments) {
console.log(arguments[k]);
}
};
logError = console.error;
}
var _default = log;
var _default = logError;
module.exports = _default;

@@ -5,2 +5,4 @@ /**

*/
/* global Float32Array */
var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;

@@ -7,0 +9,0 @@ /**

@@ -21,2 +21,4 @@ var curve = require("./curve");

// TODO getTotalLength, getPointAtLength
/* global Float32Array */
var CMD = {

@@ -660,5 +662,8 @@ M: 1,

var d = this.data;
var x0, y0;
var xi, yi;
var x, y;
var x0;
var y0;
var xi;
var yi;
var x;
var y;
var ux = this._ux;

@@ -665,0 +670,0 @@ var uy = this._uy;

@@ -330,3 +330,5 @@ // https://github.com/mziccard/node-timsort

var _minGallop = minGallop;
var count1, count2, exit;
var count1;
var count2;
var exit;

@@ -333,0 +335,0 @@ while (1) {

@@ -247,3 +247,5 @@ /**

for (var prop in clazzPrototype) {
clazz.prototype[prop] = clazzPrototype[prop];
if (clazzPrototype.hasOwnProperty(prop)) {
clazz.prototype[prop] = clazzPrototype[prop];
}
}

@@ -522,2 +524,3 @@

function eqNaN(value) {
/* eslint-disable-next-line no-self-compare */
return value !== value;

@@ -665,2 +668,3 @@ }

context !== void 0 && (cb = bind(cb, context));
/* eslint-disable guard-for-in */

@@ -670,2 +674,4 @@ for (var key in this.data) {

}
/* eslint-enable guard-for-in */
},

@@ -672,0 +678,0 @@ // Do not use this method if performance sensitive.

@@ -0,1 +1,2 @@

/* global Float32Array */
var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;

@@ -2,0 +3,0 @@ /**

@@ -545,2 +545,3 @@ var _util = require("../../core/util");

exports.getFill = getFill;
exports.parsePercent = parsePercent;
exports.needDrawText = needDrawText;

@@ -284,2 +284,3 @@ var zrUtil = require("../core/util");

for (var key in state[propName]) {
/* eslint-disable max-depth */
if (!state[propName].hasOwnProperty(key)) {

@@ -294,3 +295,5 @@ continue;

}
/* eslint-enable max-depth */
propPathMap[path] = 1;

@@ -297,0 +300,0 @@ animatingCount += self._animProp(state, propName, key, transitionCfg, animationDone);

@@ -84,4 +84,4 @@ var fixShadow = require("./helper/fixShadow");

* `false`/`null`/`undefined` are the same.
* `false` is used to remove lineDash in some
* case that `null`/`undefined` can not be set.
* `false` is used to remove lineDash in some
* case that `null`/`undefined` can not be set.
* (e.g., emphasis.lineStyle in echarts)

@@ -88,0 +88,0 @@ * @type {Array.<number>|boolean}

@@ -82,4 +82,6 @@ var util = require("./core/util");

domStyle['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)';
domStyle['padding'] = 0;
domStyle['margin'] = 0;
domStyle['padding'] = 0; // eslint-disable-line dot-notation
domStyle['margin'] = 0; // eslint-disable-line dot-notation
domStyle['border-width'] = 0;

@@ -86,0 +88,0 @@ }

var Animator = require("../animation/Animator");
var log = require("../core/log");
var logError = require("../core/log");

@@ -68,3 +68,3 @@ var _util = require("../core/util");

if (!target) {
log('Property "' + path + '" is not existed in element ' + el.id);
logError('Property "' + path + '" is not existed in element ' + el.id);
return;

@@ -71,0 +71,0 @@ }

@@ -7,3 +7,3 @@ var _config = require("./config");

var log = require("./core/log");
var logError = require("./core/log");

@@ -561,3 +561,3 @@ var BoundingRect = require("./core/BoundingRect");

if (layersMap[zlevel]) {
log('ZLevel ' + zlevel + ' has been used already');
logError('ZLevel ' + zlevel + ' has been used already');
return;

@@ -568,3 +568,3 @@ } // Check if is a valid layer

if (!isLayerValid(layer)) {
log('Layer of zlevel ' + zlevel + ' is not valid');
logError('Layer of zlevel ' + zlevel + ' is not valid');
return;

@@ -701,3 +701,3 @@ }

if (!layer.__builtin__) {
log('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);
logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);
}

@@ -704,0 +704,0 @@

@@ -338,8 +338,8 @@ var _core = require("./core");

var verticalAlign = style.textVerticalAlign;
textRect = textContain.getBoundingRect(text, font, align, verticalAlign, style.textPadding, style.textLineHeight);
textRect = textContain.getBoundingRect(text, font, align, verticalAlign, style.textPadding, style.textLineHeight, false, style.truncate);
var lineHeight = textRect.lineHeight; // Text position represented by coord
if (textPosition instanceof Array) {
x = rect.x + textPosition[0];
y = rect.y + textPosition[1];
x = rect.x + textHelper.parsePercent(textPosition[0], rect.width);
y = rect.y + textHelper.parsePercent(textPosition[1], rect.height);
} else {

@@ -400,3 +400,4 @@ var newPos = el.calculateTextPosition ? el.calculateTextPosition(tmpTextPositionResult, style, rect) : textContain.calculateTextPosition(tmpTextPositionResult, style, rect);

var textLines = text.split('\n');
var contentBlock = textContain.parsePlainText(text, font, textPadding, lineHeight, style.truncate);
var textLines = contentBlock.lines;
var nTextLines = textLines.length;

@@ -403,0 +404,0 @@ var textAnchor = align; // PENDING

@@ -5,3 +5,3 @@ var Definable = require("./Definable");

var zrLog = require("../../core/log");
var logError = require("../../core/log");

@@ -83,3 +83,3 @@ var colorTool = require("../../tool/color");

} else {
zrLog('Illegal gradient type.');
logError('Illegal gradient type.');
return null;

@@ -142,3 +142,3 @@ } // Set dom id with gradient id, since each gradient instance

} else {
zrLog('Illegal gradient type.');
logError('Illegal gradient type.');
return;

@@ -145,0 +145,0 @@ }

@@ -130,3 +130,6 @@ var Definable = require("./Definable");

var offsetX, offsetY, blur, color;
var offsetX;
var offsetY;
var blur;
var color;

@@ -133,0 +136,0 @@ if (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY) {

@@ -7,3 +7,3 @@ var _core = require("./core");

var zrLog = require("../core/log");
var logError = require("../core/log");

@@ -66,9 +66,8 @@ var Path = require("../graphic/Path");

}
}
} // function append(parent, child) {
// if (checkParentAvailable(parent, child)) {
// parent.appendChild(child);
// }
// }
function append(parent, child) {
if (checkParentAvailable(parent, child)) {
parent.appendChild(child);
}
}

@@ -352,3 +351,3 @@ function remove(parent, child) {

return function () {
zrLog('In SVG mode painter not support method "' + method + '"');
logError('In SVG mode painter not support method "' + method + '"');
};

@@ -355,0 +354,0 @@ } // Unsuppoted methods

@@ -1,2 +0,2 @@

var zrLog = require("../core/log");
var logError = require("../core/log");

@@ -166,3 +166,3 @@ var vmlCore = require("./core");

return function () {
zrLog('In IE8.0 VML mode painter not support method "' + method + '"');
logError('In IE8.0 VML mode painter not support method "' + method + '"');
};

@@ -169,0 +169,0 @@ } // Unsupported methods

@@ -36,3 +36,3 @@ var guid = require("./core/guid");

var version = '4.1.0';
var version = '4.1.1';
/**

@@ -39,0 +39,0 @@ * Initializing a zrender instance

{
"name": "zrender",
"version": "4.1.0",
"version": "4.1.1",
"description": "A lightweight canvas library.",

@@ -17,3 +17,4 @@ "keywords": [

"dev": "node build/build.js --watch",
"test": "node build/build.js"
"test": "node build/build.js",
"lint": "./node_modules/.bin/eslint src"
},

@@ -32,4 +33,5 @@ "license": "BSD-3-Clause",

"rollup": "0.50.0",
"rollup-plugin-uglify": "2.0.1"
"rollup-plugin-uglify": "2.0.1",
"eslint": "6.3.0"
}
}

@@ -15,6 +15,5 @@ var dpr = 1;

/**
* debug日志选项:catchBrushException为true下有效
* 0 : 不生成debug数据,发布用
* 1 : 异常抛出,调试用
* 2 : 控制台输出,调试用
* Debug log mode:
* 0: Do nothing, for release.
* 1: console.error, for debug.
*/

@@ -21,0 +20,0 @@ export var debugMode = 0;

@@ -9,2 +9,4 @@ /**

/* global wx */
var env = {};

@@ -11,0 +13,0 @@

import {debugMode} from '../config';
var log = function () {
var logError = function () {
};
if (debugMode === 1) {
log = function () {
for (var k in arguments) {
throw new Error(arguments[k]);
}
};
logError = console.error;
}
else if (debugMode > 1) {
log = function () {
for (var k in arguments) {
console.log(arguments[k]);
}
};
}
export default log;
export default logError;

@@ -6,2 +6,4 @@ /**

/* global Float32Array */
var ArrayCtor = typeof Float32Array === 'undefined'

@@ -8,0 +10,0 @@ ? Array

@@ -11,2 +11,4 @@ /**

/* global Float32Array */
import * as curve from './curve';

@@ -689,5 +691,8 @@ import * as vec2 from './vector';

var d = this.data;
var x0, y0;
var xi, yi;
var x, y;
var x0;
var y0;
var xi;
var yi;
var x;
var y;
var ux = this._ux;

@@ -694,0 +699,0 @@ var uy = this._uy;

@@ -248,3 +248,6 @@ // https://github.com/mziccard/node-timsort

if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) {
if (
(n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])
|| (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])
) {
if (runLength[n - 1] < runLength[n + 1]) {

@@ -339,3 +342,5 @@ n--;

var _minGallop = minGallop;
var count1, count2, exit;
var count1;
var count2;
var exit;

@@ -342,0 +347,0 @@ while (1) {

@@ -248,3 +248,5 @@ /**

for (var prop in clazzPrototype) {
clazz.prototype[prop] = clazzPrototype[prop];
if (clazzPrototype.hasOwnProperty(prop)) {
clazz.prototype[prop] = clazzPrototype[prop];
}
}

@@ -501,2 +503,3 @@ clazz.prototype.constructor = clazz;

export function eqNaN(value) {
/* eslint-disable-next-line no-self-compare */
return value !== value;

@@ -646,5 +649,7 @@ }

context !== void 0 && (cb = bind(cb, context));
/* eslint-disable guard-for-in */
for (var key in this.data) {
this.data.hasOwnProperty(key) && cb(this.data[key], key);
}
/* eslint-enable guard-for-in */
},

@@ -651,0 +656,0 @@ // Do not use this method if performance sensitive.

@@ -0,1 +1,2 @@

/* global Float32Array */

@@ -2,0 +3,0 @@ var ArrayCtor = typeof Float32Array === 'undefined'

@@ -565,3 +565,3 @@

function parsePercent(value, maxValue) {
export function parsePercent(value, maxValue) {
if (typeof value === 'string') {

@@ -568,0 +568,0 @@ if (value.lastIndexOf('%') >= 0) {

@@ -296,2 +296,3 @@ /**

for (var key in state[propName]) {
/* eslint-disable max-depth */
if (!state[propName].hasOwnProperty(key)) {

@@ -304,2 +305,3 @@ continue;

}
/* eslint-enable max-depth */
propPathMap[path] = 1;

@@ -306,0 +308,0 @@ animatingCount += self._animProp(

@@ -93,4 +93,4 @@

* `false`/`null`/`undefined` are the same.
* `false` is used to remove lineDash in some
* case that `null`/`undefined` can not be set.
* `false` is used to remove lineDash in some
* case that `null`/`undefined` can not be set.
* (e.g., emphasis.lineStyle in echarts)

@@ -97,0 +97,0 @@ * @type {Array.<number>|boolean}

@@ -74,4 +74,4 @@ /**

domStyle['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)';
domStyle['padding'] = 0;
domStyle['margin'] = 0;
domStyle['padding'] = 0; // eslint-disable-line dot-notation
domStyle['margin'] = 0; // eslint-disable-line dot-notation
domStyle['border-width'] = 0;

@@ -78,0 +78,0 @@ }

import Animator from '../animation/Animator';
import log from '../core/log';
import logError from '../core/log';
import {

@@ -65,3 +65,3 @@ isString,

if (!target) {
log(
logError(
'Property "'

@@ -68,0 +68,0 @@ + path

import {devicePixelRatio} from './config';
import * as util from './core/util';
import log from './core/log';
import logError from './core/log';
import BoundingRect from './core/BoundingRect';

@@ -53,3 +53,3 @@ import timsort from './core/timsort';

// displayable.__clipPaths can only be `null`/`undefined` or an non-empty array.
if (clipPaths === prevClipPaths) {
if (clipPaths === prevClipPaths) {
return false;

@@ -583,3 +583,3 @@ }

if (layersMap[zlevel]) {
log('ZLevel ' + zlevel + ' has been used already');
logError('ZLevel ' + zlevel + ' has been used already');
return;

@@ -589,3 +589,3 @@ }

if (!isLayerValid(layer)) {
log('Layer of zlevel ' + zlevel + ' is not valid');
logError('Layer of zlevel ' + zlevel + ' is not valid');
return;

@@ -724,7 +724,10 @@ }

else {
layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);
layer = this.getLayer(
zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0),
this._needsManuallyCompositing
);
}
if (!layer.__builtin__) {
log('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);
logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);
}

@@ -731,0 +734,0 @@

@@ -356,3 +356,4 @@ // TODO

text, font, align,
verticalAlign, style.textPadding, style.textLineHeight
verticalAlign, style.textPadding, style.textLineHeight,
false, style.truncate
);

@@ -363,4 +364,4 @@

if (textPosition instanceof Array) {
x = rect.x + textPosition[0];
y = rect.y + textPosition[1];
x = rect.x + textHelper.parsePercent(textPosition[0], rect.width);
y = rect.y + textHelper.parsePercent(textPosition[1], rect.height);
}

@@ -427,3 +428,6 @@ else {

var textLines = text.split('\n');
var contentBlock = textContain.parsePlainText(
text, font, textPadding, lineHeight, style.truncate);
var textLines = contentBlock.lines;
var nTextLines = textLines.length;

@@ -430,0 +434,0 @@ var textAnchor = align;

@@ -8,3 +8,3 @@ /**

import * as zrUtil from '../../core/util';
import zrLog from '../../core/log';
import logError from '../../core/log';
import * as colorTool from '../../tool/color';

@@ -96,3 +96,3 @@

else {
zrLog('Illegal gradient type.');
logError('Illegal gradient type.');
return null;

@@ -162,3 +162,3 @@ }

else {
zrLog('Illegal gradient type.');
logError('Illegal gradient type.');
return;

@@ -165,0 +165,0 @@ }

@@ -148,3 +148,6 @@ /**

// TODO: textBoxShadowBlur is not supported yet
var offsetX, offsetY, blur, color;
var offsetX;
var offsetY;
var blur;
var color;
if (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY) {

@@ -151,0 +154,0 @@ offsetX = style.shadowOffsetX || 0;

@@ -8,3 +8,3 @@ /**

import * as util from '../core/util';
import zrLog from '../core/log';
import logError from '../core/log';
import Path from '../graphic/Path';

@@ -62,7 +62,7 @@ import ZImage from '../graphic/Image';

function append(parent, child) {
if (checkParentAvailable(parent, child)) {
parent.appendChild(child);
}
}
// function append(parent, child) {
// if (checkParentAvailable(parent, child)) {
// parent.appendChild(child);
// }
// }

@@ -400,3 +400,3 @@ function remove(parent, child) {

return function () {
zrLog('In SVG mode painter not support method "' + method + '"');
logError('In SVG mode painter not support method "' + method + '"');
};

@@ -403,0 +403,0 @@ }

@@ -133,7 +133,13 @@ import LRU from '../core/LRU';

function setRgba(out, r, g, b, a) {
out[0] = r; out[1] = g; out[2] = b; out[3] = a;
out[0] = r;
out[1] = g;
out[2] = b;
out[3] = a;
return out;
}
function copyRgba(out, a) {
out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3];
out[0] = a[0];
out[1] = a[1];
out[2] = a[2];
out[3] = a[3];
return out;

@@ -140,0 +146,0 @@ }

@@ -7,3 +7,3 @@ /**

import zrLog from '../core/log';
import logError from '../core/log';
import * as vmlCore from './core';

@@ -191,3 +191,3 @@ import {each} from '../core/util';

return function () {
zrLog('In IE8.0 VML mode painter not support method "' + method + '"');
logError('In IE8.0 VML mode painter not support method "' + method + '"');
};

@@ -194,0 +194,0 @@ }

@@ -31,3 +31,3 @@ /*!

*/
export var version = '4.1.0';
export var version = '4.1.1';

@@ -34,0 +34,0 @@ /**

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc