OpenWaterFoundation / owf-app-dev-ng

Open Water Foundation Angular application to develop common libraries
0 stars 1 forks source link

Dashboad status indicator - thoughts on classification #41

Open smalers opened 2 years ago

smalers commented 2 years ago

The status indicator widget is now displaying some data from a CSV file. Here are thoughts on how to configure the visual aspects, using the SWSI as an example.

The following legend is used for the SWSI layer on the State of Colorado's map viewer.

image

Is it possible to use a classification table similar to map layers for the indicator? I could see how a classification file could be shared among multiple indicators but I can also see how embedding it in the JSON could simplify the code and configuration. The following is the classification information for SWSI picking colors from the above image, but if we want 3 colors then I would lump "Near Average" and wetter to green (OK), slightly dry and moderately dry as yellow (warning), and extremely dry as red (problem). The opacity in the following needs to be evaluated for maps and can be ignored for the status indicator. In general, I think using the concept of a classification table makes sense. It would also be possible to do the classification in a data processing workflow and have a column in the CSV with integer 1, 2, 3, or word that can be used in the classification table, such as when using a category symbol.

# The value from attribute is compared as follows to determine symbol:
#  value > valueMin
#  value <= valueMax
valueMin,valueMax,color,opacity,fillColor,fillOpacity,weight,label,image
-Infinity,<-4.2,#ffffff,0.0,#fffffff,1.00,1,Unknown
>=-4.2,< -3.0,#fd0017,0.0,#fd0017,0.35,1,Extremely Dry
>=-3.0,<-2.0,#fda824,0.0,#fda824,0.35,1,Moderately Dry
>=-2.0,<-1.0,#fed283,0.0,#fed283,0.35,1,Slightly Dry
>=-1.0,<1.0,#ffffc0,0.0,#ffffc0,0.35,1,Near Average
>=1.0,<2.0,#d2e8fe,0.0,#d2e8fe,0.35,1,Slightly Wet
>=2.0,<3.0,#f8e1fe,0.0,#f8e1fe,0.35,1,Moderately Wet
>=3.0,#1471fc,0.0,#1471fc,0.35,1,Extremely Wet