Fire a js function, when a graph is loaded (or changed)

don’t know if this belongs in py or js forum

(Resize <g class legend> after truncating legend text)