@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
28 lines • 1.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.miniMapUtils = void 0;
const Intent_1 = require("../../../common/Intent");
const constants_1 = require("./../../../configuration/constants");
const nodeClassName = (node) => {
var _a;
const typeClass = `${constants_1.CLASSPREFIX}-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.
const intentClass = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.intent) ? (0, Intent_1.intentClassName)(node.data.intent) : "";
return `${typeClass} ${intentClass}`;
};
const nodeColor = (node) => {
var _a, _b, _c, _d;
const 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 : "";
};
const borderColor = (node) => {
var _a, _b, _c, _d;
const 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 : "";
};
exports.miniMapUtils = {
nodeClassName,
nodeColor,
borderColor,
};
//# sourceMappingURL=utils.js.map