The TensorflowJS Visualiser documentation has example code that works fine on their own site, if you click the run button.
run
But when I literally copy>paste