Graph<N, L, D> constructor

Graph<N, L, D>({
  1. required String id,
  2. required List<N> nodes,
  3. required List<L> links,
  4. required TypedAccessorFn<N, D> nodeDomainFn,
  5. required TypedAccessorFn<L, D> linkDomainFn,
  6. required TypedAccessorFn<L, N> sourceFn,
  7. required TypedAccessorFn<L, N> targetFn,
  8. required TypedAccessorFn<N, num?> nodeMeasureFn,
  9. required TypedAccessorFn<L, num?> linkMeasureFn,
  10. TypedAccessorFn<N, Color>? nodeColorFn,
  11. TypedAccessorFn<N, Color>? nodeFillColorFn,
  12. TypedAccessorFn<N, FillPatternType>? nodeFillPatternFn,
  13. TypedAccessorFn<N, num>? nodeStrokeWidthPxFn,
  14. TypedAccessorFn<L, Color>? linkFillColorFn,
})

Implementation

factory Graph({
  required String id,
  required List<N> nodes,
  required List<L> links,
  required TypedAccessorFn<N, D> nodeDomainFn,
  required TypedAccessorFn<L, D> linkDomainFn,
  required TypedAccessorFn<L, N> sourceFn,
  required TypedAccessorFn<L, N> targetFn,
  required TypedAccessorFn<N, num?> nodeMeasureFn,
  required TypedAccessorFn<L, num?> linkMeasureFn,
  TypedAccessorFn<N, Color>? nodeColorFn,
  TypedAccessorFn<N, Color>? nodeFillColorFn,
  TypedAccessorFn<N, FillPatternType>? nodeFillPatternFn,
  TypedAccessorFn<N, num>? nodeStrokeWidthPxFn,
  TypedAccessorFn<L, Color>? linkFillColorFn,
}) =>
    Graph.base(
      id: id,
      nodes: convertGraphNodes<N, L, D>(
        nodes,
        links,
        sourceFn,
        targetFn,
        nodeDomainFn,
      ),
      links: convertGraphLinks<N, L>(links, sourceFn, targetFn),
      nodeDomainFn: actOnNodeData<N, L, D>(nodeDomainFn)!,
      linkDomainFn: actOnLinkData<N, L, D>(linkDomainFn)!,
      nodeMeasureFn: actOnNodeData<N, L, num?>(nodeMeasureFn)!,
      linkMeasureFn: actOnLinkData<N, L, num?>(linkMeasureFn)!,
      nodeColorFn: actOnNodeData<N, L, Color>(nodeColorFn),
      nodeFillColorFn: actOnNodeData<N, L, Color>(nodeFillColorFn),
      nodeFillPatternFn:
          actOnNodeData<N, L, FillPatternType>(nodeFillPatternFn),
      nodeStrokeWidthPxFn: actOnNodeData<N, L, num>(nodeStrokeWidthPxFn),
      linkFillColorFn: actOnLinkData<N, L, Color>(linkFillColorFn),
    );