-
Notifications
You must be signed in to change notification settings - Fork 18
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
Features/stack labels #109
Conversation
…ligned comments with the code
I made some errors modifying some files and will rewrite it again |
Hello @ArmelVidali, Being able to stack labels layers between them and with pictogram layers sounds great ! 🎆 On the other hand, the possibility of adding the labels at the same time as the pictograms is a strong choice, I have no opinion on this yet (I'll discuss it with @rCarto - knowing that we're trying to keep the interface as simple as possible). Count on me to review your PR when the time comes (and don't hesitate to ask for guidance if needed, or even to discuss the design of specific aspects before implementing them). |
Thanks for the feedback ! I am not very used to git and github usage, I thought that i modified files unnecessarily and hence closed the request but everything seems fine, except for the "test" commit adding a point to app.py, I will reopen the request now. We would be glad to get some guidelines since we'll keep working on this project ! |
Could you rebase your branch against the current state of riatelab/magrit master branch ? |
It's done, it seems to be the right version, please let me know |
I tested it, it seems to work well and it's a really good idea! However, I have some doubts on 2 main points:
But these two points lead me to think that we should improve the current label creation menu (it is currently rather rustic, cf. your second screenshot) to allow the user to choose the font and its size at the time of creation, as well as to allow the creation of several layers of labels at once, as you have implemented in the pictogram + label menu. One could even imagine that the user could choose the size and font individually for each layer during creation (see example screenshot). To sum up, currently I'm thinking of: keeping your functionality for stacking labels, but not changing the pictogram menu. What do you think ? |
I agree it's much better to have a detailed menu when adding labels from the layer itself I initially put it in the pictogram panel because I thought it could be a good idea to have this functionnality for the proportionnal point representation as well (stock, stock and ratio, stock and qualitative, and probably waffle map but I can't find a layer for which this one works on magrit and i'm not sure what it looks like), so that the labels be stacked on any ponctual layer. Deciding under which ponctual layer it must be stacked (for example an image and a proportionnal point are displayed over the same entity) might be tricky, but I think it could work by choosing the largest, like in this example. Do you think it'd be a good idea ? As of changing the label menu from the layer I think it would look better if you added it yourself indeed |
Indeed, it could be interesting to be able to stack label layers above / below any punctual layer! (and the strategy of choosing the largest totally makes sense I guess) However maybe the user should be able to choose if he/she want to opt-in or not for this functionality because I can also see cases when stacking the label with an other punctual layer is probably not what is expected (cf. screenshot). |
Yes I think it's a good idea, it could be implemented by a simple checkbox, by stacking underneath by default for images and on the center by default for prop symbols. I will look into that ! |
After discussing with @robLittiere, we thought it might be a better idea to keep the stack labels functionnality isolated from the positionning of the labels depending on the presence of proportional symbol layer. We thought we could add the other options in subsequents pull requests. Concerning this PR, would you rather have us only keep the label stacking feature or include as well the other options like taking into account the presence of proportional symbol layer ? |
Hello @ArmelVidali, No problem, let's focus on the label stacking feature in this PR ! If I'm not mistaken, it already seems to be in good shape and almost ready to be merged? Could you just remove what you had added to the pictograms choice window? My plan is the following:
|
…options to stack under prop symbols. Removed render_multiple_label function.
It's done ! I removed as well the few unrelated lines |
client/css/discretization.css
Outdated
display: flex; | ||
flex-direction: column; | ||
} | ||
/* End of styles for list of label elements in categorical / picto panel */ |
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.
Are the changes in this file still usefull ?
This insn't usefull indeed, i removed it |
Thanks a lot ! |
Hello,
We added a functionnality together with @robLittiere and @DevGuez allowing to automatically stack labels one underneath the other when multiple labels layers are on the map, taking into account the presence or absence of pictogram layer.
Before, when multiple labels were on the map, they were stacked on top of each other.
It stacks the labels one uderneath the other by adding to their "y" coordinate the height of the image to which the label corresponds (if it is present on the map) and the font size of other labels.
This feature was made in order to work with our previous pull request so we added a list of checkbox to the menu allowing to select images and filter them in order to select labels at the same time
We are unsure about your preferences concerning user interface changes, please let us know if you would like magrit interface to stay the same, but this feature works as well when adding labels one by one from the layer menu as below, still taking into account the presence of images.
It still works when saving and loading magrit project files.