How bgrawi/jsflap works
Project type and purpose
• This is a front-end, full-stack-style open-source visualization tool for Formal Languages and Automata Theory, named jsflap.
• It provides an embeddable web component (index.html + Angular + D3) plus a core TypeScript library (src/) to model and render finite automata, Turing machines, etc.
File structure
• Top-level artifacts:
• Gulpfile.js, package.json, bower.json, tsconfig.json, karma.conf.js: build/test configuration
• index.html, assets/, templates/: runtime HTML/CSS assets and Angular partials
• bower_components/: third-party front-end deps (Angular, D3)
• src/: core TypeScript modules
• dist/: compiled output (jsflap.js, css)
• test/: unit tests (Karma + Jasmine)
• src/ is further subdivided into logical namespaces:
• Board (canvas, mouse events, command pattern for undo/redo)
• Graph (abstract graph interfaces, FA/TM graph implementations)
• Machine (state machines built on top of graphs)
• Transition, Node, Edge classes & lists, Utils (UUID), Point modules
• Visualization (D3/DOM wrappers, Angular directives for nodes/edges)
README for additional insights
• Confirmed: “JS Implementation for visualizing Formal Languages and Automata Theory.”
Final recommendations
• Interfaces (IGraph, IMachine, ICommand) and concrete implementations (FAGraph, FAMachine, AddNodeAtPointCommand).
• Architectural elements (build, dependencies, runtime, testing) appear to give a holistic system view.