@websy/websy-designs 1.4.21 → 1.4.23

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.
@@ -4687,6 +4687,13 @@ class WebsySearch {
4687
4687
  }
4688
4688
  }
4689
4689
  }
4690
+ get text () {
4691
+ const el = document.getElementById(`${this.elementId}_search`)
4692
+ if (el) {
4693
+ return el.value
4694
+ }
4695
+ return ''
4696
+ }
4690
4697
  set text (text) {
4691
4698
  const el = document.getElementById(`${this.elementId}_search`)
4692
4699
  if (el) {
@@ -6388,7 +6395,8 @@ class WebsyTable3 {
6388
6395
  return headerHtml
6389
6396
  }
6390
6397
  buildSearchIcon (col, index) {
6391
- return `<div class="websy-table-search-icon" data-col-id="${col.dimId}" data-col-index="${index}">
6398
+ // return `<div class="websy-table-search-icon" data-col-id="${col.dimId}" data-col-index="${index}">
6399
+ return `<div class="websy-table-search-icon" data-col-index="${index}">
6392
6400
  <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>
6393
6401
  </div>`
6394
6402
  }
@@ -7960,7 +7968,7 @@ function getLabelY (d, labelPosition = 'inside') {
7960
7968
  return this[yAxis](d.y.accumulative) + (this[yAxis](d.y.value) / (labelPosition === 'inside' ? 2 : 1))
7961
7969
  }
7962
7970
  else {
7963
- return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - 4
7971
+ return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - (this.options.labelSize || this.options.fontSize)
7964
7972
  }
7965
7973
  }
7966
7974
  }
@@ -8040,11 +8048,11 @@ const drawSymbol = (size) => {
8040
8048
  // })
8041
8049
  .size(size || this.options.symbolSize)
8042
8050
  }
8043
- let xAxis = 'bottomAxis'
8044
- let yAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis'
8051
+ let xAxis = 'bottom'
8052
+ let yAxis = series.axis === 'secondary' ? 'right' : 'left'
8045
8053
  if (this.options.orienation === 'horizontal') {
8046
- xAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis'
8047
- yAxis = 'bottomAxis'
8054
+ xAxis = series.axis === 'secondary' ? 'right' : 'left'
8055
+ yAxis = 'bottom'
8048
8056
  }
8049
8057
  let symbols = this.symbolLayer.selectAll(`.symbol_${series.key}`)
8050
8058
  .data(series.data)
@@ -8057,19 +8065,23 @@ symbols.exit()
8057
8065
  symbols
8058
8066
  .attr('d', d => drawSymbol(d.y.size || series.symbolSize)(d))
8059
8067
  .transition(this.transition)
8060
- .attr('fill', 'white')
8068
+ .attr('fill', series.fillSymbols ? series.color : 'white')
8061
8069
  .attr('stroke', series.color)
8062
- .attr('transform', d => { return `translate(${this[xAxis](this.parseX(d.x.value))}, ${this[yAxis](isNaN(d.y.value) ? 0 : d.y.value)})` })
8070
+ .attr('transform', d => {
8071
+ let adjustment = this.options.data[xAxis].scale === 'Time' ? 0 : this[`${xAxis}Axis`].bandwidth() / 2
8072
+ return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
8073
+ })
8063
8074
  // Enter
8064
8075
  symbols.enter()
8065
8076
  .append('path')
8066
8077
  .attr('d', d => drawSymbol(d.y.size || series.symbolSize)(d))
8067
8078
  // .transition(this.transition)
8068
- .attr('fill', 'white')
8079
+ .attr('fill', series.fillSymbols ? series.color : 'white')
8069
8080
  .attr('stroke', series.color)
8070
8081
  .attr('class', d => { return `symbol symbol_${series.key}` })
8071
8082
  .attr('transform', d => {
8072
- return `translate(${this[xAxis](this.parseX(d.x.value))}, ${this[yAxis](isNaN(d.y.value) ? 0 : d.y.value)})`
8083
+ let adjustment = this.options.data[xAxis].scale === 'Time' ? 0 : this[`${xAxis}Axis`].bandwidth() / 2
8084
+ return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
8073
8085
  })
8074
8086
 
8075
8087
  }
@@ -5186,6 +5186,15 @@ var WebsySearch = /*#__PURE__*/function () {
5186
5186
  }
