Ad Widget

Collapse

Help with modifying Honeycomb Layout (CSS, JS, anything)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cbigler
    Junior Member
    • Jan 2021
    • 10

    #1

    Help with modifying Honeycomb Layout (CSS, JS, anything)

    I'll be the first to admit, I don't know much about editing CSS. But what I want to accomplish is hopefully straight forward and one of you experts can help.

    I have about 150 hosts in a host group that I have visualized in the honeycomb widget. I used Imonasterio's post here https://www.zabbix.com/forum/zabbix-...s-zabbix-7-0-8 to give me the count of active triggers to drive the threshold colors (thanks lmonasterio!). Clicking on the cell drives the host selection to a slew of other widgets. Functionally, everything works fine.

    I want to be able to reduce the size of the honeycomb cell below what the widget will do automatically so I can fit all 150 in the widget without the ... cell. Not ideal, but even if the size of the widget and the honeycomb cells are static, that would be better than nothing. It would be nice if the primary label would show up, but even with just three alpha characters on the smallest sized cell, they don't do that now for me.

    I was hoping this can be done in the CSS file but there's 62 entries for "honeycomb" and I don't know where to start. There's also the class.svghoneycomb.js file that seems really promising (at least I can read that one), I'm just a little hesitant making any edits.

    Any help would be GREATLY appreciated. Thanks all!

  • cbigler
    Junior Member
    • Jan 2021
    • 10

    #2
    Well, my grandpa always used to say "God hates a coward". So I put on my big boy pants and edited the /usr/share/zabbix/ui/widgets/honeycomb/assets/js/class.svghoneycomb.js file.

    I'm running 7.2.4 and the two edits I made were lines 36 and 37:
    Code:
            static CELL_WIDTH_MIN = 30;
            static LABEL_WIDTH_MIN = 24;
    I may need to play around with those values (and FONT_SIZE_MIN, LINE_HEIGHT) but it's a good start. I don't know if newer versions of Zabbix fixed this or not but it's something I'll look into later. If others have a more elegant and reactive solution, please share. Thanks again.

    Comment

    • cbigler
      Junior Member
      • Jan 2021
      • 10

      #3
      Originally posted by Donkey
      Be aware that every time you do a version upgrade, this file will get overwritten. I think.
      I'm pretty sure you are 100% correct. Not a very elegant solution, but not too difficult to redo if necessary. Thanks!

      Comment

      Working...