How to fix Histogram selectionChanged from Carto Airship 1.04 to 2.00?

by smarchan   Last Updated June 13, 2019 06:22 AM

I have spent quite a bit of time playing around with this generous example provided by Jorge Sanz of Carto:

One thing I've gotten stuck on that I can't seem to resolve is updating the version of Airship that is being incorporated from 1.03 to 2.05.

Based on a review of the changelog it seems that a "breaking change" occured in version 2.00 regarding "Histogram selectionChange" in order to allow category histograms as well as numerical. I'm guessing this is the change that is breaking Jorge Sanz's example above [when referencing the new airship.js], but after several evenings of trial and error I figured I'd reach out for help.

If I had to guess I believe the issue is either in lines 31-38 of vue-component-histogram.js :

    widget.addEventListener('selectionChanged', event => {
            event.detail !== null 
            ? event.detail 
            : []


or lines 65-68 of vue_config.js

        if (this.population.selection && this.population.selection.length == 2){
            const [minSel, maxSel] = this.population.selection;


Truly wish I could have figured this out on my own, but appreciate in advance any help from this community.

Warm regards

Related Questions

Updated July 21, 2019 14:22 PM

Updated August 27, 2019 15:22 PM

Updated November 01, 2017 17:22 PM

Updated July 01, 2018 00:22 AM

Updated August 10, 2018 11:22 AM