File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -105,5 +105,26 @@ function getColormapNames(injectableName) {
105105 injectables [ injectableName ] = Object . keys ( colormapData ) ;
106106 }
107107 ) ;
108+ } else {
109+ // Get colormaps from js-colormaps and the inversed colors
110+ const js_colormaps = Object . keys ( colormapData ) . map ( ( color => color . toLowerCase ( ) ) ) ;
111+ let colormaps = [ ] ;
112+ js_colormaps . forEach ( ( color ) => {
113+ colormaps . push ( color ) ;
114+ // js-colormaps only includes the non reversed names so add the reverse
115+ if ( ! color . endsWith ( "_r" ) ) {
116+ colormaps . push ( `${ color } _r` ) ;
117+ }
118+ } ) ;
119+
120+ // Sort
121+ colormaps . sort ( ) ;
122+
123+ // ... new Set removes duplicates
124+ injectables [ injectableName ] = [
125+ ...new Set (
126+ injectablesDefaults [ injectableName ] . concat ( colormaps )
127+ ) ,
128+ ] ;
108129 }
109130}
You can’t perform that action at this time.
0 commit comments