-
Notifications
You must be signed in to change notification settings - Fork 31
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
Time reference and decimal places #481
Conversation
Thanks Tom, this looks really nice. |
The failed run X status of this PR seems to be because the test export script is failing at Actually, I can reproduce the error by adding a label Otherwise, testing all looks good 👍 |
The script failed there yes, but I wouldn't do the change in With the version transform, all pdf generated from now on should have the new JSON, right? (except if someone forgot to refresh his browser for quite some time now) So I updated the JSON in the test (and reorganized it to make it look like the model in Let me know what you think about my JSON update, then let's see if the test passes this time 🤞 PS: Working on it, I spotted another bug in |
Hello Moore², I also updated the tests, the tip window, and the figure_file_format documentation accordingly. |
Sorry, not looked yet - I'm away till Wednesday... |
Ah - I blindly tried Could you update the PR description with the new format (this can also serve as a reference) |
Functionality testing looks good. Labels are rendered the same in JavaScript and Python. |
Thanks Tom - some others on the team are away just now, but I when they're back we'll discuss if there's any outstanding issues/feedback. Cheers |
@Tom-TBT Sorry if I missed it in your previous PR: Why is there the bounding box around the label such as Edit: sorry, I realized that this is because I copied and pasted into the label box couple of leading spaces. This is the cause of the strange formatting of the label later - still, pasting some spaces possibly should not have such consequences ? Will try other label types as well, possibly this is not something introduced in your PR, but just a consequence of the necessity to create the label formula by yourself. Edit 2: Indeed, this happens also with labels such as Image Name, so most probably not caused by this PR. It is just that this PR exposes such flaws as it imposes a different workflow. |
Other than #481 (comment), this PR LGTM |
Hi Petr, Looking a bit around I found this: https://gist.github.com/dupuy/1855764#block-quotations So I don't know if bug or feature since we can now add code to the labels!!! ... Well maybe more like a bug, that's a weird way of attaching code to images We could remove the leading spaces, but that could destroy someone's label alignment workflow. Let me see if I find a way of keeping the spaces without doing some markdown with it. Tell me if you would have that in this PR or in a separate one. |
Well maybe that becomes hard to handle, I went through that tutorial https://www.markdownguide.org/basic-syntax/ and many works: |
thank you @Tom-TBT , this #481 (comment) explains a lot. I would say this all is for another PR, cc @will-moore might even have an issue/plan for this. |
Created an issue for the formatting behaviour the @pwalczysko reported: #486 |
Thank you Jean-Marie for the review, I made the changes |
@Tom-TBT sorry for the delay. Thanks for making the adjustments |
Thanks @Tom-TBT - this is now released in omero-figure 5.1.0 |
Hello again,
with this PR I want to solve two issues that can be handled in the dynamic labels:
A picture is worth a thousand words:
The decimal precision and offset (the "reference frame") are passed as named parameters inside the label:
[time.seconds; precision=2]
-> parameters are specified after a;
, in the formatparam_name=value
[time.seconds; offset=3; precision=2]
-> the order of the parameter is not important[time.seconds ; offset = 3 ;precision= 2 ]
-> Spaces are not affecting the parsing[x.unit; offset=3; precision=2]
-> Here the offset is not relevant forx.unit
: it is ignored. The same happens with unknown parameters or invalid formats (no parameter name, no value, no=
sign).Finally, I added tests for the labels like @jburel suggested last time. I know that they should be run on github to test that nothing is crashing during the PDF conversion, but how would you run them locally to check visually that the output is the one we expect?
Cheers,
Tom
#########################################
EDIT: The following is kept for reference about the discussion in this PR, but the format that was ultimately picked is described above.
UI-wise, here is what I chose:
I specify the decimal precision as an integer instead of a series of '0'. The serie of '0' raises question about the implementation (should I count the characters, the zeros, what should it do when there is a mix). Also it would mean that the decimal precision can be 0 only when nothing is specified, but we already had 2 as the standard for x/y/z/width/height
decimal precision comes after the format specification (secs, ms, mins, ...). Luckily the default for time/x/y.... are indexes, so having decimal precision for them doesn't make sense. Decimal precision is always in 3rd position, never 2nd:
The frame reference for the time is given at the end, after a
-
. The time of that frame is subtracted from the other timepoints. Being the last parameter, it works both with and without decimal precision: