Skip to content
CAI
Software that uses CAICheck a score

terrastruct/d2

72.9

Adequate · 13 November 2026

175.5k

lines of production code

Go

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

D2 is a diagramming system that compiles a text-based domain-specific language into visual diagrams, supporting multiple layout engines including Dagre, ELK, TALA, and grid-based arrangements. It provides a comprehensive rendering pipeline capable of exporting to SVG, PNG, GIF, PDF, PPTX, and ASCII formats, with native support for animations, isometric projections, and sketch styles. The system includes a CLI tool, a JavaScript library for browser environments, and a Language Server Protocol implementation for IDE integration, all built with a focus on security, performance, and deterministic output.

How it got here

2022 — migration to d2lang and native Go rewrite

53 changes.

The project migrated its organization and module paths from terrastruct to d2lang, replacing JavaScript-based layout engines and utilities with native Go implementations. This period focused on hardening security, removing legacy plugin systems, and expanding the feature set with new diagram types and themes.

2023–2025 — multi-format export and WASM integration

31 changes.

This period focused on expanding D2's export capabilities with new pure-Go renderers for PDF, PPTX, and ASCII, alongside a new grid layout engine. It also introduced a structured WebAssembly API for JavaScript environments, replacing legacy raw exports with a stable, typed interface. Underlying infrastructure improvements included a secure multi-architecture Docker release pipeline and comprehensive end-to-end testing for layout and rendering correctness.

2026 — raster engine and isometric rendering

12 changes.

This period focused on building a new pure-Go raster rendering engine with band-based memory management and introducing a native isometric renderer for multi-format exports. Significant work also went into hardening security through bounded asset resolution and layout safety limits, while establishing a renderer-neutral scene graph to decouple representation from output formats.

Features

Add d2 man page documentation

The release template now includes a man page (d2.1) for the d2 CLI tool, documenting the command-line interface, available options (such as theme, layout, font customization, and watch mode), and subcommands (like layout, fmt, play, and validate). This provides users with local, offline-accessible reference material for using the tool's features.

ci/release/template/man · high confidence

Add generic SyncMap library with thread-safe map operations

Introduces a new generic SyncMap type that wraps Go's sync.Map to provide a thread-safe, type-parameterized map implementation. This library exposes methods for setting, retrieving (via Lookup and Get), deleting, and iterating over key-value pairs, enabling safe concurrent access to maps in generic code.

lib/syncmap · high confidence

Added FuzzyBubbles-Bold font and updated Source Code Pro encoding

Users can now utilize the new FuzzyBubbles-Bold font style in their diagrams. Additionally, the Source Code Pro bold and italic variants are now encoded using the more efficient .woff format instead of .ttf, which improves rendering performance and reduces asset size for these specific font weights.

d2renderers/d2fonts/encoded · high confidence

Added Go WASM execution polyfills for browser environments

The \wasm\_exec.js\ runtime support file has been added to enable Go WebAssembly modules to run in JavaScript environments. This file provides necessary polyfills for the Node.js \fs\ and \process\ APIs, as well as \path\ resolution, mapping them to browser-compatible implementations or throwing errors for unsupported operations. It also enforces the availability of core browser APIs like \crypto\, \performance\, \TextEncoder\, and \TextDecoder\, ensuring the Go runtime has the required global context to execute correctly.

d2js/js/wasm · high confidence

Added in-memory filesystem implementation for JavaScript environments

The \lib/memfs\ package now provides an in-memory implementation of the Go \io/fs\ interface, enabling the application to run in JavaScript environments where native file system calls are unavailable. This change introduces a new \MemoryFS\ type that stores files and directories in a map, supporting standard operations like opening, reading, and stat-ing files without requiring disk access.

lib/memfs · high confidence

Animated SVG export with namespace-safe transitions

The d2animate package now provides a new Wrap function that combines multiple SVG frames into a single animated SVG file. This feature introduces CSS keyframe animations for frame transitions, using a diagram-specific hash to namespace the animation classes and prevent conflicts. It also respects padding and scale settings from the render options and validates the diagram structure before rendering.

d2renderers/d2animate · high confidence

Appendix generation for static exports

The D2 SVG renderer now supports generating an appendix (footnotes) section for static exports like PNG or PDF. This feature appends a list of tooltips and links defined in the diagram to the bottom of the SVG, ensuring they are visible in non-interactive formats. The implementation handles layout adjustments, such as updating the SVG viewbox and dimensions to accommodate the new content, and ensures unique IDs for clip-paths to avoid conflicts. Tests cover various scenarios including tooltips wider than the diagram, links, dark themes, and internal layer links.

d2renderers/d2svg/appendix · high confidence

Introduce ASCII diagram renderer

Adds a new ASCII-based renderer for D2 diagrams, allowing users to export their visualizations as text-based art. This new capability includes support for rendering shapes, connections, and labels within an ASCII grid, with configuration options for scale and character sets, and debug logging enabled via the DEBUG\_ASCII environment variable.

d2renderers/d2ascii · high confidence

Introduce AWS builder provisioning and SSH automation scripts

Added \ci/release/aws/ensure.sh\ and \ci/release/aws/ssh.sh\ to automate the creation and management of CI builder instances on AWS. The \ensure.sh\ script provisions Linux (amd64/arm64) and macOS (amd64/arm64) EC2 instances, including dedicated macOS metal hosts, and exports their connection details. The \ssh.sh\ script provides a unified interface to run commands across all configured builder instances.

ci/release/aws · high confidence

Introduce lib/version package with source version handling

A new lib/version package has been added to centralize version management. It defines the current version as v0.8.1-HEAD for source builds and provides an OnlyNumbers helper function to extract the semantic version components (e.g., 0.8.1) from the full version string, facilitating consistent version reporting across the application.

lib/version · high confidence

A new pure-Go PDF renderer has been added to the library, replacing previous export mechanisms. This change enables PDF exports that include internal navigation links between boards, a header displaying the board path (with clickable links to parent boards), and proper handling of theme colors and transparent backgrounds. The implementation uses the \codeberg.org/go-pdf/fpdf\ library to generate PDFs directly in Go, ensuring consistent font rendering via \d2fonts\ and supporting both light and dark theme text colors.

lib/pdf · high confidence

Introduce pure-Go raster export pipeline and refine label positioning

D2 now includes a new pure-Go raster export pipeline, featuring a specialized scanline rasterizer, a renderer-neutral scene representation, and optimized GIF encoding, which provides a memory-efficient, streaming rendering path for PNG and GIF outputs. Additionally, the tool now supports precise label positioning along connection borders (e.g., border-x) and allows users to specify custom label and icon positions, while the CLI has been updated to safely contain multiboard output paths and stream rendering to reduce memory usage.

