npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@boundaryboard/renderer

v1.0.1

Published

Interactive Domain Model DSL diagram renderer with React Flow. Create and edit DDD diagrams with a visual canvas.

Readme

@boundaryboard/renderer

Interactive Domain Model DSL diagram renderer with React Flow. Create and edit DDD (Domain-Driven Design) diagrams with a visual canvas.

Features

  • DSL-Based: Define diagrams using a simple, human-readable DSL
  • Interactive Canvas: Pan, zoom, and navigate diagrams
  • Optional Editing: Enable node editing, adding, and deletion
  • Multiple Node Types: Entity, Value Object, Domain Event, Aggregate, Bounded Context, and more
  • Relationship Mapping: Visualize relationships between domain elements
  • Export: Export diagrams as SVG
  • Standalone or React: Use as a script tag or React component

Installation

npm install @boundaryboard/renderer
# or
yarn add @boundaryboard/renderer
# or
pnpm add @boundaryboard/renderer

Quick Start

React Component (Recommended)

import { EditableBoundaryBoardCanvas } from '@boundaryboard/renderer';
import '@boundaryboard/renderer/styles.css';

const dsl = `
domainModel "Order Management" {
  context OrderContext {
    entity Order {
      attributes {
        id: string
        status: OrderStatus
      }
    }

    valueObject Money {
      attributes {
        amount: number
        currency: string
      }
    }

    event OrderPlaced {
      attributes {
        orderId: string
      }
    }
  }

  relationships {
    Order -> Money {}
  }
}
`;

function DiagramViewer() {
  return (
    <div style={{ width: '100%', height: '600px' }}>
      <EditableBoundaryBoardCanvas
        dsl={dsl}
        showGrid={true}
        showControls={true}
      />
    </div>
  );
}

Editable Canvas

import { useState } from 'react';
import { EditableBoundaryBoardCanvas } from '@boundaryboard/renderer';
import '@boundaryboard/renderer/styles.css';

function DiagramEditor() {
  const [dsl, setDsl] = useState(initialDSL);

  return (
    <EditableBoundaryBoardCanvas
      dsl={dsl}
      onChange={(newDsl, ast) => {
        setDsl(newDsl);
        // Optionally persist to backend
      }}
      editable={true}           // Enable editing
      allowAdd={true}           // Right-click to add nodes
      allowDelete={true}        // Delete button in popovers
      allowEdgeEditing={true}   // Edit edge labels
      allowConnect={true}       // Connect nodes to create edges
    />
  );
}

Script Tag Usage

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://unpkg.com/@boundaryboard/renderer/dist/boundaryboard-renderer.css">
</head>
<body>
  <div id="diagram" style="width: 100%; height: 600px;"></div>

  <script src="https://unpkg.com/@boundaryboard/renderer/dist/boundaryboard-renderer.standalone.js"></script>
  <script>
    const renderer = new BoundaryBoardRenderer.BoundaryBoardRenderer('#diagram');
    renderer.render(`
      domainModel "Example" {
        entity Order {
          attributes {
            id: string
          }
        }
      }
    `);
  </script>
</body>
</html>

DSL Syntax

Basic Structure

domainModel "Model Name" {
  // Bounded contexts
  context ContextName {
    // Elements...
  }

  // Standalone elements
  entity EntityName { }

  // Relationships
  relationships {
    Source -> Target {}
  }
}

Element Types

// Entity
entity Order {
  description: "A customer order"
  attributes {
    id: string
    status: OrderStatus
    total: number
  }
}

// Aggregate root entity
root entity Order {
  attributes { id: string }
}

// Value Object
valueObject Money {
  attributes {
    amount: number
    currency: string
  }
}

// Domain Event
event OrderPlaced {
  description: "Fired when order is placed"
  color: "#fbbf24"
  attributes {
    orderId: string
    timestamp: Date
  }
}

// Sticky Note
stickyNote "Important" {
  description: "Remember to validate input"
}

// Domain Service
domainService PricingService {
  description: "Calculates prices"
}

// Repository
repository OrderRepository {
  description: "Persists Order aggregates"
}

// Factory
factory OrderFactory {
  description: "Creates Order instances"
}

Relationships

relationships {
  // Simple relationship
  Order -> Customer {}

  // With label
  Order -> Money {
    label: "has total"
  }

  // Context mapping
  OrderContext -> PaymentContext {
    label: "Upstream"
    type: customer_supplier
  }
}

Context Mapping Types

  • customer_supplier
  • conformist
  • anticorruption_layer
  • shared_kernel
  • published_language
  • open_host_service
  • partnership
  • separate_ways

API Reference

EditableBoundaryBoardCanvas Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | dsl | string | required | DSL source code | | onChange | (dsl: string, ast: DomainModelAST) => void | - | Callback when DSL changes | | editable | boolean | false | Enable editing mode | | allowAdd | boolean | false | Allow adding new nodes | | allowDelete | boolean | false | Allow deleting nodes/edges | | allowEdgeEditing | boolean | false | Allow editing edges | | allowConnect | boolean | false | Allow connecting nodes | | interactive | boolean | true | Enable pan & zoom | | fitOnRender | boolean | true | Auto-fit diagram | | showGrid | boolean | true | Show grid background | | gridType | 'dots' \| 'lines' | 'dots' | Grid style | | showControls | boolean | true | Show zoom controls | | showMinimap | boolean | false | Show minimap | | background | string | '#fafafa' | Background color |

Programmatic API

import {
  parseDSL,
  generateDSL,
  calculateLayout,
  convertToReactFlow
} from '@boundaryboard/renderer';

// Parse DSL to AST
const parseResult = parseDSL(dslString);
if (parseResult.errors.length === 0) {
  const ast = parseResult.model;

  // Calculate layout
  const layout = calculateLayout(ast);

  // Convert to React Flow format
  const { nodes, edges } = convertToReactFlow(layout);

  // Generate DSL from AST
  const newDsl = generateDSL(ast, { includeLayout: true });
}

Styling

The package includes default styles. Import them in your app:

import '@boundaryboard/renderer/styles.css';

Or link in HTML:

<link rel="stylesheet" href="https://unpkg.com/@boundaryboard/renderer/dist/boundaryboard-renderer.css">

TypeScript Support

Full TypeScript support with exported types:

import type {
  DomainModelAST,
  EditableBoundaryBoardCanvasProps,
  NodeUpdates,
  EdgeUpdates,
} from '@boundaryboard/renderer';

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT

Links