Skip to content

ft-interactive/g-chartcolour

Repository files navigation

ft-chartcolour

Work in progress.

A JS module (following the D3 pattern) for colours in FT charts.

The colours

using

Either npm install g-chartcolour or you can include it directly in your page via unpkg (or equiv)...

https://unpkg.com/[email protected]/build/g-chartcolour.min.js

developing

Clone the repository locally

install dev dependencies npm install

build the module and the documentation page npm run prepare

To change an existing palette simply go into the src directory, open the file corresponding to the palette you want to change and edit the appropriate hex code.

To add a new palette create a sensibly named file in the src directory following the example of one of the existing palettes. Each palette exports either a single array eg sequential-multi or a single object eg categorical-uk-politics). The palette should then be added to the index.js file so it gets included in the build.

Update snapshot testing with npm run update-snapshot.

When you're happy with the palette create a pull request and that's it!

Licence

This software is published by the Financial Times under the MIT licence.

Please note the MIT licence only covers the software, and does not cover any FT content or branding incorporated into the software or made available using the software. FT content is copyright © The Financial Times Limited, and FT and 'Financial Times' are trademarks of The Financial Times Limited, all rights reserved. For more information about republishing FT content, please contact our republishing department.