Tree<T, D> constructor
Tree<T, D> ({
- required String id,
- required TreeNode<
T> root, - required TypedAccessorFn<
T, D> domainFn, - required TypedAccessorFn<
T, num?> measureFn, - TypedAccessorFn<
T, Color> ? colorFn, - TypedAccessorFn<
T, Color> ? fillColorFn, - TypedAccessorFn<
T, Color> ? patternColorFn, - TypedAccessorFn<
T, FillPatternType> ? fillPatternFn, - TypedAccessorFn<
T, num> ? strokeWidthPxFn, - TypedAccessorFn<
T, String> ? labelFn, - TypedAccessorFn<
T, TextStyleSpec> ? labelStyleFn,
Implementation
factory Tree({
required String id,
required TreeNode<T> root,
required TypedAccessorFn<T, D> domainFn,
required TypedAccessorFn<T, num?> measureFn,
TypedAccessorFn<T, Color>? colorFn,
TypedAccessorFn<T, Color>? fillColorFn,
TypedAccessorFn<T, Color>? patternColorFn,
TypedAccessorFn<T, FillPatternType>? fillPatternFn,
TypedAccessorFn<T, num>? strokeWidthPxFn,
TypedAccessorFn<T, String>? labelFn,
TypedAccessorFn<T, TextStyleSpec>? labelStyleFn,
}) {
return Tree._(
id: id,
root: root,
domainFn: _castFrom<T, D>(domainFn)!,
measureFn: _castFrom<T, num?>(measureFn)!,
colorFn: _castFrom<T, Color>(colorFn),
fillColorFn: _castFrom<T, Color>(fillColorFn),
fillPatternFn: _castFrom<T, FillPatternType>(fillPatternFn),
patternColorFn: _castFrom<T, Color>(patternColorFn),
strokeWidthPxFn: _castFrom<T, num>(strokeWidthPxFn),
labelFn: _castFrom<T, String>(labelFn),
labelStyleFn: _castFrom<T, TextStyleSpec>(labelStyleFn),
);
}