Yeah, that appears to be it. I commented out all the Plot code and just did a very simple .append() example and it failed with the same error.
I guess I’m going to have to construct my legend manually. I guess I can define my color range in Plot and then just add my own elements with the same colors in the dom.
Thanks for your help @mbostock