WebViewer Version: 8.11.0
Please give a brief summary of your issue:
I’m trying to edit the web viewer so that search results have different colors based on the pattern used to search for them (for example I would like dates to be blue but names to be red). I tried using the code below. Similar code worked for redactions but it seems that the search results don’t have fields for type or color. Is there any way to do this?
documentViewer.addEventListener('searchResultsChanged', (searchResults: any[]) => {
console.log('search results changed')
searchResults.forEach(searchResult => {
if (patternMap.has(searchResult.type)) {
const [red, green, blue] = convertHexStringToRgbArray(patternMap.get(searchResult.type)!.color)
searchResult.color = new Annotations.Color(red, green, blue, 1.0)
}
})
})