Skip to content

Feature: Implement remaining diagram types (19 of 23 unimplemented) #69

@anand-testcompare

Description

@anand-testcompare

Summary

The schema defines 23 diagram types, but only 4 have actual distinct implementations. The remaining 19 types fall back to the flowchart template.

Current State

Implemented with distinct templates (4):

Type Implementation
flowchart Default rectangles, straight arrows, TB layout
architecture Wider spacing, elbow connectors
mindmap Radial layout via applyRadialLayout()
sequence Broken - see #68

Unimplemented (19) - all fall back to flowchart:

orgchart, class, er, gantt, timeline, tree, network, 
dataflow, state, swimlane, concept, fishbone, swot, 
pyramid, funnel, venn, matrix, infographic, decision-tree

Fallback logic in packages/backend/lib/templates/index.ts:

return TEMPLATES[diagramType.toLowerCase()] ?? FlowchartTemplate;

Scope

Each diagram type needs:

  1. Template - Node shapes, colors, spacing defaults
  2. Layout algorithm - Positioning logic (dagre config or custom)
  3. Grading criteria - Visual evaluation prompts
  4. Prompts - Generation guidance for the AI

Needs Grooming

This issue needs to be groomed and split into logical phases based on priority. Suggested approach:

Phase 1: High-value, achievable

Types that can be implemented with dagre config tweaks + shape mappings:

  • decision-tree (already has layout config, needs template)
  • orgchart (hierarchical TB layout)
  • tree (similar to orgchart)
  • state (already has layout config)

Phase 2: Moderate complexity

Types needing custom layout logic:

  • er (entity-relationship with crow's foot notation)
  • class (UML class diagrams with compartments)
  • swimlane (lane-based horizontal partitioning)
  • dataflow (DFD notation)

Phase 3: Specialized/Complex

Types requiring significant custom rendering:

  • gantt (timeline bars, dependencies)
  • timeline (chronological axis)
  • network (force-directed or hierarchical)
  • fishbone (Ishikawa cause-effect)

Phase 4: Evaluate necessity

Types that may not be worth implementing or could be consolidated:

  • concept (may overlap with mindmap)
  • swot (2x2 matrix - simple)
  • pyramid / funnel (stacked shapes)
  • venn (overlapping circles)
  • matrix (grid layout)
  • infographic (too generic?)

Next Steps

  1. Groom this issue into separate phase issues
  2. Prioritize based on user demand / analytics
  3. Consider removing unsupported types from schema to avoid false advertising

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions