@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/components/digi-bar-chart.js +57 -212
- package/components/digi-chart-line.js +1 -1
- package/components/{p-a47b6b5c.js → p-f9a1a787.js} +1 -1
- package/dist/cjs/digi-bar-chart_27.cjs.entry.js +56 -211
- package/dist/collection/components/_chart/bar-chart/bar-chart.js +56 -211
- package/dist/collection/design-tokens/components/_logo.variables.scss +16 -19
- package/dist/digi-arbetsformedlingen/design-tokens/components/_logo.variables.scss +19 -16
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/p-3e51b8bc.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ccf78233.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/{p-a47b6b5c.js → p-f9a1a787.js} +1 -1
- package/dist/esm/digi-bar-chart_27.entry.js +57 -212
- package/dist/esm/digi-chart-line.entry.js +1 -1
- package/dist/esm/{linear-0246aaea.js → linear-78b9219d.js} +1 -1
- package/hydrate/index.js +56 -211
- package/hydrate/index.mjs +56 -211
- package/package.json +1 -1
- package/dist/digi-arbetsformedlingen/p-0030ed70.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-10dd9a49.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent, F as Fragment } from './index-148a7577.js';
|
|
2
|
-
import { o as ordinal, i as initRange, r as range, s as select, a as axisLeft, l as linear, b as axisBottom,
|
|
2
|
+
import { o as ordinal, i as initRange, r as range, s as select, a as axisLeft, l as linear, b as axisBottom, m as max, p as polyInOut, c as min, d as linear$1 } from './linear-78b9219d.js';
|
|
3
3
|
import { _ as _t } from './text-26e02c8d.js';
|
|
4
4
|
import { r as randomIdGenerator } from './randomIdGenerator.util-56406f2e.js';
|
|
5
5
|
import { a as BarChartVariation, H as HeaderCenterContentWidth, L as LayoutBlockContainer, p as LayoutContainerVariation, q as LayoutContainerMaxWidth, r as NavigationVerticalMenuVariation, N as NavigationVerticalMenuActiveIndicatorSize, T as TitleLogoVariation } from './typography-variation.enum-531cdf64.js';
|
|
@@ -251,8 +251,6 @@ const barChart = class {
|
|
|
251
251
|
// Resizing chart while loading
|
|
252
252
|
this.loadingResize = () => {
|
|
253
253
|
const newHeight = this.setDims();
|
|
254
|
-
this.setMargins(true);
|
|
255
|
-
this.svg.attr('width', this.dims.width).attr('height', this.dims.height);
|
|
256
254
|
this.barChartContainer.attr('transform', `translate(${this.margin.left + this.tickPadding + this.yTickSize},0)`);
|
|
257
255
|
this.margin.right =
|
|
258
256
|
this.getTextSize(this.xScale.domain()[1].toLocaleString()) / 2 +
|
|
@@ -277,10 +275,8 @@ const barChart = class {
|
|
|
277
275
|
0,
|
|
278
276
|
this.dims.width - this.margin.right - this.margin.left
|
|
279
277
|
]);
|
|
280
|
-
this.barSelection
|
|
281
|
-
.attr('x', this.xFunction)
|
|
282
|
-
.attr('width', this.widthFunction);
|
|
283
278
|
this.setValueTicks();
|
|
279
|
+
this.adjustBarSize();
|
|
284
280
|
};
|
|
285
281
|
this.highlightBarGroup = (_event, datum) => {
|
|
286
282
|
if (typeof datum === 'string') {
|
|
@@ -391,189 +387,33 @@ const barChart = class {
|
|
|
391
387
|
return 'barGroup' + key.replace(/[^A-Z0-9]+/gi, '');
|
|
392
388
|
};
|
|
393
389
|
this.updateBars = (fromLoading) => {
|
|
394
|
-
this.barChartContainer
|
|
390
|
+
this.barSelection = this.barChartContainer.select('.interactiveElements')
|
|
395
391
|
.selectAll('.barGroup')
|
|
396
392
|
.data(this.mappedData)
|
|
397
|
-
.join(
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
.on('mouseenter', this.hover)
|
|
422
|
-
.on('mouseleave', this.hoverOut)
|
|
423
|
-
.on('click', this.openTooltip)
|
|
424
|
-
.transition()
|
|
425
|
-
.duration(this.defaultDuration)
|
|
426
|
-
.ease(polyInOut)
|
|
427
|
-
.attr('width', this.widthFunction)
|
|
428
|
-
.attr('y', this.yFunction)
|
|
429
|
-
.attr('height', this.heightFunction)
|
|
430
|
-
.attr('fill', '#00005a');
|
|
431
|
-
if (!((_b = (_a = this.chartData) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.valueLabels))
|
|
432
|
-
return tempSelection;
|
|
433
|
-
tempSelection
|
|
434
|
-
.append('text')
|
|
435
|
-
.text((d) => d.value.toLocaleString())
|
|
436
|
-
.attr('class', 'barText')
|
|
437
|
-
.attr('font-size', this.fontSize)
|
|
438
|
-
.attr('font-weight', '600')
|
|
439
|
-
.attr('text-anchor', 'end')
|
|
440
|
-
.style('pointer-events', 'none')
|
|
441
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
442
|
-
? this.yScale(d.key) + this.yScale.bandwidth() / 2
|
|
443
|
-
: this.dims.height - this.margin.bottom)
|
|
444
|
-
.attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
445
|
-
? 2
|
|
446
|
-
: this.xScale(d.key) + this.xScale.bandwidth() / 2)
|
|
447
|
-
.transition()
|
|
448
|
-
.duration(this.defaultDuration)
|
|
449
|
-
.ease(polyInOut)
|
|
450
|
-
.attr('font-size', this.fontSize)
|
|
451
|
-
.attr('font-weight', '600')
|
|
452
|
-
.attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
453
|
-
? this.xScale(d.value)
|
|
454
|
-
: this.xScale(d.key) + this.xScale.bandwidth() / 2)
|
|
455
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
456
|
-
? this.yScale(d.key) + this.yScale.bandwidth() / 2
|
|
457
|
-
: this.yScale(d.value))
|
|
458
|
-
.attr('text-anchor', (d) => {
|
|
459
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
460
|
-
return 'middle';
|
|
461
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
462
|
-
? 'start'
|
|
463
|
-
: 'end';
|
|
464
|
-
})
|
|
465
|
-
.attr('dx', (d) => {
|
|
466
|
-
if (this.afVariation === BarChartVariation.Horizontal)
|
|
467
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
468
|
-
? this.tickPadding
|
|
469
|
-
: -this.tickPadding;
|
|
470
|
-
return 0;
|
|
471
|
-
})
|
|
472
|
-
.attr('fill', (d) => {
|
|
473
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
474
|
-
return 'black';
|
|
475
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
476
|
-
? 'black'
|
|
477
|
-
: 'white';
|
|
478
|
-
})
|
|
479
|
-
.attr('dy', () => this.afVariation == BarChartVariation.Horizontal
|
|
480
|
-
? '0.35em'
|
|
481
|
-
: '-0.25em')
|
|
482
|
-
.style('pointer-events', 'none')
|
|
483
|
-
.attrTween('text', (d, i, nodelist) => {
|
|
484
|
-
const oldnum = parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
485
|
-
? parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
486
|
-
: 0;
|
|
487
|
-
const interpolatedValue = interpolate(oldnum, d.value);
|
|
488
|
-
return (t) => (nodelist[i].textContent = parseInt(interpolatedValue(t)).toLocaleString(undefined, this.numberFormat));
|
|
489
|
-
});
|
|
490
|
-
return tempSelection;
|
|
491
|
-
}, (update) => {
|
|
492
|
-
// Update ids to bars
|
|
493
|
-
update.attr('id', (d) => 'barGroup' + d.key.replace(/[^A-Z0-9]+/gi, ''));
|
|
494
|
-
// Mouse interaction to updated loading bars
|
|
495
|
-
if (fromLoading) {
|
|
496
|
-
update
|
|
497
|
-
.select('rect')
|
|
498
|
-
.on('mouseenter', this.hover)
|
|
499
|
-
.on('mouseleave', this.hoverOut)
|
|
500
|
-
.on('click', this.openTooltip)
|
|
501
|
-
.attr('x', this.xFunction)
|
|
502
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
503
|
-
? this.yScale(d.key)
|
|
504
|
-
: this.dims.height - this.margin.bottom)
|
|
505
|
-
.attr('width', this.widthFunction)
|
|
506
|
-
.attr('height', () => this.afVariation === BarChartVariation.Horizontal
|
|
507
|
-
? this.yScale.bandwidth()
|
|
508
|
-
: 0)
|
|
509
|
-
.attr('fill', '#00005a')
|
|
510
|
-
.transition()
|
|
511
|
-
.duration(this.defaultDuration)
|
|
512
|
-
.ease(polyInOut)
|
|
513
|
-
.attr('y', this.yFunction)
|
|
514
|
-
.attr('height', this.heightFunction)
|
|
515
|
-
.on('end', () => this.barChartObserver.observe(this.chartDiv)); // Reset barchartObserver
|
|
516
|
-
}
|
|
517
|
-
else {
|
|
518
|
-
update
|
|
519
|
-
.select('rect')
|
|
520
|
-
.transition()
|
|
521
|
-
.duration(this.defaultDuration)
|
|
522
|
-
.ease(polyInOut)
|
|
523
|
-
.attr('x', this.xFunction)
|
|
524
|
-
.attr('y', this.yFunction)
|
|
525
|
-
.attr('width', this.widthFunction)
|
|
526
|
-
.attr('height', this.heightFunction)
|
|
527
|
-
.attr('fill', '#00005a');
|
|
528
|
-
}
|
|
529
|
-
return update
|
|
530
|
-
.select('text')
|
|
531
|
-
.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'; })
|
|
532
|
-
.transition()
|
|
533
|
-
.duration(this.defaultDuration)
|
|
534
|
-
.ease(polyInOut)
|
|
535
|
-
.attr('font-size', this.fontSize)
|
|
536
|
-
.attr('font-weight', '600')
|
|
537
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
538
|
-
? this.yScale(d.key) + this.yScale.bandwidth() / 2
|
|
539
|
-
: this.yScale(d.value))
|
|
540
|
-
.attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
541
|
-
? this.xScale(d.value)
|
|
542
|
-
: this.xScale(d.key) + this.xScale.bandwidth() / 2)
|
|
543
|
-
.attr('text-anchor', (d) => {
|
|
544
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
545
|
-
return 'middle';
|
|
546
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
547
|
-
? 'start'
|
|
548
|
-
: 'end';
|
|
549
|
-
})
|
|
550
|
-
.attr('dx', (d) => {
|
|
551
|
-
if (this.afVariation === BarChartVariation.Horizontal)
|
|
552
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
553
|
-
? this.tickPadding
|
|
554
|
-
: -this.tickPadding;
|
|
555
|
-
return 0;
|
|
556
|
-
})
|
|
557
|
-
.attr('fill', (d) => {
|
|
558
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
559
|
-
return 'black';
|
|
560
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
561
|
-
? 'black'
|
|
562
|
-
: 'white';
|
|
563
|
-
})
|
|
564
|
-
.attr('dy', () => this.afVariation == BarChartVariation.Horizontal
|
|
565
|
-
? '0.35em'
|
|
566
|
-
: '-0.25em')
|
|
567
|
-
.style('pointer-events', 'none')
|
|
568
|
-
.attrTween('text', (d, i, nodelist) => {
|
|
569
|
-
const oldnum = parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
570
|
-
? parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
571
|
-
: 0;
|
|
572
|
-
const interpolatedValue = interpolate(oldnum, d.value);
|
|
573
|
-
return (t) => (nodelist[i].textContent = parseInt(interpolatedValue(t)).toLocaleString(undefined, this.numberFormat));
|
|
574
|
-
});
|
|
575
|
-
}, (exit) => exit.remove());
|
|
576
|
-
this.barSelection = this.barChartContainer.selectAll('rect');
|
|
393
|
+
.join('g')
|
|
394
|
+
.attr('class', 'barGroup')
|
|
395
|
+
.attr('id', (d) => this.barGroupID(d.key));
|
|
396
|
+
this.barSelection.selectAll('.bar')
|
|
397
|
+
.data((d) => {
|
|
398
|
+
return d.series;
|
|
399
|
+
})
|
|
400
|
+
.join('rect')
|
|
401
|
+
.attr('class', 'bar')
|
|
402
|
+
.style('cursor', 'pointer')
|
|
403
|
+
.attr('x', this.xFunction)
|
|
404
|
+
.attr('y', this.yFunction)
|
|
405
|
+
.attr('ry', 4)
|
|
406
|
+
.attr('rx', 4)
|
|
407
|
+
.attr('width', this.widthFunction)
|
|
408
|
+
.attr('height', this.heightFunction)
|
|
409
|
+
.attr('fill', (d) => this.colorFunction(d.serie))
|
|
410
|
+
.on('mouseenter', this.hover)
|
|
411
|
+
.on('mouseleave', this.hoverOut)
|
|
412
|
+
.on('click', this.openTooltip);
|
|
413
|
+
if (fromLoading) {
|
|
414
|
+
this.initLegend();
|
|
415
|
+
}
|
|
416
|
+
this.barSelection = this.barChartContainer.selectAll('.barGroup');
|
|
577
417
|
this.textSelection = this.barChartContainer.selectAll('.barText');
|
|
578
418
|
};
|
|
579
419
|
// Setting position of text according to bar size
|
|
@@ -612,7 +452,7 @@ const barChart = class {
|
|
|
612
452
|
};
|
|
613
453
|
this.reshapeData = () => {
|
|
614
454
|
const toReturn = [];
|
|
615
|
-
if (
|
|
455
|
+
if (!this.chartData) {
|
|
616
456
|
this.placeholderTicks.forEach((key) => {
|
|
617
457
|
const tick = { key: key, series: [] };
|
|
618
458
|
tick.series.push({
|
|
@@ -987,11 +827,11 @@ const barChart = class {
|
|
|
987
827
|
.html((d) => {
|
|
988
828
|
return `<span>${d.serie}: <b style="font-weight:600;">${d.value.toLocaleString(undefined, this.numberFormat)}</b></span>`;
|
|
989
829
|
});
|
|
990
|
-
this.tooltip.style('
|
|
830
|
+
this.tooltip.style('display', null);
|
|
991
831
|
this.positionTooltip(this.tooltipData);
|
|
992
832
|
};
|
|
993
833
|
this.closeTooltip = () => {
|
|
994
|
-
this.tooltip.style('
|
|
834
|
+
this.tooltip.style('display', 'none');
|
|
995
835
|
};
|
|
996
836
|
// Positions tooltip in horizontal mode
|
|
997
837
|
this.positionTooltip = (data) => {
|
|
@@ -1130,12 +970,13 @@ const barChart = class {
|
|
|
1130
970
|
this.afChartData = undefined;
|
|
1131
971
|
}
|
|
1132
972
|
afChartDataUpdate(data) {
|
|
1133
|
-
if (typeof data
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
973
|
+
if (typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0 || Object.keys(data).length > 0) {
|
|
974
|
+
if (typeof data != 'string')
|
|
975
|
+
this.chartData = data;
|
|
976
|
+
else
|
|
977
|
+
this.chartData = JSON.parse(data);
|
|
1138
978
|
this.series = this.chartData.data.series.map(serie => serie.title);
|
|
979
|
+
}
|
|
1139
980
|
this.mappedData = this.reshapeData();
|
|
1140
981
|
// checking for width of each tick
|
|
1141
982
|
this.mappedData.forEach((elem) => {
|
|
@@ -1226,7 +1067,7 @@ const barChart = class {
|
|
|
1226
1067
|
// Getting handle for tooltip
|
|
1227
1068
|
this.tooltip = select('#' + this.afId);
|
|
1228
1069
|
this.tooltip.select('.tooltipClose').on('click', this.closeTooltip);
|
|
1229
|
-
|
|
1070
|
+
this.tooltip.selectAll('.tooltipHeading').remove();
|
|
1230
1071
|
this.tooltip
|
|
1231
1072
|
.select('.tooltipHead')
|
|
1232
1073
|
.insert('h' + (parseInt(this.afHeadingLevel.replace(/\D/g, '')) + 1), ':first-child') // increment heading level by one
|
|
@@ -1234,7 +1075,7 @@ const barChart = class {
|
|
|
1234
1075
|
.style('font-size', '1rem')
|
|
1235
1076
|
.style('margin', '0 0.75rem 0.25rem 0 ')
|
|
1236
1077
|
.style('font-weight', '500');
|
|
1237
|
-
this.tooltip.style('
|
|
1078
|
+
this.tooltip.style('display', 'none');
|
|
1238
1079
|
}
|
|
1239
1080
|
initEmpty() {
|
|
1240
1081
|
select(this.chartDiv).select('.chartSVG').remove();
|
|
@@ -1254,20 +1095,20 @@ const barChart = class {
|
|
|
1254
1095
|
.attr('role', 'img')
|
|
1255
1096
|
.attr('aria-label', this.chartData && this.chartData.title
|
|
1256
1097
|
? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
|
|
1257
|
-
: 'Stapeldiagram');
|
|
1098
|
+
: 'Stapeldiagram').attr('style', 'display: flex;min-width: 0;width: 100%;height: auto;');
|
|
1258
1099
|
// Hide unusable components
|
|
1259
1100
|
select(this.titleDiv)
|
|
1260
|
-
.
|
|
1101
|
+
.append(this.afHeadingLevel)
|
|
1102
|
+
.attr('class', 'loadingHeader')
|
|
1261
1103
|
.html(`${_t.loading}...`);
|
|
1262
1104
|
this.initYAxis(true);
|
|
1263
1105
|
this.initXAxis(true);
|
|
1264
1106
|
this.tooltip = select('#' + this.afId);
|
|
1265
|
-
this.tooltip.style('
|
|
1107
|
+
this.tooltip.style('display', 'none');
|
|
1266
1108
|
this.loadingState(true);
|
|
1267
1109
|
}
|
|
1268
1110
|
loadingState(empty) {
|
|
1269
1111
|
this.loading = true;
|
|
1270
|
-
console.log('loading!');
|
|
1271
1112
|
// close potentially open tooltip
|
|
1272
1113
|
if (this.tooltip)
|
|
1273
1114
|
this.closeTooltip();
|
|
@@ -1307,14 +1148,17 @@ const barChart = class {
|
|
|
1307
1148
|
this.xAxisHandle.attr('transform', `translate(0,${this.dims.height - this.margin.bottom})`);
|
|
1308
1149
|
}
|
|
1309
1150
|
const animateBars = () => {
|
|
1310
|
-
this.barChartContainer.selectAll('.
|
|
1151
|
+
this.barChartContainer.selectAll('.interactiveElements').remove();
|
|
1311
1152
|
this.barSelection = this.barChartContainer
|
|
1153
|
+
.append('g')
|
|
1154
|
+
.attr('class', 'interactiveElements')
|
|
1155
|
+
.style('isolation', 'isolate')
|
|
1312
1156
|
.selectAll('barGroup')
|
|
1313
1157
|
.data(this.mappedData)
|
|
1314
1158
|
.join('g')
|
|
1315
1159
|
.attr('class', 'barGroup')
|
|
1316
|
-
.attr('id', (d) =>
|
|
1317
|
-
this.barSelection.selectAll('
|
|
1160
|
+
.attr('id', (d) => this.barGroupID(d.key));
|
|
1161
|
+
this.barSelection.selectAll('bar')
|
|
1318
1162
|
.data((d) => {
|
|
1319
1163
|
return d.series;
|
|
1320
1164
|
})
|
|
@@ -1336,7 +1180,7 @@ const barChart = class {
|
|
|
1336
1180
|
.attr('y', this.yFunction)
|
|
1337
1181
|
.attr('height', this.heightFunction);
|
|
1338
1182
|
this.barChartContainer.selectAll('.bar')
|
|
1339
|
-
.transition()
|
|
1183
|
+
.transition('animateBar')
|
|
1340
1184
|
.duration(400)
|
|
1341
1185
|
.ease(linear$1)
|
|
1342
1186
|
.delay((...[, i]) => i * 150 + 400)
|
|
@@ -1351,8 +1195,8 @@ const barChart = class {
|
|
|
1351
1195
|
};
|
|
1352
1196
|
const flattenBars = () => {
|
|
1353
1197
|
this.barChartContainer
|
|
1354
|
-
.selectAll('
|
|
1355
|
-
.transition()
|
|
1198
|
+
.selectAll('.bar')
|
|
1199
|
+
.transition('animateBar')
|
|
1356
1200
|
.duration(200)
|
|
1357
1201
|
.ease(linear$1)
|
|
1358
1202
|
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
@@ -1588,10 +1432,11 @@ const barChart = class {
|
|
|
1588
1432
|
]);
|
|
1589
1433
|
this.setNamedTicks(true);
|
|
1590
1434
|
// Stop animation
|
|
1591
|
-
this.
|
|
1435
|
+
this.barChartContainer.selectAll('.barGroup').on('end', null);
|
|
1436
|
+
select(this.titleDiv).select('.loadingHeader').remove();
|
|
1592
1437
|
this.loading = false;
|
|
1593
|
-
this.
|
|
1594
|
-
|
|
1438
|
+
this.barChartContainer.selectAll('.bar').interrupt('animateBar');
|
|
1439
|
+
this.barChartContainer.selectAll('.bar').transition()
|
|
1595
1440
|
.duration(this.defaultDuration)
|
|
1596
1441
|
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
1597
1442
|
? this.yScale(d.key)
|
|
@@ -1661,7 +1506,7 @@ const barChart = class {
|
|
|
1661
1506
|
this.averageLine();
|
|
1662
1507
|
this.adjustBarSize();
|
|
1663
1508
|
this.adjustBarText();
|
|
1664
|
-
if (this.tooltip.style('
|
|
1509
|
+
if (this.tooltip.style('display') !== 'none')
|
|
1665
1510
|
this.positionTooltip(this.tooltipData);
|
|
1666
1511
|
}
|
|
1667
1512
|
// Returns the longest text from an array of strings
|
|
@@ -1781,7 +1626,7 @@ const barChart = class {
|
|
|
1781
1626
|
<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>`;
|
|
1782
1627
|
}
|
|
1783
1628
|
}
|
|
1784
|
-
return (h(Host, { key: '
|
|
1629
|
+
return (h(Host, { key: '2e011f2838668e9d58a6b4442e2832b6e1bac21b', ref: (el) => (this.host = el) }, h("svg", { key: 'a91c7bc7ed311fd10f0014d382daf46d97524087', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, h("defs", { key: 'b28ad4ff2f0029eecd3a7b220d97ae81c646f6d0' }, h("pattern", { key: '2bb838607089932d089c05fdb568e06782cd6ef6', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("line", { key: '4eca3d7dbb9cd2d47bc6367a8f07808ba3767902', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), h("pattern", { key: '87585e674cc45c2496650eb5309f4eee34f89b3a', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("line", { key: '42bfe1a59192f618e60486105e919b2569fef753', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), h("pattern", { key: '2ab36682ad76783cda635db815fc9f5f542fab21', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("line", { key: 'd5b93bf96f259cdf093a3e61c38ef61bbfd565ba', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), h("div", { key: 'f94c18afa372d176500c2d3844212df29c83f16b', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, h("digi-typography", { key: '68dca23f7fd92f024f0b3d7eebc7b7214e636090', class: "chartTitle", innerHTML: heading }), h("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() : ''}` }, h("digi-icon-table", { key: '36d1e6f12b90215ba6ce00b814573616772820e7', slot: "icon" }), "Visa tabell"), h("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() : ''}` }, h("digi-icon-chart", { key: 'ba94cf5a4ad7e4272d78f1965cd63eee99eb9f8f', slot: "icon" }), "Visa diagram"), h("div", { key: 'be79a632683428a30d01a96bf41f1e446b019061', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), h("div", { key: 'd3644914ab02ae8cb8a054a1d4c90dc854fdaede', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, h("div", { key: '6cb1113d71b8cd9ec156d351dc4ea402cdf3f372', class: "chartTooltip", id: this.afId }, h("div", { key: '0c601e94970dd3563bec5bfe070a3e02fd339124', class: "tooltipHead" }, h("digi-icon-x", { key: 'a478d1013f6630767b03029f4491222bc35dc118', class: "tooltipClose" })), h("div", { key: '04de1b3898023ef79ec8c69e501d107d8039351d', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (h("digi-icon-caret-up", { class: "caret" })) : (h("digi-icon-caret-down", { class: "caret" })))), h("div", { key: '335550b9c1d64cadc9d72b14af008a2cffcfe58e', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, h("div", { key: '1bd30ebd1a5c1c6342f102f7adc131c6f85bc8d8', class: "legend" })), h("div", { key: '69ddb91b0befa23212d518c27ed018f8c8912c06', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
|
|
1785
1630
|
}
|
|
1786
1631
|
get hostElement() { return getElement(this); }
|
|
1787
1632
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-148a7577.js';
|
|
2
2
|
import { _ as _t } from './text-26e02c8d.js';
|
|
3
|
-
import { s as select,
|
|
3
|
+
import { s as select, e as dispatch, r as range, a as axisLeft, f as formatLocale, p as polyInOut, b as axisBottom, l as linear, m as max, c as min, o as ordinal, g as interpolate, d as linear$1 } from './linear-78b9219d.js';
|
|
4
4
|
import { r as randomIdGenerator } from './randomIdGenerator.util-56406f2e.js';
|
|
5
5
|
|
|
6
6
|
function sourceEvent(event) {
|
|
@@ -3719,4 +3719,4 @@ function linear() {
|
|
|
3719
3719
|
return linearish(scale);
|
|
3720
3720
|
}
|
|
3721
3721
|
|
|
3722
|
-
export { axisLeft as a, axisBottom as b,
|
|
3722
|
+
export { axisLeft as a, axisBottom as b, min as c, linear$1 as d, dispatch as e, formatLocale as f, interpolate$1 as g, initRange as i, linear as l, max as m, ordinal as o, polyInOut as p, range as r, select as s };
|