Other Usage

How to change treemap default colors for categorical colorMode?

connect
Engager

I am using treemap visualization. I have been trying to change the default color of the treemap using the following options:

<option name="treemap_app.treemap.maxColor">
<option name="treemap_app.treemap.minColor">

colorMode has been set to categorical

<option name="treemap_app.treemap.colorMode">categorical</option>

treemap doesn't seem to honor any changes to maxColor or minColor and uses the default colors.

Is this a bug in treemap?

 

maxColor/minColor seems to work if colorMode is changed is sequential but that is not the view I'm interested in

 

 

Tags (1)
0 Karma

tscroggins
Influencer

Hi,

Documentation is no longer linked on Splunkbase, but it's still available here: https://docs.splunk.com/Documentation/Treemap/1.5.0/TreemapViz/TreeMapFormat 

Minimum and maximum color values are only used in sequential mode.

In categorical mode, Treemap uses a default palette provided by Splunk:

 

ColorCodes.CATEGORICAL = [
    "#7b56db", "#cb2196", "#008c80", "#9d6300", "#f6540b", "#ff969e", "#99b100", "#f4b649", "#ae8cff", "#8cbcff",
    "#813193", "#0051b5", "#009ceb", "#00cdaf", "#00490a", "#dd9900", "#465d00", "#ff677b", "#ff6ace", "#00689d"
];

ColorCodes.CATEGORICAL_DARK = ColorCodes.CATEGORICAL; // @pwied: for now we use the same colors in dark mode

 

When useColors is false, Treemap defaults to this shade of blue: #1e93c6.

0 Karma

connect
Engager

Thank you @tscroggins  Is there any recommended way to change the defaults values for

ColorCodes.CATEGORICAL

 and have changes be limited to treemap visuals?

0 Karma

tscroggins
Influencer

There isn't a simple way, but if you're feeling adventurous, you can unminify and edit $SPLUNK_HOME/etc/apps/treemap_app/appserver/static/visualizations/treemap/visualization.js. You'll lose Splunk support, but any changes you make could be submitted to Splunk as ideas or feature enhancement requests.

Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...