Graph<N, L, D> constructor
Graph<N, L, D> ({
- 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,
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}) {
return 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),
);
}