How quakcin/digram works
Purpose and Runtime
DiGram is a desktop-style flowchart editor for building algorithm block diagrams and generating C source code from them. The repository is a small JavaScript application with HTML/CSS UI assets; no backend, database, or cloud service is evident.
Primary runtime entry point: index.js. Main application UI and behavior are split between window/window.html, window/window.js, and window/window.css.
Application Shell
index.js likely bootstraps the application window/runtime and loads the editor UI. The editor is represented by:
• index.js
• window/window.html
• window/window.js
window/window.html defines the renderer-facing document structure, while window/window.css supplies the diagram-editor presentation and window/window.js owns interactive editor behavior.
Diagram Editing Stage
The core user workflow is creating a flowchart from typed blocks: input, processing, condition, output, and function nodes. Users place blocks, connect them into a logical sequence, and add explanatory comments.
The primary editing boundary is the window renderer:
• window/window.js
• window/window.html
• window/window.css
Diagram state is expected to be managed in browser-side JavaScript, with visual elements rendered in the application window rather than through a server API.
Menu and Command Dispatch
The menu subsystem is separated from the editor window, implying application-level commands such as file operations, import/export, and code generation are initiated outside direct canvas interactions:
• menu/menu.js
• menu
This forms a control boundary between menu commands and the editor state handled in window/window.js.
Code Generation
A central product capability is transforming a completed flowchart into syntactically valid C. The README’s sample indicates generation emits includes, main, variable declarations, I/O statements, conditional branches, labels, and goto-based control flow.
The generation logic is most likely integrated into the editor/controller layer:
• window/window.js
• index.js
Generated code is local output selected by the user; no compilation or remote execution service is described.
Import, Export, and Filesystem Boundary
The application supports importing diagrams and exporting rendered diagrams as image formats such as PNG and JPG, plus saving generated C to a chosen filename/location. These operations cross from in-memory editor state to local filesystem dialogs and files.
Relevant command integration paths:
• menu/menu.js
• window/window.js
• index.js
Validation is intentionally lightweight: the product assumes diagrams are logically correct, but is expected to check completeness before generation/export.
Assets and Documentation
Visual resources are bundled locally:
• fonts
• icons
• __gallery
Projekt-zespołowy-dokumentacja.pdf and tutorial.pdf are project/user documentation, not runtime components. package.json defines the JavaScript runtime dependencies and scripts.
Main entry points: window.js Editor controller · window.html Editor document · index.js Application entry · menu.js Application menu
Components 12
Desktop shell
- Application entry · Bootstraps the desktop runtime and editor window.
index.js - Bundled visual assets
fonts - Runtime package · Defines JavaScript dependencies and scripts.
package.json
Diagram editor
- Editor document
window/window.html - Editor controller · Owns interactive editing, diagram state, validation, and generation.
window/window.js - Editor styling
window/window.css - Diagram model · Typed blocks, connections, comments, and logical flow.
- Diagram canvas
Commands & output
- Application menu · Initiates file, import/export, and code-generation commands.
menu/menu.js - Completeness checks · Checks diagram completeness before generation or export.
- C code generator · Converts flowchart control flow into local C source.
- Local files & dialogs · Loads diagrams and saves images or generated C to user-selected locations.
Connections 17
- Application entry → Editor document: loads
- Application entry → Editor controller: starts
- Editor document → Editor controller: hosts
- Editor styling → Editor document: styles
- Editor controller → Diagram model: edits
- Diagram model → Diagram canvas: renders as
- Editor controller → Diagram canvas: updates
- Application menu → Editor controller: dispatches commands to
- Diagram model → Completeness checks: checked before output
- Completeness checks → C code generator: permits generation
- Diagram model → C code generator: transforms
- C code generator → Local files & dialogs: saves C source
- Completeness checks → Local files & dialogs: permits image export
- Application menu → Local files & dialogs: opens import/export dialogs
- Local files & dialogs → Diagram model: imports diagram
- Bundled visual assets → Editor document: supplies visual resources
- Runtime package → Application entry: defines runtime