contrastbar = function (value, color, max) {
const backgroundDiv = htl.html.fragment`<div aria-hidden=true style="
z-index: -1;
position: absolute;
right: 0;
background: #dddddd;
width: 100%;
border-radius: 3px 0 0 3px;"> `;
const valueDiv = htl.html.fragment`<div aria-hidden="true" style="
z-index: 0;
position: absolute;
right: 0;
background: ${color};
width: ${(100 * Math.abs(value)) / max}%;
min-width: 0%;
border-radius: 3px 0 0 3px;"> `;
const textDiv = htl.html.fragment`<div style="
z-index: 1;
position: absolute;
right: 0;
color: white;
padding-right: 3px;
">${d3.format("0.1f")(value)}`;
return htl.html`<div style="
position: relative;
box-sizing: border-box;
">${backgroundDiv}${valueDiv}${textDiv}`;
}