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

Export macromolecules canvas as svg image #4539

Closed
rrodionov91 opened this issue Apr 25, 2024 · 1 comment · Fixed by #4611
Closed

Export macromolecules canvas as svg image #4539

rrodionov91 opened this issue Apr 25, 2024 · 1 comment · Fixed by #4611
Assignees
Labels
feature request Test Cases Written Test cases has been written for that issue

Comments

@rrodionov91
Copy link
Collaborator

rrodionov91 commented Apr 25, 2024

Background
It needs to allow users to export macromolecules canvas as svg image from ketcher ui and api.

Solution

  1. Export svg from ketcher ui
    New option "SVG Document" should appear in "file format" dropdown "Save Structure" dialog.
    When option selected system should export all structures drawn on canvas to svg format. Image should be displayed in preview window of dialog.
    When "Save" button pressed system should download file with svg image content.

  2. Export svg from ketcher api
    Implement new api methods:

  • ketcher.exportImage(format, params) - format: ["svg"], params = { margin: number }
  • ketcher.setMode(mode) - flex | sequence | snake
  • ketcher.setZoom(zoom) - zoom: number [0.2 ... 4], default value (no zoom) = 1
  1. Additional requirements for svg image
    Image should be scaled to fit all drawn structures with small offset from image borders.
    Elements should not be interactive, so all corresponding styles should not be included in export.
    Elements should be displayed in same as they drawn on canvas according selected mode(flex/snake/sequence).
    Temporary objects(monomer preview near cursor, css cursor, selectors and e.t.c) should not be included into image.
@rrodionov91 rrodionov91 added this to the Ketcher 2.22.0-rc.1 milestone Apr 25, 2024
@AlexeyGirin AlexeyGirin added the Test Cases Written Test cases has been written for that issue label May 7, 2024
@ilya-asiyuk-epam ilya-asiyuk-epam self-assigned this May 7, 2024
@ilya-asiyuk-epam ilya-asiyuk-epam linked a pull request May 13, 2024 that will close this issue
9 tasks
ilya-asiyuk-epam added a commit that referenced this issue May 15, 2024
…as-svg-image

#4539 - Export macromolecules canvas as svg image
@AlexeyGirin AlexeyGirin self-assigned this May 17, 2024
@AlexeyGirin
Copy link
Collaborator

Verified.

  • Indigo Toolkit Version 1.21.0-dev.3.0-g6f55c664-wasm32-wasm-clang-12.0.0
  • Ketcher Version 2.21.0-rc.2 Build at 2024-05-20; 05:30:45
  • Chrome Version 124.0.6367.201 (Official Build) (64-bit)
  • Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Test Cases Written Test cases has been written for that issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants