Updated the opacity to use native JS instead of d3 so it's more performant