Add callback support for palettes and legends in DCG.