JavaScript-based diagram viewer and editor