github.com/d2lang/d2 · high confidence

Introduce sequence diagram layout engine

Adds a new layout engine for sequence diagrams (shape: sequence\_diagram) in the d2layouts/d2sequence package. This feature introduces dedicated layout logic for actors, messages, lifelines, spans (activation boxes), and notes, including constants for spacing and z-indexing, and ensures proper positioning and ordering of sequence elements.

d2layouts/d2sequence · high confidence

Layout reuse for scenarios and steps

D2 now reuses the geometry of the base board for scenarios and steps when their layout inputs (structure, labels, and geometry-affecting attributes) have not changed, significantly reducing layout computation time for style-only variations. This optimization is enabled via the \LayoutReuse\ option in \CompileOptions\ and is currently supported for the built-in Dagre and ELK layout engines; it is disabled by default to preserve existing behavior for custom layout resolvers.

d2lib · high confidence

Native isometric renderer with multi-format export and cross-platform stability

D2 now includes a native isometric renderer that projects diagrams into static SVGs, PNGs, animated GIFs, PDFs, and PPTX decks without requiring a browser, JavaScript, GPU, or external font files. This new presentation mode is mutually exclusive with sketch mode and can be enabled via the \--isometric\ CLI flag, the \D2\_ISOMETRIC\ environment variable, or source configuration. The renderer uses a fixed orthographic camera to create 3D-like volumes from standard shapes, preserving authored colors, shadows, and connection routes. To ensure consistent output across different hardware, the implementation stabilizes SVG serialization and floating-point geometry calculations, preventing CPU-dependent drift. Additionally, portable SVG output now preserves authored transforms, and the animation framing logic has been updated to correctly handle tiny nodes and traffic geometry within fixed frame boundaries.

d2renderers/d2isometric · high confidence

New ASCII shape rendering implementation

The ASCII renderer now includes a dedicated \asciishapes\ package that implements drawing logic for a wide variety of diagram shapes, including callouts, classes, cylinders, diamonds, documents, hexagons, packages, pages, parallelograms, persons, queues, rectangles, SQL tables, steps, and stored data. This change introduces the core rendering primitives (such as border drawing, header rendering, and label positioning) and specific shape algorithms that allow the ASCII output to accurately represent these visual elements.

d2renderers/d2ascii/asciishapes · high confidence

New CI pipeline for building and publishing the D2 JavaScript package

This change introduces a new CI workflow in d2js/js/ci to build the Go-to-WASM binary, optimize it, and publish the resulting @d2lang/d2 npm package. The build script (build.sh) compiles the WASM module with version stamping, runs wasm-opt if available, and handles npm publishing with support for stable, nightly, and staged release modes, including package name and version validation. It also introduces a dedicated npm-auth.sh helper to securely manage authentication tokens and a test-integration.sh script to validate the published package in an isolated consumer environment. Go tests (npm\_auth\_test.go) verify the security and cleanup behavior of the auth helper.

d2js/js/ci · high confidence

New LSP features: autocomplete, board navigation, and reference resolution

The d2lsp package now provides core Language Server Protocol capabilities for IDE integration. It introduces an autocomplete system that suggests keywords, styles, shapes, and values based on the cursor's context, including support for UTF-16 column positions required by browser-based clients. Additionally, it adds functions to resolve the board path at a specific cursor position (handling nested layers, scenarios, and steps) and to find all references (including imported ones) for fields and edges, enabling features like go-to-definition and find-references.

d2lsp · high confidence

New PPTX export capability for D2 diagrams

Users can now export D2 diagrams as Microsoft PowerPoint (.pptx) presentations. The new lib/pptx package generates valid OOXML files by combining embedded base templates (for slide masters, layouts, and metadata) with generated slide content. This export supports clickable image overlays (links to other slides or external URLs), board title navigation headers, and proper XML escaping for special characters in titles and URLs. The implementation includes a test suite to validate the generated archive structure and error propagation.

lib/pptx · high confidence

New color and gradient parsing library with security validation

The lib/color package now provides core functionality for parsing CSS color strings and gradient definitions, including support for theme color constants (N, B, AA, AB series) and a Darken function that adjusts luminance. It introduces a Gradient parser that handles linear and radial gradients, converting them into SVG elements while enforcing strict validation on color stop positions to reject invalid inputs like NaN, Infinity, or non-percentage units. Additionally, the gradient-to-SVG conversion includes HTML escaping to prevent injection vulnerabilities in SVG attributes.

lib/color · high confidence

New diagnostic harness for measuring D2 performance without layout

A new CI harness at \ci/nonlayout-perf\ allows measuring the performance of the D2 compiler and renderer while explicitly excluding layout engine execution. The tool uses Go source overlays to inject timing probes into the compilation and test phases, capturing granular metrics for steps like theme application, dimension setting, and SVG rendering. It supports comparing baseline and candidate builds to isolate the impact of changes on the non-layout product metric, and includes a renderer-replay mode to verify output fidelity without re-running the layout logic.

ci/nonlayout-perf · high confidence

New grid layout engine for structured diagrams

The \d2grid\ package introduces a new layout engine that arranges objects into rows and columns based on \grid-rows\, \grid-columns\, and gap settings. It supports row-directed or column-directed placement, respects vertical and horizontal gaps, and handles container padding for labels and icons. The layout includes a bounded search algorithm to find optimal row divisions, with performance optimizations like integral prefix sums for exact integer measurements and resource limits to prevent excessive computation or memory usage.

d2layouts/d2grid · high confidence

New interactive D2.js examples for basic and customizable rendering

Added two new HTML examples in the d2js/js/examples directory that demonstrate how to use the D2.js library in a browser environment. The basic.html example provides a simple interface for compiling D2 syntax and rendering the resulting SVG, while customizable.html offers a more advanced playground with controls for layout engines (Dagre, ELK), sketch mode, ASCII mode, and centering options, allowing users to interactively adjust rendering parameters.

d2js/js/examples · high confidence

New portable scene graph and rendering primitives

The d2scene package now defines a renderer-neutral scene graph that decouples scene representation from specific output formats. It introduces typed primitives (Rect, Ellipse, Path, TextRun, Image) with explicit stroke, fill, and gradient support, alongside precise geometry bounds calculation and SVG-compatible aspect-ratio matrix generation. Animation tracks and easing are now first-class scene data, and the package includes comprehensive tests for path geometry, aspect-ratio transforms, and primitive bounds to ensure consistent rendering across different backends.

d2renderers/d2scene · high confidence

New pure-Go raster rendering engine with band-based memory management and animation support

The \d2raster\ package introduces a new, pure-Go raster rendering pipeline that replaces previous implementations. This engine supports animated diagrams by resolving animation tracks (transforms, colors, opacity, and dash offsets) at specific timestamps with configurable easing. To handle large diagrams efficiently, it uses a band-based rendering approach that processes the image in horizontal strips, significantly reducing peak memory usage compared to full-frame rendering. The renderer also includes robust support for COLRv1 font glyphs, precise arc flattening with bounded error, and various blend modes (including isolated group compositing). Comprehensive tests verify pixel-perfect equivalence between band and full-frame rendering, correct animation interpolation, and strict memory limit enforcement.

d2renderers/d2raster · high confidence

New pure-Go raster scene builder with bounded security and static appendix support

The d2renderers/d2scenebuild package introduces a new, pure-Go scene builder that converts the typed export model into an immutable scene for the raster renderer. This change adds comprehensive support for static appendix rows (numbered badges and link/tooltip footnotes) in PNG, GIF, PDF, and PPTX exports, governed by a strict LinkBudget to prevent metadata bloat. It also implements robust asset handling with bounded SVG import limits and image resolution, as well as secure code shape rendering with syntax highlighting via Chroma, all protected by document-wide budgets for nodes, path commands, and font glyphs to prevent resource exhaustion.

d2renderers/d2scenebuild · high confidence

New release orchestration, build, and installation tooling

The \ci/release\ directory now contains the complete toolchain for building, verifying, and publishing D2 releases. \release.sh\ (prepare.py) manages release preparation, including branch/tag creation and PR generation, while \build.sh\ and \\_build.sh\ handle multi-platform archive construction with strict Go toolchain pinning, size budgets, and SBOM generation. The \install.sh\ script (generated via \gen\_install.sh\) now supports standalone and Homebrew installation methods, enforces SHA-256 checksum verification for downloaded assets, and explicitly rejects legacy TALA plugin requests. Additionally, \checksum.sh\ and its tests provide robust digest verification for release assets, and \install\_test.go\ ensures the installer behaves correctly across various scenarios.

ci/release · high confidence

New shell-based install and uninstall scripts for the d2 binary

The release template now includes POSIX-compliant shell scripts (install.sh, uninstall.sh, and lib.sh) to handle the installation and removal of the d2 binary and its man page. The install script automatically detects the operating system, installing d2.exe on Windows and the standard d2 binary on other platforms, while placing the man page in the appropriate share directory. These scripts rely on a generated library (lib.sh) for common utilities like logging, temporary file management, and cross-platform compatibility checks.

ci/release/template/scripts · high confidence

New themes and catalog restructuring

The theme catalog has been expanded with several new options: Buttered Toast, Everglade Green, Dark Mauve, Dark Flagship Terrastruct, C4, Origami, Terminal, and Terminal Grayscale. The C4, Origami, Terminal, and Terminal Grayscale themes include specific visual rules (such as C4 diagram styling, no corner radius, or monospace fonts). To better organize these, the single \Catalog\ variable has been split into \LightCatalog\ and \DarkCatalog\, with the new dark-themed themes added to the latter. Additionally, the import path for the \d2themes\ package has been updated from \oss.terrastruct.com/d2/d2themes\ to \github.com/d2lang/d2/d2themes\, and theme names have been standardized to use consistent casing.

d2themes/d2themescatalog · high confidence

New time utility library with configurable timeout context

A new \lib/time\ package has been introduced, providing a \HumanDate\ function for formatting time in RFC822 format and a \WithTimeout\ helper. The \WithTimeout\ function allows users to create contexts with timeouts that can be overridden by the \D2\_TIMEOUT\ environment variable, offering a way to globally control timeout durations for operations using this library.

lib/time · high confidence

Open-source TALA layout and edge-routing engine

The \d2talalayout\ package is now public, exposing the TALA layout and edge-routing engine as a standard D2 layout option. This adds a new layout engine that translates D2 graphs into TALA's internal representation, runs deterministic layout and routing seeds, and applies the best result back to the diagram. The package includes the public adapter, internal layout algorithms, and comprehensive tests for layout correctness, routing, and cancellation behavior.

d2layouts/d2talalayout · high confidence

PNG exports now include D2 version metadata in eXIf chunks

PNG exports generated by the library now embed D2's version information into the image's eXIf metadata chunk. This allows the exported PNG files to carry the specific D2 build version used to create them, which can be useful for tracking and debugging. The implementation handles both new PNGs and existing ones, ensuring the metadata is correctly inserted or replaced without altering the image content.

lib/png · high confidence

Support for constant 'near' keyword layout

The d2near layout engine now supports positioning objects using constant 'near' keywords (such as top-left, center-right, etc.) relative to other shapes. This feature calculates bounding boxes to avoid collisions, handles label positioning adjustments, and integrates these near-attached objects into the main graph structure after the primary layout phase.

d2layouts/d2near · high confidence

Support for decompressing embedded SVG images in multiple formats

The compression library now includes utilities to handle embedded SVG images encoded with gzip, zlib/deflate, and Brotli. A new \UnzipEmbeddedSVGImages\ function detects base64-encoded SVG data URLs within SVG files and automatically decompresses them if they are compressed, ensuring that visual tests can correctly decode and compare embedded images regardless of the compression method used by the image bundler.

lib/compression · high confidence

Windows MSI installer build and validation pipeline

The Windows release process now generates a native MSI installer for D2. The new build script (build.ps1) extracts the release archive, compiles the installer using WiX 7.0.0, and validates the resulting package by verifying MSI metadata (Product Name, Manufacturer, Upgrade Code, and Product Version), performing a test installation to ensure the binary and third-party notices are placed correctly, and confirming the installed executable reports the correct version. The installer package (d2.wxs) installs d2.exe to Program Files and adds the installation directory to the system PATH, while also including the THIRD\_PARTY\_NOTICES.txt file.

ci/release/windows · high confidence

Removals

Removal of generic utility helpers from lib/go2

The \lib/go2\ package, which previously provided generic utility functions such as \Pointer\, \Min\, \Max\, \Contains\, and \Filter\, has been removed. This deletion eliminates the custom implementations for common slice operations and value comparisons that were previously available to consumers of this library.

lib/go2 · high confidence

Removal of internal HTTP utility library

