toJson method

Map<String, dynamic> toJson(
  1. Object? toJsonT(
    1. T value
    )
)

Converts the node to a JSON map.

Implementation

Map<String, dynamic> toJson(Object? Function(T value) toJsonT) => {
  'id': id,
  'type': type,
  'x': position.value.dx,
  'y': position.value.dy,
  'width': size.value.width,
  'height': size.value.height,
  'inputPorts': inputPorts.map((e) => e.toJson()).toList(),
  'outputPorts': outputPorts.map((e) => e.toJson()).toList(),
  'data': toJsonT(data),
  'zIndex': zIndex.value,
  'selected': selected.value,
  'isVisible': isVisible,
  'layer': layer.name,
  'locked': locked,
  'isResizable': isResizable,
  'selectable': selectable,
};