palantir/plottable

Complete instance gets rerendered after using the data method

fklement opened this issue · 1 comments

I've an instance with a bar plot and a pie plot.
The bar plot with the .onClick interaction updates the dataset used in the pie plot.

interaction.onClick(function(point) {
                plot.selections().attr("fill", "#5279c7");
                var selection = plot.entitiesAt(point)[0].selection;
                selection.attr("fill", "#F99D42");
                pieData.pop()
                pieData.push({
                    cat: 'Einsatz Nr: ' + plot.entitiesAt(point)[0].datum.x,
                    total: plot.entitiesAt(point)[0].datum.y
                })

                pieDataset.data(pieData)
            });

Whenever i'm using this interaction the complete instance gets rerendered instead of only rerendering the pie plot.
How can i manage it that the bar plots selection is still filled after using the data method of the Dataset class?

Hey @fklement thanks for your interest in Plottable. Can you provide a full jsfiddle/codepen repro? I think this is a limitation of the current redraw logic; you can try having two separate Plottable top-level Components (e.g. two .renderTo() to different container elements) to work around it