Socket
Socket
Sign inDemoInstall

zrender

Package Overview
Dependencies
Maintainers
13
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 5.3.1 to 5.3.2

lib/graphic/helper/dashStyle.d.ts

14

lib/canvas/helper.js

@@ -0,1 +1,4 @@

function isSafeNum(num) {
return isFinite(num);
}
export function createLinearGradient(ctx, obj, rect) {

@@ -12,6 +15,6 @@ var x = obj.x == null ? 0 : obj.x;

}
x = isNaN(x) ? 0 : x;
x2 = isNaN(x2) ? 1 : x2;
y = isNaN(y) ? 0 : y;
y2 = isNaN(y2) ? 0 : y2;
x = isSafeNum(x) ? x : 0;
x2 = isSafeNum(x2) ? x2 : 1;
y = isSafeNum(y) ? y : 0;
y2 = isSafeNum(y2) ? y2 : 0;
var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);

@@ -32,2 +35,5 @@ return canvasGradient;

}
x = isSafeNum(x) ? x : 0.5;
y = isSafeNum(y) ? y : 0.5;
r = r >= 0 && isSafeNum(r) ? r : 0.5;
var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);

@@ -34,0 +40,0 @@ return canvasGradient;

@@ -28,6 +28,6 @@ import LRU from '../../core/LRU.js';

else {
var image_1 = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad);
image_1.__zrImageSrc = newImageOrSrc;
globalImageCache.put(newImageOrSrc, image_1.__cachedImgObj = {
image: image_1,
image = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad);
image.__zrImageSrc = newImageOrSrc;
globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {
image: image,
pending: [pendingWrap]

@@ -34,0 +34,0 @@ });

@@ -85,5 +85,5 @@ /*!

export declare function registerPainter(name: string, Ctor: PainterBaseCtor): void;
export declare const version = "5.3.0";
export declare const version = "5.3.2";
export interface ZRenderType extends ZRender {
}
export {};

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

}
export var version = '5.3.0';
export var version = '5.3.2';
;
{
"name": "zrender",
"version": "5.3.1",
"version": "5.3.2",
"description": "A lightweight graphic library providing 2d draw for Apache ECharts",

@@ -5,0 +5,0 @@ "keywords": [

@@ -7,2 +7,7 @@ import { LinearGradientObject } from '../graphic/LinearGradient';

function isSafeNum(num: number) {
// NaN、Infinity、undefined、'xx'
return isFinite(num);
}
export function createLinearGradient(

@@ -27,6 +32,6 @@ this: void,

// Fix NaN when rect is Infinity
x = isNaN(x) ? 0 : x;
x2 = isNaN(x2) ? 1 : x2;
y = isNaN(y) ? 0 : y;
y2 = isNaN(y2) ? 0 : y2;
x = isSafeNum(x) ? x : 0;
x2 = isSafeNum(x2) ? x2 : 1;
y = isSafeNum(y) ? y : 0;
y2 = isSafeNum(y2) ? y2 : 0;

@@ -51,2 +56,3 @@ const canvasGradient = ctx.createLinearGradient(x, y, x2, y2);

let r = obj.r == null ? 0.5 : obj.r;
if (!obj.global) {

@@ -58,2 +64,6 @@ x = x * width + rect.x;

x = isSafeNum(x) ? x : 0.5;
y = isSafeNum(y) ? y : 0.5;
r = r >= 0 && isSafeNum(r) ? r : 0.5;
const canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);

@@ -60,0 +70,0 @@

@@ -68,3 +68,3 @@

else {
const image = platformApi.loadImage(
image = platformApi.loadImage(
newImageOrSrc, imageOnLoad, imageOnLoad

@@ -71,0 +71,0 @@ );

@@ -475,5 +475,5 @@ /*!

*/
export const version = '5.3.0';
export const version = '5.3.2';
export interface ZRenderType extends ZRender {};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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