| 574 | } |
| 575 | |
| 576 | export class LineNode implements VirtualNode { |
| 577 | attributes: Record<string, string>; |
| 578 | |
| 579 | constructor( |
| 580 | attributes?: Record<string, string>, |
| 581 | ) { |
| 582 | this.attributes = attributes || {}; |
| 583 | } |
| 584 | |
| 585 | toNode(): Node { |
| 586 | const svgNS = "http://www.w3.org/2000/svg"; |
| 587 | const node = document.createElementNS(svgNS, "line"); |
| 588 | |
| 589 | // Apply attributes |
| 590 | for (const attr of Object.keys(this.attributes)) { |
| 591 | node.setAttribute(attr, this.attributes[attr]); |
| 592 | } |
| 593 | |
| 594 | return node; |
| 595 | } |
| 596 | |
| 597 | toMarkup(): string { |
| 598 | let markup = "<line"; |
| 599 | |
| 600 | for (const attr of Object.keys(this.attributes)) { |
| 601 | markup += ` ${attr}="${escape(this.attributes[attr])}"`; |
| 602 | } |
| 603 | |
| 604 | markup += "/>"; |
| 605 | |
| 606 | return markup; |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | export function assertSymbolDomNode( |
| 611 | group: HtmlDomNode, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…