| 543 | } |
| 544 | |
| 545 | export class PathNode implements VirtualNode { |
| 546 | pathName: string; |
| 547 | alternate: string | null | undefined; |
| 548 | |
| 549 | constructor(pathName: string, alternate?: string) { |
| 550 | this.pathName = pathName; |
| 551 | this.alternate = alternate; // Used only for \sqrt, \phase, & tall delims |
| 552 | } |
| 553 | |
| 554 | toNode(): Node { |
| 555 | const svgNS = "http://www.w3.org/2000/svg"; |
| 556 | const node = document.createElementNS(svgNS, "path"); |
| 557 | |
| 558 | if (this.alternate) { |
| 559 | node.setAttribute("d", this.alternate); |
| 560 | } else { |
| 561 | node.setAttribute("d", path[this.pathName]); |
| 562 | } |
| 563 | |
| 564 | return node; |
| 565 | } |
| 566 | |
| 567 | toMarkup(): string { |
| 568 | if (this.alternate) { |
| 569 | return `<path d="${escape(this.alternate)}"/>`; |
| 570 | } else { |
| 571 | return `<path d="${escape(path[this.pathName])}"/>`; |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | export class LineNode implements VirtualNode { |
| 577 | attributes: Record<string, string>; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…