Skip to content

Commit

Permalink
work-around DCE bug in Rollup: rollup/rollup#3555
Browse files Browse the repository at this point in the history
  • Loading branch information
leeoniya committed May 13, 2020
1 parent 625f600 commit abacd02
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 29 deletions.
12 changes: 5 additions & 7 deletions dist/uPlot.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,9 @@ function uPlot(opts, data, then) {

var ready = false;

var series = setDefaults(opts.series || [], xSeriesOpts, ySeriesOpts, false);
var axes = setDefaults(opts.axes || [], xAxisOpts, yAxisOpts, true);
var scales = (opts.scales = opts.scales || {});
var series = self.series = setDefaults(opts.series || [], xSeriesOpts, ySeriesOpts, false);
var axes = self.axes = setDefaults(opts.axes || [], xAxisOpts, yAxisOpts, true);
var scales = self.scales = (opts.scales = opts.scales || {});

var gutters = assign({
x: round(yAxisOpts.size / 2),
Expand All @@ -955,10 +955,6 @@ function uPlot(opts, data, then) {
var _timeAxisVals = timeAxisVals(_tzDate, timeAxisStamps(_timeAxisStamps, _fmtDate));
var _timeSeriesVal = timeSeriesVal(_tzDate, timeSeriesStamp(_timeSeriesStamp, _fmtDate));

self.series = series;
self.axes = axes;
self.scales = scales;

var pendScales = {};

// explicitly-set initial scales
Expand Down Expand Up @@ -1112,12 +1108,14 @@ function uPlot(opts, data, then) {
si = si == null ? series.length : si;

opts = setDefault(opts, si, xSeriesOpts, ySeriesOpts);
series.splice(si, 0, opts);
initSeries(series[si], si);
}

self.addSeries = addSeries;

function delSeries(i) {
series.splice(i, 1);
legendRows.splice(i, 1)[0][0].parentNode.remove();
cursorPts.splice(i, 1)[0].remove();

Expand Down
12 changes: 5 additions & 7 deletions dist/uPlot.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,9 @@ function uPlot(opts, data, then) {

let ready = false;

const series = setDefaults(opts.series || [], xSeriesOpts, ySeriesOpts, false);
const axes = setDefaults(opts.axes || [], xAxisOpts, yAxisOpts, true);
const scales = (opts.scales = opts.scales || {});
const series = self.series = setDefaults(opts.series || [], xSeriesOpts, ySeriesOpts, false);
const axes = self.axes = setDefaults(opts.axes || [], xAxisOpts, yAxisOpts, true);
const scales = self.scales = (opts.scales = opts.scales || {});

const gutters = assign({
x: round(yAxisOpts.size / 2),
Expand All @@ -958,10 +958,6 @@ function uPlot(opts, data, then) {
const _timeAxisVals = timeAxisVals(_tzDate, timeAxisStamps(_timeAxisStamps, _fmtDate));
const _timeSeriesVal = timeSeriesVal(_tzDate, timeSeriesStamp(_timeSeriesStamp, _fmtDate));

self.series = series;
self.axes = axes;
self.scales = scales;

const pendScales = {};

// explicitly-set initial scales
Expand Down Expand Up @@ -1115,12 +1111,14 @@ function uPlot(opts, data, then) {
si = si == null ? series.length : si;

opts = setDefault(opts, si, xSeriesOpts, ySeriesOpts);
series.splice(si, 0, opts);
initSeries(series[si], si);
}

self.addSeries = addSeries;

function delSeries(i) {
series.splice(i, 1);
legendRows.splice(i, 1)[0][0].parentNode.remove();
cursorPts.splice(i, 1)[0].remove();

Expand Down
12 changes: 5 additions & 7 deletions dist/uPlot.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,9 @@ var uPlot = (function () {

var ready = false;

var series = setDefaults(opts.series || [], xSeriesOpts, ySeriesOpts, false);
var axes = setDefaults(opts.axes || [], xAxisOpts, yAxisOpts, true);
var scales = (opts.scales = opts.scales || {});
var series = self.series = setDefaults(opts.series || [], xSeriesOpts, ySeriesOpts, false);
var axes = self.axes = setDefaults(opts.axes || [], xAxisOpts, yAxisOpts, true);
var scales = self.scales = (opts.scales = opts.scales || {});

var gutters = assign({
x: round(yAxisOpts.size / 2),
Expand All @@ -956,10 +956,6 @@ var uPlot = (function () {
var _timeAxisVals = timeAxisVals(_tzDate, timeAxisStamps(_timeAxisStamps, _fmtDate));
var _timeSeriesVal = timeSeriesVal(_tzDate, timeSeriesStamp(_timeSeriesStamp, _fmtDate));

self.series = series;
self.axes = axes;
self.scales = scales;

var pendScales = {};

// explicitly-set initial scales
Expand Down Expand Up @@ -1113,12 +1109,14 @@ var uPlot = (function () {
si = si == null ? series.length : si;

opts = setDefault(opts, si, xSeriesOpts, ySeriesOpts);
series.splice(si, 0, opts);
initSeries(series[si], si);
}

self.addSeries = addSeries;

function delSeries(i) {
series.splice(i, 1);
legendRows.splice(i, 1)[0][0].parentNode.remove();
cursorPts.splice(i, 1)[0].remove();

Expand Down
Loading

0 comments on commit abacd02

Please sign in to comment.