Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dṛśyam Logo

Dṛśyam

The Minimalist SVG & Mermaid Diagram Viewer

License: MIT PWA Ready No Dependencies Offline Support

Dṛśyam (Sanskrit: दृश्यम्) — A zero-dependency, ultra-lightweight diagram viewer. Drop any file and explore it with smooth infinite pan, zoom, and high-resolution export.

View DemoReport BugRequest Feature


✨ Features

  • 🚀 Zero Install, Zero Build — A single-file core that works directly from your filesystem.
  • 🎨 Universal Viewer — Native support for .svg and Mermaid syntax (.mmd, .mermaid).
  • 🔍 Pro-Grade Navigation — Smooth D3-powered pan and zoom ranging from 0.01× to 20×.
  • 📱 PWA Native — Install it as a standalone app on iOS, Android, or Desktop.
  • 🛠 Mermaid Editor — Built-in editor with live preview, line numbers, and syntax error linting.
  • 💾 High-Res Export — Save your work as clean SVGs or high-density PNGs.
  • 🔒 Security First — Hardened with DOMPurify to prevent XSS from untrusted SVG files.
  • 🌓 Adaptive UI — Modern glassmorphism interface with persistent dark-mode settings.

🛠️ Tech Stack

Core Navigation Rendering Security
Vanilla JS D3.js v7 Mermaid.js v10 DOMPurify
PWA Service Worker CSS3 Glassmorphism Lucide Icons LocalStorage API

🚀 Quick Start

1. The Direct Way

Simply open index.html in any modern web browser.

# macOS/Linux
open index.html

# Windows
start index.html

2. The Developer Way (Local Server)

For the best experience with Service Workers and PWA features, serve the folder:

npx serve .
# or
python -m http.server 8080

⌨️ Keyboard Shortcuts

Key Action
F Fit to screen — Auto-scale diagram to viewport
R Reset zoom — Snap back to 100% scale
E Toggle Editor — Show/Hide the Mermaid editor
+ / - Zoom Control — Zoom in or out incrementally
Ctrl + Enter Render — Execute Mermaid code from editor

📂 Project Structure

drishyam/
├── index.html       # The Core Application
├── icon.svg         # Vector Source Logo
├── manifest.json    # PWA Configuration
├── sw.js            # Service Worker (Offline Support)
├── appstore-images/ # Platform-specific Icon Assets
└── README.md        # The Documentation

🎨 Name & Philosophy

Dṛśyam (Devanagari: दृश्यम्) means "that which is seen" or "the object of vision". The logo traces the Devanagari glyph दृ (Dṛ) as a single continuous stroke, representing the seamless flow of architectural ideas from code to vision.


🛠 Developer Guide

Releasing Updates

Dṛśyam uses a centralized versioning system managed by the Service Worker. To push an update to all installed PWA instances:

  1. Open sw.js.
  2. Update the VERSION constant at the top of the file using the Evergreen format (YY.M.U), e.g., const VERSION = "26.5.2";.
  3. Deploy the changes.

The app will automatically detect the change, notify users with a "Update Available" toast, and show an update button in the More menu. The UI version indicator and cache management are all driven by this single variable.


📄 License

Distributed under the MIT License. See LICENSE for more information.


Built with ❤️ for architects, developers, and visual thinkers.

About

Dṛśyam — SVG & Mermaid diagram viewer. Drop any diagram, explore with infinite pan & zoom. Single HTML file, no install.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages