@websy/websy-designs 1.4.21 → 1.4.22

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.
@@ -5987,7 +5987,8 @@ class WebsyTable3 {
5987
5987
  return headerHtml
5988
5988
  }
5989
5989
  buildSearchIcon (col, index) {
5990
- return `<div class="websy-table-search-icon" data-col-id="${col.dimId}" data-col-index="${index}">
5990
+ // return `<div class="websy-table-search-icon" data-col-id="${col.dimId}" data-col-index="${index}">
5991
+ return `<div class="websy-table-search-icon" data-col-index="${index}">
5991
5992
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512"><title>ionicons-v5-f</title><path d="M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><line x1="338.29" y1="338.29" x2="448" y2="448" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>
5992
5993
  </div>`
5993
5994
  }
@@ -7559,7 +7560,7 @@ function getLabelY (d, labelPosition = 'inside') {
7559
7560
  return this[yAxis](d.y.accumulative) + (this[yAxis](d.y.value) / (labelPosition === 'inside' ? 2 : 1))
7560
7561
  }
7561
7562
  else {
7562
- return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - 4
7563
+ return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - (this.options.labelSize || this.options.fontSize)
7563
7564
  }
7564
7565
  }
7565
7566
  }
@@ -7639,11 +7640,11 @@ const drawSymbol = (size) => {
7639
7640
  // })
7640
7641
  .size(size || this.options.symbolSize)
7641
7642
  }
7642
- let xAxis = 'bottomAxis'
7643
- let yAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis'
7643
+ let xAxis = 'bottom'
7644
+ let yAxis = series.axis === 'secondary' ? 'right' : 'left'
7644
7645
  if (this.options.orienation === 'horizontal') {
7645
- xAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis'
7646
- yAxis = 'bottomAxis'
7646
+ xAxis = series.axis === 'secondary' ? 'right' : 'left'
7647
+ yAxis = 'bottom'
7647
7648
  }
7648
7649
  let symbols = this.symbolLayer.selectAll(`.symbol_${series.key}`)
7649
7650
  .data(series.data)
@@ -7656,19 +7657,23 @@ symbols.exit()
7656
7657
  symbols
7657
7658
  .attr('d', d => drawSymbol(d.y.size || series.symbolSize)(d))
7658
7659
  .transition(this.transition)
7659
- .attr('fill', 'white')
7660
+ .attr('fill', series.fillSymbols ? series.color : 'white')
7660
7661
  .attr('stroke', series.color)
7661
- .attr('transform', d => { return `translate(${this[xAxis](this.parseX(d.x.value))}, ${this[yAxis](isNaN(d.y.value) ? 0 : d.y.value)})` })
7662
+ .attr('transform', d => {
7663
+ let adjustment = this.options.data[xAxis].scale === 'Time' ? 0 : this[`${xAxis}Axis`].bandwidth() / 2
7664
+ return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
7665
+ })
7662
7666
  // Enter
7663
7667
  symbols.enter()
7664
7668
  .append('path')
7665
7669
  .attr('d', d => drawSymbol(d.y.size || series.symbolSize)(d))
7666
7670
  // .transition(this.transition)
7667
- .attr('fill', 'white')
7671
+ .attr('fill', series.fillSymbols ? series.color : 'white')
7668
7672
  .attr('stroke', series.color)
7669
7673
  .attr('class', d => { return `symbol symbol_${series.key}` })
7670
7674
  .attr('transform', d => {
7671
- return `translate(${this[xAxis](this.parseX(d.x.value))}, ${this[yAxis](isNaN(d.y.value) ? 0 : d.y.value)})`
7675
+ let adjustment = this.options.data[xAxis].scale === 'Time' ? 0 : this[`${xAxis}Axis`].bandwidth() / 2
7676
+ return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
7672
7677
  })
7673
7678
 
7674
7679
  }
