Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
176 stars 15 forks source link

add `geom_raster`, constant columns #84

Closed Vindaar closed 4 years ago

Vindaar commented 4 years ago

This PR finally adds geom_raster to create heatmaps / tile maps with many elements without any performance / file size problems.

Still WIP. To be done:

Note that while geom_raster is significantly faster than geom_tile, it is still held back performance wise, because it is treated as a normal geom. This means a large part of the code path is not actually required for this geom. Especially the mapping of the z values to colors still happens via a callback, which is then evaluated and stored intermittently in a ScaleValue and GgStyle. This is done for all geoms to achieve maximum flexibility, but a waste of resources for this geom.

But instead of special casing this case I'd rather eventually provide a fast code path for simple plots, which have all information available without any computations.