With 21 R1 we introduced a new feature named "Heat Map". It merely used to decorate hot places in your models and your analyses so you much quicker find places you need a second view or you can quickly show upper management your results. In short: Red: Bad, Green: good :-)
Now the good news: there is also the possibility to script it, meaning, to calculate the heat for any object using a custom script. The script "contract" is simple:
- Return a heat value between 0 (cold) and 100 (hot)
- Return -1 to express to ignore certain objects
The scripting feature is hidden behind a beta flag, you as usual you need to launch the tool in debug mode to try it out. if you do so, you will find more entries in the first drop down of the heat map dialog, among others the "Scripted" one:
Select it and you can now either enter a script by pressing the [...] button or simply drag & drop a script file onto the very same button. To illustrate that, here a simple sample script that colors requirements based on their status:
/*
* Heat for Requirements based in their STATUS
*/
var status = self.state;
// console.log(status);
switch ("" + status) {
case "PROPOSED" : 90; break; // very hot!
case "ASSUMED": 60; break; // medium
case "AGREED": 30; break; // warm
case "REJECTED" : 20; break; // still warm
case "REVIEWED": 0; break; // cold
default: -1; break; // no color
}
The result looks like this:

You can grasp that the number of applications here are endless, this is just a very simple example.
Happy Scripting
jan