@@ -6506,7 +6506,8 @@ var WebsyTable3 = /*#__PURE__*/function () {
6506
6506
  }, {
6507
6507
  key: "buildSearchIcon",
6508
6508
  value: function buildSearchIcon(col, index) {
6509
- return "<div class=\"websy-table-search-icon\" data-col-id=\"".concat(col.dimId, "\" data-col-index=\"").concat(index, "\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><title>ionicons-v5-f</title><path d=\"M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>\n </div>");
6509
+ // return `<div class="websy-table-search-icon" data-col-id="${col.dimId}" data-col-index="${index}">
6510
+ return "<div class=\"websy-table-search-icon\" data-col-index=\"".concat(index, "\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><title>ionicons-v5-f</title><path d=\"M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>\n </div>");
6510
6511
  }
6511
6512
  }, {
6512
6513
  key: "buildTotalHtml",
@@ -8207,7 +8208,7 @@ var WebsyChart = /*#__PURE__*/function () {
8207
8208
  if (this.options.grouping === 'stacked') {
8208
8209
  return this[yAxis](d.y.accumulative) + this[yAxis](d.y.value) / (labelPosition === 'inside' ? 2 : 1);
8209
8210
  } else {
8210
- return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - 4;
8211
+ return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - (this.options.labelSize || this.options.fontSize);
8211
8212
  }
8212
8213
  }
8213
8214
  }
@@ -8278,12 +8279,12 @@ var WebsyChart = /*#__PURE__*/function () {
8278
8279
  .size(size || _this48.options.symbolSize);
8279
8280
  };
8280
8281
 
8281
- var xAxis = 'bottomAxis';
8282
- var yAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis';
8282
+ var xAxis = 'bottom';
8283
+ var yAxis = series.axis === 'secondary' ? 'right' : 'left';
8283
8284
 
8284
8285
  if (this.options.orienation === 'horizontal') {
8285
- xAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis';
8286
- yAxis = 'bottomAxis';
8286
+ xAxis = series.axis === 'secondary' ? 'right' : 'left';
8287
+ yAxis = 'bottom';
8287
8288
  }
8288
8289
 
8289
8290
  var symbols = this.symbolLayer.selectAll(".symbol_".concat(series.key)).data(series.data); // Exit
@@ -8292,17 +8293,19 @@ var WebsyChart = /*#__PURE__*/function () {
8292
8293
 
8293
8294
  symbols.attr('d', function (d) {
8294
8295
  return drawSymbol(d.y.size || series.symbolSize)(d);
8295
- }).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
8296
- return "translate(".concat(_this48[xAxis](_this48.parseX(d.x.value)), ", ").concat(_this48[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8296
+ }).transition(this.transition).attr('fill', series.fillSymbols ? series.color : 'white').attr('stroke', series.color).attr('transform', function (d) {
8297
+ var adjustment = _this48.options.data[xAxis].scale === 'Time' ? 0 : _this48["".concat(xAxis, "Axis")].bandwidth() / 2;
8298
+ return "translate(".concat(_this48["".concat(xAxis, "Axis")](_this48.parseX(d.x.value)) + adjustment, ", ").concat(_this48["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
8297
8299
  }); // Enter
8298
8300
 
8299
8301
  symbols.enter().append('path').attr('d', function (d) {
8300
8302
  return drawSymbol(d.y.size || series.symbolSize)(d);
8301
8303
  }) // .transition(this.transition)
8302
- .attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
8304
+ .attr('fill', series.fillSymbols ? series.color : 'white').attr('stroke', series.color).attr('class', function (d) {
8303
8305
  return "symbol symbol_".concat(series.key);
8304
8306
  }).attr('transform', function (d) {
8305
- return "translate(".concat(_this48[xAxis](_this48.parseX(d.x.value)), ", ").concat(_this48[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8307
+ var adjustment = _this48.options.data[xAxis].scale === 'Time' ? 0 : _this48["".concat(xAxis, "Axis")].bandwidth() / 2;
8308
+ return "translate(".concat(_this48["".concat(xAxis, "Axis")](_this48.parseX(d.x.value)) + adjustment, ", ").concat(_this48["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
8306
8309
  });
8307
8310
  }
8308
8311
  }, {