@websy/websy-designs 1.7.3 → 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.
@@ -7723,8 +7723,9 @@ else {
7723
7723
  this.defs = this.svg.append('defs')
7724
7724
  this.clip = this.defs.append('clipPath').attr('id', `${this.elementId}_clip`).append('rect')
7725
7725
  this.xAxisClip = this.defs.append('clipPath').attr('id', `${this.elementId}_xAxisClip`).append('rect')
7726
+ this.yAxisClip = this.defs.append('clipPath').attr('id', `${this.elementId}_yAxisClip`).append('rect')
7726
7727
  this.brushClip = this.defs.append('clipPath').attr('id', `${this.elementId}_brushclip`).append('rect')
7727
- this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer')
7728
+ this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer') // .attr('clip-path', `url(#${this.elementId}_yAxisClip)`).append('g')
7728
7729
  this.rightAxisLayer = this.svg.append('g').attr('class', 'right-axis-layer')
7729
7730
  this.bottomAxisLayer = this.svg.append('g').attr('class', 'bottom-axis-layer').attr('clip-path', `url(#${this.elementId}_xAxisClip)`).append('g')
7730
7731
  this.leftAxisLabel = this.svg.append('g').attr('class', 'left-axis-label-layer')
@@ -8134,20 +8135,34 @@ else {
8134
8135
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8135
8136
  this.trackingLineLayer
8136
8137
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8137
- this.brushLayer
8138
- .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
8139
8138
  this.clip
8140
8139
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, 0)`)
8141
8140
  .attr('width', this.plotWidth)
8142
8141
  .attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop)
8143
- this.xAxisClip
8144
- .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
8145
- .attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
8146
- .attr('height', longestBottomBounds.height + 10)
8147
- this.brushClip
8148
- .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
8149
- .attr('width', this.plotWidth)
8150
- .attr('height', this.options.brushHeight)
8142
+ if (this.options.orientation === 'horizontal') {
8143
+ this.brushLayer
8144
+ .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
8145
+ this.yAxisClip
8146
+ .attr('transform', `translate(${this.options.brushHeight + this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
8147
+ .attr('width', this.options.margin.axisLeft - this.options.brushHeight)
8148
+ .attr('height', this.plotHeight)
8149
+ this.brushClip
8150
+ .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
8151
+ .attr('height', this.plotHeight)
8152
+ .attr('width', this.options.brushHeight)
8153
+ }
8154
+ else {
8155
+ this.brushLayer
8156
+ .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
8157
+ this.xAxisClip
8158
+ .attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
8159
+ .attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
8160
+ .attr('height', longestBottomBounds.height + 10)
8161
+ this.brushClip
8162
+ .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
8163
+ .attr('width', this.plotWidth)
8164
+ .attr('height', this.options.brushHeight)
8165
+ }
8151
8166
  this.eventLayer
8152
8167
  .attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8153
8168
  let that = this
@@ -8165,9 +8180,10 @@ else {
8165
8180
  let bottomRange = [0, this.plotWidth]
8166
8181
  let bottomBrushRange = [0, this.plotWidth]
8167
8182
  let leftRange = [this.plotHeight, 0]
8168
- let leftBrushRange = [this.options.brushHeight, 0]
8183
+ let leftBrushRange = [this.options.brushHeight, 0]
8169
8184
  if (this.options.orientation === 'horizontal') {
8170
8185
  leftBrushRange = [this.plotHeight, 0]
8186
+ bottomBrushRange = [0, this.options.brushHeight]
8171
8187
  }
8172
8188
  this.widthForCalc = (proposedBandWidth * noOfPoints) // + totalPadding
8173
8189
  this.customBottomRange = []
@@ -8250,10 +8266,13 @@ else {
8250
8266
  brushMethod = 'brushY'
8251
8267
  brushLength = this.options.brushHeight
8252
8268
  brushThickness = this.plotHeight
8269
+ if (this.brushNeeded) {
8270
+ brushEnd = this.plotHeight * (this.plotHeight / (this.widthForCalc + this.totalBandPadding))
8271
+ }
8253
8272
  }
8254
8273
  else {
8255
- if (this.brushNeeded) {
8256
- brushEnd = this.plotWidth * (this.plotWidth / (this.widthForCalc + this.totalBandPadding))
8274
+ if (this.brushNeeded) {
8275
+ brushEnd = this.plotWidth * (this.plotWidth / (this.widthForCalc + this.totalBandPadding))
8257
8276
  }
8258
8277
  }
8259
8278
  this.brush = d3[brushMethod]()
@@ -8415,7 +8434,7 @@ else {
8415
8434
  }
8416
8435
  // Configure the left axis
8417
8436
  let leftDomain = this.createDomain('left')
8418
- let leftBrushDomain = this.createDomain('left', true)
8437
+ let leftBrushDomain = this.createDomain('left')
8419
8438
  let rightDomain = this.createDomain('right')
8420
8439
  this.leftAxis = d3[`scale${this.options.data.left.scale || 'Linear'}`]()
8421
8440
  .domain(leftDomain)
@@ -8578,13 +8597,17 @@ const drawArea = (xAxis, yAxis, curveStyle) => {
8578
8597
  return d3
8579
8598
  .area()
8580
8599
  .x(d => {
8581
- // return this[`${xAxis}Axis`](this.parseX(d.x.value))
8582
- let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
8583
- let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
8584
- if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
8585
- xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
8600
+ if (this.options.data[xAxis].scale === 'Time') {
8601
+ return this[`${xAxis}Axis`](this.parseX(d.x.value))
8602
+ }
8603
+ else {
8604
+ let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
8605
+ let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
8606
+ if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
8607
+ xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
8608
+ }
8609
+ return xPos
8586
8610
  }
8587
- return xPos
8588
8611
  })
8589
8612
  .y0(d => {
8590
8613
  return this[`${yAxis}Axis`](0)
@@ -8662,6 +8685,7 @@ function getBarWidth (d, i, xAxis) {
8662
8685
  let output
8663
8686
  if (this.options.orientation === 'horizontal') {
8664
8687
  output = this[`${yAxis}Axis`](Math.abs(d.y.value))
8688
+ // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
8665
8689
  }
8666
8690
  else {
8667
8691
  let x = getBarX.call(this, d, i, xAxis)
@@ -8701,15 +8725,7 @@ function getBarX (d, i, xAxis) {
8701
8725
  let xIndex = 0
8702
8726
  if (this.processedX[d.x.value]) {
8703
8727
  xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel))
8704
- }
8705
- // let barAdjustment =
8706
- // (this.options.data[xAxis].bandWidth * xIndex) +
8707
- // (xIndex * this.options.groupPadding * 2) + this.options.groupPadding +
8708
- // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
8709
- // let barAdjustment =
8710
- // (this.options.data[xAxis.replace('Brush', '')].step * xIndex) +
8711
- // this.options.groupPadding
8712
- // // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
8728
+ }
8713
8729
  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)
8714
8730
  if (this[`custom${xAxis.toInitialCaps()}Range`].length > 0) {
8715
8731
  output = this[`custom${xAxis.toInitialCaps()}Range`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment
@@ -8744,7 +8760,25 @@ function getBarY (d, i, yAxis, xAxis) {
8744
8760
  output = this[`custom${xAxis.toInitialCaps()}Range`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment
8745
8761
  }
8746
8762
  else {
8747
- output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + ((d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth)
8763
+ // output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + ((d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth)
8764
+ let xIndex = 0
8765
+ if (this.processedX[d.x.value]) {
8766
+ xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel))
8767
+ }
8768
+ 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)
8769
+ if (this[`custom${xAxis.toInitialCaps()}Range`].length > 0) {
8770
+ output = this[`custom${xAxis.toInitialCaps()}Range`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment
8771
+ // output = this[`custom${xAxis.toInitialCaps().replace('Brush', '')}DetailRange`][this[xAxis + 'Axis'].domain().indexOf(d.x.value)]
8772
+ }
8773
+ else {
8774
+ output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + barAdjustment
8775
+ }
8776
+ if (!this.processedX[d.x.value]) {
8777
+ this.processedX[d.x.value] = []
8778
+ }
8779
+ if (this.processedX[d.x.value].indexOf(d.y.tooltipLabel) === -1) {
8780
+ this.processedX[d.x.value].push(d.y.tooltipLabel)
8781
+ }
8748
8782
  }
8749
8783
  }
8750
8784
  else {
@@ -8985,14 +9019,17 @@ const drawLine = (xAxis, yAxis, curveStyle) => {
8985
9019
  return this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)
8986
9020
  }
8987
9021
  else {
8988
- let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
8989
- let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
8990
- if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
8991
- xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
9022
+ if (this.options.data[xAxis].scale === 'Time') {
9023
+ return this[`${xAxis}Axis`](this.parseX(d.x.value))
8992
9024
  }
8993
- // let adjustment = this.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : this.options.data[xAxis].bandWidth / 2
8994
- // return this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment
8995
- return xPos
9025
+ else {
9026
+ let xIndex = this[xAxis + 'Axis'].domain().indexOf(d.x.value)
9027
+ let xPos = this[`custom${xAxis.toInitialCaps()}Range`][xIndex]
9028
+ if (this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1]) {
9029
+ xPos = xPos + ((this[`custom${xAxis.toInitialCaps()}Range`][xIndex + 1] - xPos) / 2)
9030
+ }
9031
+ return xPos
9032
+ }
8996
9033
  }
8997
9034
  })
8998
9035
  .y(d => {
@@ -9203,6 +9240,9 @@ symbols
9203
9240
  return `translate(${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)}, ${xPos})`
9204
9241
  }
9205
9242
  else {
9243
+ if (this.options.data[xAxis].scale === 'Time') {
9244
+ xPos = this[`${xAxis}Axis`](this.parseX(d.x.value))
9245
+ }
9206
9246
  // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9207
9247
  return `translate(${xPos}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9208
9248
  }
@@ -9226,6 +9266,9 @@ symbols.enter()
9226
9266
  return `translate(${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)}, ${xPos})`
9227
9267
  }
9228
9268
  else {
9269
+ if (this.options.data[xAxis].scale === 'Time') {
9270
+ xPos = this[`${xAxis}Axis`](this.parseX(d.x.value))
9271
+ }
9229
9272
  // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9230
9273
  return `translate(${xPos}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9231
9274
  }
@@ -8540,8 +8540,10 @@ var WebsyChart = /*#__PURE__*/function () {
8540
8540
  this.defs = this.svg.append('defs');
8541
8541
  this.clip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_clip")).append('rect');
8542
8542
  this.xAxisClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_xAxisClip")).append('rect');
8543
+ this.yAxisClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_yAxisClip")).append('rect');
8543
8544
  this.brushClip = this.defs.append('clipPath').attr('id', "".concat(this.elementId, "_brushclip")).append('rect');
8544
- this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer');
8545
+ this.leftAxisLayer = this.svg.append('g').attr('class', 'left-axis-layer'); // .attr('clip-path', `url(#${this.elementId}_yAxisClip)`).append('g')
8546
+
8545
8547
  this.rightAxisLayer = this.svg.append('g').attr('class', 'right-axis-layer');
8546
8548
  this.bottomAxisLayer = this.svg.append('g').attr('class', 'bottom-axis-layer').attr('clip-path', "url(#".concat(this.elementId, "_xAxisClip)")).append('g');
8547
8549
  this.leftAxisLabel = this.svg.append('g').attr('class', 'left-axis-label-layer');
@@ -8993,10 +8995,18 @@ var WebsyChart = /*#__PURE__*/function () {
8993
8995
  this.symbolLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8994
8996
  this.refLineLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8995
8997
  this.trackingLineLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
8996
- 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, ")"));
8997
8998
  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);
8998
- 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);
8999
- 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);
8999
+
9000
+ if (this.options.orientation === 'horizontal') {
9001
+ this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9002
+ 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);
9003
+ 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);
9004
+ } else {
9005
+ 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, ")"));
9006
+ 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);
9007
+ 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);
9008
+ }
9009
+
9000
9010
  this.eventLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9001
