How jerry-tanghao/x-sheet works
Main Components
• User Interface & Initialization:
• “index.html” and assets (CSS, images, etc.) that serve as the entry point and styling for the spreadsheet.
• Initialization snippet that creates an instance of the spreadsheet (XSheet) and attaches it to the DOM.
• Core Spreadsheet Engine:
• Distinguish between subcomponents such as table engine, cell handling, screen rendering, resizing, protection, and context-menu management.
• Formula and Computation Engine:
• Src/formula folder (with Compiler.js and Formula.js) which deals with parsing and computing cell formulas.
• Drawing and Rendering Subsystem:
• IO and Import/Export Modules:
• Modules in src/io (for CSV and XLSX import/export) as separate components responsible for data persistence and interoperability.
• Auxiliary Modules and Utilities:
• Worker Processes:
Relationships and Interactions
• How the Core Spreadsheet Engine interacts with the formula engine for cell computations, with the drawing system for rendering visuals, and with IO modules to manage data import/export.
• How auxiliary modules support additional user interactions (context menus, alerts, etc.) and are called upon by both the UI and the core engine.
Architectural Patterns and Design Principles
• Modularity by grouping the project into distinct layers (UI, core engine, formula processing, rendering, import/export, and utilities).
• How iterative and asynchronous processing is implemented via the iterator submodules (both synchronous and asynchronous variants) in the table portion.
Relevant Technologies and Frameworks
• Usage of webpack (build/webpack configurations) for module bundling.
• That it is built in modern JavaScript, utilizes ES6 modules (as seen by .babelrc and ESLint configuration files), and employs various libraries for DOM manipulation and event handling.
• Mention that integration with external tools like exceljs is highlighted in the README for XLSX parsing.
Elements
• Clearly labeled nodes for each major component (UI, Core Spreadsheet Engine, Formula Engine, Drawing System, IO Modules, Auxiliary Modules, and Worker Processes).
• Annotation for each component mentioning key file paths or directories where their logic resides (e.g., “Core Table Components (src/core/table/*)”).