[ENH] OWColor: Saving and loading color schemata#4977
[ENH] OWColor: Saving and loading color schemata#4977ajdapretnar merged 5 commits intobiolab:masterfrom
Conversation
47a6a9b to
c078430
Compare
Codecov Report
@@ Coverage Diff @@
## master #4977 +/- ##
==========================================
+ Coverage 84.47% 84.51% +0.03%
==========================================
Files 283 283
Lines 58344 58471 +127
==========================================
+ Hits 49289 49414 +125
- Misses 9055 9057 +2 |
|
Note to self: remove the "general" format (in a separate commit, so we still have the code in case we need it someday). The remaining code implements what the issue was about. The second format is not very useful, except as a workaround for copying colors assigned to one variable to all other variables. A better solution for this is to add "Copy to all" to discrete variables, but so far nobody needed it, so we won' t implement the feature, until somebody wants it badly enough. |
d870181 to
2c67772
Compare
3d1bbc4 to
e018fc6
Compare
|
I tried testing this but I can't seem to get a working file. I tried the first file in the first comment. What am I doing wrong? |
|
I may have changed the format (though I think I haven't). But why would you use the file from the comment? You can just change some colors and names, and save the file. |
Issue
Resolves #4890.
Description of changes
I defined two file formats. One contains all changes done by the user, e.g.
When loading the file, it's content does not have to exactly match the domain: redundant variables/values are ignored, and data for variables that does not appear in the file is retained as it is in the widget.
The second format contains general definitions of colors, like
When saving, it stores the colors for values that were changed by the user, and only if the change if the same for all variables in the domain (e.g. if all "female" that are changed are changed to the same color). When loading, it changes colors for all values that appear in any variable.
Includes