Support unwrapping complex phase values#1947
Conversation
loichuder
left a comment
There was a problem hiding this comment.
The alternative would be for usePhaseAmplitudeArrays to return three arrays (of arrays because of auxiliary signals): phaseArrays, unwrappedPhaseArrays and amplitudeArrays, but this felt messier.
I'm tempted to go back to having no optimisation at all and to just compute the phase/amplitude values when changing the complex vis type... Not sure...
Yeah it feels like we are in some kind of in-between here. Personally, I would have gone for the three arrays returned by usePhaseAmplitudeArrays. What exactly felt messy in this case ?
Don't get me wrong, I am still happy with the PR and have no qualms merging like this.
The unwrap computation is super cheap relative to rendering right? I might just recompute on the fly. |
|
@NAThompson we try not to loop over the values after toolbar interactions, as it can make the UI feel laggy for large arrays. Of course, at some point, as you've experienced, interacting with the visualization itself becomes laggy, but before we get to this extreme case, extra loops can really slow things down. It's not as bad as I first thought with the three arrays returned from |
Yeah, for sure. But I hope another complex vis option will not be needed for a while |
|
@axelboc : Thanks for all your hard work! It's awesome to see this get merged! |
Fix #1925
I add an option called "Phase (unwrapped)" to the complex vis type selector in the toolbar of the complex line visusalisation:
Screencast.from.2026-01-16.13-06-22.webm
In the proposed implementation, when selecting the unwrapped option in the drop-down, the phase/amplitude values are recomputed, which kind of breaks the optimisation I had of precomputing the arrays on initial render. The alternative would be for
usePhaseAmplitudeArraysto return three arrays (of arrays because of auxiliary signals):phaseArrays,unwrappedPhaseArraysandamplitudeArrays, but this felt messier.I'm tempted to go back to having no optimisation at all and to just compute the phase/amplitude values when changing the complex vis type... Not sure...