deephaven / web-client-ui

Deephaven Web Client UI
Apache License 2.0
29 stars 31 forks source link

feat: Allow ref callback for Chart and ChartPanel #2174

Closed mattrunyon closed 1 month ago

mattrunyon commented 1 month ago

Needed for https://github.com/deephaven/deephaven-plugins/issues/657 because when using ChartPanel containerRef is undefined on first render due to the loading logic. This means we need to allow a ref callback so we can use a callback to set state in the plugin and add event listeners to the container when it actually exists

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Project coverage is 46.67%. Comparing base (a5cb947) to head (8b3ca50). Report is 4 commits behind head on main.

Files Patch % Lines
packages/chart/src/Chart.tsx 0.00% 2 Missing :warning:
...ages/components/src/spectrum/comboBox/ComboBox.tsx 0.00% 1 Missing :warning:
packages/components/src/spectrum/picker/Picker.tsx 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2174 +/- ## ======================================= Coverage 46.67% 46.67% ======================================= Files 692 692 Lines 38628 38624 -4 Branches 9631 9625 -6 ======================================= Hits 18028 18028 + Misses 20589 20585 -4 Partials 11 11 ``` | [Flag](https://app.codecov.io/gh/deephaven/web-client-ui/pull/2174/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=deephaven) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/deephaven/web-client-ui/pull/2174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=deephaven) | `46.67% <71.42%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=deephaven#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.