CartoDB / turbo-carto

CartoCSS preprocessor
BSD 3-Clause "New" or "Revised" License
28 stars 7 forks source link

For discussion: defining start and end colors for custom sequential color scheme #63

Open makella opened 7 years ago

makella commented 7 years ago

We need to discuss how to implement color scaling between a start and end color using TurboCARTO. The reason that this is so important is for a couple of main reasons:

Example: Classed Choropleth

The output map would be something like this:

screen shot 2017-01-03 at 12 19 45 pm

Example: Unclassed Choropleth

The good news is, TurboCARTO is built to support unclassed mapping. To streamline this for the user, we need to take their [attribute], use their start and end colors as our range( ) and automatically interpolate between the two colors based on the number of unique values that exist in the data.

Here is an example unclassed map.

screen shot 2017-01-03 at 12 18 02 pm

Current Workflow

  polygon-fill: ramp([intersect_sum], 
    (#275372,
    #285675,
    #295977,
    #2a5c7a,
    #2c5e7c,
    #2d617e,
    #2e6481,
    #306783,
    #316a86,
    #336d88,
    #34708a,
    #36738d,
    #38768f,
    #397991,
    #3b7c94,
    #3d7f96,
    #3f8298,
    #41859a,
    #43889c,
    #458b9f,
    #488ea1,
    #4a91a3,
    #4c94a5,
    #4f97a7,
    #519aa9,
    #549dab,
    #56a0ad,
    #59a3af,
    #5ca6b1,
    #5fa9b3,
    #61acb5,
    #64afb7,
    #67b2b8,
    #6ab5ba,
    #6db8bc,
    #71bbbe,
    #74bec0,
    #77c1c2,
    #7ac4c3,
    #7dc7c5,
    #81cac7,
    #84cdc9,
    #88d0cb,
    #8bd3cc,
    #8fd7ce,
    #92dad0,
    #96ddd2,
    #9ae0d3,
    #9ee3d5,
    #a1e6d7,
    #a5e9d8,
    #a9ecda,
    #adefdc,
    #b1f2de,
    #b5f5df,
    #b9f8e1)
 );

Getting Started

There is definitely more to discuss about this, but would love to get the conversation started.

cc @saleiva

AbelVM commented 7 years ago

This may be related to https://github.com/CartoDB/solutions/issues/716