CartoDB / toolkit

JS library to interact with CARTO APIs in a simple way
https://toolkit-wheat.now.sh
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Deck-styles #97

Closed alasarr closed 4 years ago

VictorVelarde commented 4 years ago

I'm ok with this. Being able to use deckgl styles is gonna be very useful.


I have a related-question:

We use custom style builders, our helpers, and we admit also deckgl pure styles, but can't we combine them? I see that as a very useful thing. For example, let's image we have:

const availabilityStyle = carto.viz.colorBinsStyle('availability_365');

And we're absolutely happy with the style results, on every aspect but.... point size.

I think we need a simple way to pass / override 'extra style' params to helpers, like this:

const availabilityStyle = carto.viz.colorBinsStyle('availability_365', { deckStyles: { getRadius: 5, whatEverExtraProp: foo } } );

(we could also consider using our own 'styles' set of properties, but I think I would prefer deckgl's)

What do you think?

alasarr commented 4 years ago

I think we need a simple way to pass / override 'extra style' params to helpers, like this:

+1 I agree

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carto-frontend/toolkit/b40dsoarz ✅ Preview: https://toolkit-git-alasarr-examples-deck.carto-frontend.now.sh

VictorVelarde commented 4 years ago

I'm gonna merge this as it is, with a bit modified example (https://toolkit-b40dsoarz.now.sh/examples/layer/deck-styles.html), and postpone the discussion about passing 'extra deck-gl' styles as options to helpers.

cc/ @borja-munoz on that in case he want to consider adding an extra story for that part (Mixing deck-gl styles with helpers)