The internal \lib/xhttp\ package has been removed, eliminating the custom HTTP server helpers, error handling wrappers, and request logging middleware that were previously available to the application. Users of this library will no longer have access to the \xhttp.Errorf\, \HandlerFuncAdapter\, and \Log\ utilities for standardizing HTTP responses and logging.

lib/xhttp · high confidence

Removal of lib/diff package

The \lib/diff\ package has been removed from the codebase. This deletion eliminates the \TestdataGeneric\ helper function, which was previously used to compare test output against expected files and manage test data acceptance via the \TESTDATA\_ACCEPT\ environment variable. Users relying on this internal utility for test data management will need to adopt the replacement implementation in \util-go\.

lib/diff, lib/xexec · high confidence

Removal of the external plugin system

The d2plugin package and its associated files (exec.go, plugin.go, plugin\_dagre.go, serve.go) have been deleted, removing the ability to use external binary plugins for layout and post-processing. Users can no longer install or invoke third-party layout engines via the d2plugin- prefix in their PATH; layout functionality is now handled by built-in engines within the main binary.

d2plugin · high confidence

Removal of the xmain library

The lib/xmain package, which previously provided a standard stub for command-line main functions including logging, flag parsing, signal handling, and shutdown logic, has been removed from the codebase.

lib/xmain · high confidence

Removal of xbrowser utility package

The xbrowser package, which provided a utility for opening URLs in the system browser, has been removed from the codebase. This change eliminates the local implementation that handled browser launching via environment variables or a third-party library, indicating that this functionality is no longer required or has been moved elsewhere.

lib/xbrowser · high confidence

Security

Compiler security hardening and resource limits

The d2compiler now enforces strict bounds on resource-intensive operations to prevent denial-of-service and injection attacks. Variable expansion, glob matching, and edge expansion are capped via new CompileOptions (MaxVariableExpansion, MaxGlobExpansion, MaxEdgeExpansion, MaxEdgeExpansionWork), rejecting inputs that exceed these limits. SVG gradient stops are validated to reject markup injection, and opacity values are restricted to finite numbers between 0.0 and 1.0. Additionally, the compiler now supports cancellation via a Context, allows configuring the filesystem for imports (with nil disabling them), and returns a Config object alongside the graph.

d2compiler · high confidence

New bounded image asset resolver with strict security policies

The \lib/imageasset\ package introduces a new resolver that enforces strict security and resource limits on image processing. Local file access is now denied by default and requires explicit opt-in via a rooted policy, preventing unauthorized file reads. Network access for remote assets is also restricted by default, blocking private and non-public IP addresses to mitigate SSRF and DNS rebinding attacks, with an explicit \AllowPrivateNetworks\ option for trusted environments. The resolver implements comprehensive byte and pixel budgets (fetched, encoded, decompressed, and decoded) to prevent resource exhaustion, and includes robust validation for SVGs (bounding depth, elements, and tokens) and animated formats (charging only the first frame). Fuzz testing has been added for data URIs, SVG validation, content encoding, and raster image scanners to ensure stability against malformed inputs.

lib/imageasset · high confidence

Secure image bundling with strict resource limits and access policies

The \imgbundler\ library now enforces strict security boundaries when embedding images into SVGs. Local file access is denied by default and requires an explicit policy (e.g., \localfile.Rooted\ or \localfile.Unrestricted\), preventing unauthorized reads and symlink escapes. Remote network access is similarly restricted, blocking private networks unless explicitly opted-in via \netpolicy.Policy\. To prevent resource exhaustion, the bundler now caps the number of image references (4,096), output size (512 MB), and individual image dimensions/decoding resources. Additionally, the library introduces a new \simplelog.Logger\ interface for logging and deprecates the older \BundleLocal\ and \BundleRemote\ functions in favor of the more flexible \BundleWithResolver\.

lib/imgbundler · high confidence

Security hardening and test coverage for SVG rendering

The d2svg renderer now includes comprehensive tests to verify security hardening against SVG injection and unsafe link schemes. Tests confirm that shape and connection class attributes are properly escaped to prevent event-handler injection, that clip-path IDs are unique and resolvable to prevent ID collision attacks, and that color attributes are validated to reject dangerous paint injections. Additionally, the renderer now rejects dangerous link schemes in legend shapes and validates raw render targets, while also ensuring that rich connection labels preserve links correctly.

d2renderers/d2svg · high confidence

Behavioural changes

ASCII renderer now supports selectable character sets

The ASCII renderer in d2renderers/d2ascii/charset now allows users to choose between standard ASCII characters and Unicode box-drawing characters for diagram rendering. This change introduces a new \charset\ package that defines a \Set\ interface and two implementations: \ASCIISet\, which uses basic punctuation (e.g., \+\, \-\, \\|\, \.\) for maximum compatibility, and \UnicodeSet\, which uses full Unicode box-drawing symbols (e.g., \┌\, \─\, \│\, \╭\) for richer visual output. The \New\ function enables selecting the desired set via a \Type\ enum (ASCII or Unicode), allowing the renderer to adapt its output style based on user preference or environment capabilities.

d2renderers/d2ascii/charset · high confidence

AST node additions and import path migration

The d2ast package now supports new AST node types, specifically Suspension and Import, which are integrated into the existing node interfaces (Node, MapNode, ArrayNode, Scalar). Additionally, the package has migrated its external dependencies from the legacy oss.terrastruct.com paths to the new github.com/d2lang/util-go module, and the Position struct now includes a Debug method and refined comparison logic to handle missing byte offsets for LSP usage.

d2ast · high confidence

CLI help output and version check logic restructured

The command-line interface help text is now generated dynamically via the xmain framework rather than a static string, and the version check functionality has been moved from cmd/version to lib/version. Users will see updated help formatting and potentially different behavior when checking for updates, as the version logic is now centralized.

cmd · high confidence

Chaos testing framework updates for ID generation and sequence diagram stability

The d2chaos test generator now supports configurable complex IDs (controlled by a new \complexIDs\ flag) that allow for longer node labels and IDs, improving test coverage for edge cases. It also prevents invalid sequence diagram inputs by excluding image and text shapes from random shape selection and adding logic to avoid creating self-referencing edges on sequence diagrams. Additionally, the framework prevents cycles in sequence diagrams by checking container hierarchy, and updates internal API calls to match new compiler and layout signatures.

d2chaos · high confidence

Configurable timeout and relaxed skip-test flag

Users can now set the D2\_TIMEOUT environment variable to specify a custom timeout duration for operations, with the library parsing the value as an integer. Additionally, the SKIP\_GRAPH\_DIFF\_TESTS environment variable no longer requires the specific value "on" to activate; any non-empty value will now skip the graph diff tests.

