function setupPropertiesListener(view, name) {
const propertiesRow = document.querySelector(`#${name}`);
console.log("propertiesRow: ", propertiesRow, name);
const propertiesRowData = propertiesRow.querySelector(
`.property-data-${name}`
);
view.watch(
name,
(value) => {
propertiesRow.className = "property active";
const formattedValue =
typeof value === "number" ? value.toFixed(4) : value;
propertiesRowData.innerHTML = formattedValue.toString();
if (propertiesRow.highlightTimeout) {
clearTimeout(propertiesRow.highlightTimeout);
}
propertiesRow.highlightTimeout = setTimeout(() => {
propertiesRow.className = "property inactive";
}, 1000);
},
{
initial: true
}
);
}