UNPKG

@eccenca/gui-elements

Version:

GUI elements based on other libraries, usable in React application, written in Typescript.

25 lines 1.57 kB
import { intentClassName } from "../../../common/Intent/index.js"; import { CLASSPREFIX as eccgui } from "./../../../configuration/constants.js"; var nodeClassName = function (node) { var _a; var typeClass = "".concat(eccgui, "-graphviz__minimap__node--") + node.type; // TODO: re-implement the evaluation of node.data.highlightColor so it is highlighted the same way in the minimap, too. var intentClass = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.intent) ? intentClassName(node.data.intent) : ""; return "".concat(typeClass, " ").concat(intentClass); }; var nodeColor = function (node) { var _a, _b, _c, _d; var fillColor = ((_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.backgroundColor) || ((_d = (_c = node.data) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.borderColor); return fillColor !== null && fillColor !== void 0 ? fillColor : ""; }; var borderColor = function (node) { var _a, _b, _c, _d; var strokeColor = ((_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.borderColor) || ((_d = (_c = node.data) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.backgroundColor); return strokeColor !== null && strokeColor !== void 0 ? strokeColor : ""; }; export var miniMapUtils = { nodeClassName: nodeClassName, nodeColor: nodeColor, borderColor: borderColor, }; //# sourceMappingURL=utils.js.map