lib/env · high confidence

D2.js 0.1.34 release with TALA layout, disposal API, and Unicode fixes

The d2.js package (version 0.1.34) introduces support for the D2 0.9.0 TALA layout engine (\layout: 'tala'\) and configurable TALA seeds. A new \D2.dispose()\ method is available to terminate the backing Web Worker, ensuring proper resource cleanup in browsers and allowing Node processes to exit. The release fixes concurrent calls sharing a D2 instance, corrects completions after Unicode characters, and resolves issues with theme-overrides not applying and grids in ELK layouts. Additionally, the raw \d2.getELKGraph\ and \d2.getObjOrder\ compatibility exports are deprecated with migration warnings, TypeScript signatures are fixed, and the bundle size is significantly reduced.

d2js/js · high confidence

Dagre layout engine migrated to native Go implementation

The Dagre layout engine in the d2dagrelayout package has been replaced with a native Go port (Dagro 3.1.1), removing the previous JavaScript/V8-based implementation. This change eliminates the dependency on external JS files (dagre.js, setup.js) and the V8 runtime, replacing them with the github.com/d2lang/dagro library and a new Go-based object mapper for ID management. The migration includes updated layout logic for handling node/edge labels, container padding, and rank directions, along with new benchmark tests to measure performance on real-world diagrams.

d2layouts/d2dagrelayout · high confidence

Deterministic emoji rendering and bounded system font fallbacks

The font renderer now guarantees consistent emoji display across all machines by bundling and prioritizing the Noto Color Emoji font before consulting the host system. It also introduces a new system font fallback resolver that discovers local fonts with strict, configurable limits on file size, directory entries, and byte usage to prevent resource exhaustion. Additionally, WASM builds now use Brotli-compressed font assets to reduce package size, and the library includes comprehensive tests for font authentication, isolation, and concurrent access.

d2renderers/d2fonts · high confidence

Diagram hash stability and render-target validation

The diagram hash (used for caching and change detection) is now stable across Go versions by normalizing URL field ordering in icon data, and the system now validates raw render targets to prevent crashes from malformed inputs (e.g., invalid board trees, non-finite coordinates, or missing image icons). Additionally, class and SQL table rendering now supports underlined fields/methods and abbreviates constraints (PK, FK, UNQ) for clearer display.

d2target · high confidence

E2E report generation now supports profiling, configurable test names, and improved report layout

The e2etests/report tool has been updated to allow users to profile test execution by passing --cpuprofile and --memprofile flags, which generate pprof data files. Users can now customize the test name prefix via the --test-name flag (defaulting to 'E2E') and skip the test run phase with --skip-tests. The generated HTML report has been redesigned with a table of contents, side-by-side image comparison for expected vs. got results, and relative path handling to ensure links work correctly regardless of output location. Additionally, internal dependencies were migrated from oss.terrastruct.com/d2 to github.com/d2lang/d2, and deprecated ioutil usage was replaced with os package equivalents.

e2etests/report · high confidence

Enhanced theme system with overrides, special rules, and improved SVG safety

The d2themes package now supports granular color customization via ThemeOverrides, allowing users to modify specific palette colors (e.g., B1, N1) rather than replacing entire themes. New SpecialRules enable distinct visual styles such as monochrome rendering, disabled corner radius, and C4-specific layouts. The ThemableElement helper has been refactored to enforce strict XML serialization, automatically escaping event handlers and validating local references to prevent SVG injection, while also adding support for inline themes and div namespaces.

d2themes · high confidence

Export API refactored to support font families and legend generation

The d2exporter's Export function now accepts explicit font family parameters instead of a theme ID, allowing users to specify custom primary and monospace fonts for the exported diagram. Additionally, the exporter now processes and includes legend definitions in the output when they are present in the graph, enabling the generation of diagrams with custom legends. The internal styling logic has been updated to apply theme-specific rules (such as C4 or Origami themes) directly to shape properties like fill patterns and accent colors, rather than relying on a centralized theme lookup during export.

d2exporter · high confidence

Improved ASCII diagram cropping and route-line handling

The ASCII renderer now produces tighter output by automatically stripping empty rows and columns from the edges of the diagram. Additionally, it intelligently suppresses redundant vertical and horizontal route lines (such as repeated connector segments) to reduce visual clutter in the generated ASCII art.

d2renderers/d2ascii/asciicanvas · high confidence

Improved SVG rendering and error handling in watch mode

The watch mode now parses incoming SVG messages as XML and injects only the inner SVG content, ensuring proper scaling and zoom behavior via a new ratio calculation. Error states are now visually indicated by updating the favicon to an error icon, and the WebSocket connection path has been standardized.

d2cli/static · high confidence

Improved formatting for imports, board structures, and special keywords

The D2 formatter now handles several formatting nuances more robustly. Import paths are cleaned (e.g., stripping leading \./\) and formatted correctly, including support for spread imports (\...@file\). Board structures (layers, scenarios, steps) are now consistently placed at the bottom of their scope with proper spacing. The keyword \null\ is escaped as \'null'\ to avoid ambiguity, and reserved keywords in interpolation boxes are lowercased. Additionally, comment spacing is preserved where appropriate, and new \suspend\/\unsuspend\ values are formatted correctly.

d2format · high confidence

LaTeX renderer switches to mathjax-go with input complexity limits

The LaTeX rendering engine now uses the Go-based mathjax-go library instead of the previous JavaScript-based MathJax, providing native rendering for labels. To prevent resource exhaustion, the renderer enforces strict input limits: a maximum of 4096 bytes and a group nesting depth of 128, rejecting overly complex or deeply nested LaTeX expressions before processing.

d2renderers/d2latex · high confidence

Layout validation and deterministic raster image handling

The system now validates diagram attributes against the capabilities of built-in layout engines (dagre, elk, tala), rejecting unsupported features like locked positions or container dimensions where applicable. Additionally, raster image processing has been updated to deterministically extract the first frame from animated formats (GIF, PNG, WebP) and correctly apply JPEG EXIF orientation metadata, ensuring consistent rendering across platforms.

internal · high confidence

Logging subsystem migrated to Go standard library slog with colored console output

The logging library has replaced the external cdr.dev/slog dependency with Go's standard library log/slog. This change introduces a new PrettyHandler that formats log messages with color-coded levels (red for errors, yellow for warnings, green for info, cyan for debug) and faded timestamps for improved readability in the console. The default logger now initializes via a new Init() function and uses a text handler wrapped by the level and pretty handlers. Public API functions like Debug, Info, Warn, and Error now accept slog.Attr instead of slog.Field, and the test-only WithTB helper has been deprecated in favor of creating custom slog loggers backed by the test logger.

lib/log · high confidence

Multiboard output paths are now safely contained and collision-free

The CLI now uses a new board-output system that guarantees multiboard exports (boards, layers, scenarios, steps) are written into a single, isolated directory structure. Unsafe board names (such as those containing path separators, absolute paths, or reserved OS names like NUL/CON) are automatically escaped using SHA-256 hashes, preventing directory traversal and filesystem collisions. The publication process is atomic and transactional, using a manifest file to ensure that the final output tree is either fully updated or left unchanged, eliminating race conditions and partial writes.

d2cli · high confidence

Native Go ELK layout engine replaces ELK.js

The D2 layout engine in this package has migrated from the JavaScript-based ELK.js library to a native Go implementation (elk-go), which targets the behavior of Eclipse Layout Kernel 0.12.0 and ELK.js 0.12.0. This change introduces a new layout backend that preserves layout compatibility through frozen regression fixtures while adding native Go-specific optimizations, such as a spatial index for edge collision detection and a dedicated descendant shifter for performance. The migration also includes updated licensing notices for the Go port and its dependencies (GWT, V8), and introduces new configuration options for layout behavior like self-loop spacing and node spacing.

d2layouts/d2elklayout · high confidence

Native Go GIF encoder replaces standard library for improved performance and control

The \lib/xgif\ library now uses a pure-Go GIF encoder (\encode.go\) instead of the standard library's \image/gif\ package for the final encoding step. This new encoder supports a shared global color table for fully opaque frames to reduce file size, centers frames on a common canvas without allocating full pixel buffers for every frame, and enforces strict output byte limits and context cancellation checks during writing. The change includes a new \OpaqueQuantizationWorkspace\ for reusable memory allocation during quantization and adds comprehensive benchmarks and tests to verify deterministic output compatibility with the standard library.

lib/xgif · high confidence

Native Go sketch renderer replaces Rough.js

The sketch rendering engine in d2sketch has been migrated from the JavaScript-based Rough.js library to a native Go port called rough-go (version 4.6.6). This change introduces a new rendering pipeline that converts rough-go operations into typed scene paths, ensuring deterministic and bounded geometry generation for shapes, connections, and arrowheads. Users will see the same hand-drawn aesthetic, but the underlying implementation is now fully native Go, improving performance and eliminating JavaScript dependencies for sketch mode diagrams.

d2renderers/d2sketch · high confidence

Native SVG rendering and performance improvements for Markdown text measurement

The \lib/textmeasure\ package now renders Markdown as native SVG primitives instead of using HTML foreign objects, ensuring that text dimensions and layout match browser rendering more accurately. This change introduces a new glyph atlas packing algorithm that queries each glyph's metrics only once, significantly reducing allocation overhead and improving measurement performance. Additionally, variable substitution in Markdown is now bounded to prevent excessive expansion, and link schemes are sanitized to reject dangerous protocols.

lib/textmeasure · high confidence

Nested layout engine overhaul with batched extraction and cross-graph routing

The layout system in d2layouts has been refactored to support complex nested diagrams (grids, sequences, and constant-near) with improved stability and performance. Key changes include: 1) Batched extraction of nested subgraphs to optimize layout processing order and reduce redundant operations. 2) Robust error handling with rollback capabilities, ensuring that if a nested layout fails, the parent graph state is preserved. 3) New cross-graph edge routing support via the RoutingPlugin interface, enabling edges to connect across nested graph boundaries. 4) Fixed multiple issues with object reference staleness, edge reconnection after serialization, and grid cell positioning. 5) Replaced the external d2plugin system with built-in layout engines for simpler maintenance. 6) Added comprehensive tests for batched extraction consistency and error state preservation.

d2layouts · high confidence

New ASCII route rendering engine for diagram connections

The ASCII renderer now uses a dedicated routing package (d2renderers/d2ascii/asciiroute) to draw connection lines. This new implementation replaces the previous connection parsing logic with a process that merges collinear segments, forces diagonal paths into horizontal and vertical steps, and carefully adjusts route endpoints to avoid overlapping with shape boundaries. It also introduces improved label positioning logic to better center connection labels on route segments.

d2renderers/d2ascii/asciiroute · high confidence

New CI utility scripts and refactored test execution

The CI system now includes several new helper scripts: \cov.sh\ for generating Go code coverage reports, \dev.sh\ for building and running the application in development mode, \e2ereport.sh\ for generating and opening end-to-end test reports, \gen.sh\ for regenerating installation scripts and templates, \peek-wasm-size.sh\ for measuring and optimizing WebAssembly build sizes, and \test-wasm.sh\ for running tests in a WebAssembly environment. Additionally, the \ci/sub\ submodule has been updated to replace the previous local library with a new version, and \ci/test.sh\ now unconditionally sets the \CI=1\ environment variable during test execution to ensure consistent behavior regardless of the host environment.

ci · high confidence

New Docker release pipeline with multi-architecture support and provenance verification

The Docker release process has been replaced with a new, secure pipeline that builds native multi-architecture images (amd64 and arm64) using Ubuntu 24.04 and the fixuid tool for proper user handling. The new system enforces strict immutability by verifying release assets, validating provenance attestations, and ensuring that version tags are only published once. It also supports publishing to both a primary and a legacy Docker Hub repository simultaneously, with comprehensive smoke tests and validation scripts to guarantee image integrity before release.

ci/release/docker · high confidence

New IR compiler with bounded glob and variable expansion

The d2ir package now includes a new compiler (compile.go) that introduces work budgets to prevent infinite loops and resource exhaustion during compilation. Users benefit from bounded glob expansion (default 65,536 work units, max 10,000 created fields), bounded edge expansion (default 1,024 endpoint pairs, 65,536 work units), and bounded variable substitution expansion (default 65,536 work units). The compiler also enforces a maximum import depth of 128 and detects cyclic imports. These limits ensure that complex diagrams with globs, spreads, and imports do not cause the compiler to hang or consume excessive memory.

d2ir · high confidence

New URL encoding library with compression and size limits

The \lib/urlenc\ package now provides a new implementation for encoding D2 scripts into URL-safe strings. It compresses the input using DEFLATE and encodes the result in base64, replacing the previous method. To prevent resource exhaustion, the decoder enforces a maximum decoded size of 16 MB, rejecting any script that exceeds this limit.

lib/urlenc · high confidence

New structured WASM API with deprecation of legacy raw calls

The d2wasm package now exposes a structured API (api.go) that wraps Go functions in a consistent JSON-based response format (WASMResponse), replacing the previous raw WASM export mechanism. This change introduces standardized error handling with specific error codes and messages, and adds support for new rendering options such as custom fonts, animation intervals, and force appendix. Additionally, legacy functions like getObjOrder and getELKGraph are now deprecated; they remain functional but emit a one-time warning and will be removed after one compatibility release, encouraging users to migrate to the new compile and oracle APIs.

d2js/d2wasm · high confidence

Optimized font subsetting and WOFF conversion with memory-safe compression

The font library now includes a native Go implementation for converting SFNT fonts (.ttf, .otf) to WOFF format and for subsetting fonts to specific character sets. This change introduces a pooled, reusable zlib compressor for WOFF table compression, which improves performance and prevents memory leaks by capping retained buffer sizes. The subsetting logic has been updated to snapshot table offsets, ensuring that subsequent modifications to the input font data do not corrupt the subset output. These changes are verified by comprehensive tests, including fingerprint checks against legacy outputs and concurrent conversion benchmarks.

lib/font · high confidence

Parser improvements: UTF-16 BOM detection, cancellation support, and nesting limits

The d2parser now automatically detects and decodes UTF-16 files based on the Byte Order Mark (BOM), ensuring correct parsing of Windows-style encoded inputs. It also supports context cancellation via ParseContext, allowing long-running parses to be stopped promptly, and enforces a maximum nesting depth of 128 to prevent stack exhaustion on deeply nested structures. Additionally, the parser now correctly handles the 'not ampersand' (!&) operator in keys and fixes edge cases in whitespace range reporting for edges.

d2parser · high confidence

Refactor d2graph module and introduce grid diagram support

The d2graph package has been reorganized and expanded to support new diagram types and improved internal consistency. A new grid diagram feature is introduced via grid\_diagram.go, which enforces dimension and cell limits (MaxGridDimension, MaxGridCells) and provides helper methods to identify and navigate grid structures. The module also adds dedicated logic for sequence diagrams (seqdiagram.go) to correctly identify actors, groups, and notes. Internally, the Graph struct is enhanced with fields for Layers, Scenarios, Steps, and Themes, and serialization/deserialization (serde.go) is updated to handle these new structures and ensure case-sensitive ID preservation. Legacy helper files for colors and fonts have been removed, and import paths are updated to the new github.com/d2lang/d2 module structure.

d2graph · high confidence

Refactor geo library to remove gonum dependency and add geometric utilities

The \lib/geo\ package no longer depends on the external \gonum.org/v1/plot\ library; bezier curve calculations are now handled by a local implementation in \bezier.go\, ensuring consistent behavior across platforms. Several new geometric capabilities have been added to support layout and routing: \Box\ now includes \Intersects\ (with buffer), \Contains\, and \Overlaps\ methods; \Point\ gains \OnOrthogonalSegment\, \Interpolate\, and float-precision truncation methods; \Segment\ adds \Intersects\, \Length\, and \ToVector\; and \Vector\ provides \Radians\, \Degrees\, and \Reverse\. Additionally, \Route.GetPointAtDistance\ has been updated to handle distances exceeding the total route length by projecting onto the final segment.

lib/geo · high confidence

Refactor text measurement to load fonts on demand

The text measurement system in d2renderers/textmeasure has been refactored to load font sizes on demand rather than pre-loading all available font sizes at startup. This change modifies the core Ruler implementation and markdown measurement logic to improve initialization performance and resource usage by only instantiating font atlases and metrics for the specific sizes actually required during measurement.

d2renderers/textmeasure · high confidence

Release template now includes Makefile and dynamic README generation

The release template now provides a Makefile with install and uninstall targets that invoke shell scripts, and a script to generate a dynamic README.md containing version, OS, and architecture details. This simplifies the installation process for users by allowing them to run 'make install' or 'make uninstall' instead of manually executing scripts, and ensures the documentation accurately reflects the specific release build.

ci/release/template · high confidence

Repository reorganization and community governance updates

The project has migrated its GitHub organization from terrastruct to d2lang, updating all repository URLs, CI badges, and Go module paths (e.g., oss.terrastruct.com/d2 to github.com/d2lang/d2). The codebase structure has been reorganized: the main CLI entry point has moved from cmd/d2plugin-dagre/main.go to the repository root as main.go, and the legacy d2plugin system has been removed in favor of built-in layout engines. A new install.sh script has been added to simplify installation, and the project has adopted the Contributor Covenant Code of Conduct.

(repo-wide) · high confidence

SVG rendering engine refactored for security, precision, and performance

The SVG generation library has been rewritten to centralize safe markup serialization, preventing injection vulnerabilities by strictly validating attribute names (rejecting event handlers), escaping all values, and rejecting malformed XML. Floating-point coordinates are now formatted with higher precision (six decimal places) and normalized to remove redundant zeros, ensuring geometric accuracy. The path context now tracks typed commands for better internal consistency, and the module path has been updated to github.com/d2lang/d2.

lib/svg · high confidence

Shape layout engine overhaul with per-shape padding and C4 Person support

The shape rendering library has been refactored to support independent horizontal and vertical padding (paddingX, paddingY) for all shapes, replacing the previous single padding value. This change introduces a new C4 Person shape type with specific aspect ratio limits and inner box calculations, and updates the layout logic for existing shapes (such as Cloud, Circle, Oval, and Page) to use these per-axis padding values and refined inner bounding boxes. Additionally, a new PathCommandProvider interface allows shapes to expose typed path commands for more precise rendering control.

lib/shape · high confidence

WASM API initialization and deprecation of legacy endpoints

The d2js module now initializes the WebAssembly API by registering core functions (compile, render, encode, decode, version, jsVersion, getCompletions, getParentID, getRefRanges, getBoardAtPosition) and invoking the onWasmInitialized callback if defined. As part of this initialization, the getObjOrder and getELKGraph endpoints are explicitly marked as deprecated and retained only for one compatibility release for raw WASM callers.

d2js · high confidence

d2oracle API updates for nested board editing and dependency migration

The d2oracle package now supports editing nested boards (layers, scenarios, and steps) by adding a boardPath argument to functions like Create, Set, GetParentID, GetObj, and GetEdge, allowing modifications to be applied to the correct scope and persisted via AST replacement. A new ReconnectEdge function enables changing an edge's source and destination. Additionally, the module path has been migrated from oss.terrastruct.com to github.com/d2lang/d2, and internal dependencies (xdefer, xrand, go2, assert, diff) have been switched to the github.com/d2lang/util-go package.

d2oracle · high confidence

Fixes

Layout engines now reject oversized or overly dense diagrams

The layout system now enforces safety limits on graph complexity before passing control to layout engines like Dagre and ELK, which cannot be interrupted mid-calculation. Diagrams exceeding 1,024 objects or 1,024 edges are now rejected, and highly interconnected subgraphs are blocked if their edge interaction work exceeds 8,192 units. This prevents layout operations from hanging or consuming excessive resources on malformed or extremely dense diagrams, while still allowing small graphs with many parallel edges to pass through.

d2layouts/internal · high confidence

Test coverage

Added PNG pixel-snapshot tests for isometric renders; Added integration tests for ESM, CommonJS, and isometric rendering; Added tests for dark theme rendering; Added type tests for D2 compile and render APIs; Added unit and type tests for the D2 JavaScript API; Expanded CLI end-to-end test coverage; Expanded E2E test fixtures for layout, styling, and real-world diagrams; Expanded end-to-end test coverage for D2 diagram rendering.

Dependencies

D2.js 0.1.34 release and Go module modernization

The D2.js JavaScript package is released at version 0.1.34, introducing a new \package.json\ and \package-lock.json\ that establish Bun 1.3.14 and TypeScript 5.9.3 as development dependencies. Concurrently, the Go module undergoes a major modernization: the module path is migrated from \oss.terrastruct.com/d2\ to \github.com/d2lang/d2\, and the Go version requirement is bumped to 1.27.0. This update replaces several legacy dependencies with native Go implementations—specifically \dagro\, \elk-go\, \mathjax-go\, \rough-go\, and \util-go\—while upgrading core libraries such as \chroma\ to v2, \goquery\, and \fsnotify\, and removing older tools like \v8go\ and \slog\ in favor of standard library equivalents.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 71 → 73 (+1.7)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 77 → 75 (-2.6)
  • Architecture 87 → 99 (+11.4)
  • Maturity 80 → 78 (-2.6)
  • Readiness 66 → 66 (-0.1)
  • Security 86 → 81 (-4.8)
  • Accessibility 70 → 83 (+13.0)
  • Performance 84 → 95 (+11.4)

Resolved (35)

  • Duplicated block (10 lines × 2) (d2layouts/d2talalayout/internal/routing/ovg_edge_router.go)
  • Duplicated block (10 lines × 2) (d2renderers/d2fonts/bundled_fallback.go)
  • Duplicated block (11 lines × 2) (d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go)
  • Duplicated block (11 lines × 2) (d2renderers/d2raster/image.go)
  • Duplicated block (13 lines × 2) (lib/xgif/xgif.go)
  • Duplicated block (138 lines × 2) (d2layouts/d2elklayout/layout.go)
  • Duplicated block (15 lines × 2) (d2layouts/d2talalayout/internal/layoutgraph/transaction.go)
  • Duplicated block (16 lines × 2) (d2layouts/d2talalayout/internal/labeling/placement.go)
  • Duplicated block (24 lines × 2) (d2layouts/d2elklayout/layout.go)
  • Duplicated block (30 lines × 2) (lib/xgif/xgif.go)
  • Duplicated block (32 lines × 2) (d2renderers/d2svg/d2svg.go)
  • Duplicated block (45 lines × 2) (d2layouts/d2talalayout/internal/packing/combine_snapshot.go)
  • Duplicated block (5 lines × 2) (d2layouts/d2talalayout/internal/placement/optimization_guard.go)
  • Duplicated block (5 lines × 2) (d2renderers/d2isometric/d2isometricimg/route_bridges.go)
  • Duplicated block (5 lines × 2) (d2renderers/d2svg/d2svg.go)
  • Duplicated block (5 lines × 3) (d2layouts/d2talalayout/internal/layoutgraph/node.go)
  • Duplicated block (7 lines × 2) (d2layouts/d2elklayout/layout.go)
  • Duplicated block (7 lines × 2) (d2renderers/d2raster/gradient.go)
  • Duplicated block (7 lines × 2) (d2renderers/d2svgimport/boilerplate.go)
  • Duplicated block (7–8 lines × 2) (lib/xgif/xgif.go)
  • …and 15 more

New (197)

  • Duplicated block (10 lines × 6) (d2renderers/d2raster/internal/scanline/rasterizer.go)
  • Duplicated block (15 lines × 2) (d2layouts/d2talalayout/internal/layoutgraph/transaction.go)
  • Duplicated block (32 lines × 2) (d2renderers/d2svg/d2svg.go)
  • Duplicated block (45 lines × 2) (d2layouts/d2talalayout/internal/packing/combine_snapshot.go)
  • Duplicated block (7 lines × 2) (d2renderers/d2isometric/d2isometricimg/route_bridges.go)
  • Duplicated block (8 lines × 2) (d2renderers/d2svgimport/import.go)
  • Duplicated block (9 lines × 3) (d2renderers/d2svgimport/transform.go)
  • Edited copies of one member (3 members, 10+ corresponding lines) (d2layouts/d2talalayout/internal/labeling/guard.go)
  • Edited copies of one member (3 members, 12+ corresponding lines) (ci/release/releasetool/main.go)
  • Edited copies of one member (3 members, 13+ corresponding lines) (ci/release/releasetool/main.go)
  • Edited copies of one member (3 members, 13+ corresponding lines) (lib/shape/shape_package.go)
  • Edited copies of one member (3 members, 15+ corresponding lines) (d2layouts/d2talalayout/internal/layoutgraph/segment_crossing.go)
  • Edited copies of one member (3 members, 15+ corresponding lines) (d2parser/parse.go)
  • Edited copies of one member (3 members, 15+ corresponding lines) (lib/svg/path.go)
  • Edited copies of one member (3 members, 16+ corresponding lines) (d2ir/import_cache.go)
  • Edited copies of one member (3 members, 22+ corresponding lines) (d2ir/d2ir.go)
  • Edited copies of one member (3 members, 28+ corresponding lines) (d2layouts/d2talalayout/internal/grouping/cluster_discovery.go)
  • Edited copies of one member (3 members, 32+ corresponding lines) (d2renderers/d2sketch/sketch.go)
  • Edited copies of one member (3 members, 63+ corresponding lines) (d2layouts/d2talalayout/internal/nodeshape/shape_cylinder.go)
  • Edited copies of one member (3 members, 7+ corresponding lines) (d2layouts/d2talalayout/internal/layoutgraph/cluster.go)
  • …and 177 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

terrastruct/d2 was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 6a7b4837838a3907604a1d9eec57ee98b6f3cd01 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-f3449e6eb431.