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

Limit x-axis by filtered measurements #1827

Merged
merged 6 commits into from
Aug 20, 2024
Merged

Commits on Aug 16, 2024

  1. measurements: Replace useMemo with useCallback

    Replace the clunky use of `useMemo` with built in `useCallback`.
    Based on React docs, this should be completely equivalent
    <https://react.dev/reference/react/useMemo#memoizing-a-function>
    joverlee521 committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    5c7fd47 View commit details
    Browse the repository at this point in the history
  2. measurements: Limit xScale by filtered measurements

    Resolves #1814
    
    Includes a new `useDeepCompareCallback` wrapper to be able to do a
    deep comparison of the filtered measurements array so that the `xScale`
    does not change on every re-render.
    joverlee521 committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    d46db51 View commit details
    Browse the repository at this point in the history
  3. measurements: Pad x-axis

    Add padding to x-axis by padding the domain of the xScale.
    Copied the example shared in open issue to support this natively in
    d3-scale
    
    <d3/d3-scale#150 (comment)>
    joverlee521 committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    87b4446 View commit details
    Browse the repository at this point in the history
  4. measurements/createXScale: Add paddingProportion param

    Based on feedback from @huddlej
    <87b4446#r1720389378>
    
    I added as optional param here with a default value of 0.1
    In the future, we can potentially feed in a user defined value from
    the measurements JSON.
    joverlee521 committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    c302939 View commit details
    Browse the repository at this point in the history
  5. measurements: Fix drawMeansForColorBy bug that excluded undefined

    Fixes bug flagged by @huddlej in review
    <#1827 (review)>
    
    Previously, measurements that were group by `undefined` did not have a
    mean for display because the panel was only iterating over existing
    legend values.
    joverlee521 committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    b201e5c View commit details
    Browse the repository at this point in the history
  6. Update changelog

    joverlee521 committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    6bb14a6 View commit details
    Browse the repository at this point in the history