9011
  var that = this;
9002
9012
  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)
@@ -9012,6 +9022,7 @@ var WebsyChart = /*#__PURE__*/function () {
9012
9022
 
9013
9023
  if (this.options.orientation === 'horizontal') {
9014
9024
  leftBrushRange = [this.plotHeight, 0];
9025
+ bottomBrushRange = [0, this.options.brushHeight];
9015
9026
  }
9016
9027
 
9017
9028
  this.widthForCalc = proposedBandWidth * noOfPoints; // + totalPadding
@@ -9104,6 +9115,10 @@ var WebsyChart = /*#__PURE__*/function () {
9104
9115
  brushMethod = 'brushY';
9105
9116
  brushLength = this.options.brushHeight;
9106
9117
  brushThickness = this.plotHeight;
9118
+
9119
+ if (this.brushNeeded) {
9120
+ brushEnd = this.plotHeight * (this.plotHeight / (this.widthForCalc + this.totalBandPadding));
9121
+ }
9107
9122
  } else {
9108
9123
  if (this.brushNeeded) {
9109
9124
  brushEnd = this.plotWidth * (this.plotWidth / (this.widthForCalc + this.totalBandPadding));
@@ -9253,7 +9268,7 @@ var WebsyChart = /*#__PURE__*/function () {
9253
9268
 
9254
9269
 
9255
9270
  var leftDomain = this.createDomain('left');
9256
- var leftBrushDomain = this.createDomain('left', true);
9271
+ var leftBrushDomain = this.createDomain('left');
9257
9272
  var rightDomain = this.createDomain('right');
9258
9273
  this.leftAxis = d3["scale".concat(this.options.data.left.scale || 'Linear')]().domain(leftDomain).range(leftRange);
9259
9274
  this.leftBrushAxis = d3["scale".concat(this.options.data.left.scale || 'Linear')]().domain(leftBrushDomain).range(leftBrushRange);
@@ -9393,16 +9408,19 @@ var WebsyChart = /*#__PURE__*/function () {
9393
9408
  /* global d3 series index */
9394
9409
  var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
9395
9410
  return d3.area().x(function (d) {
9396
- // return this[`${xAxis}Axis`](this.parseX(d.x.value))
9397
- var xIndex = _this51[xAxis + 'Axis'].domain().indexOf(d.x.value);
9411
+ if (_this51.options.data[xAxis].scale === 'Time') {
9412
+ return _this51["".concat(xAxis, "Axis")](_this51.parseX(d.x.value));
9413
+ } else {
9414
+ var xIndex = _this51[xAxis + 'Axis'].domain().indexOf(d.x.value);
9398
9415
 
9399
- var xPos = _this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9416
+ var xPos = _this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9400
9417
 
9401
- if (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9402
- xPos = xPos + (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9403
- }
9418
+ if (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9419
+ xPos = xPos + (_this51["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9420
+ }
9404
9421
 
9405
- return xPos;
9422
+ return xPos;
9423
+ }
9406
9424
  }).y0(function (d) {
9407
9425
  return _this51["".concat(yAxis, "Axis")](0);
9408
9426
  }).y1(function (d) {
@@ -9485,7 +9503,7 @@ var WebsyChart = /*#__PURE__*/function () {
9485
9503
  var output;
9486
9504
 
9487
9505
  if (this.options.orientation === 'horizontal') {
9488
- output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value));
9506
+ output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value)); // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
9489
9507
  } else {
9490
9508
  var x = getBarX.call(this, d, i, xAxis);
9491
9509
 
@@ -9534,15 +9552,7 @@ var WebsyChart = /*#__PURE__*/function () {
9534
9552
 
9535
9553
  if (this.processedX[d.x.value]) {
9536
9554
  xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel));
9537
- } // let barAdjustment =
9538
- // (this.options.data[xAxis].bandWidth * xIndex) +
9539
- // (xIndex * this.options.groupPadding * 2) + this.options.groupPadding +
9540
- // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
9541
- // let barAdjustment =
9542
- // (this.options.data[xAxis.replace('Brush', '')].step * xIndex) +
9543
- // this.options.groupPadding
9544
- // // (xAxis.indexOf('Brush') === -1 ? this.bandPadding : 1)
9545
-
9555
+ }
9546
9556
 
9547
9557
  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);
9548
9558
 
@@ -9582,7 +9592,28 @@ var WebsyChart = /*#__PURE__*/function () {
9582
9592
  var barAdjustment = (xAxis.indexOf('Brush') !== -1 ? this.brushBandPadding : this.bandPadding) / 2 + (xAxis.indexOf('Brush') !== -1 ? 1 : this.options.groupPadding);
9583
9593
  output = this["custom".concat(xAxis.toInitialCaps(), "Range")][this[xAxis + 'Axis'].domain().indexOf(d.x.value)] + barAdjustment;
9584
9594
  } else {
9585
- output = this["".concat(xAxis, "Axis")](this.parseX(d.x.value)) + (d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth;
9595
+ // output = this[`${xAxis}Axis`](this.parseX(d.x.value)) + ((d.y.index || i) * this.options.data[xAxis.replace('Brush', '')].barWidth)
9596
+ var xIndex = 0;
9597
+
9598
+ if (this.processedX[d.x.value]) {
9599
+ xIndex = Math.max(0, this.processedX[d.x.value].indexOf(d.y.tooltipLabel));
9600
+ }
9601
+
9602
+ 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);
9603
+
9604
+ if (this["custom".concat(xAxis.toInitialCaps(), "Range")].length > 0) {
9605
+ 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)]
9606
+ } else {
9607
+ output = this["".concat(xAxis, "Axis")](this.parseX(d.x.value)) + _barAdjustment2;
9608
+ }
9609
+
9610
+ if (!this.processedX[d.x.value]) {
9611
+ this.processedX[d.x.value] = [];
9612
+ }
9613
+
9614
+ if (this.processedX[d.x.value].indexOf(d.y.tooltipLabel) === -1) {
9615
+ this.processedX[d.x.value].push(d.y.tooltipLabel);
9616
+ }
9586
9617
  }
9587
9618
  } else {
9588
9619
  if (this.options.grouping === 'stacked') {
@@ -9822,17 +9853,19 @@ var WebsyChart = /*#__PURE__*/function () {
9822
9853
  if (_this54.options.orientation === 'horizontal') {
9823
9854
  return _this54["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
9824
9855
  } else {
9825
- var xIndex = _this54[xAxis + 'Axis'].domain().indexOf(d.x.value);
9826
-
9827
- var xPos = _this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9856
+ if (_this54.options.data[xAxis].scale === 'Time') {
9857
+ return _this54["".concat(xAxis, "Axis")](_this54.parseX(d.x.value));
9858
+ } else {
9859
+ var xIndex = _this54[xAxis + 'Axis'].domain().indexOf(d.x.value);
9828
9860
 
9829
- if (_this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9830
- xPos = xPos + (_this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9831
- } // let adjustment = this.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : this.options.data[xAxis].bandWidth / 2
9832
- // return this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment
9861
+ var xPos = _this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9833
9862
 
9863
+ if (_this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9864
+ xPos = xPos + (_this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9865
+ }
9834
9866
 
9835
- return xPos;
9867
+ return xPos;
9868
+ }
9836
9869
  }
9837
9870
  }).y(function (d) {
9838
9871
  if (_this54.options.orientation === 'horizontal') {
@@ -10004,7 +10037,11 @@ var WebsyChart = /*#__PURE__*/function () {
10004
10037
  if (_this55.options.orientation === 'horizontal') {
10005
10038
  return "translate(".concat(_this55["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
10006
10039
  } else {
10007
- // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
10040
+ if (_this55.options.data[xAxis].scale === 'Time') {
10041
+ xPos = _this55["".concat(xAxis, "Axis")](_this55.parseX(d.x.value));
10042
+ } // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
10043
+
10044
+
10008
10045
  return "translate(".concat(xPos, ", ").concat(_this55["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
10009
10046
  }
10010
10047
  }); // Enter
@@ -10032,7 +10069,11 @@ var WebsyChart = /*#__PURE__*/function () {
10032
10069
  if (_this55.options.orientation === 'horizontal') {
10033
10070
  return "translate(".concat(_this55["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
10034
10071
  } else {
10035
- // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
10072
+ if (_this55.options.data[xAxis].scale === 'Time') {
10073
+ xPos = _this55["".concat(xAxis, "Axis")](_this55.parseX(d.x.value));
10074
+ } // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
10075
+
10076
+
10036
10077
  return "translate(".concat(xPos, ", ").concat(_this55["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
10037
10078
  }
10038
10079
  });