jstd-web/node_modules/diagram-js/lib/util/GraphicsUtil.js

27 lines
532 B
JavaScript
Raw Normal View History

2025-11-25 15:23:22 +08:00
/**
* SVGs for elements are generated by the {@link GraphicsFactory}.
*
* This utility gives quick access to the important semantic
* parts of an element.
*/
/**
* Returns the visual part of a diagram element.
*
* @param {SVGElement} gfx
*
* @return {SVGElement}
*/
export function getVisual(gfx) {
return gfx.childNodes[0];
}
/**
* Returns the children for a given diagram element.
*
* @param {SVGElement} gfx
* @return {SVGElement}
*/
export function getChildren(gfx) {
return gfx.parentNode.childNodes[1];
}