Skip to content

Commit

Permalink
Add methods for getting SVG and JSON metadata in NAD viewer (#152)
Browse files Browse the repository at this point in the history
Signed-off-by: massimo.ferraro <[email protected]>
  • Loading branch information
massimo-ferraro authored Jan 17, 2025
1 parent fda6b0c commit eb46496
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,14 @@ export class NetworkAreaDiagramViewer {
}
}

public getSvg(): string | null {
return this.svgDraw !== undefined ? this.svgDraw.svg() : null;
}

public getJsonMetadata(): string | null {
return JSON.stringify(this.diagramMetadata);
}

public getDimensionsFromSvg(): DIMENSIONS | null {
// Dimensions are set in the main svg tag attributes. We want to parse those data without loading the whole svg in the DOM.
const result = this.svgContent.match('<svg[^>]*>');
Expand Down

0 comments on commit eb46496

Please sign in to comment.