vyuh_diagram_types 3.5.0 copy "vyuh_diagram_types: ^3.5.0" to clipboard
vyuh_diagram_types: ^3.5.0 copied to clipboard

Immutable document model, shapes, text and geometry for Vyuh Diagram. Pure Dart with no Flutter dependency, so it runs on servers, CLIs and agents.

example/main.dart

import 'package:vyuh_diagram_types/vyuh_diagram_types.dart';

/// Builds an immutable diagram document and reads it back.
///
/// Documents are plain values and need no Flutter. To edit one, give it to a
/// `DiagramController` from `vyuh_diagram_core`.
void main() {
  final document = DiagramDocument(
    id: 'plan',
    revision: 0,
    elements: [
      ShapeElement(
        id: 'start',
        type: Shapes.rectangle,
        frame: const DiagramRect.fromLTWH(0, 0, 160, 80),
      ),
      ShapeElement(
        id: 'finish',
        type: Shapes.rectangle,
        frame: const DiagramRect.fromLTWH(240, 0, 160, 80),
      ),
    ],
  );

  final finish = document.elementById('finish') as ShapeElement;
  // ignore: avoid_print
  print('${document.elements.length} elements, finish at ${finish.frame}');
}
0
likes
160
points
484
downloads

Documentation

Documentation
API reference

Publisher

verified publishervyuh.tech

Weekly Downloads

Immutable document model, shapes, text and geometry for Vyuh Diagram. Pure Dart with no Flutter dependency, so it runs on servers, CLIs and agents.

Homepage

Topics

#diagram #data-model #geometry #flowchart #immutable

License

Apache-2.0 (license)

More

Packages that depend on vyuh_diagram_types