UNPKG

@eclipse-glsp/graph

Version:

The typescript implementation of the GLSP graphical model (GModel)

39 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GLayoutableBuilder = exports.isGLayoutable = exports.GLayoutable = void 0; exports.GLayoutable = Symbol('GLayoutable'); function isGLayoutable(element) { return exports.GLayoutable in element && element[exports.GLayoutable] === true; } exports.isGLayoutable = isGLayoutable; var GLayoutableBuilder; (function (GLayoutableBuilder) { function addLayoutOption(builder, key, value) { const proxy = builder['proxy']; if (!proxy.layoutOptions) { proxy.layoutOptions = {}; } proxy.layoutOptions[key] = value; return builder; } GLayoutableBuilder.addLayoutOption = addLayoutOption; function addLayoutOptions(builder, layoutOptions) { const toAssign = {}; const proxy = builder['proxy']; if (layoutOptions instanceof Map) { [...layoutOptions.keys()].forEach(key => (toAssign[key] = layoutOptions.get(key))); } else { Object.keys(layoutOptions).forEach(key => (toAssign[key] = layoutOptions[key])); } if (proxy.layoutOptions) { Object.assign(proxy.layoutOptions, toAssign); } else { proxy.layoutOptions = toAssign; } return builder; } GLayoutableBuilder.addLayoutOptions = addLayoutOptions; })(GLayoutableBuilder || (exports.GLayoutableBuilder = GLayoutableBuilder = {})); //# sourceMappingURL=glayoutable.js.map