BugFixes to Rotated SignalXY plots #3921
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reolution for #3812 had introduced an incorrect final pixel location for rotated SignalXY plots.
This was resolved by a swapping of Xs and Ys coordinates when defining the additional "lastPoint" value.
Note, we could consider renaming Xs and Ys to something like independentValues and dependentValues respectively. Not sure if that will be intuitove to all developers though.
Using the sample code provided in comment on #3812 the fix provided no longer shows a distored line at top of the plot:
![image](https://private-user-images.githubusercontent.com/119825052/337956782-8a9f638f-2c9d-494d-8912-d81cf74da02a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0OTQ2OTIsIm5iZiI6MTcyMTQ5NDM5MiwicGF0aCI6Ii8xMTk4MjUwNTIvMzM3OTU2NzgyLThhOWY2MzhmLTJjOWQtNDk0ZC04OTEyLWQ4MWNmNzRkYTAyYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyMFQxNjUzMTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02NzNiZDg1NmYyMTNlNWFjZWJjZTNhN2FmOGFhZTRjYWMzOWMyZGVhNjY4ZTk0OTQ2ZDM3OTRjOTFkNGZmOGQzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.IPRShiA5cr9YNiW02vOTQbORtPUwy02Y3mxh3WRbPY0)
Second bug was pre-existing, and became apparent when zoomed into the series to observe the final pixel.
Rotated SignalXY series were performing an incorrect interpolation for the final pixel location (another mix-up of Xs and Ys).
Code to demonstrate this issue is as follows:
This plots a normal SignalXY and a rotated SignalXY on the same graph.
Before the bug fix, this becomes distorted when panning the content up or down:
After the bug fix the plot keeps its cross shape while scrolling off the page in any direction:
![image](https://private-user-images.githubusercontent.com/119825052/337956705-db874073-d8be-4dc9-9ffd-6d9debd0450a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0OTQ2OTIsIm5iZiI6MTcyMTQ5NDM5MiwicGF0aCI6Ii8xMTk4MjUwNTIvMzM3OTU2NzA1LWRiODc0MDczLWQ4YmUtNGRjOS05ZmZkLTZkOWRlYmQwNDUwYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyMFQxNjUzMTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZWZiMTJlNTU0ZjYzODkzM2FlYzEyOTdmNGY2ZjJkMjYwZGJiNGM0OTc2ZDc0ZWU5YWFlODE0ZTg2MjFlOGVmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Wv2ByWBIMDvcRE75f2uhI-7JtNe8eEeh1_xRT9Xdfg4)