Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Configuring parameters for png export in embed mode #1590

Closed
2 tasks done
hediet opened this issue Dec 9, 2020 · 5 comments
Closed
2 tasks done

Feature Request: Configuring parameters for png export in embed mode #1590

hediet opened this issue Dec 9, 2020 · 5 comments

Comments

@hediet
Copy link

hediet commented Dec 9, 2020

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe.
Some users of the Draw.io VS Code extension would love to set parameters when exporting or saving the diagram as png image. Most importantly, this includes the zoom parameter.

Describe the solution you'd like
If embedded mode consumers could specify the following parameters in the export action, I could implement that feature in the Draw.io extension:
95143512-90189e80-0776-11eb-8457-a3d6e246a354

This could look like this:

{
    action: "export",
    format: "xmlpng",
    zoom: 2, // by default 1
    dark: true, // by default false
    grid: false, // by default false
    borderWidth: 0, // by default 0
}
@hediet hediet changed the title Feature Request: Configuring parameters for png export Feature Request: Configuring parameters for png export in embed mode Dec 9, 2020
@alderg
Copy link
Contributor

alderg commented Dec 9, 2020

We'll add the following optional parameters in the next release: width (px) defines the width of the image to be exported, border (px) defines the border, shadow (boolean) specifies if a shadow filter should be applied to the export, grid (boolean) specifies if a grid should be added, keepTheme (boolean) specifies if the theme should be kept (eg. for dark themes), transparent (boolean) specifies if a transparent background should be used and background (string) specifies the background color.

@alderg alderg closed this as completed Dec 9, 2020
@hediet
Copy link
Author

hediet commented Dec 9, 2020

Thanks! How can I set a zoom level if I don't know the dimensions? I think having both a fixed width export and a fixed dpi export would be useful.

@alderg
Copy link
Contributor

alderg commented Dec 9, 2020

Not sure if I understand: We'll have a width (in pixels) and a scale (zoom), do you need something else?

@hediet
Copy link
Author

hediet commented Dec 9, 2020

So you have a scale/zoom parameter? Then I'm happy ;) You didn't mention it in your listing.

@alderg
Copy link
Contributor

alderg commented Dec 9, 2020

It was already there. But yes. We're trying to document all the options here: https://www.diagrams.net/doc/faq/embed-mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants