Add support for data and renderer changes
Closed this issue · 0 comments
flekschas commented
Currently, we load and draw items only ever once and never update them during the exploration.
Our library should be able to dynamically re-render the items, previews, and covers either when their data changes or when the renderer changes.
Examples:
- In the matrix example, it should be possible to change the colormap (which would subsequently change the renderer) and the items should rerender dynamically.
- In the lines example, let's create a custom content menu button that allows the user to recreate the random line. A custom context menu callback can be created with
pileContextMenuItems
. See the docs for an example. To update the items all that one should be required to do is update thedata
array and pass it intopiling.set('items', data)
again. The library should be able to find out which item was updated by comparing the reference as usual. E.g., to update the 5th linedata[5] = { src: newSrc}
andpiling.set('items', data)
.