Skip to content

Commit

Permalink
Update azdataGraph dependency to version 0.0.104 and enhance exportAs…
Browse files Browse the repository at this point in the history
… functionality in SchemaDesigner
  • Loading branch information
aasimkhan30 committed Feb 25, 2025
1 parent bbcea63 commit 694c6db
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"angular-in-memory-web-api": "0.1.13",
"angular2-slickgrid": "github:microsoft/angular2-slickgrid#1.4.7",
"assert": "^1.4.1",
"azdataGraph": "github:Microsoft/azdataGraph#0.0.103",
"azdataGraph": "github:Microsoft/azdataGraph#0.0.104",
"chai": "^3.5.0",
"cli-color": "^2.0.4",
"coveralls": "^3.0.2",
Expand Down
21 changes: 17 additions & 4 deletions src/reactviews/pages/SchemaDesigner/schemaDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,20 @@ export const SchemaDesigner = () => {
createGraph();
}, [context.schema]);

function exportAs(format: "svg" | "png" | "jpg") {
async function exportAs(format: "svg" | "png" | "jpg") {
if (!schemaDesigner) {
return;
}
const imageContent = await schemaDesigner.exportImage(format);
if (imageContent && context) {
context.saveAs(
imageContent.fileContent,
imageContent.format,
imageContent.width,
imageContent.height,
);
return;
}
// transperant background
var background = "none";
var scale = 1;
Expand Down Expand Up @@ -350,7 +363,7 @@ export const SchemaDesigner = () => {
<MenuItem
onClick={async (_e) => {
setTimeout(() => {
exportAs("svg");
void exportAs("svg");
}, 0);
}}
>
Expand All @@ -359,7 +372,7 @@ export const SchemaDesigner = () => {
<MenuItem
onClick={(_e) => {
setTimeout(() => {
exportAs("png");
void exportAs("png");
}, 0);
}}
>
Expand All @@ -368,7 +381,7 @@ export const SchemaDesigner = () => {
<MenuItem
onClick={(_e) => {
setTimeout(() => {
exportAs("jpg");
void exportAs("jpg");
}, 0);
}}
>
Expand Down
20 changes: 17 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,18 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"

"@dagrejs/dagre@^1.1.4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@dagrejs/dagre/-/dagre-1.1.4.tgz#66f9c0e2b558308f2c268f60e2c28f22ee17e339"
integrity sha512-QUTc54Cg/wvmlEUxB+uvoPVKFazM1H18kVHBQNmK2NbrDR5ihOCR6CXLnDSZzMcSQKJtabPUWridBOlJM3WkDg==
dependencies:
"@dagrejs/graphlib" "2.2.4"

"@dagrejs/graphlib@2.2.4":
version "2.2.4"
resolved "https://registry.yarnpkg.com/@dagrejs/graphlib/-/graphlib-2.2.4.tgz#d77bfa9ff49e2307c0c6e6b8b26b5dd3c05816c4"
integrity sha512-mepCf/e9+SKYy1d02/UkvSy6+6MoyXhVxP8lLDfA7BPE1X1d4dR0sZznmbM8/XVJ1GPM+Svnx7Xj6ZweByWUkw==

"@emotion/hash@^0.9.0":
version "0.9.1"
resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.1.tgz#4ffb0055f7ef676ebc3a5a91fb621393294e2f43"
Expand Down Expand Up @@ -3426,11 +3438,13 @@ axobject-query@^4.1.0:
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee"
integrity sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==

"azdataGraph@github:Microsoft/azdataGraph#0.0.103":
version "0.0.103"
resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/f4dc9aee203b7a6afb0d97eeabfe07f80cafe2cc"
"azdataGraph@github:Microsoft/azdataGraph#0.0.104":
version "0.0.104"
resolved "https://codeload.github.com/Microsoft/azdataGraph/tar.gz/a633f0d2032ceb378ad93376518e38f7d657cf1d"
dependencies:
"@dagrejs/dagre" "^1.1.4"
create-color "^2.0.6"
html-to-image "^1.11.13"
uuid "^11.0.5"

azure-devops-node-api@^12.5.0:
Expand Down

0 comments on commit 694c6db

Please sign in to comment.