@designsystem-se/af 35.4.1-beta.4 → 35.4.1-beta.6

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.
package/hydrate/index.js CHANGED
@@ -35813,8 +35813,6 @@ class barChart {
35813
35813
  // Resizing chart while loading
35814
35814
  this.loadingResize = () => {
35815
35815
  const newHeight = this.setDims();
35816
- this.setMargins(true);
35817
- this.svg.attr('width', this.dims.width).attr('height', this.dims.height);
35818
35816
  this.barChartContainer.attr('transform', `translate(${this.margin.left + this.tickPadding + this.yTickSize},0)`);
35819
35817
  this.margin.right =
35820
35818
  this.getTextSize(this.xScale.domain()[1].toLocaleString()) / 2 +
@@ -35839,10 +35837,8 @@ class barChart {
35839
35837
  0,
35840
35838
  this.dims.width - this.margin.right - this.margin.left
35841
35839
  ]);
35842
- this.barSelection
35843
- .attr('x', this.xFunction)
35844
- .attr('width', this.widthFunction);
35845
35840
  this.setValueTicks();
35841
+ this.adjustBarSize();
35846
35842
  };
35847
35843
  this.highlightBarGroup = (_event, datum) => {
35848
35844
  if (typeof datum === 'string') {
@@ -35953,189 +35949,33 @@ class barChart {
35953
35949
  return 'barGroup' + key.replace(/[^A-Z0-9]+/gi, '');
35954
35950
  };
35955
35951
  this.updateBars = (fromLoading) => {
35956
- this.barChartContainer
35952
+ this.barSelection = this.barChartContainer.select('.interactiveElements')
35957
35953
  .selectAll('.barGroup')
35958
35954
  .data(this.mappedData)
35959
- .join((enter) => {
35960
- var _a, _b;
35961
- const tempSelection = enter
35962
- .append('g')
35963
- .attr('class', 'barGroup')
35964
- .attr('id', (d) => 'barGroup' + d.key.replace(/[^A-Z0-9]+/gi, ''));
35965
- tempSelection
35966
- .append('rect')
35967
- .attr('class', 'bar')
35968
- .style('cursor', 'pointer')
35969
- .attr('ry', 4)
35970
- .attr('rx', 4)
35971
- .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
35972
- ? this.yScale(d.key)
35973
- : this.dims.height - this.margin.bottom)
35974
- .attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
35975
- ? 2
35976
- : this.xScale(d.key))
35977
- .attr('width', () => this.afVariation === BarChartVariation.Horizontal
35978
- ? 0
35979
- : this.xScale.bandwidth())
35980
- .attr('height', () => this.afVariation === BarChartVariation.Horizontal
35981
- ? this.yScale.bandwidth()
35982
- : 0)
35983
- .on('mouseenter', this.hover)
35984
- .on('mouseleave', this.hoverOut)
35985
- .on('click', this.openTooltip)
35986
- .transition()
35987
- .duration(this.defaultDuration)
35988
- .ease(polyInOut)
35989
- .attr('width', this.widthFunction)
35990
- .attr('y', this.yFunction)
35991
- .attr('height', this.heightFunction)
35992
- .attr('fill', '#00005a');
35993
- if (!((_b = (_a = this.chartData) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.valueLabels))
35994
- return tempSelection;
35995
- tempSelection
35996
- .append('text')
35997
- .text((d) => d.value.toLocaleString())
35998
- .attr('class', 'barText')
35999
- .attr('font-size', this.fontSize)
36000
- .attr('font-weight', '600')
36001
- .attr('text-anchor', 'end')
36002
- .style('pointer-events', 'none')
36003
- .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
36004
- ? this.yScale(d.key) + this.yScale.bandwidth() / 2
36005
- : this.dims.height - this.margin.bottom)
36006
- .attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
36007
- ? 2
36008
- : this.xScale(d.key) + this.xScale.bandwidth() / 2)
36009
- .transition()
36010
- .duration(this.defaultDuration)
36011
- .ease(polyInOut)
36012
- .attr('font-size', this.fontSize)
36013
- .attr('font-weight', '600')
36014
- .attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
36015
- ? this.xScale(d.value)
36016
- : this.xScale(d.key) + this.xScale.bandwidth() / 2)
36017
- .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
36018
- ? this.yScale(d.key) + this.yScale.bandwidth() / 2
36019
- : this.yScale(d.value))
36020
- .attr('text-anchor', (d) => {
36021
- if (this.afVariation === BarChartVariation.Vertical)
36022
- return 'middle';
36023
- return this.xScale(d.value) < d.len + this.tickPadding * 2
36024
- ? 'start'
36025
- : 'end';
36026
- })
36027
- .attr('dx', (d) => {
36028
- if (this.afVariation === BarChartVariation.Horizontal)
36029
- return this.xScale(d.value) < d.len + this.tickPadding * 2
36030
- ? this.tickPadding
36031
- : -this.tickPadding;
36032
- return 0;
36033
- })
36034
- .attr('fill', (d) => {
36035
- if (this.afVariation === BarChartVariation.Vertical)
36036
- return 'black';
36037
- return this.xScale(d.value) < d.len + this.tickPadding * 2
36038
- ? 'black'
36039
- : 'white';
36040
- })
36041
- .attr('dy', () => this.afVariation == BarChartVariation.Horizontal
36042
- ? '0.35em'
36043
- : '-0.25em')
36044
- .style('pointer-events', 'none')
36045
- .attrTween('text', (d, i, nodelist) => {
36046
- const oldnum = parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
36047
- ? parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
36048
- : 0;
36049
- const interpolatedValue = interpolate$1(oldnum, d.value);
36050
- return (t) => (nodelist[i].textContent = parseInt(interpolatedValue(t)).toLocaleString(undefined, this.numberFormat));
36051
- });
36052
- return tempSelection;
36053
- }, (update) => {
36054
- // Update ids to bars
36055
- update.attr('id', (d) => 'barGroup' + d.key.replace(/[^A-Z0-9]+/gi, ''));
36056
- // Mouse interaction to updated loading bars
36057
- if (fromLoading) {
36058
- update
36059
- .select('rect')
36060
- .on('mouseenter', this.hover)
36061
- .on('mouseleave', this.hoverOut)
36062
- .on('click', this.openTooltip)
36063
- .attr('x', this.xFunction)
36064
- .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
36065
- ? this.yScale(d.key)
36066
- : this.dims.height - this.margin.bottom)
36067
- .attr('width', this.widthFunction)
36068
- .attr('height', () => this.afVariation === BarChartVariation.Horizontal
36069
- ? this.yScale.bandwidth()
36070
- : 0)
36071
- .attr('fill', '#00005a')
36072
- .transition()
36073
- .duration(this.defaultDuration)
36074
- .ease(polyInOut)
36075
- .attr('y', this.yFunction)
36076
- .attr('height', this.heightFunction)
36077
- .on('end', () => this.barChartObserver.observe(this.chartDiv)); // Reset barchartObserver
36078
- }
36079
- else {
36080
- update
36081
- .select('rect')
36082
- .transition()
36083
- .duration(this.defaultDuration)
36084
- .ease(polyInOut)
36085
- .attr('x', this.xFunction)
36086
- .attr('y', this.yFunction)
36087
- .attr('width', this.widthFunction)
36088
- .attr('height', this.heightFunction)
36089
- .attr('fill', '#00005a');
36090
- }
36091
- return update
36092
- .select('text')
36093
- .style('display', () => { var _a, _b; return ((_b = (_a = this.chartData) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.valueLabels) ? null : 'none'; })
36094
- .transition()
36095
- .duration(this.defaultDuration)
36096
- .ease(polyInOut)
36097
- .attr('font-size', this.fontSize)
36098
- .attr('font-weight', '600')
36099
- .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
36100
- ? this.yScale(d.key) + this.yScale.bandwidth() / 2
36101
- : this.yScale(d.value))
36102
- .attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
36103
- ? this.xScale(d.value)
36104
- : this.xScale(d.key) + this.xScale.bandwidth() / 2)
36105
- .attr('text-anchor', (d) => {
36106
- if (this.afVariation === BarChartVariation.Vertical)
36107
- return 'middle';
36108
- return this.xScale(d.value) < d.len + this.tickPadding * 2
36109
- ? 'start'
36110
- : 'end';
36111
- })
36112
- .attr('dx', (d) => {
36113
- if (this.afVariation === BarChartVariation.Horizontal)
36114
- return this.xScale(d.value) < d.len + this.tickPadding * 2
36115
- ? this.tickPadding
36116
- : -this.tickPadding;
36117
- return 0;
36118
- })
36119
- .attr('fill', (d) => {
36120
- if (this.afVariation === BarChartVariation.Vertical)
36121
- return 'black';
36122
- return this.xScale(d.value) < d.len + this.tickPadding * 2
36123
- ? 'black'
36124
- : 'white';
36125
- })
36126
- .attr('dy', () => this.afVariation == BarChartVariation.Horizontal
36127
- ? '0.35em'
36128
- : '-0.25em')
36129
- .style('pointer-events', 'none')
36130
- .attrTween('text', (d, i, nodelist) => {
36131
- const oldnum = parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
36132
- ? parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
36133
- : 0;
36134
- const interpolatedValue = interpolate$1(oldnum, d.value);
36135
- return (t) => (nodelist[i].textContent = parseInt(interpolatedValue(t)).toLocaleString(undefined, this.numberFormat));
36136
- });
36137
- }, (exit) => exit.remove());
36138
- this.barSelection = this.barChartContainer.selectAll('rect');
35955
+ .join('g')
35956
+ .attr('class', 'barGroup')
35957
+ .attr('id', (d) => this.barGroupID(d.key));
35958
+ this.barSelection.selectAll('.bar')
35959
+ .data((d) => {
35960
+ return d.series;
35961
+ })
35962
+ .join('rect')
35963
+ .attr('class', 'bar')
35964
+ .style('cursor', 'pointer')
35965
+ .attr('x', this.xFunction)
35966
+ .attr('y', this.yFunction)
35967
+ .attr('ry', 4)
35968
+ .attr('rx', 4)
35969
+ .attr('width', this.widthFunction)
35970
+ .attr('height', this.heightFunction)
35971
+ .attr('fill', (d) => this.colorFunction(d.serie))
35972
+ .on('mouseenter', this.hover)
35973
+ .on('mouseleave', this.hoverOut)
35974
+ .on('click', this.openTooltip);
35975
+ if (fromLoading) {
35976
+ this.initLegend();
35977
+ }
35978
+ this.barSelection = this.barChartContainer.selectAll('.barGroup');
36139
35979
  this.textSelection = this.barChartContainer.selectAll('.barText');
