@@ -88,41 +88,80 @@ const FLAG_COLORS = {
8888 'ICOS' : {
8989 'y1' : {
9090 'Needed' : '#817FFF' ,
91- 'Not calibrated' : '#AC9326' ,
92- '1' : '#AC9326' ,
93- 'Questionable' : '#FFA42B' ,
94- '3' : '#FFA42B' ,
95- 'Bad' : '#FF0000' ,
96- '4' : '#FF0000' ,
97- 'Good' : '' ,
98- '2' : '' ,
99- 'Assumed Good' : '' ,
100- '-2' : '' ,
101- 'GHOST' : '#C0C0C0'
91+ 'Not calibrated' : '#AC9326' ,
92+ '1' : '#AC9326' ,
93+ 'Questionable' : '#FFA42B' ,
94+ '3' : '#FFA42B' ,
95+ 'Bad' : '#FF0000' ,
96+ '4' : '#FF0000' ,
97+ 'Good' : '' ,
98+ '2' : '' ,
99+ 'Assumed Good' : '' ,
100+ '-2' : '' ,
101+ 'GHOST' : '#C0C0C0'
102102 } ,
103103 'y2' : {
104104 'Needed' : '#D7D6FF' ,
105105 'Not calibrated' : '#CCCBAF' ,
106- '1' : '#CCCBAF' ,
107- 'Bad' : '#E6B6A6' ,
108- '4' : '#E6B6A6' ,
109- 'Questionable' : '#EFDCBF' ,
106+ '1' : '#CCCBAF' ,
107+ 'Bad' : '#E6B6A6' ,
108+ '4' : '#E6B6A6' ,
109+ 'Questionable' : '#EFDCBF' ,
110110 '3' : '#EFDCBF'
111111 }
112+ } ,
113+ 'Argo' : {
114+ 'y1' : {
115+ 'Needed' : '#817FFF' ,
116+ 'Good' : '' ,
117+ '1' : '' ,
118+ 'Assumed Good' : '' ,
119+ '-1' : '' ,
120+ 'Probably Good' : '#FFFF00' ,
121+ '2' : '#FFFF00' ,
122+ 'Bad, potentially correctable' : '#ED7F10' ,
123+ '3' : '#ED7F10' ,
124+ 'Bad' : '#FF0000' ,
125+ '4' : '#FF0000' ,
126+ 'Value Changed' : '#FF00FF' ,
127+ '5' : '#FF00FF' ,
128+ 'Estimated Value' : '#0000FF' ,
129+ '8' : '#0000FF' ,
130+ } ,
131+ 'y2' : {
132+ 'Needed' : '#817FFF' ,
133+ 'Good' : '' ,
134+ '1' : '' ,
135+ 'Assumed Good' : '' ,
136+ '-1' : '' ,
137+ 'Probably Good' : '#FFFF00' ,
138+ '2' : '#FFFF00' ,
139+ 'Bad, potentially correctable' : '#ED7F10' ,
140+ '3' : '#ED7F10' ,
141+ 'Bad' : '#FF0000' ,
142+ '4' : '#FF0000' ,
143+ 'Value Changed' : '#FF00FF' ,
144+ '5' : '#FF00FF' ,
145+ 'Estimated Value' : '#0000FF' ,
146+ '8' : '#0000FF' ,
147+ }
112148 }
113149}
114150
115151function getFlagScheme ( ) {
116152 return $ ( '#plotPageForm\\:flagScheme' ) . val ( ) ;
117153}
118154
119- function getFlagColor ( flag , axis ) {
120- return FLAG_COLORS [ getFlagScheme ( ) ] [ axis ] [ flag ] ;
155+ function getFlagColor ( flag , axis , emptyIsTransparent ) {
156+ let color = FLAG_COLORS [ getFlagScheme ( ) ] [ axis ] [ flag ] ;
157+ if ( color == '' ) {
158+ color = emptyIsTransparent ? '#00000000' : '#000000' ;
159+ }
160+ return color ;
121161}
122162
123- function getFlagColors ( flags , axis ) {
124- let lookupTable = FLAG_COLORS [ getFlagScheme ( ) ] [ axis ] ;
125- return flags . map ( f => { return lookupTable [ f ] ; } ) ;
163+ function getFlagColors ( flags , axis , emptyIsTransparent ) {
164+ return flags . map ( f => { return getFlagColor ( f , axis , emptyIsTransparent ) } ) ;
126165}
127166
128167// VARIABLES FOR THE PLOT/TABLE LAYOUT
@@ -325,7 +364,7 @@ function showQCMessage(qcFlag, qcMessage) {
325364 if ( qcMessage != '' ) {
326365
327366 let content = '' ;
328- content += '<div class="qcInfoMessage" style="color: ' + getFlagColor ( qcFlag , 'y1' ) + '">' ;
367+ content += '<div class="qcInfoMessage" style="color: ' + getFlagColor ( qcFlag , 'y1' , false ) + '">' ;
329368 content += qcMessage ;
330369 content += '</div>' ;
331370
@@ -900,7 +939,7 @@ function getColumnDefs() {
900939 "render" : function ( data , type , row , meta ) {
901940 let result = '' ;
902941 if ( null != data && ! jQuery . isEmptyObject ( data ) ) {
903- let flagColor = getFlagColor ( data [ 'qcFlag' ] , 'y1' ) ;
942+ let flagColor = getFlagColor ( data [ 'qcFlag' ] , 'y1' , false ) ;
904943 if ( null == flagColor ) {
905944 throw 'Unrecognised flag ' + data [ 'qcFlag' ] ;
906945 }
@@ -1159,7 +1198,7 @@ function drawY2Plot(index, keepZoom) {
11591198 y2_options . visibility [ 0 ] = false ;
11601199
11611200 // The labels contain the X axis, which we don't use for series colors
1162- let y2Colors = getFlagColors ( labels . slice ( 3 , labels . length - 1 ) , 'y2' ) ;
1201+ let y2Colors = getFlagColors ( labels . slice ( 3 , labels . length - 1 ) , 'y2' , true ) ;
11631202 // Insert blank colors for the ID and Y1 series, which aren't shown
11641203 y2Colors . splice ( 0 , 0 , null , null ) ;
11651204
@@ -1574,10 +1613,10 @@ function drawFlagPlot1Y(index) {
15741613 window [ 'flagPlot' + index ] = null ;
15751614 } else {
15761615 let flag_options = Object . assign ( { } , BASE_PLOT_OPTIONS ) ;
1577- flag_options . labels = JSON . parse ( $ ( getPlotFormName ( index ) + '\\:plot' + index + 'FlagLabels' ) . val ( ) ) ;
1616+ flag_options . labels = JSON . parse ( $ ( getPlotFormName ( index ) + '\\:plot' + index + 'FlagLabels' ) . val ( ) ) ;
15781617
1579- // The labels contain the X axis, which we don't use for series colors
1580- flag_options . colors = getFlagColors ( flag_options . labels . slice ( 1 ) , 'y1' ) ;
1618+ // The labels contain the X axis, which we don't use for series colors
1619+ flag_options . colors = getFlagColors ( flag_options . labels . slice ( 1 ) , 'y1' , true ) ;
15811620 flag_options . xlabel = ' ' ;
15821621 flag_options . ylabel = ' ' ;
15831622 flag_options . pointSize = FLAG_POINT_SIZE ;
@@ -1628,8 +1667,8 @@ function drawFlagPlot2Y(index) {
16281667
16291668 flag_options . labels = JSON . parse ( $ ( getPlotFormName ( index ) + '\\:plot' + index + 'FlagLabels' ) . val ( ) ) ;
16301669
1631- // The labels contain the X axis, which we don't use for series colors
1632- flag_options . colors = getFlagColors ( flag_options . labels . slice ( 1 ) , 'y1' ) ;
1670+ // The labels contain the X axis, which we don't use for series colors
1671+ flag_options . colors = getFlagColors ( flag_options . labels . slice ( 1 ) , 'y1' , true ) ;
16331672
16341673 flag_options . xlabel = ' ' ;
16351674 flag_options . ylabel = ' ' ;
@@ -2408,7 +2447,7 @@ function getPointColor(mapIndex, point) {
24082447 . getColor ( point . properties . value ) ;
24092448 }
24102449 case FLAG_TYPE : {
2411- return getFlagColor ( point . properties . flag , 'y1' ) ;
2450+ return getFlagColor ( point . properties . flag , 'y1' , true ) ;
24122451 }
24132452 case SELECTION_TYPE : {
24142453 return null != window [ 'mapSelectionColor' ] ? window [ 'mapSelectionColor' ] : '#FFFF00' ;
0 commit comments