Source File
elk.go
Belonging Package
github.com/d2lang/elk-go
// Copyright (c) 2026 The elk-go Authors.//// This program and the accompanying materials are made available under the// terms of the Eclipse Public License 2.0 which is available at// https://www.eclipse.org/legal/epl-2.0.//// SPDX-License-Identifier: EPL-2.0// Package elk provides a native Go implementation of the Eclipse Layout// Kernel JSON behavior used by D2, pinned to official ELK.js 0.12.0. It does// not promise compatibility with expert option combinations outside D2's// documented profile.package elkimport// Graph is the root ELK JSON graph type.type Graph = graphjson.Graph// Node is an ELK JSON node.type Node = graphjson.Node// Port is an ELK JSON port.type Port = graphjson.Port// Label is an ELK JSON label.type Label = graphjson.Label// Edge is an ELK JSON edge.type Edge = graphjson.Edge// EdgeSection is a routed section of an ELK JSON edge.type EdgeSection = graphjson.EdgeSection// Point is an ELK JSON bend or junction point.type Point = graphjson.Point// ID is a string- or integer-valued ELK graph identifier.type ID = graphjson.ID// LayoutOptions maps ELK option identifiers to their JSON values.type LayoutOptions = graphjson.LayoutOptions// StringID constructs a string-valued graph identifier.func ( string) ID { return graphjson.StringID() }// IntID constructs an integer-valued graph identifier.func ( int64) ID { return graphjson.IntID() }// IDPtr returns a pointer to a copy of id.func ( ID) *ID { return graphjson.IDPtr() }// Float64 returns a pointer suitable for optional numeric graph fields.func ( float64) *float64 { return graphjson.Float64() }// String returns a pointer suitable for optional text fields.func ( string) *string { return graphjson.String() }// Number returns value, or zero when value is nil.func ( *float64) float64 { return graphjson.Number() }
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |