Update index.js

diagram generation for each map update