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

Add rbm-viz v2.1.0. #1856

Merged
merged 7 commits into from
Oct 4, 2024
Merged

Add rbm-viz v2.1.0. #1856

merged 7 commits into from
Oct 4, 2024

Conversation

samussiah
Copy link
Contributor

@samussiah samussiah commented Sep 24, 2024

Overview

Adds new riskSignalSelected event that can be monitored by any ancestor of the widget (barChart, scatterPlot, timeSeries, groupOverview). Returns the {gsm} data associated with the clicked risk signal.

The event also fires when the widget-level group dropdown changes. For the time series, the event should return the latest data point.

Test Notes/Sample Code

  1. Generate a report.
load_all()
lCharts <- MakeCharts(
  dfResults = reportingResults,
  dfGroups = reportingGroups,
  dfMetrics = reportingMetrics,
  dfBounds = reportingBounds
)

strOutputFile <- "StandardSiteReport.html"
kri_report_path <- Report_KRI(
  lCharts = lCharts,
  dfResults = reportingResults,
  dfGroups = reportingGroups,
  dfMetrics = reportingMetrics,
  strOutputFile = strOutputFile
)
browseURL('StandardSiteReport.html')
  1. Open the report in the browser.
  2. Open the browser console and add an event listener for riskSignalSelected:
document.body.addEventListener('riskSignalSelected', (event) => {
    console.table(event.data);
});
  1. Click a point/bar and verify the underlying result is displayed in the browser console.
  2. Update the widget-level group dropdown and verify the underlying result is displayed in the browser console.
    • For the time series, verify the latest result is displayed in the browser console.

Connected Issues

Copy link
Contributor

@lauramaxwell lauramaxwell left a comment

Choose a reason for hiding this comment

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

Looks great to me! Maybe @jonthegeek should take a look to see if these updates add events with all of the information he needs for use in gsm.app

Copy link
Contributor

@jonthegeek jonthegeek left a comment

Choose a reason for hiding this comment

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

This definitely looks interesting! For the moment it still makes sense for me to wrap my own version of the widget, but I'll definitely take a close look when this is merged to see what's left in my version that isn't over here, and whether it makes sense to add issues here (or in rbm-viz) to sync the versions.

@lauramaxwell
Copy link
Contributor

@samussiah are you still working on this, or is it in draft by accident?

@samussiah
Copy link
Contributor Author

@samussiah are you still working on this, or is it in draft by accident?

@lauramaxwell - I'm waiting for feedback from the Gismo UI team. It sounds like this event will need to be triggered by the widget dropdowns as well.

It might work for @jonthegeek's purposes with a dedicated event listener on the {gsm.app} side of things - love that idea! Theoretically a single event listener could catch interactions in all widgets...

@jonthegeek
Copy link
Contributor

Theoretically a single event listener could catch interactions in all widgets...

I'm trying to keep things neatly namespaces, then recombine as makes sense. That way these could eventually work for selecting two sites to compare, for example.

Copy link
Contributor

@lauramaxwell lauramaxwell left a comment

Choose a reason for hiding this comment

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

working great, for me! feel free to merge, @samussiah

Copy link
Collaborator

@zdz2101 zdz2101 left a comment

Choose a reason for hiding this comment

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

Super cool!

@samussiah samussiah marked this pull request as ready for review October 4, 2024 17:42
@samussiah samussiah merged commit db4119f into dev Oct 4, 2024
5 checks passed
@samussiah samussiah deleted the fix-1855 branch October 4, 2024 17:42
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.

Feature: Group dropdown should trigger riskSignalSelected event. Feature: merge in updated rbm-viz index.js
4 participants