You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementing the saving of the diagram as an image
This issue is about saving of the diagram as an image in a file.
The user flow
To implement that, we will add a new button to the toolbar. When the user clicks on this button, the VsCode saving dialog should be open and asks him where to save the file.
When the user selects a location, the image will be saved in the location.
Implementing the saving of the diagram as an image
This issue is about saving of the diagram as an image in a file.
The user flow
To implement that, we will add a new button to the toolbar. When the user clicks on this button, the VsCode saving dialog should be open and asks him where to save the file.
When the user selects a location, the image will be saved in the location.
Some documentation
How to open the VsCode saving dialogs
Here is the documentation : https://code.visualstudio.com/api/references/vscode-api#:~:text=or%20undefined.-,showSaveDialog,-(options%3F
An usage example : https://github.com/Durandal14/vscode-extension-dbml-viewer/blob/main/src/extension.ts#L118C37-L118C51
How to generate the image
Since the plugin uses
Konva.js
we that use the provided method for create image.Here is the documentation : https://konvajs.org/api/Konva.Node.html#toImage:~:text=()%3B-,toDataURL(config),-Creates%20a%20composite
Some indication about the code
db-schema-visualizer/packages/json-table-schema-visualizer/src/components/DiagramViewer/DiagramWrapper.tsx
Line 28 in d872d32
The documentation : https://code.visualstudio.com/api/extension-guides/webview#passing-messages-from-an-extension-to-a-webview
How it is implemented in the plugin :
- handling the command server-side :
db-schema-visualizer/packages/extension-shared/extension/views/helper.ts
Lines 44 to 45 in d872d32
- sending a command from the webview :
db-schema-visualizer/packages/extension-shared/src/App.tsx
Line 37 in d872d32
hi @ayushsaini12
The text was updated successfully, but these errors were encountered: