How bardurt/odontograma works
Main Components
• HTML & Entry Point – The index.html file is the entry point that sets up the user interface and loads the JavaScript code.
• JavaScript Modules – The “js” directory contains all the core modules. Each module plays an important role:
• engine.js: Acts as the central simulation or game loop engine, driving the application’s logic.
• renderer.js: Handles drawing to the screen, likely using the HTML5 Canvas or similar.
• odontogramaGenerator.js: Responsible for generating the odontogram structure, creating tooth objects, or laying out the dental chart.
• tooth.js: Defines the data/behavior for individual tooth objects.
• collisionHandler.js & rect.js: Likely manage collision detection and geometric bounds for interactive or movable components.
• menuItem.js and textBox.js: Deal with user interface elements – menus, buttons, and text overlays.
• constants.js & settings.js: Provide configuration data and constants used throughout the application.
• damage.js: Perhaps handles representation of dental damage or modifications to the odontogram.
Relationships and Interactions
• The engine.js serves as the central coordinator that repeatedly updates the state of the system. It calls:
• renderer.js for drawing the updated state.
• odontogramaGenerator.js to create or refresh the odontogram.
• Collision and input handlers (via collisionHandler.js) to manage interactions.
• The tooth objects (from tooth.js) are generated and manipulated by the odontogramaGenerator, while any graphical representation might be processed by renderer.js.
• MenuItem.js and textBox.js interact with engine.js to modify settings or display feedback during user interactions.
• Settings and constants modules provide shared configurations to all major modules.
Architectural Patterns and Design Principles
• Modular JavaScript design: The project is divided into multiple well-defined modules, keeping concerns separated.
• MVC-like Separation (loosely speaking): Although not formally structured as MVC, you have components responsible for:
– Data (tooth.js, damage.js)
– Logic/Control (engine.js, collisionHandler.js)
– View (renderer.js, textBox.js, menuItem.js)
• Reusability & Separation of Concerns: Each file/module is dedicated to a specific aspect of the overall functionality ensuring extensibility and ease of maintenance.
Including Relevant Technologies
• Core Web technologies: HTML5 and JavaScript.
• Likely usage of Canvas or DOM manipulation for rendering.
• No explicit external libraries are mentioned so it appears to be a custom built solution.