@websy/websy-designs 1.7.6 → 1.7.8

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.
@@ -7156,7 +7156,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
7156
7156
  bodyEl.innerHTML = this.buildBodyHtml(data, true);
7157
7157
  this.currentData = data;
7158
7158
  } else {
7159
- bodyEl.innerHTML += this.buildBodyHtml(data, true);
7159
+ if (bodyEl.querySelector('tbody')) {
7160
+ bodyEl.querySelector('tbody').innerHTML += this.buildBodyHtml(data, true, true);
7161
+ } else {
7162
+ bodyEl.innerHTML += this.buildBodyHtml(data, true);
7163
+ }
7164
+
7160
7165
  this.currentData = this.currentData.concat(data);
7161
7166
  }
7162
7167
  } // this.data = this.data.concat(data)
@@ -8253,39 +8258,50 @@ var WebsyChart = /*#__PURE__*/function () {
8253
8258
  var that = this;
8254
8259
 
8255
8260
  this.brushed = function (event) {
8256
- console.log('brushing', event);
8257
8261
  var newX = that.options.margin.left + that.options.margin.axisLeft + (1 - event.selection[0] / (that.plotWidth / (that.widthForCalc + that.totalBandPadding)));
8262
+ var newY = that.options.margin.top + that.options.margin.axisTop;
8263
+
8264
+ if (that.options.orientation === 'horizontal') {
8265
+ newX = that.options.brushHeight + that.options.margin.left + that.options.margin.axisLeft;
8266
+ newY = that.options.margin.top + that.options.margin.axisTop + (1 - event.selection[0] / (that.plotHeight / (that.widthForCalc + that.totalBandPadding)));
8267
+ }
8258
8268
 
8259
8269
  if (that.plotArea) {
8260
- that.plotArea.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop, ")"));
8270
+ that.plotArea.attr('transform', "translate(".concat(newX, ", ").concat(newY, ")"));
8261
8271
  }
8262
8272
 
8263
8273
  if (that.areaLayer) {
8264
- that.areaLayer.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop, ")"));
8274
+ that.areaLayer.attr('transform', "translate(".concat(newX, ", ").concat(newY, ")"));
8265
8275
  }
8266
8276
 
8267
8277
  if (that.lineLayer) {
8268
- that.lineLayer.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop, ")"));
8278
+ that.lineLayer.attr('transform', "translate(".concat(newX, ", ").concat(newY, ")"));
8269
8279
  }
8270
8280
 
8271
8281
  if (that.barLayer) {
8272
- that.barLayer.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop, ")"));
8282
+ that.barLayer.attr('transform', "translate(".concat(newX, ", ").concat(newY, ")"));
8273
8283
  }
8274
8284
 
8275
8285
  if (that.labelLayer) {
8276
- that.labelLayer.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop, ")"));
8286
+ that.labelLayer.attr('transform', "translate(".concat(newX, ", ").concat(newY, ")"));
8277
8287
  }
8278
8288
 
8279
8289
  if (that.symbolLayer) {
8280
- that.symbolLayer.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop, ")"));
8290
+ that.symbolLayer.attr('transform', "translate(".concat(newX, ", ").concat(newY, ")"));
8281
8291
  }
8282
8292
 
8283
8293
  if (that.refLineLayer) {
8284
- that.refLineLayer.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop, ")"));
8294
+ that.refLineLayer.attr('transform', "translate(".concat(newX, ", ").concat(newY, ")"));
8285
8295
  }
8286
8296
 
8287
- if (that.bottomAxisLayer) {
8288
- that.bottomAxisLayer.attr('transform', "translate(".concat(newX, ", ").concat(that.options.margin.top + that.options.margin.axisTop + that.plotHeight, ")"));
8297
+ if (that.options.orientation === 'horizontal') {
8298
+ if (that.leftAxisLayer) {
8299
+ that.leftAxisLayer.attr('transform', "translate(".concat(that.options.brushHeight + that.options.margin.left + that.options.margin.axisLeft, ", ").concat(newY, ")"));
8300
+ }
8301
+ } else {
8302
+ if (that.bottomAxisLayer) {
8303
+ that.bottomAxisLayer.attr('transform', "translate(".concat(newX, ", ").concat(newY + that.plotHeight, ")"));
8304
+ }
8289
8305
  } // that.brushedDomain = []
8290
8306
  // let xAxis = 'bottom'
8291
8307
  // let xAxisCaps = 'Bottom'
@@ -8380,18 +8396,18 @@ var WebsyChart = /*#__PURE__*/function () {
8380
8396
  _createClass(WebsyChart, [{
8381
8397
  key: "close",
8382
8398
  value: function close() {
8383
- this.leftAxisLayer.selectAll('*').remove();
8384
- this.rightAxisLayer.selectAll('*').remove();
8385
- this.bottomAxisLayer.selectAll('*').remove();
8386
- this.leftAxisLabel.selectAll('*').remove();
8387
- this.rightAxisLabel.selectAll('*').remove();
8388
- this.bottomAxisLabel.selectAll('*').remove();
8389
- this.plotArea.selectAll('*').remove();
8390
- this.areaLayer.selectAll('*').remove();
8391
- this.lineLayer.selectAll('*').remove();
8392
- this.barLayer.selectAll('*').remove();
8393
- this.labelLayer.selectAll('*').remove();
8394
- this.symbolLayer.selectAll('*').remove();
8399
+ this.leftAxisLayer && this.leftAxisLayer.selectAll('*').remove();
8400
+ this.rightAxisLayer && this.rightAxisLayer.selectAll('*').remove();
8401
+ this.bottomAxisLayer && this.bottomAxisLayer.selectAll('*').remove();
8402
+ this.leftAxisLabel && this.leftAxisLabel.selectAll('*').remove();
8403
+ this.rightAxisLabel && this.rightAxisLabel.selectAll('*').remove();
8404
+ this.bottomAxisLabel && this.bottomAxisLabel.selectAll('*').remove();
8405
+ this.plotArea && this.plotArea.selectAll('*').remove();
8406
+ this.areaLayer && this.areaLayer.selectAll('*').remove();
8407
+ this.lineLayer && this.lineLayer.selectAll('*').remove();
8408
+ this.barLayer && this.barLayer.selectAll('*').remove();
8409
+ this.labelLayer && this.labelLayer.selectAll('*').remove();
8410
+ this.symbolLayer && this.symbolLayer.selectAll('*').remove();
8395
8411
  }
8396
8412
  }, {
8397
8413
  key: "createDomain",
@@ -8689,8 +8705,7 @@ var WebsyChart = /*#__PURE__*/function () {
8689
8705
  this.xAxisClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_xAxisClip")).append('rect');
8690
8706
  this.yAxisClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_yAxisClip")).append('rect');
8691
8707
  this.brushClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_brushclip")).append('rect');
8692
- this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer'); // .attr('clip-path', `url(#${this.elementId}_yAxisClip)`).append('g')
8693
-
8708
+ this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer').attr('clip-path', "url(#".concat(this.elementId, "_yAxisClip)")).append('g');
8694
8709
  this.rightAxisLayer = this.svg.append('g').attr('class', 'right-axis-layer');
8695
8710
  this.bottomAxisLayer = this.svg.append('g').attr('class', 'bottom-axis-layer').attr('clip-path', "url(#".concat(this.elementId, "_xAxisClip)")).append('g');
8696
8711
  this.leftAxisLabel = this.svg.append('g').attr('class', 'left-axis-label-layer');
@@ -9128,28 +9143,31 @@ var WebsyChart = /*#__PURE__*/function () {
9128
9143
  // Translate the layers
9129
9144
 
9130
9145
 
9131
- this.leftAxisLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.left && this.options.data.left.fontSize || this.options.fontSize);
9132
- this.rightAxisLayer.attr('transform', "translate(".concat(this.options.margin.left + this.plotWidth + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.right && this.options.data.right.fontSize || this.options.fontSize);
9133
- this.bottomAxisLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).style('font-size', this.options.data.bottom && this.options.data.bottom.fontSize || this.options.fontSize);
9134
- this.leftAxisLabel.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9135
- this.rightAxisLabel.attr('transform', "translate(".concat(this.options.margin.left + this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9136
- this.bottomAxisLabel.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")"));
9137
- this.plotArea.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9138
- this.areaLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9139
- this.lineLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9140
- this.barLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9141
- this.labelLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9142
- this.symbolLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9143
- this.refLineLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9144
- this.trackingLineLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9145
- this.clip.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", 0)")).attr('width', this.plotWidth).attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop);
9146
+ var leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight + 5 : 0;
9147
+ this.leftAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.left && this.options.data.left.fontSize || this.options.fontSize);
9148
+ this.rightAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.plotWidth + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.right && this.options.data.right.fontSize || this.options.fontSize);
9149
+ this.bottomAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).style('font-size', this.options.data.bottom && this.options.data.bottom.fontSize || this.options.fontSize);
9150
+ this.leftAxisLabel.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9151
+ this.rightAxisLabel.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9152
+ this.bottomAxisLabel.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")"));
9153
+ this.plotArea.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9154
+ this.areaLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9155
+ this.lineLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9156
+ this.barLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9157
+ this.labelLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9158
+ this.symbolLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9159
+ this.refLineLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9160
+ this.trackingLineLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9161
+ this.clip.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", 0)")).attr('width', this.plotWidth).attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop);
9146
9162
 
9147
9163
  if (this.options.orientation === 'horizontal') {
9148
9164
  this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9149
- this.yAxisClip.attr('transform', "translate(".concat(this.options.brushHeight + this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).attr('width', this.options.margin.axisLeft - this.options.brushHeight).attr('height', this.plotHeight);
9165
+ this.yAxisClip.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).attr('width', this.options.margin.axisLeft + 10).attr('height', this.plotHeight);
9166
+ this.xAxisClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight).attr('height', longestBottomBounds.height + 10);
9150
9167
  this.brushClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).attr('height', this.plotHeight).attr('width', this.options.brushHeight);
9151
9168
  } else {
9152
9169
  this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height, ")"));
9170
+ this.yAxisClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop - 10, ")")).attr('width', this.options.margin.axisLeft + 10).attr('height', this.plotHeight + 20);
9153
9171
  this.xAxisClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight).attr('height', longestBottomBounds.height + 10);
9154
9172
  this.brushClip.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height, ")")).attr('width', this.plotWidth).attr('height', this.options.brushHeight);
9155
9173
  }
@@ -9630,7 +9648,7 @@ var WebsyChart = /*#__PURE__*/function () {
9630
9648
  if (this.options.orientation === 'horizontal') {
9631
9649
  output = Math.max(1, this.options.data[xAxis].bandWidth - (xAxis.indexOf('Brush') !== -1 ? 2 : this.options.groupPadding * 2));
9632
9650
  } else {
9633
- var x = getBarX.call(this, d, i, xAxis);
9651
+ var x = getBarX.call(this, d, i, yAxis, xAxis);
9634
9652
 
9635
9653
  if (typeof x === 'undefined' || x === null) {
9636
9654
  return null;
@@ -9646,13 +9664,15 @@ var WebsyChart = /*#__PURE__*/function () {
9646
9664
  return output;
9647
9665
  }
9648
9666
 
9649
- function getBarWidth(d, i, xAxis) {
9667
+ function getBarWidth(d, i, yAxis, xAxis) {
9650
9668
  var output;
9651
9669
 
9652
9670
  if (this.options.orientation === 'horizontal') {
9653
- output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value)); // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
9671
+ // output = this[`${yAxis}Axis`](Math.abs(d.y.value))
9672
+ output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value)); // output = (this[`${yAxis}Axis`](0)) + this[`${yAxis}Axis`](Math.abs(d.y.value))
9673
+ // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
9654
9674
  } else {
9655
- var x = getBarX.call(this, d, i, xAxis);
9675
+ var x = getBarX.call(this, d, i, yAxis, xAxis);
9656
9676
 
9657
9677
  if (typeof x === 'undefined' || x === null) {
9658
9678
  return null;
@@ -9668,28 +9688,40 @@ var WebsyChart = /*#__PURE__*/function () {
9668
9688
  return output;
9669
9689
  }
9670
9690
 
9671
- function getBarX(d, i, xAxis) {
9691
+ function getBarX(d, i, yAxis, xAxis) {
9672
9692
  var output;
9673
9693
 
9674
9694
  if (this.options.orientation === 'horizontal') {
9695
+ // if (this.options.grouping === 'stacked') {
9696
+ // // let h = getBarWidth.call(this, d, i, xAxis)
9697
+ // // let adjustment = 0
9698
+ // // if (d.y.accumulative && d.y.accumulative !== 0) {
9699
+ // // adjustment = this[`${yAxis}Axis`](d.y.accumulative || 0)
9700
+ // // }
9701
+ // // output = this[`${yAxis}Axis`](0) + (adjustment * (d.y.value < 0 ? 1 : 0)) + (h * (d.y.value < 0 ? 1 : 0))
9702
+ // let accH = getBarWidth.call(this, {x: d.x, y: { value: d.y.accumulative }}, i, xAxis)
9703
+ // // let h = getBarWidth.call(this, d, i, xAxis)
9704
+ // output = (accH * (d.y.accumulative < 0 ? 0 : 1))
9705
+ // }
9706
+ // else {
9707
+ // let h = getBarWidth.call(this, d, i, xAxis)
9708
+ // output = (this[`${yAxis}Axis`](0)) + (h * (d.y.value < 0 ? 1 : 0))
9709
+ // }
9675
9710
  if (this.options.grouping === 'stacked') {
9676
- // let h = getBarWidth.call(this, d, i, xAxis)
9677
- // let adjustment = 0
9678
- // if (d.y.accumulative && d.y.accumulative !== 0) {
9679
- // adjustment = this[`${yAxis}Axis`](d.y.accumulative || 0)
9680
- // }
9681
- // output = this[`${yAxis}Axis`](0) + (adjustment * (d.y.value < 0 ? 1 : 0)) + (h * (d.y.value < 0 ? 1 : 0))
9711
+ // no support for stacks yet
9682
9712
  var accH = getBarWidth.call(this, {
9683
9713
  x: d.x,
9684
9714
  y: {
9685
9715
  value: d.y.accumulative
9686
9716
  }
9687
- }, i, xAxis); // let h = getBarWidth.call(this, d, i, xAxis)
9717
+ }, i, yAxis, xAxis);
9718
+ var h = getBarWidth.call(this, d, i, yAxis, xAxis); // output = (this[`${yAxis}Axis`](0)) + ((accH + h) * (d.y.accumulative > 0 ? 0 : 1))
9688
9719
 
9689
- output = accH * (d.y.accumulative < 0 ? 0 : 1);
9720
+ output = this["".concat(yAxis, "Axis")](0) + accH * (d.y.accumulative > 0 ? 1 : 0);
9690
9721
  } else {
9691
- var h = getBarWidth.call(this, d, i, xAxis);
9692
- output = this["".concat(yAxis, "Axis")](0) + h * (d.y.value < 0 ? 1 : 0);
9722
+ var _h = getBarWidth.call(this, d, i, yAxis, xAxis);
9723
+
9724
+ output = this["".concat(yAxis, "Axis")](0) + _h * (d.y.value > 0 ? 0 : 1);
9693
9725
  }
9694
9726
  } else {
9695
9727
  // let adjustment = this.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : this.options.data[xAxis.replace('Brush', '')].bandWidth / 2
@@ -9773,9 +9805,9 @@ var WebsyChart = /*#__PURE__*/function () {
9773
9805
  var h = getBarHeight.call(this, d, i, yAxis, xAxis);
9774
9806
  output = this["".concat(yAxis, "Axis")](0) - (accH + h) * (d.y.accumulative < 0 ? 0 : 1);
9775
9807
  } else {
9776
- var _h = getBarHeight.call(this, d, i, yAxis, xAxis);
9808
+ var _h2 = getBarHeight.call(this, d, i, yAxis, xAxis);
9777
9809
 
9778
- output = this["".concat(yAxis, "Axis")](0) - _h * (d.y.value < 0 ? 0 : 1);
9810
+ output = this["".concat(yAxis, "Axis")](0) - _h2 * (d.y.value < 0 ? 0 : 1);
9779
9811
  }
9780
9812
  }
9781
9813
 
@@ -9788,11 +9820,11 @@ var WebsyChart = /*#__PURE__*/function () {
9788
9820
 
9789
9821
  bars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
9790
9822
  bars.attr('width', function (d, i) {
9791
- return Math.abs(getBarWidth.call(_this53, d, i, xAxis));
9823
+ return Math.abs(getBarWidth.call(_this53, d, i, yAxis, xAxis));
9792
9824
  }).attr('height', function (d, i) {
9793
9825
  return getBarHeight.call(_this53, d, i, yAxis, xAxis);
9794
9826
  }).attr('x', function (d, i) {
9795
- return getBarX.call(_this53, d, i, xAxis);
9827
+ return getBarX.call(_this53, d, i, yAxis, xAxis);
9796
9828
  }).attr('y', function (d, i) {
9797
9829
  return getBarY.call(_this53, d, i, yAxis, xAxis);
9798
9830
  }) // .transition(this.transition)
@@ -9800,11 +9832,11 @@ var WebsyChart = /*#__PURE__*/function () {
9800
9832
  return d.y.color || d.color || series.color;
9801
9833
  });
9802
9834
  bars.enter().append('rect').attr('width', function (d, i) {
9803
- return Math.abs(getBarWidth.call(_this53, d, i, xAxis));
9835
+ return Math.abs(getBarWidth.call(_this53, d, i, yAxis, xAxis));
9804
9836
  }).attr('height', function (d, i) {
9805
9837
  return getBarHeight.call(_this53, d, i, yAxis, xAxis);
9806
9838
  }).attr('x', function (d, i) {
9807
- return getBarX.call(_this53, d, i, xAxis);
9839
+ return getBarX.call(_this53, d, i, yAxis, xAxis);
9808
9840
  }).attr('y', function (d, i) {
9809
9841
  return getBarY.call(_this53, d, i, yAxis, xAxis);
9810
9842
  }) // .transition(this.transition)
@@ -9818,11 +9850,11 @@ var WebsyChart = /*#__PURE__*/function () {
9818
9850
  this.brushBarsInitialized[series.key] = true;
9819
9851
  brushBars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
9820
9852
  brushBars.attr('width', function (d, i) {
9821
- return Math.abs(getBarWidth.call(_this53, d, i, "".concat(xAxis, "Brush")));
9853
+ return Math.abs(getBarWidth.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
9822
9854
  }).attr('height', function (d, i) {
9823
9855
  return getBarHeight.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9824
9856
  }).attr('x', function (d, i) {
9825
- return getBarX.call(_this53, d, i, "".concat(xAxis, "Brush"));
9857
+ return getBarX.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9826
9858
  }).attr('y', function (d, i) {
9827
9859
  return getBarY.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9828
9860
  }) // .transition(this.transition)
@@ -9830,11 +9862,11 @@ var WebsyChart = /*#__PURE__*/function () {
9830
9862
  return d.y.color || d.color || series.color;
9831
9863
  });
9832
9864
  brushBars.enter().append('rect').attr('width', function (d, i) {
9833
- return Math.abs(getBarWidth.call(_this53, d, i, "".concat(xAxis, "Brush")));
9865
+ return Math.abs(getBarWidth.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
9834
9866
  }).attr('height', function (d, i) {
9835
9867
  return getBarHeight.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9836
9868
  }).attr('x', function (d, i) {
9837
- return getBarX.call(_this53, d, i, "".concat(xAxis, "Brush"));
9869
+ return getBarX.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9838
9870
  }).attr('y', function (d, i) {
9839
9871
  return getBarY.call(_this53, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9840
9872
  }) // .transition(this.transition)
@@ -9892,6 +9924,14 @@ var WebsyChart = /*#__PURE__*/function () {
9892
9924
  this.setAttribute('text-anchor', 'end');
9893
9925
  this.setAttribute('x', +this.getAttribute('x') - 8);
9894
9926
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9927
+ } else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
9928
+ this.setAttribute('text-anchor', 'end');
9929
+ this.setAttribute('x', +this.getAttribute('x') - 8);
9930
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
9931
+ } else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
9932
+ this.setAttribute('text-anchor', 'start');
9933
+ this.setAttribute('x', +this.getAttribute('x') + 8);
9934
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9895
9935
  } else if (series.labelPosition === 'outside') {
9896
9936
  this.setAttribute('text-anchor', 'start');
9897
9937
  this.setAttribute('x', +this.getAttribute('x') + 8);
@@ -9925,6 +9965,14 @@ var WebsyChart = /*#__PURE__*/function () {
9925
9965
  this.setAttribute('text-anchor', 'end');
9926
9966
  this.setAttribute('x', +this.getAttribute('x') - 8);
9927
9967
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9968
+ } else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
9969
+ this.setAttribute('text-anchor', 'end');
9970
+ this.setAttribute('x', +this.getAttribute('x') - 8);
9971
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
9972
+ } else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
9973
+ this.setAttribute('text-anchor', 'start');
9974
+ this.setAttribute('x', +this.getAttribute('x') + 8);
9975
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9928
9976
  } else if (series.labelPosition === 'outside') {
9929
9977
  this.setAttribute('text-anchor', 'start');
9930
9978
  this.setAttribute('x', +this.getAttribute('x') + 8);