Ficha: dibujar el intervalo sobre la escala y llevar la fecha índice al pie

This commit is contained in:
2026-12-02 19:42:36 -06:00
parent 2970ce16b0
commit 0d458818b5
+33 -2
View File
@@ -79,7 +79,7 @@ export function riskGroups(
}
@for (g of groups(); track $index) {
@if (g.title) {
<h3>{{ g.title }}{{ g.index ? ' · fecha índice ' + g.index : '' }}</h3>
<h3>{{ g.title }}</h3>
}
@for (s of g.scales; track s.label) {
<div class="risk-scale" [attr.data-scale]="s.label">
@@ -97,6 +97,14 @@ export function riskGroups(
<div class="risk-plot" [class.unavailable]="!s.risk">
<div class="risk-line" aria-hidden="true"></div>
@if (s.risk; as r) {
@if (r.low !== undefined && r.high !== undefined) {
<span
class="risk-interval"
[style.left.%]="r.low * 100"
[style.width.%]="(r.high - r.low) * 100"
aria-hidden="true"
></span>
}
<span class="risk-marker" [style.left.%]="r.p * 100" aria-hidden="true"></span>
<strong
class="risk-value"
@@ -110,6 +118,9 @@ export function riskGroups(
</div>
</div>
}
@if (g.index) {
<p class="muted foot">Fecha índice {{ g.index }}</p>
}
}
`,
styles: `
@@ -124,7 +135,7 @@ export function riskGroups(
margin: 0;
}
.risk-plot {
padding-top: 24px;
padding-top: 30px;
position: relative;
}
.risk-line {
@@ -146,6 +157,26 @@ export function riskGroups(
#fff 25%
);
}
.risk-interval {
border-left: 2px solid #17324d;
border-right: 2px solid #17324d;
height: 8px;
min-width: 2px;
position: absolute;
top: 20px;
}
.risk-interval::before {
background: #17324d;
content: '';
height: 2px;
left: 0;
position: absolute;
right: 0;
top: 3px;
}
.foot {
font-size: 12px;
}
.risk-marker {
background: #17324d;
bottom: -2px;