-
Notifications
You must be signed in to change notification settings - Fork 2
Add/chart to popup #73
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
Conversation
Hi @bmlancien :), I would like to invite you to work with me in this branch ( The popup is based on a template named You can also play with all chart and popup options in Please notice: you have to wait until the app loads and then go to "Ergebnisse" and click on a blackish municipality area for the popup to appear. Screenie of the unstyled popup with bar chart: |
Sure, I'd be pleased to work on this :) |
@bmlancien, a small thing popped into my mind. I integrated the title for the chart, not in the chart, but via an Can you make the appropriate changes? Drop me a line if you need help with this! Please also look at this screenie, then you should exactly know what I mean: |
@4lm Thanks for all the explanations. I preferred working on a mockups before starting implementing it. Here is the result: As mentioned to @nesnoj today, the text would go below the chart because we want to keep the focus on the chart. And the text should also be optional, because in this case (population growth) it is a bit redundant, so I would not even add anything. Important is to have something accessible, like stated in #66, it could for example be the aria-label from echarts that can read charts to screen readers. Now that I have a mockup, I'm trying to work on the code side, but I am not able to add or change CSS styles to the popup in Any idea why it is not working? |
I love it :)
I will have a look and report back! |
Works. HTML is there. The results.html is just wrapped into Maplibre-specific popup HTML. The class popup is replaced by maplibregl-popup-content. But the rest of the classes are there. Look at this gist. There I added for you all the HTML that is getting rendered. I also switched the CSS import order, so you can cleanly overwrite classes from Maplibre (see commit 216ea1f). Please note: Maplibre is a fork of Mapbox; therefore, the team of Maplibre left all CSS identifiers named Please also note: my wire up SCSS example I created for you in I wish you a happy styling session :) |
Ok, thanks for the explanations @4lm! This is what I thought so, the
Alright :) |
@bmlancien, please not. I made changes to the test API JSON and dependent JS implementation in this PR branch to reflect changes made in #77. Please look those changes made in 391ac4c. Should be self-explanatory, If not, drop me a line, I'm happy to help! |
@4lm I updated the popup with the new design. Please check that I haven't destroyed anything :) There are also two other things:
|
Very nice. Looks good to me. Thank you.
OK :)
This is by design. Changing this would also require other changes to make it acceptable to the user. We also had this behavior (click on a municipality to show a popup) in the prior Stemp ABW app. I would suggest keeping it like it is for now, and if we have later time and still want to change this, look at it. OK?
No problem. I will integrate this before I open this PR for review. |
@henhuy, this PR is ready for review now. Please merge on approval. |
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.
Thanks for implementing charts in popups. Looks very nice indeed.
Only some little change requests..
const {chart: {data: {series}}} = response; | ||
const xAxisData = createListByName("key", series); | ||
const yAxisData = createListByName("value", series); | ||
const option = { |
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.
I would suggest loading a chart option style file with named options for different charts from outside.
And afterwards fill remaining fields with data from visualization request.
What do you think?
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.
Yes, of course, but not in this PR - I would suggest. This version lacks a proper API and only has one fixed chart type. The code in this PR is a first step, a MacGyver Implementation, held together by a thread, a piece of chewing gum, and some Gaffa tape. I would suggest implementing your suggestion in another PR when we have more data to play with and, therefore, different chart types. As said before, I want to make smaller PRs, to move faster. What do you think? Is this OK for you? I do not insist on my points if they are not absolutely important to me, and this one is NOT absolutely important to me!
</span> | ||
`; | ||
} | ||
if (field === "description") { |
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.
If clauses for title, municipality and description almost look the same - maybe refactor to DRY?
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.
Yes, I also suggest postponing this to a different PR. Because as you can see in the many TODO
comments, this code implementation will change a lot in the future. No stone will be left untouched. But for now, I would leave it like this because it makes IMO little sense to change something that will totally be changed in the future. If I keep the if-clauses, work with switch-cases or some function calls is TBD and would be determined in the future. Is that OK for you?
digiplan/templates/map.html
Outdated
|
||
{{ block.super }} | ||
|
||
{% compress css %} |
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.
why did you add a second compress
block?
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.
To implicitly make clear to others that there is the possibility to also add css after the super block. I don't know, I felt like it, maybe a YAGNI case?
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.
I will remove the second compress block.
No problem for me. Let's see later, maybe with user testing, how it integrated well in the app
Cool, thanks! :) |
@henhuy, from my point of view, this PR is ready for re-review. As written, I would postpone some requested changes to a future PR. |
This PR adds dynamic titles, descriptions, charts, and sources to popups.