5187
5187
  }, {
5188
5188
  key: "text",
5189
+ get: function get() {
5190
+ var el = document.getElementById("".concat(this.elementId, "_search"));
5191
+
5192
+ if (el) {
5193
+ return el.value;
5194
+ }
5195
+
5196
+ return '';
5197
+ },
5189
5198
  set: function set(text) {
5190
5199
  var el = document.getElementById("".concat(this.elementId, "_search"));
5191
5200
 
@@ -6968,7 +6977,8 @@ var WebsyTable3 = /*#__PURE__*/function () {
6968
6977
  }, {
6969
6978
  key: "buildSearchIcon",
6970
6979
  value: function buildSearchIcon(col, index) {
6971
- 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>");
6980
+ // return `<div class="websy-table-search-icon" data-col-id="${col.dimId}" data-col-index="${index}">
6981
+ 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>");
6972
6982
  }
6973
6983
  }, {
6974
6984
  key: "buildTotalHtml",
@@ -8669,7 +8679,7 @@ var WebsyChart = /*#__PURE__*/function () {
8669
8679
  if (this.options.grouping === 'stacked') {
8670
8680
  return this[yAxis](d.y.accumulative) + this[yAxis](d.y.value) / (labelPosition === 'inside' ? 2 : 1);
8671
8681
  } else {
8672
- return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - 4;
8682
+ return this[yAxis](isNaN(d.y.value) ? 0 : d.y.value) - (this.options.labelSize || this.options.fontSize);
8673
8683
  }
8674
8684
  }
8675
8685
  }
@@ -8740,12 +8750,12 @@ var WebsyChart = /*#__PURE__*/function () {
8740
8750
  .size(size || _this51.options.symbolSize);
8741
8751
  };
8742
8752
 
8743
- var xAxis = 'bottomAxis';
8744
- var yAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis';
8753
+ var xAxis = 'bottom';
8754
+ var yAxis = series.axis === 'secondary' ? 'right' : 'left';
8745
8755
 
8746
8756
  if (this.options.orienation === 'horizontal') {
8747
- xAxis = series.axis === 'secondary' ? 'rightAxis' : 'leftAxis';
8748
- yAxis = 'bottomAxis';
8757
+ xAxis = series.axis === 'secondary' ? 'right' : 'left';
8758
+ yAxis = 'bottom';
8749
8759
  }
8750
8760
 
8751
8761
  var symbols = this.symbolLayer.selectAll(".symbol_".concat(series.key)).data(series.data); // Exit
@@ -8754,17 +8764,19 @@ var WebsyChart = /*#__PURE__*/function () {
8754
8764
 
8755
8765
  symbols.attr('d', function (d) {
8756
8766
  return drawSymbol(d.y.size || series.symbolSize)(d);
8757
- }).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
8758
- return "translate(".concat(_this51[xAxis](_this51.parseX(d.x.value)), ", ").concat(_this51[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8767
+ }).transition(this.transition).attr('fill', series.fillSymbols ? series.color : 'white').attr('stroke', series.color).attr('transform', function (d) {
8768
+ var adjustment = _this51.options.data[xAxis].scale === 'Time' ? 0 : _this51["".concat(xAxis, "Axis")].bandwidth() / 2;
8769
+ return "translate(".concat(_this51["".concat(xAxis, "Axis")](_this51.parseX(d.x.value)) + adjustment, ", ").concat(_this51["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
8759
8770
  }); // Enter
8760
8771
 
8761
8772
  symbols.enter().append('path').attr('d', function (d) {
8762
8773
  return drawSymbol(d.y.size || series.symbolSize)(d);
8763
8774
  }) // .transition(this.transition)
8764
- .attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
8775
+ .attr('fill', series.fillSymbols ? series.color : 'white').attr('stroke', series.color).attr('class', function (d) {
8765
8776
  return "symbol symbol_".concat(series.key);
8766
8777
  }).attr('transform', function (d) {
8767
- return "translate(".concat(_this51[xAxis](_this51.parseX(d.x.value)), ", ").concat(_this51[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8778
+ var adjustment = _this51.options.data[xAxis].scale === 'Time' ? 0 : _this51["".concat(xAxis, "Axis")].bandwidth() / 2;
8779
+ return "translate(".concat(_this51["".concat(xAxis, "Axis")](_this51.parseX(d.x.value)) + adjustment, ", ").concat(_this51["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
8768
8780
  });
8769
8781
  }
8770
8782
  }, {