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

frappe-charts

Package Overview
Dependencies
Maintainers
5
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frappe-charts - npm Package Compare versions

Comparing version 2.0.0-rc5 to 2.0.0-rc6

2

package.json
{
"name": "frappe-charts",
"version": "2.0.0-rc5",
"version": "2.0.0-rc6",
"main": "src/js/chart.js",

@@ -5,0 +5,0 @@ "module": "dist/frappe-charts.esm.js",

@@ -12,5 +12,7 @@ import SvgTip from '../objects/SvgTip';

import { downloadFile, prepareForExport } from '../utils/export';
import { deepClone } from '../utils/helpers';
export default class BaseChart {
constructor(parent, options) {
options = deepClone(options)

@@ -17,0 +19,0 @@ this.parent = typeof parent === 'string'

@@ -17,6 +17,6 @@ import { ANGLE_RATIO } from './constants';

export function arraysEqual(arr1, arr2) {
if (arr1.length !== arr2.length) return false;
if(arr1.length !== arr2.length) return false;
let areEqual = true;
arr1.map((d, i) => {
if (arr2[i] !== d) areEqual = false;
if(arr2[i] !== d) areEqual = false;
});

@@ -50,4 +50,4 @@ return areEqual;

*/
export function fillArray(array, count, element, start = false) {
if (!element) {
export function fillArray(array, count, element, start=false) {
if(!element) {
element = start ? array[0] : array[array.length - 1];

@@ -66,3 +66,3 @@ }

export function getStringWidth(string, charWidth) {
return (string + "").length * charWidth;
return (string+"").length * charWidth;
}

@@ -72,7 +72,7 @@

return new Proxy(obj, {
set: function (target, prop, value) {
set: function(target, prop, value) {
setFn();
return Reflect.set(target, prop, value);
},
get: function (target, prop) {
get: function(target, prop) {
getFn();

@@ -105,3 +105,3 @@ return Reflect.get(target, prop);

*/
export function isValidNumber(candidate, nonNegative = false) {
export function isValidNumber(candidate, nonNegative=false) {
if (Number.isNaN(candidate)) return false;

@@ -122,2 +122,28 @@ else if (candidate === undefined) return false;

return Number(Math.round(d + 'e4') + 'e-4');
}
}
/**
* Creates a deep clone of an object
* @param {Object} candidate Any Object
*/
export function deepClone(candidate) {
let cloned, value, key;
if (candidate instanceof Date) {
return new Date(candidate.getTime());
}
if (typeof candidate !== "object" || candidate === null) {
return candidate;
}
cloned = Array.isArray(candidate) ? [] : {};
for (key in candidate) {
value = candidate[key];
cloned[key] = deepClone(value);
}
return cloned;
}

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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