-
Notifications
You must be signed in to change notification settings - Fork 4
Datadesciption: Let datadescription place units at values #66
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Datadescription descripes data with colors. But values often have units (e.g. km, mm, cm, ...) Datadescription should be expanded to add the units at the displayed data.
Example code:
function appendUnits(evt) {
let units = JSON.parse(localStorage.getItem("attributeUnits"));
const repeatedSets = evt.detail.repeateds;
repeatedSets.forEach(set => {
for (let i = 0; i < set.children.length; i++) {
const child = set.children[i];
const bpElements = child.querySelectorAll("swac-bp[attrname]");
bpElements.forEach(bp => {
const attr = bp.getAttribute("attrname");
if (units[attr] !== null && units[attr] !== undefined) {
const span = child.querySelector("span");
if (span) {
span.textContent += " " + units[attr]
}
}
});
}
});
}
But code should not modify the displayed value itself but have to add the unit after the values bindpoint.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request