Closed sccolbert closed 5 years ago
@sccolbert The prepare method is still useful for computing per-column attributes that affect the rendering (for example, the location of axis/grid lines across all cells in a column for a barcharts based on ideal labeling, etc). Those are still a bit expensive to do per cell, and they don't make sense to calculate in the data model since they depend on the rendering space
@nmichaud Thanks. I can add it back and make it a no-op in the base class.
@nmichaud Wait, I can't add it back, because we have per-cell renderers. So you'll need to cache those computations based on the width/index of the column.
Yeah I was afraid of that. Will see how that works out.
cc @blink1073 @afshin @jasongrout @ellisonbg @SylvainCorlay
This updates the
DataModel
to allow per-cellmetadata
. I profiled this with the datagrid example app, and found negligible difference in rendering times. This change will make it easier to build a spreadsheet model, where the easiest way to store per-cell type/styling/formatting info is with per-cell metadata.I also updated the logic of the
RendererMap
. My initial implementation of matching based on metadata string values was too much magic (IMO) and was unnecessarily restrictive. The new version is much simpler and has much more flexibility. It allows for arbitrary resolution logic by the end user.The
prepare
method was removed fromCellRenderer
because it was called once per column. This matched the mental model that metadata was per-column rather than per-cell. The idea was that a renderer could pre-set GC properties which are common for a column. This turned out to not be necessary because the GC is caching property changes automatically anyway. Getting rid of that method simplifies the mental model.There are a few other unrelated updates to copyright dates and changing
interface
totype
where it makes sense.