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

[FE] Bar Chart widget #129

Open
01painadam opened this issue Jan 31, 2025 · 0 comments
Open

[FE] Bar Chart widget #129

01painadam opened this issue Jan 31, 2025 · 0 comments
Assignees

Comments

@01painadam
Copy link
Collaborator

01painadam commented Jan 31, 2025

Goal

Implement a bar chart widget and summary text to consume annual data loaded into RAG, such as:

  • gfw_forest_carbon_gross_emissions_all_gases – Annual gross emissions (Mg CO2e)
  • umd_tree_cover_loss – Annual tree cover loss (ha)
  • {year}_cultivated_ha – Annual cultivated grassland area (ha)
  • {year}_nsn_ha – Annual natural/semi-natural grassland area (ha)
  • {year}_GPP_gc_m2 – Annual Gross Primary Productivity (gC per m²)

Designs

Chart

The bar chart visualises annual data across the portfolio of Key Biodiversity Areas (KBAs).

Chart Features

  • Annual bars representing selected dataset values
  • Legend for data categories
  • y-axis labels with units
  • Tooltips displaying data values (e.g. tree cover loss in ha and year)

Example:

Bar Chart Example

Title and Summary Text

Each chart is accompanied by dynamically generated summary text, tailored to the user persona via LLM processing.

Summary Text Requirements

  • Quantitative data retrieved from RAG
  • Qualitative descriptive data from KBA factsheets (also in RAG)
  • Data sources, citations, or disclaimers for transparency (e.g. limitations, cautions)
  • Title automatically defined by LLM

Edit/Save Interface

The widget allows users to refine the summary text using:

  • Quick-select buttons:

    • Concise – Shortens the summary
    • Simplify – Adjusts language for accessibility
    • Explain – Adds detail and context
  • Chat-based interaction: Users can edit text manually, request alternative phrasing, or modify data visualisation aspects before saving.

  • "Add to Dashboard" button: Saves the final edited version to the dashboard.

Scope

In Scope

  • Bar chart visualisation with configurable dataset selection (for annual data only? see future work)
  • Persona-based summary text generation using relevant RAG data for chart and text
  • Chat-based interactions for summary editing
  • Context-aware buttons for modifying summaries
  • Save the final output to the dashboard (and in local storage)

Out of Scope

  • Editing does not persist previous versions of summaries or charts
  • No full customisation of chart styling beyond standard controls
  • Share/export e.g. data download, share url

Acceptance Criteria

Chart Display

When I am viewing the dashboard,
I want to see a bar chart visualising annual data,
So that I can quickly understand trends in key environmental indicators.

Acceptance Criteria:

  • The bar chart correctly displays the selected dataset
  • The chart includes a legend, axis labels, and tooltips
  • Data updates dynamically based on the selected time range

Summary Text Generation

When I am reviewing a data visualisation,
I want to see a natural-language summary alongside the chart,
So that I can easily interpret the key takeaways, actions without deep analysis.

Acceptance Criteria:

  • The LLM generates summary text based on the selected dataset and user persona
  • The summary includes quantitative data, qualitative insights, and citations where relevant

Summary Editing & Refinement

When I want to adjust the generated summary,
I want to modify the text using quick actions or chat,
So that I can tailor the insights to my communication needs.

Acceptance Criteria:

  • Quick-select buttons adjust summary length and complexity
  • Users can manually edit the summary or request changes via chat
  • The final edited version is saved when added to the dashboard

Saving to Dashboard

When I finalise a chart and its summary,
I want to save it to my dashboard,
So that I can reference it later or share it with others.

Acceptance Criteria:

  • Clicking "Add to Dashboard" saves the final edited version
  • The saved version retains all edits and selections

Risks & Questions

Data Integrity

  • How do we handle missing or incomplete annual data in the RAG source?
  • Should we offer fallback descriptions when certain data points are unavailable?

User Experience

  • Should users be able to compare multiple locations within one chart?
  • Should we include non-annual data aggregation for bars? e.g. aggregations by species or habitat

LLM Processing

  • Should summary generation be fully automated, or should users confirm the text before saving?
  • How do we ensure the LLM maintains factual accuracy and does not over-interpret trends?

Solution Hints

  • Use a structured layout with tooltips and labels for clarity
  • Ensure summary text is concise but informative, adapting to user personas
  • Allow simple, non-destructive edits with preview before saving

Future Work

...

@01painadam 01painadam added this to the Monitoring workflow milestone Jan 31, 2025
@01painadam 01painadam changed the title [FE] Bar Chart [FE] Bar Chart widget Jan 31, 2025
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

No branches or pull requests

2 participants