Bond diagrams in JS