Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
feat(color): add echarts colors
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Aug 25, 2020
1 parent 5f090ff commit a30618c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/superset-ui-color/src/colorSchemes/categorical/echarts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import CategoricalScheme from '../../CategoricalScheme';

const schemes = [
{
id: 'echarts4Colors',
label: 'ECharts 4 Colors',
colors: [
'#c23531',
'#2f4554',
'#61a0a8',
'#d48265',
'#91c7ae',
'#749f83',
'#ca8622',
'#bda29a',
'#6e7074',
'#546570',
'#c4ccd3',
],
},
{
id: 'echarts5Colors',
label: 'ECharts 5 Colors',
colors: [
'#5470C6',
'#91CC75',
'#FAC858',
'#EE6666',
'#73C0DE',
'#3BA272',
'#FC8452',
'#9A60B4',
'#EA7CCC',
],
},
].map(s => new CategoricalScheme(s));

export default schemes;
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ const schemes = [
'#3AA3B2',
],
},
{
id: 'echarts_gradient',
label: 'ECharts gradient',
isDiverging: false,
colors: ['#f6EFA6', '#D88273', '#BF444C'],
},
].map(s => new SequentialScheme(s));

export default schemes;
2 changes: 2 additions & 0 deletions packages/superset-ui-color/test/colorSchemes.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import categoricalAirbnb from '../src/colorSchemes/categorical/airbnb';
import categoricalEcharts from '../src/colorSchemes/categorical/echarts';
import categoricalSuperset from '../src/colorSchemes/categorical/superset';
import categoricalPreset from '../src/colorSchemes/categorical/preset';
import categoricalD3 from '../src/colorSchemes/categorical/d3';
Expand All @@ -14,6 +15,7 @@ describe('Color Schemes', () => {
it('returns an array of CategoricalScheme', () => {
[
categoricalAirbnb,
categoricalEcharts,
categoricalD3,
categoricalGoogle,
categoricalLyft,
Expand Down

0 comments on commit a30618c

Please sign in to comment.