36140
35980
  };
36141
35981
  // Setting position of text according to bar size
@@ -36174,7 +36014,7 @@ class barChart {
36174
36014
  };
36175
36015
  this.reshapeData = () => {
36176
36016
  const toReturn = [];
36177
- if (this.loading || !this.chartData) {
36017
+ if (!this.chartData) {
36178
36018
  this.placeholderTicks.forEach((key) => {
36179
36019
  const tick = { key: key, series: [] };
36180
36020
  tick.series.push({
@@ -36549,11 +36389,11 @@ class barChart {
36549
36389
  .html((d) => {
36550
36390
  return `<span>${d.serie}: <b style="font-weight:600;">${d.value.toLocaleString(undefined, this.numberFormat)}</b></span>`;
36551
36391
  });
36552
- this.tooltip.style('visibility', 'visible');
36392
+ this.tooltip.style('display', null);
36553
36393
  this.positionTooltip(this.tooltipData);
36554
36394
  };
36555
36395
  this.closeTooltip = () => {
36556
- this.tooltip.style('visibility', 'hidden');
36396
+ this.tooltip.style('display', 'none');
36557
36397
  };
36558
36398
  // Positions tooltip in horizontal mode
36559
36399
  this.positionTooltip = (data) => {
@@ -36692,12 +36532,13 @@ class barChart {
36692
36532
  this.afChartData = undefined;
36693
36533
  }
36694
36534
  afChartDataUpdate(data) {
36695
- if (typeof data != 'string')
36696
- this.chartData = data;
36697
- else
36698
- this.chartData = JSON.parse(data);
36699
- if (this.chartData)
36535
+ if (typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0 || Object.keys(data).length > 0) {
36536
+ if (typeof data != 'string')
36537
+ this.chartData = data;
36538
+ else
36539
+ this.chartData = JSON.parse(data);
36700
36540
  this.series = this.chartData.data.series.map(serie => serie.title);
36541
+ }
36701
36542
  this.mappedData = this.reshapeData();
36702
36543
  // checking for width of each tick
36703
36544
  this.mappedData.forEach((elem) => {
@@ -36788,7 +36629,7 @@ class barChart {
36788
36629
  // Getting handle for tooltip
36789
36630
  this.tooltip = select('#' + this.afId);
36790
36631
  this.tooltip.select('.tooltipClose').on('click', this.closeTooltip);
36791
- // Add heading placeholder for heading
36632
+ this.tooltip.selectAll('.tooltipHeading').remove();
36792
36633
  this.tooltip
36793
36634
  .select('.tooltipHead')
36794
36635
  .insert('h' + (parseInt(this.afHeadingLevel.replace(/\D/g, '')) + 1), ':first-child') // increment heading level by one
@@ -36796,7 +36637,7 @@ class barChart {
36796
36637
  .style('font-size', '1rem')
36797
36638
  .style('margin', '0 0.75rem 0.25rem 0 ')
36798
36639
  .style('font-weight', '500');
36799
- this.tooltip.style('visibility', 'hidden');
36640
+ this.tooltip.style('display', 'none');
36800
36641
  }
36801
36642
  initEmpty() {
36802
36643
  select(this.chartDiv).select('.chartSVG').remove();
@@ -36816,20 +36657,20 @@ class barChart {
36816
36657
  .attr('role', 'img')
36817
36658
  .attr('aria-label', this.chartData && this.chartData.title
36818
36659
  ? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
36819
- : 'Stapeldiagram');
36660
+ : 'Stapeldiagram').attr('style', 'display: flex;min-width: 0;width: 100%;height: auto;');
36820
36661
  // Hide unusable components
36821
36662
  select(this.titleDiv)
36822
- .select(this.afHeadingLevel)
36663
+ .append(this.afHeadingLevel)
36664
+ .attr('class', 'loadingHeader')
36823
36665
  .html(`${_t.loading}...`);
36824
36666
  this.initYAxis(true);
36825
36667
  this.initXAxis(true);
36826
36668
  this.tooltip = select('#' + this.afId);
36827
- this.tooltip.style('visibility', 'hidden');
36669
+ this.tooltip.style('display', 'none');
36828
36670
  this.loadingState(true);
36829
36671
  }
36830
36672
  loadingState(empty) {
36831
36673
  this.loading = true;
36832
- console.log('loading!');
36833
36674
  // close potentially open tooltip
36834
36675
  if (this.tooltip)
36835
36676
  this.closeTooltip();
@@ -36869,14 +36710,17 @@ class barChart {
36869
36710
  this.xAxisHandle.attr('transform', `translate(0,${this.dims.height - this.margin.bottom})`);
36870
36711
  }
36871
36712
  const animateBars = () => {
36872
- this.barChartContainer.selectAll('.barGroup').remove();
36713
+ this.barChartContainer.selectAll('.interactiveElements').remove();
36873
36714
  this.barSelection = this.barChartContainer
36715
+ .append('g')
36716
+ .attr('class', 'interactiveElements')
36717
+ .style('isolation', 'isolate')
36874
36718
  .selectAll('barGroup')
36875
36719
  .data(this.mappedData)
36876
36720
  .join('g')
36877
36721
  .attr('class', 'barGroup')
36878
- .attr('id', (d) => 'barGroup' + d.key.replace(/[^A-Z0-9]+/gi, ''));
36879
- this.barSelection.selectAll('.barGroup')
36722
+ .attr('id', (d) => this.barGroupID(d.key));
36723
+ this.barSelection.selectAll('bar')
36880
36724
  .data((d) => {
36881
36725
  return d.series;
36882
36726
  })
@@ -36898,7 +36742,7 @@ class barChart {
36898
36742
  .attr('y', this.yFunction)
36899
36743
  .attr('height', this.heightFunction);
36900
36744
  this.barChartContainer.selectAll('.bar')
36901
- .transition()
36745
+ .transition('animateBar')
36902
36746
  .duration(400)
36903
36747
  .ease(linear$1)
36904
36748
  .delay((...[, i]) => i * 150 + 400)
@@ -36913,8 +36757,8 @@ class barChart {
36913
36757
  };
36914
36758
  const flattenBars = () => {
36915
36759
  this.barChartContainer
36916
- .selectAll('rect')
36917
- .transition()
36760
+ .selectAll('.bar')
36761
+ .transition('animateBar')
36918
36762
  .duration(200)
36919
36763
  .ease(linear$1)
36920
36764
  .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
@@ -37150,10 +36994,11 @@ class barChart {
37150
36994
  ]);
37151
36995
  this.setNamedTicks(true);
37152
36996
  // Stop animation
37153
- this.barSelection.selectAll('.barGroup').on('end', null);
36997
+ this.barChartContainer.selectAll('.barGroup').on('end', null);
36998
+ select(this.titleDiv).select('.loadingHeader').remove();
37154
36999
  this.loading = false;
37155
- this.barSelection
37156
- .transition()
37000
+ this.barChartContainer.selectAll('.bar').interrupt('animateBar');
37001
+ this.barChartContainer.selectAll('.bar').transition()
37157
37002
  .duration(this.defaultDuration)
37158
37003
  .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
37159
37004
  ? this.yScale(d.key)
@@ -37223,7 +37068,7 @@ class barChart {
37223
37068
  this.averageLine();
37224
37069
  this.adjustBarSize();
37225
37070
  this.adjustBarText();
37226
- if (this.tooltip.style('visibility') !== 'hidden')
37071
+ if (this.tooltip.style('display') !== 'none')
37227
37072
  this.positionTooltip(this.tooltipData);
37228
37073
  }
37229
37074
  // Returns the longest text from an array of strings
@@ -37343,7 +37188,7 @@ class barChart {
37343
37188
  <span style="display:block;margin-top:0.25rem;font-size:0.875rem;color:var(--digi--global--color--neutral--grayscale--darkest-3)">${this.chartData.infoText}</span></p>`;
37344
37189
  }
37345
37190
  }
37346
- return (hAsync(Host, { key: '3b919d1bdd201ddf5e4e5e2955190ed34c5aced3', ref: (el) => (this.host = el) }, hAsync("svg", { key: '380b1d30cc3c7a71bf05fa4cdf4bb00def16b090', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, hAsync("defs", { key: 'd39cde898124df9b34b994d0105fcc28e486a8f4' }, hAsync("pattern", { key: '20d0ffdfa0e5310cad77ec994bf963f600de7b69', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("line", { key: '17d98e16afa2c42146a22a441d3dd0922ae767f5', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), hAsync("pattern", { key: '3dfdebb12e5f2eba8b216acd4ff846e82615ed66', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("line", { key: 'df76dde74f8e49e600f97b81c0c50e97147b9626', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), hAsync("pattern", { key: '1d7a87ca509e067288af063e406d98962639560c', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("line", { key: '1c9618f2b783704cc0ceab0c38d8b525b9fdc520', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), hAsync("div", { key: '5217e3c1b3063bcb77fee7bebf631296ea95ab6b', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, hAsync("digi-typography", { key: '904c16605d7947862bbf77b7f5dcbf581284ef97', class: "chartTitle", innerHTML: heading }), hAsync("digi-button", { key: 'e285bef2d76e214a5615d4cee157bde5061e472a', class: "buttonWrapper tableButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.activateTable, afAriaLabel: `Visa tabell ${((_b = this.chartData) === null || _b === void 0 ? void 0 : _b.title) ? (_c = this.chartData) === null || _c === void 0 ? void 0 : _c.title.toLowerCase() : ''}` }, hAsync("digi-icon-table", { key: '2b278678de6fc8feda2f02c494c6e0dc76d1b3bb', slot: "icon" }), "Visa tabell"), hAsync("digi-button", { key: '85aa9d581cdf8332b87eebb80df10e2e654ec81e', style: { display: 'none' }, class: "buttonWrapper chartButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.reInitChart, afAriaLabel: `Visa diagram ${((_d = this.chartData) === null || _d === void 0 ? void 0 : _d.title) ? (_e = this.chartData) === null || _e === void 0 ? void 0 : _e.title.toLowerCase() : ''}` }, hAsync("digi-icon-chart", { key: 'e4396b006704ebd6ffad155ebb4be3ae7abaf5d0', slot: "icon" }), "Visa diagram"), hAsync("div", { key: '6c8a51169075d49b9da6f0158042c06e5d38a6e2', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), hAsync("div", { key: '8b0b7b63ba4f8b428f6d728d48cdc05ae791a605', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, hAsync("div", { key: 'fadf084df0bfcd6f39831b92983091e6c0fefbd0', class: "chartTooltip", id: this.afId }, hAsync("div", { key: '3a0258527320c1719bffec8c221bc9884d77ee1f', class: "tooltipHead" }, hAsync("digi-icon-x", { key: 'b1013c82580116f7806b2bf31b08eea205a47db1', class: "tooltipClose" })), hAsync("div", { key: 'e98e704c7f03fe0e0c1a90a9088f2962b9661a5c', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (hAsync("digi-icon-caret-up", { class: "caret" })) : (hAsync("digi-icon-caret-down", { class: "caret" })))), hAsync("div", { key: '56da797be96540039f52ae28a2bf250d46f47f12', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, hAsync("div", { key: '3f3621240d161083d114df5d02a550d1f06613fa', class: "legend" })), hAsync("div", { key: '427754c0a4b58f1cb334e89960d60c4ef22284f4', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
37191
+ return (hAsync(Host, { key: '2e011f2838668e9d58a6b4442e2832b6e1bac21b', ref: (el) => (this.host = el) }, hAsync("svg", { key: 'a91c7bc7ed311fd10f0014d382daf46d97524087', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, hAsync("defs", { key: 'b28ad4ff2f0029eecd3a7b220d97ae81c646f6d0' }, hAsync("pattern", { key: '2bb838607089932d089c05fdb568e06782cd6ef6', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("line", { key: '4eca3d7dbb9cd2d47bc6367a8f07808ba3767902', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), hAsync("pattern", { key: '87585e674cc45c2496650eb5309f4eee34f89b3a', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("line", { key: '42bfe1a59192f618e60486105e919b2569fef753', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), hAsync("pattern", { key: '2ab36682ad76783cda635db815fc9f5f542fab21', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("line", { key: 'd5b93bf96f259cdf093a3e61c38ef61bbfd565ba', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), hAsync("div", { key: 'f94c18afa372d176500c2d3844212df29c83f16b', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, hAsync("digi-typography", { key: '68dca23f7fd92f024f0b3d7eebc7b7214e636090', class: "chartTitle", innerHTML: heading }), hAsync("digi-button", { key: '98d6ade579584a998a1d3e246168f42b19bd277f', class: "buttonWrapper tableButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.activateTable, afAriaLabel: `Visa tabell ${((_b = this.chartData) === null || _b === void 0 ? void 0 : _b.title) ? (_c = this.chartData) === null || _c === void 0 ? void 0 : _c.title.toLowerCase() : ''}` }, hAsync("digi-icon-table", { key: '36d1e6f12b90215ba6ce00b814573616772820e7', slot: "icon" }), "Visa tabell"), hAsync("digi-button", { key: 'c94200814deba4524301e7f2c07ad57e94b6381d', style: { display: 'none' }, class: "buttonWrapper chartButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.reInitChart, afAriaLabel: `Visa diagram ${((_d = this.chartData) === null || _d === void 0 ? void 0 : _d.title) ? (_e = this.chartData) === null || _e === void 0 ? void 0 : _e.title.toLowerCase() : ''}` }, hAsync("digi-icon-chart", { key: 'ba94cf5a4ad7e4272d78f1965cd63eee99eb9f8f', slot: "icon" }), "Visa diagram"), hAsync("div", { key: 'be79a632683428a30d01a96bf41f1e446b019061', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), hAsync("div", { key: 'd3644914ab02ae8cb8a054a1d4c90dc854fdaede', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, hAsync("div", { key: '6cb1113d71b8cd9ec156d351dc4ea402cdf3f372', class: "chartTooltip", id: this.afId }, hAsync("div", { key: '0c601e94970dd3563bec5bfe070a3e02fd339124', class: "tooltipHead" }, hAsync("digi-icon-x", { key: 'a478d1013f6630767b03029f4491222bc35dc118', class: "tooltipClose" })), hAsync("div", { key: '04de1b3898023ef79ec8c69e501d107d8039351d', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (hAsync("digi-icon-caret-up", { class: "caret" })) : (hAsync("digi-icon-caret-down", { class: "caret" })))), hAsync("div", { key: '335550b9c1d64cadc9d72b14af008a2cffcfe58e', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, hAsync("div", { key: '1bd30ebd1a5c1c6342f102f7adc131c6f85bc8d8', class: "legend" })), hAsync("div", { key: '69ddb91b0befa23212d518c27ed018f8c8912c06', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
37347
37192
  }
37348
37193
  get hostElement() { return getElement(this); }
37349
37194
  static get watchers() { return {