CartoDB/carto-react

[RFC] Disable filtering in widgets

Clebal opened this issue · 6 comments

Issue

Currently, in both widget and widget ui there isn't a way to disable filtering/category selection.

Solution

Add a property called: filtering or interactivity in every widget, with true by default, that allows to have static widgets if false.

Why do I need that?

In professional services projects it's a common use case where we need to show static widgets once we've made an analysis and we don't want the user to change the filters already applied.

I understand the use case but I'd like to know what will happen if the user changes the viewport. In this case, you will have a widget showing data that might not match with the features displayed in the map. You could also have some widgets with interactivity set to true but, if you filter using these widgets, the other widgets will remain static. Should we mark/label the not interactive widgets in any way?

I think it is important to have also feedback from Product Design here: @javigil-geo @josegilg

A property called filtering/interactivity just involves the filter that the widget applies, not the viewport filter. Viewport filter will be always applied since there's not an explicit prop for that, but that's what we're talking about.

When filtering/interactivity is disabled, the widget won't raised any event when the user clicks in a certain category. I don't think it needs some special kind of mark/label.

OK, so the widgets are not really static. They are updated if the viewport changes or there are new filters applied to the source, right? If that's the case, I am not sure how it works with the concept of the analysis you are mentioning.

Let's wait to have the feedback from Product Design to see what they propose.

They are static as far as you cannot interact with the widget. I know that static can have many meanings. Static widgets can be filtered by viewport filters and source filters, the only difference is that static widget cannot apply filters.

Okey, I'll wait.

I think this makes a lot of sense. To be honest I think that we already had this feature on (I think we had it in the past). It's probably also quite easy to integrate

I've already talked with @josegilg and we just need to make some minor changes to the widgets design, so the RFC is approved for implementation.