A Visual Studio Code extension to visualize database schemas as Entity Relationship Diagrams (ERD) from DBML or Prisma files directly within the editor.
MIT License
63
stars
7
forks
source link
Implementing the saving of the diagram as an image #67
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%20compositeSome indication about the code
hi @ayushsaini12