CartoDB / airship

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

Line size legend component #614

Closed rjimenezda closed 5 years ago

rjimenezda commented 5 years ago

Fix #612 Fix #615

image

Created the base <as-legend-line-size> component and added the following aliases:

And now, <as-legend-size-bins> will render it if the type is 'line', and so will <as-legend-size-continuous>

~Unrelated tests are failing despite not having changed anything :thinking:~ A rerun fixed it

rjimenezda commented 5 years ago

I uploaded the continuous one.

image

This component is slightly different from the rest because it's done with SVG. so it's less flexible size-wise. You can specify a size property (300px by default), and even a factor that is used to add a bit of inner margin (0.1 by default)

When it's used horizontally (not the case for cartoframes) there's some extra logic to reduce the required space for the SVG.

On the vertical rendering, this doesn't happen. Partly because we can use the space to render long numbers without worrying too much.

rjimenezda commented 5 years ago

image

Now there's also as-legend-size-category which is a metacomponent for:

rjimenezda commented 5 years ago

I've made elena's suggestions.

I'm going to keep this open to merge the specs branch into this one later.