Skip to content

Document usage of BaseGraph and advices for optimal tree-shaking #781

@tbouffard

Description

@tbouffard

Is your documentation request related to a problem? Please describe.

#760 provides a way to highly reduce the footprint of maxGraph in applications.
The documentation currently only mention the Graph class which limits tree-shaking.

Describe the solution you'd like

The documentation should provides guidance and best-pratices to reduce the bundle size of applications using maxGraph.

  • Create a dedicated documentation page for tree-shaking

    • Explain tree-shaking patterns with maxGraph, and add links to existing pages
    • Detail in particular:
  • Document usage patterns for both Graph and BaseGraph

    • Explain pros/cons of the 2 classes
    • Describe the differences
    • introduce BaseGraph which prevents from loading some maxGraph default
    • code example: comparison of the signature of the constructors
    • link to examples and stories

Additional context

Summary from OpenAI Codex

  • Graph is the ready-to-use DOM graph class; it wires a container, default model/view, registers built-in shapes, markers, and loads the default plugin set for prototyping (packages/core/src/view/Graph.ts:41).
  • BaseGraph exposes the minimal, tree-shakeable graph skeleton for production builds where you opt into specific plugins/styles yourself (packages/core/src/view/BaseGraph.ts:34).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions