@websy/websy-designs 1.7.2 → 1.7.4

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.
@@ -7308,8 +7308,9 @@ else {
7308
7308
  this.defs = this.svg.append('defs')
7309
7309
  this.clip = this.defs.append('clipPath').attr('id', `${this.elementId}_clip`).append('rect')
7310
7310
  this.xAxisClip = this.defs.append('clipPath').attr('id', `${this.elementId}_xAxisClip`).append('rect')
7311
+ this.yAxisClip = this.defs.append('clipPath').attr('id', `${this.elementId}_yAxisClip`).append('rect')
7311
7312
  this.brushClip = this.defs.append('clipPath').attr('id', `${this.elementId}_brushclip`).append('rect')
7312
- this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer')
7313
+ this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer') // .attr('clip-path', `url(#${this.elementId}_yAxisClip)`).append('g')
7313
7314
  this.rightAxisLayer = this.svg.append('g').attr('class', 'right-axis-layer')
7314
7315
  this.bottomAxisLayer = this.svg.append('g').attr('class', 'bottom-axis-layer').attr('clip-path', `url(#${this.elementId}_xAxisClip)`).append('g')
7315
7316
  this.leftAxisLabel = this.svg.append('g').attr('class', 'left-axis-label-layer')
@@ -7719,20 +7720,34 @@ else {
7719
7720
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
7720
7721
  this.trackingLineLayer
7721
7722
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
7722
- this.brushLayer
7723
- .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
7724
7723
  this.clip
7725
7724
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, 0)`)
7726
7725
  .attr('width', this.plotWidth)
7727
7726
  .attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop)
7728
- this.xAxisClip
7729
- .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
7730
- .attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
7731
- .attr('height', longestBottomBounds.height + 10)
7732
- this.brushClip
7733
- .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
7734
- .attr('width', this.plotWidth)
7735
- .attr('height', this.options.brushHeight)
7727
+ if (this.options.orientation === 'horizontal') {
7728
+ this.brushLayer
7729
+ .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
7730
+ this.yAxisClip
7731
+ .attr('transform', `translate(${this.options.brushHeight + this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
7732
+ .attr('width', this.options.margin.axisLeft - this.options.brushHeight)
7733
+ .attr('height', this.plotHeight)
7734
+ this.brushClip
7735
+ .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
7736
+ .attr('height', this.plotHeight)
7737
+ .attr('width', this.options.brushHeight)
7738
+ }
7739
+ else {
7740
+ this.brushLayer
7741
+ .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
7742
+ this.xAxisClip
7743
+ .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
7744
+ .attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
7745
+ .attr('height', longestBottomBounds.height + 10)
7746
+ this.brushClip
7747
+ .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
7748
+ .attr('width', this.plotWidth)
7749
+ .attr('height', this.options.brushHeight)
7750
+ }
7736
7751
  this.eventLayer
7737
7752
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
7738
7753
  let that = this
@@ -7750,9 +7765,10 @@ else {
7750
7765
  let bottomRange = [0, this.plotWidth]
7751
7766
  let bottomBrushRange = [0, this.plotWidth]
7752
7767
  let leftRange = [this.plotHeight, 0]
7753
- let leftBrushRange = [this.options.brushHeight, 0]
7768
+ let leftBrushRange = [this.options.brushHeight, 0]
7754
7769
  if (this.options.orientation === 'horizontal') {
7755
7770
  leftBrushRange = [this.plotHeight, 0]
7771
+ bottomBrushRange = [0, this.options.brushHeight]
7756
7772
  }
7757
7773
  this.widthForCalc = (proposedBandWidth * noOfPoints) // + totalPadding
7758
7774
  this.customBottomRange = []
@@ -7835,10 +7851,13 @@ else {
7835
7851
  brushMethod = 'brushY'
7836
7852
  brushLength = this.options.brushHeight
7837
7853
  brushThickness = this.plotHeight
7854
+ if (this.brushNeeded) {
7855
+ brushEnd = this.plotHeight * (this.plotHeight / (this.widthForCalc + this.totalBandPadding))
7856
+ }
7838
7857
  }
7839
7858
  else {
7840
- if (this.brushNeeded) {
7841
- brushEnd = this.plotWidth * (this.plotWidth / (this.widthForCalc + this.totalBandPadding))
7859
+ if (this.brushNeeded) {
7860
+ brushEnd = this.plotWidth * (this.plotWidth / (this.widthForCalc + this.totalBandPadding))
7842
7861
  }
7843
7862
  }
7844
7863
  this.brush = d3[brushMethod]()
@@ -8000,7 +8019,7 @@ else {
8000
8019
  }
8001
8020
  // Configure the left axis
8002
8021
  let leftDomain = this.createDomain('left')
8003
- let leftBrushDomain = this.createDomain('left', true)
8022
+ let leftBrushDomain = this.createDomain('left')
8004
8023
  let rightDomain = this.createDomain('right')
8005
8024
  this.leftAxis = d3[`scale${this.options.data.left.scale || 'Linear'}`]()
8006
8025
  .domain(leftDomain)
@@ -8163,13 +8182,17 @@ const drawArea = (xAxis, yAxis, curveStyle) => {
8163
8182
  return d3
8164
8183
  .area()
8165
8184
  .x(d => {
8166
- // return this[`${xAxis}Axis`](this.parseX(d.x.value))
8167
- let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
8168
- let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
8169
- if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
8170
- xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
8185
+ if (this.options.data[xAxis].scale === 'Time') {
8186
+ return this[`${xAxis}Axis`](this.parseX(d.x.value))
8187
+ }
8188
+ else {
8189
+ let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
8190
+ let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
8191
+ if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
8192
+ xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
8193
+ }
8194
+ return xPos
8171
8195
  }
8172
- return xPos
8173
8196
  })
8174
8197
  .y0(d => {
8175
8198
  return this[`${yAxis}Axis`](0)
@@ -8247,6 +8270,7 @@ function getBarWidth (d, i, xAxis) {
8247
8270
  let output
8248
8271
  if (this.options.orientation === 'horizontal') {
8249
8272
  output = this[`${yAxis}Axis`](Math.abs(d.y.value))
8273
+ // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
8250
8274
  }
8251
8275
  else {
8252
8276
  let x = getBarX.call(this, d, i, xAxis)
@@ -8286,15 +8310,7 @@ function getBarX (d, i, xAxis) {
8286
8310
  let xIndex = 0
8287
8311
  if (this.processedX[d.x.value]) {
8288
8312
  xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel))
8289
- }
8290
- // let barAdjustment =
8291
- // (this.options.data[xAxis].bandWidth * xIndex) +
8292
- // (xIndex * this.options.groupPadding * 2) + this.options.groupPadding +
8293
- // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
8294
- // let barAdjustment =
8295
- // (this.options.data[xAxis.replace('Brush', '')].step * xIndex) +
8296
- // this.options.groupPadding
8297
- // // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
8313
+ }
8298
8314
  let barAdjustment = (this.options.data[xAxis].bandWidth * xIndex) + ((xAxis.indexOf('Brush') !== -1 ? this.brushBandPadding : this.bandPadding) / 2) + (xAxis.indexOf('Brush') !== -1 ? 1 : this.options.groupPadding)
8299
8315
  if (this[`custom${xAxis.toInitialCaps()}Range`].length > 0) {
8300
8316
  output = this[`custom${xAxis.toInitialCaps()}Range`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment
@@ -8329,7 +8345,25 @@ function getBarY (d, i, yAxis, xAxis) {
8329
8345
  output = this[`custom${xAxis.toInitialCaps()}Range`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment
8330
8346
  }
8331
8347
  else {
8332
- output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + ((d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth)
8348
+ // output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + ((d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth)
8349
+ let xIndex = 0
8350
+ if (this.processedX[d.x.value]) {
8351
+ xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel))
8352
+ }
8353
+ let barAdjustment = (this.options.data[xAxis].bandWidth * xIndex) + ((xAxis.indexOf('Brush') !== -1 ? this.brushBandPadding : this.bandPadding) / 2) + (xAxis.indexOf('Brush') !== -1 ? 1 : this.options.groupPadding)
8354
+ if (this[`custom${xAxis.toInitialCaps()}Range`].length > 0) {
8355
+ output = this[`custom${xAxis.toInitialCaps()}Range`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment
8356
+ // output = this[`custom${xAxis.toInitialCaps().replace('Brush', '')}DetailRange`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)]
8357
+ }
8358
+ else {
8359
+ output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + barAdjustment
8360
+ }
8361
+ if (!this.processedX[d.x.value]) {
8362
+ this.processedX[d.x.value] = []
8363
+ }
8364
+ if (this.processedX[d.x.value].indexOf(d.y.tooltipLabel) === -1) {
8365
+ this.processedX[d.x.value].push(d.y.tooltipLabel)
8366
+ }
8333
8367
  }
8334
8368
  }
8335
8369
  else {
@@ -8570,14 +8604,17 @@ const drawLine = (xAxis, yAxis, curveStyle) => {
8570
8604
  return this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)
8571
8605
  }
8572
8606
  else {
8573
- let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
8574
- let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
8575
- if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
8576
- xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
8607
+ if (this.options.data[xAxis].scale === 'Time') {
8608
+ return this[`${xAxis}Axis`](this.parseX(d.x.value))
8577
8609
  }
8578
- // let adjustment = this.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : this.options.data[xAxis].bandWidth / 2
8579
- // return this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment
8580
- return xPos
8610
+ else {
8611
+ let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
8612
+ let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
8613
+ if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
8614
+ xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
8615
+ }
8616
+ return xPos
8617
+ }
8581
8618
  }
8582
8619
  })
8583
8620
  .y(d => {
@@ -8788,6 +8825,9 @@ symbols
8788
8825
  return `translate(${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)}, ${xPos})`
8789
8826
  }
8790
8827
  else {
8828
+ if (this.options.data[xAxis].scale === 'Time') {
8829
+ xPos = this[`${xAxis}Axis`](this.parseX(d.x.value))
8830
+ }
8791
8831
  // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
8792
8832
  return `translate(${xPos}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
8793
8833
  }
@@ -8811,6 +8851,9 @@ symbols.enter()
8811
8851
  return `translate(${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)}, ${xPos})`
8812
8852
  }
8813
8853
  else {
8854
+ if (this.options.data[xAxis].scale === 'Time') {
8855
+ xPos = this[`${xAxis}Axis`](this.parseX(d.x.value))
8856
+ }
8814
8857
  // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
8815
8858
  return `translate(${xPos}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
8816
8859
  }
@@ -8059,8 +8059,10 @@ var WebsyChart = /*#__PURE__*/function () {
8059
8059
  this.defs = this.svg.append('defs');
8060
8060
  this.clip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_clip")).append('rect');
8061
8061
  this.xAxisClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_xAxisClip")).append('rect');
8062
+ this.yAxisClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_yAxisClip")).append('rect');
8062
8063
  this.brushClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_brushclip")).append('rect');
8063
- this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer');
8064
+ this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer'); // .attr('clip-path', `url(#${this.elementId}_yAxisClip)`).append('g')
8065
+
8064
8066
  this.rightAxisLayer = this.svg.append('g').attr('class', 'right-axis-layer');
8065
8067
  this.bottomAxisLayer = this.svg.append('g').attr('class', 'bottom-axis-layer').attr('clip-path', "url(#".concat(this.elementId, "_xAxisClip)")).append('g');
8066
8068
  this.leftAxisLabel = this.svg.append('g').attr('class', 'left-axis-label-layer');
@@ -8512,10 +8514,18 @@ var WebsyChart = /*#__PURE__*/function () {
8512
8514
  this.symbolLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8513
8515
  this.refLineLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8514
8516
  this.trackingLineLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8515
- 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, ")"));
8516
8517
  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);
8517
- 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);
8518
- 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);
8518
+
8519
+ if (this.options.orientation === 'horizontal') {
8520
+ this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8521
+ 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);
8522
+ 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);
8523
+ } else {
8524
+ 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, ")"));
8525
+ 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);
8526
+ 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);
8527
+ }
8528
+
8519
8529
  this.eventLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8520
