12345678910111213141516171819202122232425262728293031 |
- import {
- query as domQuery
- } from 'min-dom';
- /**
- * 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 {Snap<SVGElement>} gfx
- *
- * @return {Snap<SVGElement>}
- */
- export function getVisual(gfx) {
- return domQuery('.djs-visual', gfx);
- }
- /**
- * Returns the children for a given diagram element.
- *
- * @param {Snap<SVGElement>} gfx
- * @return {Snap<SVGElement>}
- */
- export function getChildren(gfx) {
- return gfx.parentNode.childNodes[1];
- }
|