drawGroupPrimitives method

  1. @override
List<MarkElement<ElementStyle>> drawGroupPrimitives(
  1. List<Attributes> group,
  2. CoordConv coord,
  3. Offset origin
)
override

Renders primitive elements of all tuples of a group.

The tuples are rendered in groups. the Attributes.shape of the first tuple of a group will be taken as a represent, and it's drawGroupPrimitives method decides the basic way to render the whole group. If different tuples have different shapes, define and call special element rendering methods for each item.

Implementation

@override
List<MarkElement> drawGroupPrimitives(
  List<Attributes> group,
  CoordConv coord,
  Offset origin,
) {
  final rst = <MarkElement>[];

  for (var item in group) {
    assert(item.shape is PointShape);

    var empty = false;
    for (var point in item.position) {
      if (!point.isFinite) {
        empty = true;
        break;
      }
    }
    if (empty) {
      continue;
    }

    rst.add((item.shape as PointShape).drawPoint(item, coord));
  }

  return rst;
}