type property

SymbolType Function(Symbol, [List<Object?>?]) type
getter/setter pair

The symbol type.

final symbol = Symbol()..type = (thisArg, [args]) => symbolCross;

symbol.type; // symbolCross

this and the symbol generator args are passed through this accessor. This is convenient for use with selection.attr, say in conjunction with an ordinal scale to produce a categorical symbol encoding.

final symbolType = ScaleOrdinal(range: symbolsFill);
final symbol = Symbol()..type = (thisArg, [args]) => symbolType(args[0]["category"]);

The symbol type accessor defaults to:

type() {
  return circle;
}

See symbolsFill and symbolsStroke for built-in symbol types. To implement a custom symbol type, pass an object that implements SymbolType.draw.

Implementation

SymbolType Function(Symbol, [List<Object?>?]) type;