8530
  var that = this;
8521
8531
  this.eventLayer.attr('x', 0).attr('y', 0).attr('width', this.plotWidth).attr('height', this.plotHeight).attr('fill-opacity', '0'); // this.tooltip.transform(this.options.margin.left + this.options.margin.axisLeft, this.options.margin.top + this.options.margin.axisTop)
@@ -8531,6 +8541,7 @@ var WebsyChart = /*#__PURE__*/function () {
8531
8541
 
8532
8542
  if (this.options.orientation === 'horizontal') {
8533
8543
  leftBrushRange = [this.plotHeight, 0];
8544
+ bottomBrushRange = [0, this.options.brushHeight];
8534
8545
  }
8535
8546
 
8536
8547
  this.widthForCalc = proposedBandWidth * noOfPoints; // + totalPadding
@@ -8623,6 +8634,10 @@ var WebsyChart = /*#__PURE__*/function () {
8623
8634
  brushMethod = 'brushY';
8624
8635
  brushLength = this.options.brushHeight;
8625
8636
  brushThickness = this.plotHeight;
8637
+
8638
+ if (this.brushNeeded) {
8639
+ brushEnd = this.plotHeight * (this.plotHeight / (this.widthForCalc + this.totalBandPadding));
8640
+ }
8626
8641
  } else {
8627
8642
  if (this.brushNeeded) {
8628
8643
  brushEnd = this.plotWidth * (this.plotWidth / (this.widthForCalc + this.totalBandPadding));
@@ -8772,7 +8787,7 @@ var WebsyChart = /*#__PURE__*/function () {
8772
8787
 
8773
8788
 
8774
8789
  var leftDomain = this.createDomain('left');
8775
- var leftBrushDomain = this.createDomain('left', true);
8790
+ var leftBrushDomain = this.createDomain('left');
8776
8791
  var rightDomain = this.createDomain('right');
8777
8792
  this.leftAxis = d3["scale".concat(this.options.data.left.scale || 'Linear')]().domain(leftDomain).range(leftRange);
8778
8793
  this.leftBrushAxis = d3["scale".concat(this.options.data.left.scale || 'Linear')]().domain(leftBrushDomain).range(leftBrushRange);
@@ -8912,16 +8927,19 @@ var WebsyChart = /*#__PURE__*/function () {
8912
8927
  /* global d3 series index */
8913
8928
  var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
8914
8929
  return d3.area().x(function (d) {
8915
- // return this[`${xAxis}Axis`](this.parseX(d.x.value))
8916
- var xIndex = _this48[xAxis + 'Axis'].domain().indexOf(d.x.value);
8930
+ if (_this48.options.data[xAxis].scale === 'Time') {
8931
+ return _this48["".concat(xAxis, "Axis")](_this48.parseX(d.x.value));
8932
+ } else {
8933
+ var xIndex = _this48[xAxis + 'Axis'].domain().indexOf(d.x.value);
8917
8934
 
8918
- var xPos = _this48["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
8935
+ var xPos = _this48["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
8919
8936
 
8920
- if (_this48["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
8921
- xPos = xPos + (_this48["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
8922
- }
8937
+ if (_this48["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
8938
+ xPos = xPos + (_this48["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
8939
+ }
8923
8940
 
8924
- return xPos;
8941
+ return xPos;
8942
+ }
8925
8943
  }).y0(function (d) {
8926
8944
  return _this48["".concat(yAxis, "Axis")](0);
8927
8945
  }).y1(function (d) {
@@ -9004,7 +9022,7 @@ var WebsyChart = /*#__PURE__*/function () {
9004
9022
  var output;
9005
9023
 
9006
9024
  if (this.options.orientation === 'horizontal') {
9007
- output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value));
9025
+ output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value)); // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
9008
9026
  } else {
9009
9027
  var x = getBarX.call(this, d, i, xAxis);
9010
9028
 
@@ -9053,15 +9071,7 @@ var WebsyChart = /*#__PURE__*/function () {
9053
9071
 
9054
9072
  if (this.processedX[d.x.value]) {
9055
9073
  xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel));
9056
- } // let barAdjustment =
9057
- // (this.options.data[xAxis].bandWidth * xIndex) +
9058
- // (xIndex * this.options.groupPadding * 2) + this.options.groupPadding +
9059
- // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
9060
- // let barAdjustment =
9061
- // (this.options.data[xAxis.replace('Brush', '')].step * xIndex) +
9062
- // this.options.groupPadding
9063
- // // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
9064
-
9074
+ }
9065
9075
 
9066
9076
  var barAdjustment = this.options.data[xAxis].bandWidth * xIndex + (xAxis.indexOf('Brush') !== -1 ? this.brushBandPadding : this.bandPadding) / 2 + (xAxis.indexOf('Brush') !== -1 ? 1 : this.options.groupPadding);
9067
9077
 
@@ -9101,7 +9111,28 @@ var WebsyChart = /*#__PURE__*/function () {
9101
9111
  var barAdjustment = (xAxis.indexOf('Brush') !== -1 ? this.brushBandPadding : this.bandPadding) / 2 + (xAxis.indexOf('Brush') !== -1 ? 1 : this.options.groupPadding);
9102
9112
  output = this["custom".concat(xAxis.toInitialCaps(), "Range")][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment;
9103
9113
  } else {
9104
- output = this["".concat(xAxis, "Axis")](this.parseX(d.x.value)) + (d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth;
9114
+ // output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + ((d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth)
9115
+ var xIndex = 0;
9116
+
9117
+ if (this.processedX[d.x.value]) {
9118
+ xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel));
9119
+ }
9120
+
9121
+ var _barAdjustment2 = this.options.data[xAxis].bandWidth * xIndex + (xAxis.indexOf('Brush') !== -1 ? this.brushBandPadding : this.bandPadding) / 2 + (xAxis.indexOf('Brush') !== -1 ? 1 : this.options.groupPadding);
9122
+
9123
+ if (this["custom".concat(xAxis.toInitialCaps(), "Range")].length > 0) {
9124
+ output = this["custom".concat(xAxis.toInitialCaps(), "Range")][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + _barAdjustment2; // output = this[`custom${xAxis.toInitialCaps().replace('Brush', '')}DetailRange`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)]
9125
+ } else {
9126
+ output = this["".concat(xAxis, "Axis")](this.parseX(d.x.value)) + _barAdjustment2;
9127
+ }
9128
+
9129
+ if (!this.processedX[d.x.value]) {
9130
+ this.processedX[d.x.value] = [];
9131
+ }
9132
+
9133
+ if (this.processedX[d.x.value].indexOf(d.y.tooltipLabel) === -1) {
9134
+ this.processedX[d.x.value].push(d.y.tooltipLabel);
9135
+ }
9105
9136
  }
9106
9137
  } else {
9107
9138
  if (this.options.grouping === 'stacked') {
@@ -9341,17 +9372,19 @@ var WebsyChart = /*#__PURE__*/function () {
9341
9372
  if (_this51.options.orientation === 'horizontal') {
9342
9373
  return _this51["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
9343
9374
  } else {
9344
- var xIndex = _this51[xAxis + 'Axis'].domain().indexOf(d.x.value);
9345
-
9346
- var xPos = _this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9375
+ if (_this51.options.data[xAxis].scale === 'Time') {
9376
+ return _this51["".concat(xAxis, "Axis")](_this51.parseX(d.x.value));
9377
+ } else {
9378
+ var xIndex = _this51[xAxis + 'Axis'].domain().indexOf(d.x.value);
9347
9379
 
9348
- if (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9349
- xPos = xPos + (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9350
- } // let adjustment = this.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : this.options.data[xAxis].bandWidth / 2
9351
- // return this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment
9380
+ var xPos = _this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9352
9381
 
9382
+ if (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9383
+ xPos = xPos + (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9384
+ }
9353
9385
 
9354
- return xPos;
9386
+ return xPos;
9387
+ }
9355
9388
  }
9356
9389
  }).y(function (d) {
9357
9390
  if (_this51.options.orientation === 'horizontal') {
@@ -9523,7 +9556,11 @@ var WebsyChart = /*#__PURE__*/function () {
9523
9556
  if (_this52.options.orientation === 'horizontal') {
9524
9557
  return "translate(".concat(_this52["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
9525
9558
  } else {
9526
- // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9559
+ if (_this52.options.data[xAxis].scale === 'Time') {
9560
+ xPos = _this52["".concat(xAxis, "Axis")](_this52.parseX(d.x.value));
9561
+ } // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9562
+
9563
+
9527
9564
  return "translate(".concat(xPos, ", ").concat(_this52["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
9528
9565
  }
9529
9566
  }); // Enter
@@ -9551,7 +9588,11 @@ var WebsyChart = /*#__PURE__*/function () {
9551
9588
  if (_this52.options.orientation === 'horizontal') {
9552
9589
  return "translate(".concat(_this52["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
9553
9590
  } else {
9554
- // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9591
+ if (_this52.options.data[xAxis].scale === 'Time') {
9592
+ xPos = _this52["".concat(xAxis, "Axis")](_this52.parseX(d.x.value));
9593
+ } // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9594
+
9595
+
9555
9596
  return "translate(".concat(xPos, ", ").concat(_this52["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
9556
9597
  }
9557
9598
  });