axidio-styleguide-library1-v2 0.0.955 → 0.0.956

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.
@@ -8791,6 +8791,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8791
8791
  .selectAll('g.x1.axis1 g.tick text')
8792
8792
  .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
8793
8793
  .attr('y', function () {
8794
+ // Minimize gap in maximized (fullscreen) view for weekly charts
8795
+ if (self.chartConfiguration.isFullScreen) {
8796
+ return short_tick_length_bg;
8797
+ }
8794
8798
  if (alternate_text) {
8795
8799
  alternate_text = false;
8796
8800
  return long_tick_length_bg;
@@ -8809,11 +8813,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8809
8813
  .attr('y', function (d) {
8810
8814
  // For grouped bar charts with many bars and xLabel present, do NOT add extra space (avoid overlap)
8811
8815
  if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
8816
+ // In maximized (fullscreen) view, keep the gap minimal
8817
+ if (self.chartConfiguration.isFullScreen) {
8818
+ return short_tick_length_bg;
8819
+ }
8812
8820
  return short_tick_length_bg;
8813
8821
  }
8814
- // For grouped bar charts with many bars and NO xLabel, add space as before
8822
+ // For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
8815
8823
  if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
8816
8824
  const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
8825
+ if (self.chartConfiguration.isFullScreen) {
8826
+ // Reduce extra gap in maximized view
8827
+ return short_tick_length_bg + 2;
8828
+ }
8817
8829
  return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
8818
8830
  }
8819
8831
  // Default/fallback logic for other cases
@@ -8826,6 +8838,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8826
8838
  if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
8827
8839
  baseY += 4;
8828
8840
  }
8841
+ // In maximized view, reduce baseY slightly for grouped bars
8842
+ if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
8843
+ baseY = Math.max(short_tick_length_bg, baseY - 10);
8844
+ }
8829
8845
  return baseY;
8830
8846
  })
8831
8847
  .attr('x', function (d) {
@@ -8892,11 +8908,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8892
8908
  });
8893
8909
  }
8894
8910
  }
8895
- if (isMobile && !this.isHeaderVisible) {
8896
- svg
8897
- .selectAll('g.x1.axis1 g.tick text')
8898
- .classed('mobile-xaxis-override', true);
8899
- }
8900
8911
  if (isria && self.chartData.data.length > 8) {
8901
8912
  svg
8902
8913
  .selectAll('g.x1.axis1 g.tick text')
@@ -8909,6 +8920,11 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8909
8920
  .attr('x', 5)
8910
8921
  .style('text-anchor', 'middle');
8911
8922
  }
8923
+ if (isMobile && !this.isHeaderVisible) {
8924
+ svg
8925
+ .selectAll('g.x1.axis1 g.tick text')
8926
+ .classed('mobile-xaxis-override', true);
8927
+ }
8912
8928
  /**y scale for left y axis */
8913
8929
  var y = d3.scaleLinear().rangeRound([height, 0]);
8914
8930
  var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
@@ -9436,41 +9452,85 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9436
9452
  state
9437
9453
  .selectAll('rect')
9438
9454
  .on('mouseout', function (d) {
9439
- state.selectAll('.barstext').remove();
9455
+ state.selectAll('.lib-verticalstack-title-ontop').remove();
9440
9456
  })
9441
9457
  .on('mouseover', function (d1) {
9458
+ // Calculate positioning scale
9459
+ let tempScale;
9460
+ data.map((indiv) => {
9461
+ if (indiv.name == d1.name) {
9462
+ let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9463
+ tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9464
+ if (x.bandwidth() > 100) {
9465
+ if (self.chartData.data.length == 1) {
9466
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9467
+ tempScale.range([
9468
+ 0 + (x.bandwidth() - 200) / 2,
9469
+ x.bandwidth() - (x.bandwidth() - 200) / 2,
9470
+ ]);
9471
+ }
9472
+ else {
9473
+ tempScale.range([
9474
+ 0 + (x.bandwidth() - 300) / 2,
9475
+ x.bandwidth() - (x.bandwidth() - 300) / 2,
9476
+ ]);
9477
+ }
9478
+ }
9479
+ else {
9480
+ tempScale.range([
9481
+ 0 + (x.bandwidth() - 125) / 2,
9482
+ x.bandwidth() - (x.bandwidth() - 125) / 2,
9483
+ ]);
9484
+ }
9485
+ }
9486
+ }
9487
+ });
9442
9488
  state
9443
- .selectAll('text')
9444
- .data(function (d) {
9445
- let newList = [];
9446
- subgroups.map(function (key) {
9447
- if (key !== 'name' &&
9448
- d1.key == key &&
9449
- d1.value == d[key] &&
9450
- d1.name == d.name) {
9451
- let obj = { key: key, value: d[key], name: d.name };
9452
- newList.push(obj);
9489
+ .append('foreignObject')
9490
+ .attr('class', 'lib-verticalstack-title-ontop')
9491
+ .attr('x', function () {
9492
+ if (metaData.hasDrillDown) {
9493
+ if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
9494
+ return (xSubgroup(d1.key) + tempScale.bandwidth() / 2 - 90);
9453
9495
  }
9454
- });
9455
- return newList;
9456
- })
9457
- .enter()
9458
- .append('text')
9459
- .attr('fill', 'var(--chart-text-color)')
9460
- .attr('class', 'barstext')
9461
- .attr('x', function (d) {
9462
- return xSubgroup(d.key);
9496
+ return (xSubgroup(d1.key) -
9497
+ (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 +
9498
+ tempScale.bandwidth() / 2);
9499
+ }
9500
+ else {
9501
+ return xSubgroup(d1.key) - (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 + tempScale.bandwidth() / 2;
9502
+ }
9463
9503
  })
9464
- .attr('y', function (d) {
9465
- return y(d.value);
9504
+ .attr('y', function () {
9505
+ return y(d1.value) - 3 - 40 - 10;
9466
9506
  })
9467
- .attr('style', 'font-size: ' + '.85em' + ';' + ' font-weight:' + 'bold' + ';')
9468
- .style('fill', function (d) {
9469
- return metaData.colors[d.key];
9507
+ .attr('width', function () {
9508
+ if (metaData.hasDrillDown) {
9509
+ if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
9510
+ return '180px';
9511
+ }
9512
+ return tempScale.bandwidth() + leftAndRightSpaces * 2;
9513
+ }
9514
+ else {
9515
+ return tempScale.bandwidth() + leftAndRightSpaces * 2;
9516
+ }
9470
9517
  })
9471
- .attr('width', self.isZoomedOut ? xSubgroup.bandwidth() : xSubgroup.bandwidth())
9472
- .text(function (d) {
9473
- return d.value;
9518
+ .attr('height', 40)
9519
+ .append('xhtml:div')
9520
+ .attr('class', 'title')
9521
+ .style('z-index', 99)
9522
+ .html(function () {
9523
+ let barLabel = d1.key;
9524
+ let dataType = metaData.dataType ? metaData.dataType : '';
9525
+ let value = d1.value;
9526
+ let desiredText = '<span class="title-bar-name">' + barLabel + '</span>';
9527
+ desiredText +=
9528
+ '<span class="title-bar-value"><span>' +
9529
+ value +
9530
+ '</span>' +
9531
+ dataType +
9532
+ '</span>';
9533
+ return desiredText;
9474
9534
  });
9475
9535
  });
9476
9536
  }