-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: print spectra #2786
feat: print spectra #2786
Conversation
hamed-musallam
commented
Dec 4, 2023
- Printing spectrum #2781
Deploying nmrium with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2786 +/- ##
=======================================
Coverage 53.42% 53.42%
=======================================
Files 52 52
Lines 2456 2456
Branches 95 95
=======================================
Hits 1312 1312
Misses 1143 1143
Partials 1 1 ☔ View full report in Codecov by Sentry. |
3d3f7ce
to
48eaf2d
Compare
48eaf2d
to
0073612
Compare
Could you finalize this PR ? The goal is that when you print from the browser fill either an A4, B4, Letter (?) page depending of your general preferences. It could be related to: https://stackoverflow.com/questions/16649943/css-to-set-a4-paper-size Currently we have in the bottom the grey banner that should not be present and some green edit buttons on the top. The size is also not setup automatically and it currently depends on the size of your browser window. |
0073612
to
72a00bc
Compare
489c4cb
to
33d5535
Compare
Looks great, thanks ! Couple of little points: I found out that the place we put the delta(ppm) is different in 1D and 2D. 1D it is in the grey banner in the bottom: 2D it is over this grey banner This has as consequence than when printing currently we need to display this banner and for 2D it appears like an empty grey banner: 2 possibilities:
I would go for the first possibility even if we loose a little bit of space for the spectrum. The second issue is how the size of the paper is expected to be decided ? I didn't see in the code the selection of the paper size and if I change to A3 for example the spectrum would not enlarge: On firefox there are also 2 pages rather than one: Did you know that you can emulate the @media: print from the developer tools? When I do this, we have the panels on the right and a grey zone at the bottom: If you need a new feature to hide the panels when printing (from react-science), do not hesitate to ask us. |
@targos Hamed wrote me:
You was speaking to me about some features of react that allows to copy dom possibly in another window. Could you detail a little bit this idea ? |
My idea is really abstract for now. I don't know how to do it (the React feature is |
067c82a
to
b2b6bc8
Compare
Would using https://stackoverflow.com/questions/1234008/detecting-browser-print-event help in order to catch the 'File -> print' event ? |
Dialog box is really a great idea ! Could you save this information in the workspace as well so that it remembers the choice ? I don't think it is the case currently. |
it still not, We should save them within the workspace. Should we store them at the top level as follows? {
printPageOptions: {
layout: 'portrait',
size: 'A4',
padding: '0cm'
}
} Or should they be included under the 'general' section in the 'General' tab of the general settings? |
As long as we always present the print dialog we don't need to add it in the general preferences but this could evolve in the future. It could become part of the general settings and be editable there as well. |
b136045
to
65d3477
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionalities looks good to me.
aea04bc
to
d13edc9
Compare
can you test again on Firefox, Chrome, and Safari |
feat: prepare NMRium structure for printing fix: trigger printing after the NMRium viewer is rendered and rescaled to an A4 page
89a9c72
to
d408ec4
Compare