Source
xxxxxxxxxx
* It is large number because SVG works more precise that way (later it will be scaled according to widget size).
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
class CSVGHoneycomb {
static ZBX_COLOR_CELL_FILL_LIGHT = '#a5c6d4';
static ZBX_COLOR_CELL_FILL_DARK = '#668696';
static ZBX_STYLE_CLASS = 'svg-honeycomb';
static ZBX_STYLE_HONEYCOMB_CONTAINER = 'svg-honeycomb-container';
static ZBX_STYLE_CELL = 'svg-honeycomb-cell';
static ZBX_STYLE_CELL_SELECTED = 'svg-honeycomb-cell-selected';
static ZBX_STYLE_CELL_NO_DATA = 'svg-honeycomb-cell-no-data';
static ZBX_STYLE_CELL_SHADOW = 'svg-honeycomb-cell-shadow';
static ZBX_STYLE_CELL_OTHER = 'svg-honeycomb-cell-other';
static ZBX_STYLE_CELL_OTHER_ELLIPSIS = 'svg-honeycomb-cell-other-ellipsis';
static ZBX_STYLE_CONTENT = 'svg-honeycomb-content';
static ZBX_STYLE_BACKDROP = 'svg-honeycomb-backdrop';
static ZBX_STYLE_LABEL = 'svg-honeycomb-label';
static ZBX_STYLE_LABEL_PRIMARY = 'svg-honeycomb-label-primary';
static ZBX_STYLE_LABEL_SECONDARY = 'svg-honeycomb-label-secondary';
static ID_COUNTER = 0;
static CELL_WIDTH_MIN = 50;
static LABEL_WIDTH_MIN = 56;
static FONT_SIZE_MIN = 12;
static LINE_HEIGHT = 1.15;
static EVENT_CELL_CLICK = 'cell.click';
static EVENT_CELL_ENTER = 'cell.enter';
static EVENT_CELL_LEAVE = 'cell.leave';
/**
* Widget configuration.
*
* @type {Object}
*/
#config;
/**
* Inner padding of the root SVG element.
*
* @type {Object}
*/
#padding;
/**
* Usable width of widget without padding.
*
* @type {number}
*/
#width;
/**
* Usable height of widget without padding.
*
* @type {number}
*/
#height;
/**
* Container calculated parameters based on SVG size and cells data.
*
* @type {Object}
*/
#container_params = {
x: 0,
y: 0,
width: 0,
height: 0,
columns: 1,
rows: 1,
scale: 1
}
/**
* Data about cells.
*
* @type {Array | null}