SankeyGraph<N, L, D> constructor

SankeyGraph<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,
  15. TypedAccessorFn<L, num>? secondaryLinkMeasureFn,
})

Implementation

factory SankeyGraph({
  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,
  TypedAccessorFn<L, num>? secondaryLinkMeasureFn,
}) =>
    SankeyGraph._(
      id: id,
      nodes: _convertSankeyNodes<N, L, D>(
        nodes,
        links,
        sourceFn,
        targetFn,
        nodeDomainFn,
      ),
      links: _convertSankeyLinks<N, L>(
        links,
        sourceFn,
        targetFn,
        secondaryLinkMeasureFn,
      ),
      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),
    );