apexcharts
Advanced tools
Comparing version 1.4.6 to 1.4.7
{ | ||
"name": "apexcharts", | ||
"description": "A JavaScript Chart Library", | ||
"version": "1.4.6", | ||
"version": "1.4.7", | ||
"main": "dist/apexcharts.min.js", | ||
@@ -11,3 +11,3 @@ "directories": { | ||
"start": "webpack --watch", | ||
"build": "webpack -p", | ||
"build": "gulp build", | ||
"test": "jest" | ||
@@ -49,2 +49,7 @@ }, | ||
"eslint-plugin-standard": "^3.0.1", | ||
"gulp": "^3.9.1", | ||
"gulp-remove-logging": "^1.2.0", | ||
"gulp-rename": "^1.4.0", | ||
"gulp-strip-debug": "^3.0.0", | ||
"gulp-uglify": "^3.0.1", | ||
"imports-loader": "^0.7.1", | ||
@@ -51,0 +56,0 @@ "jest": "^23.5.0", |
@@ -66,2 +66,5 @@ import Annotations from './modules/Annotations' | ||
} | ||
// set the culture here | ||
this.setCulture(this.w.config.chart.defaultCulture) | ||
const beforeMount = this.w.config.chart.events.beforeMount | ||
@@ -634,2 +637,19 @@ if (typeof beforeMount === 'function') { | ||
setCulture (cultureName) { | ||
this.setCurrentCultureValues(cultureName) | ||
} | ||
setCurrentCultureValues (cultureName) { | ||
const selectedCulture = this.w.config.chart.cultures.find((c) => { | ||
return c.name === cultureName | ||
}) | ||
if (selectedCulture) { | ||
this.w.globals.culture = selectedCulture.options | ||
return selectedCulture.options | ||
} else { | ||
throw new Error('Wrong culture name provided. Please make sure you set the correct culture name in options') | ||
} | ||
} | ||
paper () { | ||
@@ -636,0 +656,0 @@ return this.w.globals.dom.Paper |
@@ -22,2 +22,3 @@ import Graphics from '../Graphics' | ||
} | ||
if (w.config.xaxis.position === 'top') { | ||
@@ -113,3 +114,3 @@ this.offY = 0 | ||
if (customFormatter !== undefined) { | ||
label = customFormatter(label) | ||
label = customFormatter(label, this.xaxisLabels[i]) | ||
} | ||
@@ -116,0 +117,0 @@ |
@@ -429,3 +429,3 @@ import Utils from '../utils/Utils' | ||
stroke: opts.pointStrokeColor, | ||
'stroke-width': opts.pWidth ? opts.pWidth : 1, | ||
'stroke-width': opts.pWidth ? opts.pWidth : 0, | ||
'stroke-opacity': opts.pointStrokeOpacity ? opts.pointStrokeOpacity : 1 | ||
@@ -432,0 +432,0 @@ }) |
@@ -81,3 +81,3 @@ import Utils from '../utils/Utils' | ||
// TODO: need to remove this stupid condition below which makes this function tightly coupled. | ||
// TODO: need to remove this condition below which makes this function tightly coupled with w. | ||
if (this.w.config.yaxis[0].max === undefined && | ||
@@ -338,5 +338,2 @@ this.w.config.yaxis[0].min === undefined) { | ||
ticks = cnf.xaxis.tickAmount | ||
if (!gl.noLabelsProvided) { | ||
ticks = cnf.xaxis.tickAmount - 3 | ||
} | ||
} | ||
@@ -343,0 +340,0 @@ |
@@ -29,3 +29,2 @@ /** | ||
crosshairs: { | ||
// TODO: make default 1 | ||
width: 1 | ||
@@ -120,3 +119,2 @@ } | ||
tooltip: { | ||
// TODO: make shared false | ||
shared: false | ||
@@ -123,0 +121,0 @@ }, |
@@ -80,2 +80,3 @@ import Utils from './../../utils/Utils' | ||
svgHeight: 0, // the whole svg height | ||
culture: {}, // the current culture values will be preserved here for global access | ||
dom: {}, // for storing all dom nodes in this particular property | ||
@@ -82,0 +83,0 @@ // elWrap: null, // the element that wraps everything |
@@ -184,3 +184,21 @@ /** | ||
background: 'transparent', | ||
foreColor: '#373d3f', | ||
cultures: [{ | ||
name: 'en', | ||
options: { | ||
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], | ||
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], | ||
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], | ||
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], | ||
toolbar: { | ||
selectionZoom: 'Selection Zoom', | ||
zoomIn: 'Zoom In', | ||
zoomOut: 'Zoom Out', | ||
reset: 'Reset Zoom', | ||
pan: 'Panning', | ||
selection: 'Selection', | ||
download: 'Download SVG' | ||
} | ||
} | ||
}], | ||
defaultCulture: 'en', | ||
dropShadow: { | ||
@@ -204,2 +222,3 @@ enabled: false, | ||
}, | ||
foreColor: '#373d3f', | ||
height: 'auto', | ||
@@ -689,3 +708,3 @@ offsetX: 0, | ||
offsetY: 0, | ||
strokeWidth: 1 // TODO: add in the website docs | ||
strokeWidth: 1 | ||
}, | ||
@@ -692,0 +711,0 @@ axisTicks: { |
@@ -106,3 +106,4 @@ import DateTime from '../utils/DateTime' | ||
year: ts.year, | ||
month: ts.month + 1 | ||
month: ts.month + 1, | ||
day: 1 | ||
} | ||
@@ -115,3 +116,4 @@ } else if (ts.unit === 'day' || ts.unit === 'hour') { | ||
year: ts.year, | ||
month: ts.month + 1 | ||
month: ts.month + 1, | ||
day: ts.day | ||
} | ||
@@ -338,3 +340,3 @@ } | ||
pos = ((dt.determineDaysOfMonths(month, year) * daysWidthOnXAxis)) + pos | ||
pos = (dt.determineDaysOfMonths(month, year) * daysWidthOnXAxis) + pos | ||
let monthVal = month === 0 ? year : month | ||
@@ -381,3 +383,3 @@ this.timeScaleArray.push({ position: pos, value: monthVal, unit, year, month: month === 0 ? 1 : month }) | ||
// push the first tick in the array | ||
this.timeScaleArray.push({ position: firstTickPosition, value: firstTickValue, unit, year: currentYear, month: this.monthMod(month) }) | ||
this.timeScaleArray.push({ position: firstTickPosition, value: firstTickValue, unit, year: currentYear, month: this.monthMod(month), day: firstTickValue }) | ||
@@ -395,3 +397,3 @@ let pos = firstTickPosition | ||
let val = (date === 1) ? this.monthMod(month) : date | ||
this.timeScaleArray.push({ position: pos, value: val, unit, year, month: this.monthMod(month) }) | ||
this.timeScaleArray.push({ position: pos, value: val, unit, year, month: this.monthMod(month), day: val }) | ||
} | ||
@@ -481,7 +483,7 @@ } | ||
let dateString = ts.year | ||
dateString += '-' + ('0' + ts.month.toString()).slice(-2) | ||
dateString += ts.unit === 'day' ? '-' + ('0' + value).slice(-2) : '-01' | ||
dateString += ts.unit === 'hour' ? 'T' + ('0' + value).slice(-2) + ':00:00' : 'T00:00:00' | ||
dateString = new Date(Date.parse(dateString)) | ||
let raw = ts.year | ||
raw += '-' + ('0' + ts.month.toString()).slice(-2) | ||
raw += ts.unit === 'day' ? '-' + ('0' + value).slice(-2) : '-01' | ||
raw += ts.unit === 'hour' ? 'T' + ('0' + value).slice(-2) + ':00:00' : 'T00:00:00.000Z' | ||
const dateString = new Date(Date.parse(raw)) | ||
@@ -502,2 +504,3 @@ if (w.config.xaxis.labels.format === undefined) { | ||
return { | ||
dateString: raw, | ||
position: ts.position, | ||
@@ -504,0 +507,0 @@ value: value, |
@@ -35,3 +35,3 @@ import Graphics from './Graphics' | ||
fontSize: w.config.title.style.fontSize, | ||
foreColor: w.config.title.style.foreColor, | ||
foreColor: w.config.title.style.color, | ||
opacity: 1 | ||
@@ -38,0 +38,0 @@ }) |
@@ -21,2 +21,4 @@ import Graphics from './Graphics' | ||
this.w = ctx.w | ||
this.cultureValues = this.w.globals.culture.toolbar | ||
} | ||
@@ -44,3 +46,3 @@ | ||
icon: icoCamera, | ||
title: 'Download SVG', | ||
title: this.cultureValues.download, | ||
class: 'apexcharts-download-icon' | ||
@@ -54,3 +56,3 @@ }) | ||
icon: icoSelect, | ||
title: 'Select', | ||
title: this.cultureValues.selection, | ||
class: 'apexcharts-selection-icon' | ||
@@ -64,3 +66,3 @@ }) | ||
icon: icoZoomIn, | ||
title: 'Zoom In', | ||
title: this.cultureValues.zoomIn, | ||
class: 'apexcharts-zoom-in-icon' | ||
@@ -74,3 +76,3 @@ }) | ||
icon: icoZoomOut, | ||
title: 'Zoom Out', | ||
title: this.cultureValues.zoomOut, | ||
class: 'apexcharts-zoom-out-icon' | ||
@@ -84,3 +86,3 @@ }) | ||
icon: icoZoom, | ||
title: 'Zoom', | ||
title: this.cultureValues.selectionZoom, | ||
class: 'apexcharts-zoom-icon' | ||
@@ -94,3 +96,3 @@ }) | ||
icon: icoPan, | ||
title: 'Panning', | ||
title: this.cultureValues.panning, | ||
class: 'apexcharts-pan-icon' | ||
@@ -104,3 +106,3 @@ }) | ||
icon: icoReset, | ||
title: 'Reset Zoom', | ||
title: this.cultureValues.reset, | ||
class: 'apexcharts-reset-zoom-icon' | ||
@@ -107,0 +109,0 @@ }) |
@@ -428,3 +428,2 @@ import Labels from './Labels' | ||
// TODO: the hoverY is causing issues currently, hence commented out | ||
if (capj.hoverX < 0 || capj.hoverX > w.globals.gridWidth || capj.hoverY < 0 || capj.hoverY > w.globals.gridHeight) { | ||
@@ -431,0 +430,0 @@ self.handleMouseOut(opt) |
@@ -18,4 +18,2 @@ import TimeScale from '../modules/TimeScale' | ||
this.daysCntOfYear = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334] | ||
this.MMMM = ['\x00', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | ||
} | ||
@@ -45,7 +43,9 @@ | ||
formatDate (date, format, utc = true) { | ||
let MMMM = ['\x00', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | ||
let MMM = ['\x01', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | ||
let dddd = ['\x02', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] | ||
let ddd = ['\x03', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] | ||
const culture = this.w.globals.culture | ||
let MMMM = ['\x00', ...culture.months] | ||
let MMM = ['\x01', ...culture.shortMonths] | ||
let dddd = ['\x02', ...culture.days] | ||
let ddd = ['\x03', ...culture.shortDays] | ||
function ii (i, len) { | ||
@@ -52,0 +52,0 @@ let s = i + '' |
@@ -5,3 +5,2 @@ var path = require('path'); | ||
entry: ['core-js/fn/promise','core-js/fn/array/includes', 'core-js/fn/array/reduce', 'core-js/fn/array/from','core-js/fn/array/find', 'core-js/fn/symbol', path.resolve(__dirname, 'src/apexcharts.js')], | ||
// entry: ['babel-polyfill', path.resolve(__dirname, 'src/apexcharts.js')], | ||
output: { | ||
@@ -12,3 +11,3 @@ library: 'ApexCharts', | ||
path: path.resolve(__dirname, 'dist/'), | ||
filename: 'apexcharts.min.js' , | ||
filename: 'apexcharts.js' , | ||
}, | ||
@@ -15,0 +14,0 @@ module: { |
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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2257811
107
39466
34
2
2