generate method

Future<Uint8List> generate()

Implementation

Future<Uint8List> generate() async {
  await ready.future;

  // if there is no data then return a transparent image
  if (data.isEmpty) {
    return kTransparentImage;
  }
  // generate shape to be used for all points on the heatmap
  final baseShape = await _getBaseShape();

  final grayscale = await _grayscaleHeatmap(baseShape);

  final heatmapBytes = await _colorize(grayscale);

  return heatmapBytes;
}