can I have an conditional in the update pattern on whether to update an attribute?

This is a mouthful of a title,

basically I am wondering if I can have

update => update
.attr('y', d => y(Number(d.score)))
            .attr('width', x.bandwidth())
            .attr('height', d => height - y(Number(d.score)))
            if (updateColor)
            {
                update
                .style('fill', 'black');
                console.log(updateColor);
            }

It doesn’t throw an error but it also doesn’t work haha.

many thanks for any tips!

update, I think it actually works but I have a bug, been at this too long today :sweat_smile:

1 Like