-
Notifications
You must be signed in to change notification settings - Fork 2
Add learning by sector,regions bar chart and Map for learning #1577
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
Add learning by sector,regions bar chart and Map for learning #1577
Conversation
|
89e0a01
to
e80e0a5
Compare
e80e0a5
to
3bde6b9
Compare
3bde6b9
to
3ef7309
Compare
3ef7309
to
a9f5ebb
Compare
a9f5ebb
to
3071d1b
Compare
6af5950
to
087c25b
Compare
92f7f35
to
b9a1d6a
Compare
- include the `endDate` if it matches the exact start of a year
dc97d89
to
3123692
Compare
c1f350e
into
project/operational-learning-2.0
const oldestDate = new Date(Math.min(...dates.map((date) => date.getTime()))); | ||
const latestDate = new Date(Math.max(...dates.map((date) => date.getTime()))); |
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.
We need to check if length of days is zero.
compactMessage | ||
pending={learningStatsPending} | ||
empty={isDefined(learningStatsResponse?.learning_by_sector) && ( | ||
(learningStatsResponse?.learning_by_sector.length ?? 0) < 1 |
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.
No need to add default value if isDefined is already used.
withInternalPadding | ||
compactMessage | ||
pending={learningStatsPending} | ||
empty={isDefined(learningStatsResponse?.learning_by_region) && ( |
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.
No need to add default value if isDefined is already used.
pending={learningStatsPending} | ||
childrenContainerClassName={styles.chartContainer} | ||
empty={isDefined(learningStatsResponse?.sources_overtime) && ( | ||
(learningStatsResponse?.sources_overtime.length ?? 0) < 1 |
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.
No need to add default value if isDefined is already used.
strings.sourceOthers, | ||
]); | ||
|
||
const activePointData = activePointKey ? sourcesOverTimeData?.[activePointKey] : undefined; |
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.
Let's use isDefined.
<div className={styles.legendLabel}> | ||
{strings.sourcesTypeLegendLabel} | ||
</div> | ||
<div className={styles.legendContent}> |
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.
Do we mount the container if the list of items is zero?
const features = learningByCountry | ||
?.map((value) => { |
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.
const features = learningByCountry | |
?.map((value) => { | |
const features = learningByCountry | |
.map((value) => { |
Addresses:
Changes
Depends on
This PR doesn't introduce:
console.log
meant for debugging