@websy/websy-designs 1.12.5 → 1.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -178,10 +178,10 @@ class MySqlHelper {
178
178
  })
179
179
  }
180
180
  JSONSafeWrite (v) {
181
- return v.replace(/'/g, '\'\'').replace(/\\(?=[bfnrtv0'"])/g, '\\\\')
181
+ return v.replace(/'/g, '\'\'').replace(/"/g, '\\"').replace(/\\(?=[bfnrtv0'"])/g, '\\\\')
182
182
  }
183
183
  JSONSafeRead (v) {
184
- return v.replace(/''/g, '\'').replace(/\\(?=[^bfnrtv0'"])/g, '\\\\')
184
+ return v.replace(/''/g, '\'').replace(/\\"/g, '"').replace(/\\(?=[^bfnrtv0'"])/g, '\\\\')
185
185
  }
186
186
  }
187
187
 
@@ -7826,6 +7826,7 @@ class WebsyChart {
7826
7826
  this.brushedDomain = []
7827
7827
  this.brushBarsInitialized = {}
7828
7828
  this.brushLinesInitialized = {}
7829
+ // this.transition = d3.transition().duration(this.options.transitionDuration)
7829
7830
  if (!elementId) {
7830
7831
  console.log('No element Id provided for Websy Chart')
7831
7832
  return
@@ -8267,7 +8268,7 @@ if (!this.options.data) {
8267
8268
  }
8268
8269
  else {
8269
8270
  this.processedX = {}
8270
- this.transition = d3.transition().duration(this.options.transitionDuration)
8271
+ // this.transition = d3.transition().duration(this.options.transitionDuration)
8271
8272
  if (this.options.data.bottom.scale && this.options.data.bottom.scale === 'Time') {
8272
8273
  this.parseX = function (input) {
8273
8274
  if (typeof input.getTime !== 'undefined') {
@@ -8284,7 +8285,7 @@ else {
8284
8285
  }
8285
8286
  }
8286
8287
  if (this.options.disableTransitions === true) {
8287
- this.transition = d3.transition().duration(0)
8288
+ this.options.transitionDuration = 0
8288
8289
  }
8289
8290
  // Add placeholders for the data entries that don't exist
8290
8291
  if (!this.options.data.left) {
@@ -8307,7 +8308,7 @@ else {
8307
8308
  this.bottomAxisLayer && this.bottomAxisLayer.attr('class', 'y-axis')
8308
8309
  }
8309
8310
  const el = document.getElementById(this.elementId)
8310
- if (el) {
8311
+ if (el && el.clientHeight > 0) {
8311
8312
  this.width = el.clientWidth
8312
8313
  this.height = el.clientHeight
8313
8314
  // establish the space and size for the legend
@@ -9161,7 +9162,8 @@ let areas = this.areaLayer.selectAll(`.area_${series.key}`)
9161
9162
  .data([series.data])
9162
9163
  // Exit
9163
9164
  areas.exit()
9164
- .transition(this.transition)
9165
+ .transition()
9166
+ .duration(this.options.transitionDuration)
9165
9167
  .style('fill-opacity', 1e-6)
9166
9168
  .remove()
9167
9169
  // Update
@@ -9171,7 +9173,8 @@ areas
9171
9173
  // .attr('transform', 'translate('+ (that.bandWidth/2) +',0)')
9172
9174
  .attr('fill', d => d[0].y.color || series.color)
9173
9175
  // .attr('stroke', 'transparent')
9174
- .transition(this.transition)
9176
+ .transition()
9177
+ .duration(this.options.transitionDuration)
9175
9178
  .attr('d', d => drawArea(xAxis, yAxis, series.curveStyle)(d))
9176
9179
  // Enter
9177
9180
  areas.enter().append('path')
@@ -9355,7 +9358,8 @@ function getBarY (d, i, yAxis, xAxis) {
9355
9358
  }
9356
9359
  bars
9357
9360
  .exit()
9358
- .transition(this.transition)
9361
+ .transition()
9362
+ .duration(this.options.transitionDuration)
9359
9363
  .style('fill-opacity', 1e-6)
9360
9364
  .remove()
9361
9365
 
@@ -9364,7 +9368,8 @@ bars
9364
9368
  .attr('height', (d, i) => getBarHeight.call(this, d, i, yAxis, xAxis))
9365
9369
  .attr('x', (d, i) => getBarX.call(this, d, i, yAxis, xAxis))
9366
9370
  .attr('y', (d, i) => getBarY.call(this, d, i, yAxis, xAxis))
9367
- // .transition(this.transition)
9371
+ .transition()
9372
+ .duration(this.options.transitionDuration)
9368
9373
  .attr('fill', d => d.y.color || d.color || series.color)
9369
9374
 
9370
9375
  bars
@@ -9384,7 +9389,8 @@ if (!this.brushBarsInitialized[series.key]) {
9384
9389
  this.brushBarsInitialized[series.key] = true
9385
9390
  brushBars
9386
9391
  .exit()
9387
- .transition(this.transition)
9392
+ .transition()
9393
+ .duration(this.options.transitionDuration)
9388
9394
  .style('fill-opacity', 1e-6)
9389
9395
  .remove()
9390
9396
 
@@ -9393,7 +9399,8 @@ if (!this.brushBarsInitialized[series.key]) {
9393
9399
  .attr('height', (d, i) => getBarHeight.call(this, d, i, `${yAxis}Brush`, `${xAxis}Brush`))
9394
9400
  .attr('x', (d, i) => getBarX.call(this, d, i, `${yAxis}Brush`, `${xAxis}Brush`))
9395
9401
  .attr('y', (d, i) => getBarY.call(this, d, i, `${yAxis}Brush`, `${xAxis}Brush`))
9396
- // .transition(this.transition)
9402
+ .transition()
9403
+ .duration(this.options.transitionDuration)
9397
9404
  .attr('fill', d => d.y.color || d.color || series.color)
9398
9405
 
9399
9406
  brushBars
@@ -9414,12 +9421,14 @@ if (!this.brushBarsInitialized[series.key]) {
9414
9421
  removebar (key) {
9415
9422
  /* global key d3 */
9416
9423
  this.barLayer.selectAll(`.bar_${key}`)
9417
- .transition(this.transition)
9424
+ // .transition()
9425
+ // .duration(this.options.transitionDuration)
9418
9426
  .style('fill-opacity', 1e-6)
9419
9427
  .remove()
9420
9428
  // remove from the brush as well
9421
9429
  this.brushArea.selectAll(`.bar_${key}`)
9422
- .transition(this.transition)
9430
+ // .transition()
9431
+ // .duration(this.options.transitionDuration)
9423
9432
  .style('fill-opacity', 1e-6)
9424
9433
  .remove()
9425
9434
 
@@ -9440,7 +9449,8 @@ if (this.options.showLabels === true || series.showLabels === true) {
9440
9449
  let labels = this.labelLayer.selectAll(`.label_${series.key}`).data(series.data)
9441
9450
  labels
9442
9451
  .exit()
9443
- .transition(this.transition)
9452
+ .transition()
9453
+ .duration(this.options.transitionDuration)
9444
9454
  .style('stroke-opacity', 1e-6)
9445
9455
  .remove()
9446
9456
  labels
@@ -9454,7 +9464,8 @@ if (this.options.showLabels === true || series.showLabels === true) {
9454
9464
  return this.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color)
9455
9465
  })
9456
9466
  .style('font-size', `${this.options.labelSize || this.options.fontSize}px`)
9457
- .transition(this.transition)
9467
+ .transition()
9468
+ .duration(this.options.transitionDuration)
9458
9469
  .text(d => d.y.label || d.y.value)
9459
9470
  .each(function (d, i) {
9460
9471
  if (that.options.orientation === 'horizontal') {
@@ -9643,7 +9654,8 @@ let brushLines = this.brushArea.selectAll(`.line_${series.key}`)
9643
9654
  .data([series.data])
9644
9655
  // Exit
9645
9656
  lines.exit()
9646
- .transition(this.transition)
9657
+ .transition()
9658
+ .duration(this.options.transitionDuration)
9647
9659
  .style('stroke-opacity', 1e-6)
9648
9660
  .remove()
9649
9661
  // Update
@@ -9653,7 +9665,8 @@ lines
9653
9665
  // .attr('transform', 'translate('+ (that.bandWidth/2) +',0)')
9654
9666
  .attr('stroke', d => d[0].y.color || series.color)
9655
9667
  .attr('fill', 'transparent')
9656
- .transition(this.transition)
9668
+ .transition()
9669
+ .duration(this.options.transitionDuration)
9657
9670
  .attr('d', d => drawLine(xAxis, yAxis, series.curveStyle)(d))
9658
9671
  // Enter
9659
9672
  lines.enter().append('path')
@@ -9671,7 +9684,8 @@ if (!this.brushLinesInitialized[series.key]) {
9671
9684
  this.brushLinesInitialized[series.key] = true
9672
9685
  // Exit
9673
9686
  brushLines.exit()
9674
- .transition(this.transition)
9687
+ .transition()
9688
+ .duration(this.options.transitionDuration)
9675
9689
  .style('stroke-opacity', 1e-6)
9676
9690
  .remove()
9677
9691
  // Update
@@ -9681,7 +9695,8 @@ if (!this.brushLinesInitialized[series.key]) {
9681
9695
  // .attr('transform', 'translate('+ (that.bandWidth/2) +',0)')
9682
9696
  .attr('stroke', series.color)
9683
9697
  .attr('fill', 'transparent')
9684
- .transition(this.transition)
9698
+ .transition()
9699
+ .duration(this.options.transitionDuration)
9685
9700
  .attr('d', d => drawLine(xBrushAxis, yBrushAxis, series.curveStyle)(d))
9686
9701
  // Enter
9687
9702
  brushLines.enter().append('path')
@@ -9750,11 +9765,13 @@ if (data.label && data.label !== '') {
9750
9765
  removeline (key) {
9751
9766
  /* global key d3 */
9752
9767
  let lines = this.lineLayer.selectAll(`.line_${key}`)
9753
- .transition(this.transition)
9768
+ // .transition()
9769
+ // .duration(this.options.transitionDuration)
9754
9770
  .style('stroke-opacity', 1e-6)
9755
9771
  .remove()
9756
9772
  let areas = this.areaLayer.selectAll(`.area_${key}`)
9757
- .transition(this.transition)
9773
+ // .transition()
9774
+ // .duration(this.options.transitionDuration)
9758
9775
  .style('stroke-opacity', 1e-6)
9759
9776
  .remove()
9760
9777
 
@@ -9762,7 +9779,8 @@ let areas = this.areaLayer.selectAll(`.area_${key}`)
9762
9779
  removelabel (key) {
9763
9780
  /* global key d3 */
9764
9781
  let labels = this.labelLayer.selectAll(`.label_${key}`)
9765
- .transition(this.transition)
9782
+ // .transition()
9783
+ // .duration(this.options.transitionDuration)
9766
9784
  .style('stroke-opacity', 1e-6)
9767
9785
  .remove()
9768
9786
 
@@ -9770,7 +9788,8 @@ let labels = this.labelLayer.selectAll(`.label_${key}`)
9770
9788
  removesymbol (key) {
9771
9789
  /* global key d3 */
9772
9790
  let symbols = this.symbolLayer.selectAll(`.symbol_${key}`)
9773
- .transition(this.transition)
9791
+ // .transition()
9792
+ // .duration(this.options.transitionDuration)
9774
9793
  .style('stroke-opacity', 1e-6)
9775
9794
  .remove()
9776
9795
 
@@ -9795,13 +9814,15 @@ let symbols = this.symbolLayer.selectAll(`.symbol_${series.key}`)
9795
9814
  .data(series.data)
9796
9815
  // Exit
9797
9816
  symbols.exit()
9798
- .transition(this.transition)
9799
- .style('fill-opacity', 1e-6)
9817
+ // .transition()
9818
+ // .duration(this.options.transitionDuration)
9819
+ // .style('fill-opacity', 1e-6)
9800
9820
  .remove()
9801
9821
  // Update
9802
9822
  symbols
9803
9823
  .attr('d', d => drawSymbol(d.y.size || series.symbolSize)(d))
9804
- .transition(this.transition)
9824
+ .transition()
9825
+ .duration(this.options.transitionDuration)
9805
9826
  .attr('fill', d => series.fillSymbols ? d.y.color || series.color : 'white')
9806
9827
  .attr('stroke', d => d.y.color || series.color)
9807
9828
  .attr('transform', d => {
@@ -10170,7 +10191,7 @@ class WebsyKPI {
10170
10191
  if (this.options.tooltip && this.options.tooltip.value) {
10171
10192
  html += `
10172
10193
  <div class="websy-info ${this.options.tooltip.classes.join(' ') || ''}" data-info="${this.options.tooltip.value}">
10173
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512"><title>ionicons-v5-e</title><path d="M256,56C145.72,56,56,145.72,56,256s89.72,200,200,200,200-89.72,200-200S366.28,56,256,56Zm0,82a26,26,0,1,1-26,26A26,26,0,0,1,256,138Zm48,226H216a16,16,0,0,1,0-32h28V244H228a16,16,0,0,1,0-32h32a16,16,0,0,1,16,16V332h28a16,16,0,0,1,0,32Z"/></svg>
10194
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512"><path d="M256,56C145.72,56,56,145.72,56,256s89.72,200,200,200,200-89.72,200-200S366.28,56,256,56Zm0,82a26,26,0,1,1-26,26A26,26,0,0,1,256,138Zm48,226H216a16,16,0,0,1,0-32h28V244H228a16,16,0,0,1,0-32h32a16,16,0,0,1,16,16V332h28a16,16,0,0,1,0,32Z"/></svg>
10174
10195
  </div>
10175
10196
  `
10176
10197
  }
@@ -10380,7 +10401,10 @@ class WebsyMap {
10380
10401
  // this.map.invalidateSize()
10381
10402
  // }
10382
10403
  if (this.geo) {
10383
- this.map.fitBounds(this.geo.getBounds())
10404
+ const b = this.geo.getBounds()
10405
+ if (b.isValid()) {
10406
+ this.map.fitBounds(this.geo.getBounds())
10407
+ }
10384
10408
  }
10385
10409
  else if (this.polygons) {
10386
10410
  // this.map.fitBounds(this.geo.getBounds())
@@ -7555,6 +7555,7 @@ var WebsyChart = /*#__PURE__*/function () {
7555
7555
  this.brushedDomain = [];
7556
7556
  this.brushBarsInitialized = {};
7557
7557
  this.brushLinesInitialized = {};
7558
+ // this.transition = d3.transition().duration(this.options.transitionDuration)
7558
7559
  if (!elementId) {
7559
7560
  console.log('No element Id provided for Websy Chart');
7560
7561
  return;
@@ -7980,7 +7981,7 @@ var WebsyChart = /*#__PURE__*/function () {
7980
7981
  // tell the user no data has been provided
7981
7982
  } else {
7982
7983
  this.processedX = {};
7983
- this.transition = d3.transition().duration(this.options.transitionDuration);
7984
+ // this.transition = d3.transition().duration(this.options.transitionDuration)
7984
7985
  if (this.options.data.bottom.scale && this.options.data.bottom.scale === 'Time') {
7985
7986
  this.parseX = function (input) {
7986
7987
  if (typeof input.getTime !== 'undefined') {
@@ -7995,7 +7996,7 @@ var WebsyChart = /*#__PURE__*/function () {
7995
7996
  };
7996
7997
  }
7997
7998
  if (this.options.disableTransitions === true) {
7998
- this.transition = d3.transition().duration(0);
7999
+ this.options.transitionDuration = 0;
7999
8000
  }
8000
8001
  // Add placeholders for the data entries that don't exist
8001
8002
  if (!this.options.data.left) {
@@ -8023,7 +8024,7 @@ var WebsyChart = /*#__PURE__*/function () {
8023
8024
  this.bottomAxisLayer && this.bottomAxisLayer.attr('class', 'y-axis');
8024
8025
  }
8025
8026
  var el = document.getElementById(this.elementId);
8026
- if (el) {
8027
+ if (el && el.clientHeight > 0) {
8027
8028
  this.width = el.clientWidth;
8028
8029
  this.height = el.clientHeight;
8029
8030
  // establish the space and size for the legend
@@ -8743,7 +8744,7 @@ var WebsyChart = /*#__PURE__*/function () {
8743
8744
  }
8744
8745
  var areas = this.areaLayer.selectAll(".area_".concat(series.key)).data([series.data]);
8745
8746
  // Exit
8746
- areas.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
8747
+ areas.exit().transition().duration(this.options.transitionDuration).style('fill-opacity', 1e-6).remove();
8747
8748
  // Update
8748
8749
  areas
8749
8750
  // .style('stroke-width', series.lineWidth || this.options.lineWidth)
@@ -8753,7 +8754,7 @@ var WebsyChart = /*#__PURE__*/function () {
8753
8754
  return d[0].y.color || series.color;
8754
8755
  })
8755
8756
  // .attr('stroke', 'transparent')
8756
- .transition(this.transition).attr('d', function (d) {
8757
+ .transition().duration(this.options.transitionDuration).attr('d', function (d) {
8757
8758
  return drawArea(xAxis, yAxis, series.curveStyle)(d);
8758
8759
  });
8759
8760
  // Enter
@@ -8938,7 +8939,7 @@ var WebsyChart = /*#__PURE__*/function () {
8938
8939
  }
8939
8940
  return output;
8940
8941
  }
8941
- bars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
8942
+ bars.exit().transition().duration(this.options.transitionDuration).style('fill-opacity', 1e-6).remove();
8942
8943
  bars.attr('width', function (d, i) {
8943
8944
  return Math.abs(getBarWidth.call(_this56, d, i, yAxis, xAxis));
8944
8945
  }).attr('height', function (d, i) {
@@ -8947,9 +8948,7 @@ var WebsyChart = /*#__PURE__*/function () {
8947
8948
  return getBarX.call(_this56, d, i, yAxis, xAxis);
8948
8949
  }).attr('y', function (d, i) {
8949
8950
  return getBarY.call(_this56, d, i, yAxis, xAxis);
8950
- })
8951
- // .transition(this.transition)
8952
- .attr('fill', function (d) {
8951
+ }).transition().duration(this.options.transitionDuration).attr('fill', function (d) {
8953
8952
  return d.y.color || d.color || series.color;
8954
8953
  });
8955
8954
  bars.enter().append('rect').attr('width', function (d, i) {
@@ -8969,7 +8968,7 @@ var WebsyChart = /*#__PURE__*/function () {
8969
8968
  });
8970
8969
  if (!this.brushBarsInitialized[series.key]) {
8971
8970
  this.brushBarsInitialized[series.key] = true;
8972
- brushBars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
8971
+ brushBars.exit().transition().duration(this.options.transitionDuration).style('fill-opacity', 1e-6).remove();
8973
8972
  brushBars.attr('width', function (d, i) {
8974
8973
  return Math.abs(getBarWidth.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
8975
8974
  }).attr('height', function (d, i) {
@@ -8978,9 +8977,7 @@ var WebsyChart = /*#__PURE__*/function () {
8978
8977
  return getBarX.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
8979
8978
  }).attr('y', function (d, i) {
8980
8979
  return getBarY.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
8981
- })
8982
- // .transition(this.transition)
8983
- .attr('fill', function (d) {
8980
+ }).transition().duration(this.options.transitionDuration).attr('fill', function (d) {
8984
8981
  return d.y.color || d.color || series.color;
8985
8982
  });
8986
8983
  brushBars.enter().append('rect').attr('width', function (d, i) {
@@ -9004,9 +9001,15 @@ var WebsyChart = /*#__PURE__*/function () {
9004
9001
  key: "removebar",
9005
9002
  value: function removebar(key) {
9006
9003
  /* global key d3 */
9007
- this.barLayer.selectAll(".bar_".concat(key)).transition(this.transition).style('fill-opacity', 1e-6).remove();
9004
+ this.barLayer.selectAll(".bar_".concat(key))
9005
+ // .transition()
9006
+ // .duration(this.options.transitionDuration)
9007
+ .style('fill-opacity', 1e-6).remove();
9008
9008
  // remove from the brush as well
9009
- this.brushArea.selectAll(".bar_".concat(key)).transition(this.transition).style('fill-opacity', 1e-6).remove();
9009
+ this.brushArea.selectAll(".bar_".concat(key))
9010
+ // .transition()
9011
+ // .duration(this.options.transitionDuration)
9012
+ .style('fill-opacity', 1e-6).remove();
9010
9013
  }
9011
9014
  }, {
9012
9015
  key: "renderLabels",
@@ -9025,7 +9028,7 @@ var WebsyChart = /*#__PURE__*/function () {
9025
9028
  // e.g. Inside, Outide, Auto (this will also affect the available plot space)
9026
9029
  // We currently only support 'Auto'
9027
9030
  var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
9028
- labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
9031
+ labels.exit().transition().duration(this.options.transitionDuration).style('stroke-opacity', 1e-6).remove();
9029
9032
  labels.attr('x', function (d) {
9030
9033
  return getLabelX.call(_this57, d, series.labelPosition);
9031
9034
  }).attr('y', function (d) {
@@ -9035,7 +9038,7 @@ var WebsyChart = /*#__PURE__*/function () {
9035
9038
  return 'transparent';
9036
9039
  }
9037
9040
  return _this57.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
9038
- }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
9041
+ }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition().duration(this.options.transitionDuration).text(function (d) {
9039
9042
  return d.y.label || d.y.value;
9040
9043
  }).each(function (d, i) {
9041
9044
  if (that.options.orientation === 'horizontal') {
@@ -9195,14 +9198,14 @@ var WebsyChart = /*#__PURE__*/function () {
9195
9198
  var lines = this.lineLayer.selectAll(".line_".concat(series.key)).data([series.data]);
9196
9199
  var brushLines = this.brushArea.selectAll(".line_".concat(series.key)).data([series.data]);
9197
9200
  // Exit
9198
- lines.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
9201
+ lines.exit().transition().duration(this.options.transitionDuration).style('stroke-opacity', 1e-6).remove();
9199
9202
  // Update
9200
9203
  lines.style('stroke-width', series.lineWidth || this.options.lineWidth)
9201
9204
  // .attr('id', `line_${series.key}`)
9202
9205
  // .attr('transform', 'translate('+ (that.bandWidth/2) +',0)')
9203
9206
  .attr('stroke', function (d) {
9204
9207
  return d[0].y.color || series.color;
9205
- }).attr('fill', 'transparent').transition(this.transition).attr('d', function (d) {
9208
+ }).attr('fill', 'transparent').transition().duration(this.options.transitionDuration).attr('d', function (d) {
9206
9209
  return drawLine(xAxis, yAxis, series.curveStyle)(d);
9207
9210
  });
9208
9211
  // Enter
@@ -9218,12 +9221,12 @@ var WebsyChart = /*#__PURE__*/function () {
9218
9221
  if (!this.brushLinesInitialized[series.key]) {
9219
9222
  this.brushLinesInitialized[series.key] = true;
9220
9223
  // Exit
9221
- brushLines.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
9224
+ brushLines.exit().transition().duration(this.options.transitionDuration).style('stroke-opacity', 1e-6).remove();
9222
9225
  // Update
9223
9226
  brushLines.style('stroke-width', 1)
9224
9227
  // .attr('id', `line_${series.key}`)
9225
9228
  // .attr('transform', 'translate('+ (that.bandWidth/2) +',0)')
9226
- .attr('stroke', series.color).attr('fill', 'transparent').transition(this.transition).attr('d', function (d) {
9229
+ .attr('stroke', series.color).attr('fill', 'transparent').transition().duration(this.options.transitionDuration).attr('d', function (d) {
9227
9230
  return drawLine(xBrushAxis, yBrushAxis, series.curveStyle)(d);
9228
9231
  });
9229
9232
  // Enter
@@ -9269,20 +9272,32 @@ var WebsyChart = /*#__PURE__*/function () {
9269
9272
  key: "removeline",
9270
9273
  value: function removeline(key) {
9271
9274
  /* global key d3 */
9272
- var lines = this.lineLayer.selectAll(".line_".concat(key)).transition(this.transition).style('stroke-opacity', 1e-6).remove();
9273
- var areas = this.areaLayer.selectAll(".area_".concat(key)).transition(this.transition).style('stroke-opacity', 1e-6).remove();
9275
+ var lines = this.lineLayer.selectAll(".line_".concat(key))
9276
+ // .transition()
9277
+ // .duration(this.options.transitionDuration)
9278
+ .style('stroke-opacity', 1e-6).remove();
9279
+ var areas = this.areaLayer.selectAll(".area_".concat(key))
9280
+ // .transition()
9281
+ // .duration(this.options.transitionDuration)
9282
+ .style('stroke-opacity', 1e-6).remove();
9274
9283
  }
9275
9284
  }, {
9276
9285
  key: "removelabel",
9277
9286
  value: function removelabel(key) {
9278
9287
  /* global key d3 */
9279
- var labels = this.labelLayer.selectAll(".label_".concat(key)).transition(this.transition).style('stroke-opacity', 1e-6).remove();
9288
+ var labels = this.labelLayer.selectAll(".label_".concat(key))
9289
+ // .transition()
9290
+ // .duration(this.options.transitionDuration)
9291
+ .style('stroke-opacity', 1e-6).remove();
9280
9292
  }
9281
9293
  }, {
9282
9294
  key: "removesymbol",
9283
9295
  value: function removesymbol(key) {
9284
9296
  /* global key d3 */
9285
- var symbols = this.symbolLayer.selectAll(".symbol_".concat(key)).transition(this.transition).style('stroke-opacity', 1e-6).remove();
9297
+ var symbols = this.symbolLayer.selectAll(".symbol_".concat(key))
9298
+ // .transition()
9299
+ // .duration(this.options.transitionDuration)
9300
+ .style('stroke-opacity', 1e-6).remove();
9286
9301
  }
9287
9302
  }, {
9288
9303
  key: "rendersymbol",
@@ -9304,11 +9319,15 @@ var WebsyChart = /*#__PURE__*/function () {
9304
9319
  }
9305
9320
  var symbols = this.symbolLayer.selectAll(".symbol_".concat(series.key)).data(series.data);
9306
9321
  // Exit
9307
- symbols.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
9322
+ symbols.exit()
9323
+ // .transition()
9324
+ // .duration(this.options.transitionDuration)
9325
+ // .style('fill-opacity', 1e-6)
9326
+ .remove();
9308
9327
  // Update
9309
9328
  symbols.attr('d', function (d) {
9310
9329
  return drawSymbol(d.y.size || series.symbolSize)(d);
9311
- }).transition(this.transition).attr('fill', function (d) {
9330
+ }).transition().duration(this.options.transitionDuration).attr('fill', function (d) {
9312
9331
  return series.fillSymbols ? d.y.color || series.color : 'white';
9313
9332
  }).attr('stroke', function (d) {
9314
9333
  return d.y.color || series.color;
@@ -9665,7 +9684,7 @@ var WebsyKPI = /*#__PURE__*/function () {
9665
9684
  }
9666
9685
  html += " \n <div class=\"websy-kpi-info\">\n <div class=\"websy-kpi-label-container\">\n <div class=\"websy-kpi-label ".concat(this.options.label.classes.join(' ') || '', "\">\n ").concat((this.options.label || {}).value || '', "\n </div>\n ");
9667
9686
  if (this.options.tooltip && this.options.tooltip.value) {
9668
- html += "\n <div class=\"websy-info ".concat(this.options.tooltip.classes.join(' ') || '', "\" data-info=\"").concat(this.options.tooltip.value, "\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><title>ionicons-v5-e</title><path d=\"M256,56C145.72,56,56,145.72,56,256s89.72,200,200,200,200-89.72,200-200S366.28,56,256,56Zm0,82a26,26,0,1,1-26,26A26,26,0,0,1,256,138Zm48,226H216a16,16,0,0,1,0-32h28V244H228a16,16,0,0,1,0-32h32a16,16,0,0,1,16,16V332h28a16,16,0,0,1,0,32Z\"/></svg>\n </div> \n ");
9687
+ html += "\n <div class=\"websy-info ".concat(this.options.tooltip.classes.join(' ') || '', "\" data-info=\"").concat(this.options.tooltip.value, "\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><path d=\"M256,56C145.72,56,56,145.72,56,256s89.72,200,200,200,200-89.72,200-200S366.28,56,256,56Zm0,82a26,26,0,1,1-26,26A26,26,0,0,1,256,138Zm48,226H216a16,16,0,0,1,0-32h28V244H228a16,16,0,0,1,0-32h32a16,16,0,0,1,16,16V332h28a16,16,0,0,1,0,32Z\"/></svg>\n </div> \n ");
9669
9688
  }
9670
9689
  html += "\n </div>\n <div class=\"websy-kpi-value ".concat(this.options.value.classes.join(' ') || '', "\">").concat(this.options.value.value, "</div>\n ");
9671
9690
  if (this.options.subValue) {
@@ -9880,7 +9899,10 @@ var WebsyMap = /*#__PURE__*/function () {
9880
9899
  // this.map.invalidateSize()
9881
9900
  // }
9882
9901
  if (this.geo) {
9883
- this.map.fitBounds(this.geo.getBounds());
9902
+ var b = this.geo.getBounds();
9903
+ if (b.isValid()) {
9904
+ this.map.fitBounds(this.geo.getBounds());
9905
+ }
9884
9906
  } else if (this.polygons) {
9885
9907
  // this.map.fitBounds(this.geo.getBounds())
9886
9908
  } else if (this.options.center) {