Prerequisites
- A working Risksheet document with risk items
- Access to the
risksheet.jsonconfiguration file - Familiarity with CSS color properties
How Item Color Styling Works
Risksheet uses three configuration properties that work together to apply data-driven colors:cellDecorators— JavaScript functions that evaluate cell values and apply CSS classesstyles— CSS class definitions that specify colors, fonts, and backgroundsheaders.rowHeader.renderer— Optional row header renderer for applying colors to the row header column
| Configuration Flow | ||||
|---|---|---|---|---|
| cellDecorators styles Grid Display | ||||
| rpn: function() | ------> | .rpn1 { green } | ---> | Cell: 120 (green) |
| evaluates value | .rpn2 { yellow } | Cell: 250 (amber) | ||
| applies CSS class | .rpn3 { red } | Cell: 400 (red) |
Step 1: Define Cell Decorator Functions
Cell decorators are JavaScript functions that inspect cell values and toggle CSS classes. Add them to thecellDecorators section of your risksheet.json:
info parameter provides:
| Property | Description |
|---|---|
info.value | The current cell value |
info.cell | The DOM element of the cell |
info.item | The full work item data for the row |
Step 2: Define CSS Styles for Color Classes
Map the CSS classes used in your decorators to actual color definitions in thestyles section:
| Class | Range | Background | Text | Meaning |
|---|---|---|---|---|
rpn1 | 1 — 150 | Light green (#eaf5e9) | Dark green (#1d5f20) | Low risk |
rpn2 | 151 — 350 | Light yellow (#fff3d2) | Dark amber (#735602) | Medium risk |
rpn3 | > 350 | Light red (#f8eae7) | Dark red (#ab1c00) | High risk |
Step 3: Assign the Decorator to Your Column
Reference the decorator name in thecellDecorator property of the column that should display conditional colors:
cellDecorator value must match a key defined in the top-level cellDecorators object.
Step 4: Color Row Headers
To apply color coding to the row header column for at-a-glance risk visibility, configure a custom renderer in theheaders section and pair it with a cell decorator that reads from the work item:
Step 5: Style Column Group Headers
Apply distinct background colors to column group headers to visually separate FMEA sections:.firstRow and .lastRow selectors target multi-row column group headers, letting you differentiate between the group title row and the individual column title row.
Common Color Palettes
Recommended color combinations for standard risk analysis use cases:| Use Case | Low | Medium | High |
|---|---|---|---|
| RPN (3-tier) | #eaf5e9 / #1d5f20 | #fff3d2 / #735602 | #f8eae7 / #ab1c00 |
| Status flags | #e8f5e9 / #388e3c | #e3f2fd / #1565c0 | #ffebee / #b71c1c |
The color palettes above are suggested starting points. Adjust the threshold values in your
cellDecorators functions to match your organization’s risk classification scales and standards.Verification
After saving yourrisksheet.json and refreshing the page:
- You should now see RPN cells color-coded green (1—150), yellow (151—350), or red (>350)
- Row headers should reflect the revised RPN color for each risk item
- Column group headers should display the configured section colors
rpn1, rpn2, rpn3) are being applied to the cell elements.
See Also
- Apply Conditional Formatting — broader conditional formatting patterns
- Configure Cell Styles — general cell styling options
- Configure Row Header Styles — row header customization
- Configure Calculated Columns — set up formulas that drive color-coded values
Sources
Sources
KB ArticlesSource Code
risksheet.jsonAppConfig.tsCellEditorFormatter.tsExportToPdf.tsRiskSheetContextMenu.ts