CartoDB / airship

A design library for building Location Intelligence applications.
https://carto.com/developers/airship/
BSD 3-Clause "New" or "Revised" License
75 stars 13 forks source link

VLBridge does not update charts with filter #650

Open AdriSolid opened 4 years ago

AdriSolid commented 4 years ago

Hi all,

First of all, I have to say that VLBridge saved me a lot of work, thanks.

Everything works fine except if you add a 'filter' in 'Viz'. The charts don't update following the filter you define, it ignores the 'filter' (the map is updated correctly instead).

Below an example: https://codepen.io/AdriSolid/pen/wvwyRON

Cheers!

VictorVelarde commented 4 years ago

Please @CartoDB/rt-managers add this to RT

/cc @rjimenezda

rjimenezda commented 4 years ago

Hi, thank you for using Airship, and it's great you found the bridge useful.

Unfortunately, this is a design choice, not a bug. If you want to use the bridge you cannot really use Viz filters alongside with it, you must leave all the filtering to the bridge.

This was done to simplify the code, but we can use this issue to track any attempts to add this functionality. Theoretically we could try and read the initial filter, or add a way for the bridge to accept "external filters" that the user can define. It's uncharted territory, though

In this particular case you've shared, what you could do is filter at the source. Instead of using a carto.source.Dataset, use a SQL source

carto.source.SQL(`SELECT * from ne_10m_airports where location='terminal'`);

This is not as helpful as using Viz filters, but it might help in some cases.

AdriSolid commented 4 years ago

I tried to use SQL source instead, the problem remains in the update. Whether you update the SQL source using the 'update' method or even the 'blendToViz' using Viz filter, it does not work neither. As you know, is much better to use Viz filters and filter the protobuf with the smooth transitions.

Would like to extend the library.. For the moment I managed to use 'raw' Airship charts extracting the data from 'viewportHistogram'.

Thanks!