Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Apr 21, 2024
1 parent 44d61f6 commit 050b7b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 7 additions & 9 deletions src/modules/Exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ class Exports {

// let the caller know the current category is null. this can happen for example
// when dealing with line charts having inconsistent time series data
if (cat === null)
return 'nullvalue'
if (cat === null) return 'nullvalue'

if (Array.isArray(cat)) {
cat = cat.join(' ')
Expand Down Expand Up @@ -289,8 +288,7 @@ class Exports {
let cat = getCat(i)

// current category is null, let's move on to the next one
if (cat === 'nullvalue')
continue
if (cat === 'nullvalue') continue

if (!cat) {
if (dataFormat.isFormatXY()) {
Expand All @@ -306,8 +304,8 @@ class Exports {
isTimeStamp(cat)
? w.config.chart.toolbar.export.csv.dateFormatter(cat)
: Utils.isNumber(cat)
? cat
: cat.split(columnDelimiter).join('')
? cat
: cat.split(columnDelimiter).join('')
)

for (let ci = 0; ci < w.globals.series.length; ci++) {
Expand Down Expand Up @@ -390,8 +388,8 @@ class Exports {
isTimeStamp(cat) && w.config.xaxis.type === 'datetime'
? w.config.chart.toolbar.export.csv.dateFormatter(cat)
: Utils.isNumber(cat)
? cat
: cat.split(columnDelimiter).join(''),
? cat
: cat.split(columnDelimiter).join(''),
data[cat].join(columnDelimiter),
])
})
Expand Down Expand Up @@ -456,7 +454,7 @@ class Exports {

this.triggerDownload(
'data:text/csv; charset=utf-8,' +
encodeURIComponent(universalBOM + result),
encodeURIComponent(universalBOM + result),
fileName ? fileName : w.config.chart.toolbar.export.csv.filename,
'.csv'
)
Expand Down
6 changes: 4 additions & 2 deletions src/modules/dimensions/Dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export default class Dimensions {

this.lgRect = this.dimHelpers.getLegendsRect()

const maxStrokeWidth = Array.isArray(w.config.stroke.width) ? Math.max(...w.config.stroke.width) : w.config.stroke.width
const maxStrokeWidth = Array.isArray(w.config.stroke.width)
? Math.max(...w.config.stroke.width)
: w.config.stroke.width

if (this.isSparkline) {
if (w.config.markers.discrete.length > 0 || w.config.markers.size > 0) {
Expand Down Expand Up @@ -69,7 +71,7 @@ export default class Dimensions {

// after calculating everything, apply padding set by user
gl.gridHeight = gl.gridHeight - this.gridPad.top - this.gridPad.bottom

gl.gridWidth =
gl.gridWidth -
this.gridPad.left -
Expand Down

0 comments on commit 050b7b1

Please sign in to comment.