Skip to content
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

[FLAG-1145][FLAG-1110] Support legend in bar chart widgets + add legend primary forest loss widget #4859

Merged
merged 10 commits into from
Oct 28, 2024

Conversation

SARodrigues
Copy link
Collaborator

@SARodrigues SARodrigues commented Sep 26, 2024

Overview

This PR adds a new WidgetChartLegend component to display legends below a chart.
Although it's currently being imported in WidgetComposedChart, it is made to be very generic and to work in a widget's body. It could potentially be displayed below other chart types.

Although it is built focused on column support (with optional titles), it does have a vertical prop to display columns vertically. This support is due to the inability to display columns in the map/analysis, but could be used if added to other widgets that are half size.

Notes:

  • This PR is primarily to add support for this type of legend as requested; I've added a legend quickly to the emissions widget just for demonstration of the multi-column & title support. There is no active task to add the legend to the widget, so I just quickly matched it to the designs.
    • I'll be ensuring that support is to be removed before this PR gets merged
  • This PR does include implementation for display in the forest loss widget, FLAG-1110.

Screenshots

legend_pfl_dashboard
legend_drivers_dashboard
legend_pfl_analysis
legend_drivers_analysis

Testing

Where to find two widgets with examples in order to verify the new legend support and options:

  • Gas emissions by dominant driver:
    • Dashboard:
      • Select "Brazil"
      • Click on the "Climate" tab
    • Map
      • Run analysis on "Brazil"
      • Select on "Climate"
      • Select the "Forest greenhouse gas emissions" layer
  • Primary forest loss
    • Dashboard
      • Visit the "Summary" tab
    • Map
      • Run analysis on "Brazil"
      • Select "Forest change"
      • Activate the "Tree cover loss" layer

Tracking

  • FLAG-1145 | Support legend in bar chart widgets
  • FLAG-1110 | Add annotation for dotted line on primary forest loss widget

@SARodrigues SARodrigues self-assigned this Sep 26, 2024
@SARodrigues SARodrigues marked this pull request as ready for review September 26, 2024 14:17
Copy link
Collaborator

@willian-viana willian-viana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@SARodrigues SARodrigues temporarily deployed to gfw-staging-pr-4859 October 17, 2024 11:32 Inactive
@SARodrigues SARodrigues temporarily deployed to gfw-staging-pr-4859 October 24, 2024 10:46 Inactive
Code used only for visual example of the support of columns & titles
@SARodrigues SARodrigues temporarily deployed to gfw-staging-pr-4859 October 28, 2024 12:26 Inactive
@SARodrigues SARodrigues merged commit 8186945 into develop Oct 28, 2024
4 checks passed
@SARodrigues SARodrigues deleted the FLAG-1145-support-legend-in-bar-chart-widgets branch October 28, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants