Skip to content

Conversation

@mosoriob
Copy link
Collaborator

@mosoriob mosoriob commented Jun 4, 2025

Overview

This PR introduces significant improvements to the Line Confidence Chart's interaction model, replacing the brush-based navigation with a more intuitive zoom-based approach. The changes enhance user experience by providing smoother zooming capabilities and better control over the visualization.

Key Changes

1. Zoom Behavior Enhancement

  • Replaced d3-brush with d3-zoom for more natural interaction
  • Implemented smooth zoom transitions with configurable zoom levels (1x to 1000x)
  • Added wheel-based zooming support with customizable zoom speed
  • Introduced touch support for mobile devices

2. UI/UX Improvements

  • Improved tooltip positioning and layout
  • Enhanced loading state visibility during sample size changes
  • Optimized chart dimensions for better space utilization

3. Code Structure Improvements

  • Removed OverviewChart component in favor of integrated zoom functionality
  • Enhanced event handling to prevent event bubbling issues
  • Improved pointer event handling for better interaction layers
  • Added proper cleanup for zoom event listeners

4. Performance Optimizations

  • Optimized rendering of data points and interaction layers
  • Improved memory management with proper cleanup of event listeners
  • Enhanced state management for zoom behavior

Technical Details

  • Implemented new useChartBrush hook (renamed but now handles zoom behavior)
  • Added proper TypeScript types for all new functionality
  • Improved error handling and null checks
  • Enhanced accessibility with proper ARIA attributes

Testing

Please test the following scenarios:

  1. Zoom in/out using mouse wheel
  2. Pan the chart by dragging
  3. Reset view functionality
  4. Touch interactions on mobile devices
  5. Loading states during sample size changes
  6. Tooltip behavior with new positioning

Screenshots

[Add relevant screenshots showing the new zoom behavior and UI improvements]

Related Issues

[Link to any related issues or tickets]

mosoriob added 10 commits June 2, 2025 10:23
- Introduced an option to filter data in the Chart component based on parametric upper and lower bounds, improving data accuracy in visualizations.
- Updated max and min calculations to conditionally use filtered values, enhancing the overall functionality of the chart.
- Refactored TimeSeriesGraph layout for better responsiveness and user experience.
…cales

- Enhanced error messages in LineConfidenceChart to provide specific feedback when scales, paths, or axis ticks are unavailable.
- Updated useChartScales to check for undefined values in xExtent and yExtent, improving robustness in scale calculations.
- Adjusted Chart component to conditionally use maxValueChart for min-max calculations, ensuring accurate data representation.
- Introduced state management for maxValueChart and minValueChart in LineConfidenceContext to streamline data handling.
…g and user interaction

- Updated Chart component to adjust min-max calculations, ensuring more accurate data representation.
- Introduced aggregation interval selection in Controls component, allowing users to choose from various time intervals for data aggregation.
- Improved error handling in LineConfidenceContext to set aggregation interval only when data is available, enhancing robustness.
…roved data handling

- Removed unused OverviewChart import and showAreaOverview prop from LineConfidenceChart.
- Adjusted xFormatter logic in LineConfidenceChart to conditionally use xFormatterOverview based on showLineOverview.
- Enhanced MainChart to accept showLineOverview prop, allowing for conditional rendering of the zoom container.
- Updated event handling in MainChart to prevent event bubbling for data point interactions, improving user experience.
…ved layout and functionality

- Adjusted height calculations in useChartDimensions to set the main chart height to 700.
- Modified LineConfidenceChart to use mainInnerHeight for overview inner height, enhancing layout consistency.
- Updated ChartTooltip positioning to improve visibility by adjusting the tooltip's vertical offset.
- Enhanced useChartBrush to include a filter for zoom events, ensuring better user interaction.
- Refactored Chart component to improve date formatting in xFormatter and xFormatterOverview for consistency.
…components

- Removed 'second' option from aggregation interval selection in Controls component.
- Updated AggregationInterval type to exclude 'second' across relevant files.
- Adjusted default aggregation interval to 'minute' when data is available, enhancing user experience and consistency in data handling.
…ce components

- Introduced a sample size dropdown in the Controls component, allowing users to select the number of data points for visualization.
- Enhanced MainChart to display a loading indicator based on both loading states and sample size loading, improving user feedback during data processing.
- Updated LineConfidenceContext to manage sample size state and loading status, ensuring consistent data handling across components.
… layout

- Modified text positioning in MainChart for improved alignment with chart dimensions.
- Updated MeasurementsSummary to change grid layout from three columns to two on larger screens, enhancing visual consistency.
- Renamed button text from "View Line Confidence" to "View Time Series" for clarity in navigation.
…visualization

- Updated ChartTooltip to adjust positioning based on window dimensions, ensuring better visibility.
- Added GeometryMap component to display geographical data within the tooltip.
- Modified MeasurementsSummary by removing unused icon import, streamlining the component.
@netlify
Copy link

netlify bot commented Jun 4, 2025

Deploy Preview for dso-tacc ready!

Name Link
🔨 Latest commit 6c362d8
🔍 Latest deploy log https://app.netlify.com/projects/dso-tacc/deploys/68404cf2f7d151000837b9ee
😎 Deploy Preview https://deploy-preview-89--dso-tacc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mosoriob mosoriob merged commit 7de3f32 into main Jun 4, 2025
4 checks passed
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.

2 participants