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

Generate image of the spectrum from outside component #1569

Closed
hamed-musallam opened this issue Jun 3, 2022 · 4 comments · Fixed by #1589
Closed

Generate image of the spectrum from outside component #1569

hamed-musallam opened this issue Jun 3, 2022 · 4 comments · Fixed by #1589
Labels
enhancement New feature or request

Comments

@hamed-musallam
Copy link
Member

in addition to exporting spectra as SVG, jpeg we need a way to capture and save them directly to the external data service. This has to be done from where our component is imported. for example, in Chemotion ELN they need to be able to capture the Blob of the generated image and store it as a blob in the database or store the image in the file server and store its path in the database

@lpatiny
Copy link
Member

lpatiny commented Jun 7, 2022

Could you please clarify how it should work at the point of view of the user ?

When should this image be generated ? Should the user click somewhere outside NMRium and at that time the NMRium file and PNG are generated at this moment ?

@hamed-musallam
Copy link
Member Author

hamed-musallam commented Jun 7, 2022

@lpatiny

The user can click somewhere outside NMRium or trigger an event in the NMRium Wrapper to generate an image as a blob to save it somewhere else, maybe in a database or upload it as a file in another file server.

I will ask Chandu to comment on this ticket

@lpatiny lpatiny changed the title catch generated image Generate image of the spectrum from outside component Jun 7, 2022
@hamed-musallam
Copy link
Member Author

@CS76

can you comment on this and clarify the idea if I miss things

@CS76
Copy link
Collaborator

CS76 commented Jun 9, 2022

Use case: ELNs and repositories would like to create a thumbnail or preview of the spectra for the user to quickly identify the spectra and not have to load the spectra every time.

Trigger point:
Ideally, this will be triggered behind the scenes by the parent application (via the nmrium wrapper) and NMRium just has to pass back the image/png or image/jpg blob or SVG back as a response. This will then be handled by the parent application (saved to the file system on the server or to a database).

hamed-musallam added a commit that referenced this issue Jun 21, 2022
* feat: generate blob for the spectra from an outside component
 close #1569
* refactor: rename generateBlob function to 'getSpectraViewerAsBlob'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants