Quartz / Chartbuilder

A front-end charting application that facilitates easy creation of simple beautiful charts
http://quartz.github.io/Chartbuilder
MIT License
2.1k stars 354 forks source link

Add aspect ratios for social images #256

Open duner opened 7 years ago

duner commented 7 years ago

Feature request: In addition to the small/long chart sizes, it would be great to have aspect ratios optimized for sharing charts on Twitter and Facebook.

yanofsky commented 7 years ago

Do you know what those ratio are?

duner commented 7 years ago

Sorry for not including in the original issue — meant to but then was running to grab lunch. Anyway, per Vox's meme tool (among other sources), Twitter is 2:1 and Facebook is 1.91:1.

duner commented 7 years ago

If this is a feature y'all would rather not add to the core Chartbuilder tool, we can add it to our fork (and I'd be happy to spend some time figuring out how to implement it) but I figured y'all have a better handle on the codebase and would be better suited to getting something like this done.

petulla commented 7 years ago

@duner I would also look into the cropping margins of those respective platforms, which are different. We've added support for these ARs to our CBs, with optimized margins.

yanofsky commented 7 years ago

I'd be happy to have these sizes in core Chartbuilder

You'd define the sizes in this config: https://github.com/Quartz/Chartbuilder/blob/f0b18d2ac05f55b1231fda37ae3b7fc122f35f94/src/js/config/chart-sizes.js

Then add how they should be styled here: https://github.com/Quartz/Chartbuilder/blob/f0b18d2ac05f55b1231fda37ae3b7fc122f35f94/src/styl/chart-renderer.styl#L168-L237