@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 { p as proxyCustomElement, H, h, d as Host } from './p-a53686b3.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 './p-f9a1a787.js';
|
|
3
3
|
import { _ as _t } from './p-08cf2c0e.js';
|
|
4
4
|
import { r as randomIdGenerator } from './p-ffe5c0e8.js';
|
|
5
5
|
import { B as BarChartVariation } from './p-dcdffb3c.js';
|
|
@@ -213,8 +213,6 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
213
213
|
// Resizing chart while loading
|
|
214
214
|
this.loadingResize = () => {
|
|
215
215
|
const newHeight = this.setDims();
|
|
216
|
-
this.setMargins(true);
|
|
217
|
-
this.svg.attr('width', this.dims.width).attr('height', this.dims.height);
|
|
218
216
|
this.barChartContainer.attr('transform', `translate(${this.margin.left + this.tickPadding + this.yTickSize},0)`);
|
|
219
217
|
this.margin.right =
|
|
220
218
|
this.getTextSize(this.xScale.domain()[1].toLocaleString()) / 2 +
|
|
@@ -239,10 +237,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
239
237
|
0,
|
|
240
238
|
this.dims.width - this.margin.right - this.margin.left
|
|
241
239
|
]);
|
|
242
|
-
this.barSelection
|
|
243
|
-
.attr('x', this.xFunction)
|
|
244
|
-
.attr('width', this.widthFunction);
|
|
245
240
|
this.setValueTicks();
|
|
241
|
+
this.adjustBarSize();
|
|
246
242
|
};
|
|
247
243
|
this.highlightBarGroup = (_event, datum) => {
|
|
248
244
|
if (typeof datum === 'string') {
|
|
@@ -353,189 +349,33 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
353
349
|
return 'barGroup' + key.replace(/[^A-Z0-9]+/gi, '');
|
|
354
350
|
};
|
|
355
351
|
this.updateBars = (fromLoading) => {
|
|
356
|
-
this.barChartContainer
|
|
352
|
+
this.barSelection = this.barChartContainer.select('.interactiveElements')
|
|
357
353
|
.selectAll('.barGroup')
|
|
358
354
|
.data(this.mappedData)
|
|
359
|
-
.join(
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
.on('mouseenter', this.hover)
|
|
384
|
-
.on('mouseleave', this.hoverOut)
|
|
385
|
-
.on('click', this.openTooltip)
|
|
386
|
-
.transition()
|
|
387
|
-
.duration(this.defaultDuration)
|
|
388
|
-
.ease(polyInOut)
|
|
389
|
-
.attr('width', this.widthFunction)
|
|
390
|
-
.attr('y', this.yFunction)
|
|
391
|
-
.attr('height', this.heightFunction)
|
|
392
|
-
.attr('fill', '#00005a');
|
|
393
|
-
if (!((_b = (_a = this.chartData) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.valueLabels))
|
|
394
|
-
return tempSelection;
|
|
395
|
-
tempSelection
|
|
396
|
-
.append('text')
|
|
397
|
-
.text((d) => d.value.toLocaleString())
|
|
398
|
-
.attr('class', 'barText')
|
|
399
|
-
.attr('font-size', this.fontSize)
|
|
400
|
-
.attr('font-weight', '600')
|
|
401
|
-
.attr('text-anchor', 'end')
|
|
402
|
-
.style('pointer-events', 'none')
|
|
403
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
404
|
-
? this.yScale(d.key) + this.yScale.bandwidth() / 2
|
|
405
|
-
: this.dims.height - this.margin.bottom)
|
|
406
|
-
.attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
407
|
-
? 2
|
|
408
|
-
: this.xScale(d.key) + this.xScale.bandwidth() / 2)
|
|
409
|
-
.transition()
|
|
410
|
-
.duration(this.defaultDuration)
|
|
411
|
-
.ease(polyInOut)
|
|
412
|
-
.attr('font-size', this.fontSize)
|
|
413
|
-
.attr('font-weight', '600')
|
|
414
|
-
.attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
415
|
-
? this.xScale(d.value)
|
|
416
|
-
: this.xScale(d.key) + this.xScale.bandwidth() / 2)
|
|
417
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
418
|
-
? this.yScale(d.key) + this.yScale.bandwidth() / 2
|
|
419
|
-
: this.yScale(d.value))
|
|
420
|
-
.attr('text-anchor', (d) => {
|
|
421
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
422
|
-
return 'middle';
|
|
423
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
424
|
-
? 'start'
|
|
425
|
-
: 'end';
|
|
426
|
-
})
|
|
427
|
-
.attr('dx', (d) => {
|
|
428
|
-
if (this.afVariation === BarChartVariation.Horizontal)
|
|
429
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
430
|
-
? this.tickPadding
|
|
431
|
-
: -this.tickPadding;
|
|
432
|
-
return 0;
|
|
433
|
-
})
|
|
434
|
-
.attr('fill', (d) => {
|
|
435
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
436
|
-
return 'black';
|
|
437
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
438
|
-
? 'black'
|
|
439
|
-
: 'white';
|
|
440
|
-
})
|
|
441
|
-
.attr('dy', () => this.afVariation == BarChartVariation.Horizontal
|
|
442
|
-
? '0.35em'
|
|
443
|
-
: '-0.25em')
|
|
444
|
-
.style('pointer-events', 'none')
|
|
445
|
-
.attrTween('text', (d, i, nodelist) => {
|
|
446
|
-
const oldnum = parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
447
|
-
? parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
448
|
-
: 0;
|
|
449
|
-
const interpolatedValue = interpolate(oldnum, d.value);
|
|
450
|
-
return (t) => (nodelist[i].textContent = parseInt(interpolatedValue(t)).toLocaleString(undefined, this.numberFormat));
|
|
451
|
-
});
|
|
452
|
-
return tempSelection;
|
|
453
|
-
}, (update) => {
|
|
454
|
-
// Update ids to bars
|
|
455
|
-
update.attr('id', (d) => 'barGroup' + d.key.replace(/[^A-Z0-9]+/gi, ''));
|
|
456
|
-
// Mouse interaction to updated loading bars
|
|
457
|
-
if (fromLoading) {
|
|
458
|
-
update
|
|
459
|
-
.select('rect')
|
|
460
|
-
.on('mouseenter', this.hover)
|
|
461
|
-
.on('mouseleave', this.hoverOut)
|
|
462
|
-
.on('click', this.openTooltip)
|
|
463
|
-
.attr('x', this.xFunction)
|
|
464
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
465
|
-
? this.yScale(d.key)
|
|
466
|
-
: this.dims.height - this.margin.bottom)
|
|
467
|
-
.attr('width', this.widthFunction)
|
|
468
|
-
.attr('height', () => this.afVariation === BarChartVariation.Horizontal
|
|
469
|
-
? this.yScale.bandwidth()
|
|
470
|
-
: 0)
|
|
471
|
-
.attr('fill', '#00005a')
|
|
472
|
-
.transition()
|
|
473
|
-
.duration(this.defaultDuration)
|
|
474
|
-
.ease(polyInOut)
|
|
475
|
-
.attr('y', this.yFunction)
|
|
476
|
-
.attr('height', this.heightFunction)
|
|
477
|
-
.on('end', () => this.barChartObserver.observe(this.chartDiv)); // Reset barchartObserver
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
update
|
|
481
|
-
.select('rect')
|
|
482
|
-
.transition()
|
|
483
|
-
.duration(this.defaultDuration)
|
|
484
|
-
.ease(polyInOut)
|
|
485
|
-
.attr('x', this.xFunction)
|
|
486
|
-
.attr('y', this.yFunction)
|
|
487
|
-
.attr('width', this.widthFunction)
|
|
488
|
-
.attr('height', this.heightFunction)
|
|
489
|
-
.attr('fill', '#00005a');
|
|
490
|
-
}
|
|
491
|
-
return update
|
|
492
|
-
.select('text')
|
|
493
|
-
.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'; })
|
|
494
|
-
.transition()
|
|
495
|
-
.duration(this.defaultDuration)
|
|
496
|
-
.ease(polyInOut)
|
|
497
|
-
.attr('font-size', this.fontSize)
|
|
498
|
-
.attr('font-weight', '600')
|
|
499
|
-
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
500
|
-
? this.yScale(d.key) + this.yScale.bandwidth() / 2
|
|
501
|
-
: this.yScale(d.value))
|
|
502
|
-
.attr('x', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
503
|
-
? this.xScale(d.value)
|
|
504
|
-
: this.xScale(d.key) + this.xScale.bandwidth() / 2)
|
|
505
|
-
.attr('text-anchor', (d) => {
|
|
506
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
507
|
-
return 'middle';
|
|
508
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
509
|
-
? 'start'
|
|
510
|
-
: 'end';
|
|
511
|
-
})
|
|
512
|
-
.attr('dx', (d) => {
|
|
513
|
-
if (this.afVariation === BarChartVariation.Horizontal)
|
|
514
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
515
|
-
? this.tickPadding
|
|
516
|
-
: -this.tickPadding;
|
|
517
|
-
return 0;
|
|
518
|
-
})
|
|
519
|
-
.attr('fill', (d) => {
|
|
520
|
-
if (this.afVariation === BarChartVariation.Vertical)
|
|
521
|
-
return 'black';
|
|
522
|
-
return this.xScale(d.value) < d.len + this.tickPadding * 2
|
|
523
|
-
? 'black'
|
|
524
|
-
: 'white';
|
|
525
|
-
})
|
|
526
|
-
.attr('dy', () => this.afVariation == BarChartVariation.Horizontal
|
|
527
|
-
? '0.35em'
|
|
528
|
-
: '-0.25em')
|
|
529
|
-
.style('pointer-events', 'none')
|
|
530
|
-
.attrTween('text', (d, i, nodelist) => {
|
|
531
|
-
const oldnum = parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
532
|
-
? parseFloat(nodelist[i].textContent.replace(/\s/g, ''))
|
|
533
|
-
: 0;
|
|
534
|
-
const interpolatedValue = interpolate(oldnum, d.value);
|
|
535
|
-
return (t) => (nodelist[i].textContent = parseInt(interpolatedValue(t)).toLocaleString(undefined, this.numberFormat));
|
|
536
|
-
});
|
|
537
|
-
}, (exit) => exit.remove());
|
|
538
|
-
this.barSelection = this.barChartContainer.selectAll('rect');
|
|
355
|
+
.join('g')
|
|
356
|
+
.attr('class', 'barGroup')
|
|
357
|
+
.attr('id', (d) => this.barGroupID(d.key));
|
|
358
|
+
this.barSelection.selectAll('.bar')
|
|
359
|
+
.data((d) => {
|
|
360
|
+
return d.series;
|
|
361
|
+
})
|
|
362
|
+
.join('rect')
|
|
363
|
+
.attr('class', 'bar')
|
|
364
|
+
.style('cursor', 'pointer')
|
|
365
|
+
.attr('x', this.xFunction)
|
|
366
|
+
.attr('y', this.yFunction)
|
|
367
|
+
.attr('ry', 4)
|
|
368
|
+
.attr('rx', 4)
|
|
369
|
+
.attr('width', this.widthFunction)
|
|
370
|
+
.attr('height', this.heightFunction)
|
|
371
|
+
.attr('fill', (d) => this.colorFunction(d.serie))
|
|
372
|
+
.on('mouseenter', this.hover)
|
|
373
|
+
.on('mouseleave', this.hoverOut)
|
|
374
|
+
.on('click', this.openTooltip);
|
|
375
|
+
if (fromLoading) {
|
|
376
|
+
this.initLegend();
|
|
377
|
+
}
|
|
378
|
+
this.barSelection = this.barChartContainer.selectAll('.barGroup');
|
|
539
379
|
this.textSelection = this.barChartContainer.selectAll('.barText');
|
|
540
380
|
};
|
|
541
381
|
// Setting position of text according to bar size
|
|
@@ -574,7 +414,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
574
414
|
};
|
|
575
415
|
this.reshapeData = () => {
|
|
576
416
|
const toReturn = [];
|
|
577
|
-
if (
|
|
417
|
+
if (!this.chartData) {
|
|
578
418
|
this.placeholderTicks.forEach((key) => {
|
|
579
419
|
const tick = { key: key, series: [] };
|
|
580
420
|
tick.series.push({
|
|
@@ -949,11 +789,11 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
949
789
|
.html((d) => {
|
|
950
790
|
return `<span>${d.serie}: <b style="font-weight:600;">${d.value.toLocaleString(undefined, this.numberFormat)}</b></span>`;
|
|
951
791
|
});
|
|
952
|
-
this.tooltip.style('
|
|
792
|
+
this.tooltip.style('display', null);
|
|
953
793
|
this.positionTooltip(this.tooltipData);
|
|
954
794
|
};
|
|
955
795
|
this.closeTooltip = () => {
|
|
956
|
-
this.tooltip.style('
|
|
796
|
+
this.tooltip.style('display', 'none');
|
|
957
797
|
};
|
|
958
798
|
// Positions tooltip in horizontal mode
|
|
959
799
|
this.positionTooltip = (data) => {
|
|
@@ -1092,12 +932,13 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1092
932
|
this.afChartData = undefined;
|
|
1093
933
|
}
|
|
1094
934
|
afChartDataUpdate(data) {
|
|
1095
|
-
if (typeof data
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
935
|
+
if (typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0 || Object.keys(data).length > 0) {
|
|
936
|
+
if (typeof data != 'string')
|
|
937
|
+
this.chartData = data;
|
|
938
|
+
else
|
|
939
|
+
this.chartData = JSON.parse(data);
|
|
1100
940
|
this.series = this.chartData.data.series.map(serie => serie.title);
|
|
941
|
+
}
|
|
1101
942
|
this.mappedData = this.reshapeData();
|
|
1102
943
|
// checking for width of each tick
|
|
1103
944
|
this.mappedData.forEach((elem) => {
|
|
@@ -1188,7 +1029,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1188
1029
|
// Getting handle for tooltip
|
|
1189
1030
|
this.tooltip = select('#' + this.afId);
|
|
1190
1031
|
this.tooltip.select('.tooltipClose').on('click', this.closeTooltip);
|
|
1191
|
-
|
|
1032
|
+
this.tooltip.selectAll('.tooltipHeading').remove();
|
|
1192
1033
|
this.tooltip
|
|
1193
1034
|
.select('.tooltipHead')
|
|
1194
1035
|
.insert('h' + (parseInt(this.afHeadingLevel.replace(/\D/g, '')) + 1), ':first-child') // increment heading level by one
|
|
@@ -1196,7 +1037,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1196
1037
|
.style('font-size', '1rem')
|
|
1197
1038
|
.style('margin', '0 0.75rem 0.25rem 0 ')
|
|
1198
1039
|
.style('font-weight', '500');
|
|
1199
|
-
this.tooltip.style('
|
|
1040
|
+
this.tooltip.style('display', 'none');
|
|
1200
1041
|
}
|
|
1201
1042
|
initEmpty() {
|
|
1202
1043
|
select(this.chartDiv).select('.chartSVG').remove();
|
|
@@ -1216,20 +1057,20 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1216
1057
|
.attr('role', 'img')
|
|
1217
1058
|
.attr('aria-label', this.chartData && this.chartData.title
|
|
1218
1059
|
? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
|
|
1219
|
-
: 'Stapeldiagram');
|
|
1060
|
+
: 'Stapeldiagram').attr('style', 'display: flex;min-width: 0;width: 100%;height: auto;');
|
|
1220
1061
|
// Hide unusable components
|
|
1221
1062
|
select(this.titleDiv)
|
|
1222
|
-
.
|
|
1063
|
+
.append(this.afHeadingLevel)
|
|
1064
|
+
.attr('class', 'loadingHeader')
|
|
1223
1065
|
.html(`${_t.loading}...`);
|
|
1224
1066
|
this.initYAxis(true);
|
|
1225
1067
|
this.initXAxis(true);
|
|
1226
1068
|
this.tooltip = select('#' + this.afId);
|
|
1227
|
-
this.tooltip.style('
|
|
1069
|
+
this.tooltip.style('display', 'none');
|
|
1228
1070
|
this.loadingState(true);
|
|
1229
1071
|
}
|
|
1230
1072
|
loadingState(empty) {
|
|
1231
1073
|
this.loading = true;
|
|
1232
|
-
console.log('loading!');
|
|
1233
1074
|
// close potentially open tooltip
|
|
1234
1075
|
if (this.tooltip)
|
|
1235
1076
|
this.closeTooltip();
|
|
@@ -1269,14 +1110,17 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1269
1110
|
this.xAxisHandle.attr('transform', `translate(0,${this.dims.height - this.margin.bottom})`);
|
|
1270
1111
|
}
|
|
1271
1112
|
const animateBars = () => {
|
|
1272
|
-
this.barChartContainer.selectAll('.
|
|
1113
|
+
this.barChartContainer.selectAll('.interactiveElements').remove();
|
|
1273
1114
|
this.barSelection = this.barChartContainer
|
|
1115
|
+
.append('g')
|
|
1116
|
+
.attr('class', 'interactiveElements')
|
|
1117
|
+
.style('isolation', 'isolate')
|
|
1274
1118
|
.selectAll('barGroup')
|
|
1275
1119
|
.data(this.mappedData)
|
|
1276
1120
|
.join('g')
|
|
1277
1121
|
.attr('class', 'barGroup')
|
|
1278
|
-
.attr('id', (d) =>
|
|
1279
|
-
this.barSelection.selectAll('
|
|
1122
|
+
.attr('id', (d) => this.barGroupID(d.key));
|
|
1123
|
+
this.barSelection.selectAll('bar')
|
|
1280
1124
|
.data((d) => {
|
|
1281
1125
|
return d.series;
|
|
1282
1126
|
})
|
|
@@ -1298,7 +1142,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1298
1142
|
.attr('y', this.yFunction)
|
|
1299
1143
|
.attr('height', this.heightFunction);
|
|
1300
1144
|
this.barChartContainer.selectAll('.bar')
|
|
1301
|
-
.transition()
|
|
1145
|
+
.transition('animateBar')
|
|
1302
1146
|
.duration(400)
|
|
1303
1147
|
.ease(linear$1)
|
|
1304
1148
|
.delay((...[, i]) => i * 150 + 400)
|
|
@@ -1313,8 +1157,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1313
1157
|
};
|
|
1314
1158
|
const flattenBars = () => {
|
|
1315
1159
|
this.barChartContainer
|
|
1316
|
-
.selectAll('
|
|
1317
|
-
.transition()
|
|
1160
|
+
.selectAll('.bar')
|
|
1161
|
+
.transition('animateBar')
|
|
1318
1162
|
.duration(200)
|
|
1319
1163
|
.ease(linear$1)
|
|
1320
1164
|
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
@@ -1550,10 +1394,11 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1550
1394
|
]);
|
|
1551
1395
|
this.setNamedTicks(true);
|
|
1552
1396
|
// Stop animation
|
|
1553
|
-
this.
|
|
1397
|
+
this.barChartContainer.selectAll('.barGroup').on('end', null);
|
|
1398
|
+
select(this.titleDiv).select('.loadingHeader').remove();
|
|
1554
1399
|
this.loading = false;
|
|
1555
|
-
this.
|
|
1556
|
-
|
|
1400
|
+
this.barChartContainer.selectAll('.bar').interrupt('animateBar');
|
|
1401
|
+
this.barChartContainer.selectAll('.bar').transition()
|
|
1557
1402
|
.duration(this.defaultDuration)
|
|
1558
1403
|
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
1559
1404
|
? this.yScale(d.key)
|
|
@@ -1623,7 +1468,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1623
1468
|
this.averageLine();
|
|
1624
1469
|
this.adjustBarSize();
|
|
1625
1470
|
this.adjustBarText();
|
|
1626
|
-
if (this.tooltip.style('
|
|
1471
|
+
if (this.tooltip.style('display') !== 'none')
|
|
1627
1472
|
this.positionTooltip(this.tooltipData);
|
|
1628
1473
|
}
|
|
1629
1474
|
// Returns the longest text from an array of strings
|
|
@@ -1743,7 +1588,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1743
1588
|
<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>`;
|
|
1744
1589
|
}
|
|
1745
1590
|
}
|
|
1746
|
-
return (h(Host, { key: '
|
|
1591
|
+
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) }, ' ')));
|
|
1747
1592
|
}
|
|
1748
1593
|
get hostElement() { return this; }
|
|
1749
1594
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-a53686b3.js';
|
|
2
2
|
import { _ as _t } from './p-08cf2c0e.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 './p-f9a1a787.js';
|
|
4
4
|
import { r as randomIdGenerator } from './p-ffe5c0e8.js';
|
|
5
5
|
import { d as defineCustomElement$6 } from './p-e8fc33ed.js';
|
|
6
6
|
import { d as defineCustomElement$5 } from './p-3c9cea93.js';
|
|
@@ -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 };
|