-
Notifications
You must be signed in to change notification settings - Fork 77
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
Many properties are not properly saved by the drawingJSON() function #307
Comments
Thanks reporting the problem. This function was not used much and not fully tested. |
When adding new text line to the TPaveText (like title), reset all attributes. By default attributes of TPaveText has to be used
When adding new text line to the TPaveText (like title), reset all attributes. By default attributes of TPaveText has to be used
This options will be used to draw histogram again
When adding new text line to the TPaveText (like title), reset all attributes. By default attributes of TPaveText has to be used
Many problems should be fixed now:
Please try code in master branch or from https://jsroot.gsi.de/dev If you still see problems - please report them here. |
Thank you for looking into this. I have tried the latest version from the master branch, but perhaps I did something wrong as the results are quite confusing. I can confirm that now the background colour of the StatBox is preserved, but it seems that the text colour is not. |
Please ignore my comment about the TPaveText attributes. I have realised that the background colour changes were not visible because the fill style was set t 1, which I think means transparent. When I changed this, the colours have changed as well and these changes were correctly preserved. |
If changed interactively - also chnge pad attributes
To be sure to using latest JSROOT code - always clear browser cache before. |
|
If you just want update histogram drawing - you can use redraw() function of JSROOT. It should preserve interactive changes done by the user and only update histogram content. You can try to test interactive attributes changes of TH1 histogram here: https://root.cern/js/latest/demo/update_draw.htm It should be also possible with canvas drawn after using It would be nice to see reproducer with |
Thank you, I'll give it a try. |
Now I see. Please use "col" instead of "hist" as draw option. I will fix this problem |
Thank you, this works! |
It is intended behavior. In "replica" histogram object drawn as is. And if you try to redraw it - all graphics attributes are updated from new content. In original drawing changes made interactively and therefore preserved also after object update. The only solution I see - modify directly only histogram content after you got new histogram. And then do redraw.
|
Thank you again, the proposed solution works. |
While interactive changes stored in special painter objects. These painter objects did not stored in JSON with |
I think I'm still missing something. You are saying that the "painter objects are not stored in JSON", but then how the state of these attributes, which have been interactively modified is preserved when the JSON is drawn in another canvas? |
While each histogram has line attributes. Changing line width one changes |
All mentioned improvements are now published in 7.7.0 release. If you still see problems - you can reopen this issue or open new one |
Hi
Trying to save and restore histogram state to and from JSON, I have noticed that many properties are not correctly saved to JSON if they had been modified using interactive menus. For example for Frame, TCanvas, TPaveText, TPaveStats, TH1X, TH2X classes the following attributes:
are not taken into account. Could this be fixed?
Cheers
The text was updated successfully, but these errors were encountered: