-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Floorplan Syntax: A Declarative Way to Define Room Layouts #6134
Comments
Floorplan Syntax Proposal for Mermaid.jsOverviewThe Floorplan Syntax allows users to create architectural layouts in a declarative and intuitive way. It is designed for use cases like floor plans, interior design, event planning, and game maps. This syntax builds on the following principles:
Syntax FeaturesRoom Definition
Default Behavior:
Example:
Simplified to:
Walls with Multiple ElementsWalls can include multiple elements (e.g., doors and windows) which are either positioned explicitly or automatically spaced evenly. Explicit Positioning
Automatic Spacing
Example:
Overlapping ElementsIf multiple elements overlap (e.g., a door and a window both at 50%), the window will render beneath the door by default. Placement Preferences
Walls with Auto-Placement (
|
Proposal
Mermaid.js should add Floorplan Syntax, a declarative way to define architectural layouts such as room-based floor plans. This syntax would enable users to quickly and visually design rooms, hallways, and multi-level spaces in a structured format.
Floorplan syntax supports:
Room Placement: Define rooms using dimensions, coordinates, and walls.
Sub-Rooms: Allow smaller rooms (e.g., closets, toilets) within a parent room.
Connections: Doors and windows can be placed precisely on walls, using percentage-based placement.
Hierarchies: Support multiple levels with nested sub-rooms and hallways.
Automatic Door Behavior: Doors swing into the largest of two connected rooms unless explicitly stated. Swing to closest wall if nothing is stated.
With this addition, Mermaid.js expands its usefulness into architecture, interior design, and even game development for mapping spaces.
Why Add Floorplan Syntax?
Mermaid.js currently lacks tools for architectural diagrams. Adding floorplan capabilities fills a new niche.
Syntax is simple, intuitive, and follows Mermaid.js' declarative principles.
Many industries (real estate, design, construction) use diagrams like floorplans, and this would open Mermaid.js to a wider audience.
Example
Screenshots
The text was updated successfully, but these errors were encountered: