-
Notifications
You must be signed in to change notification settings - Fork 594
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
Visibility rework #1656
Merged
Merged
Visibility rework #1656
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This event seems useless, since we can use the PropertyChanged event and detect if the change was made on the IsVisible property.
The `VisibleSeries` property in `CartesianChart.cs`, `PieChart.cs`, and `PolarChart.cs` now casts each series to `ChartElement<TDrawingContext>` before checking its `IsVisible` property. This ensures the visibility check is performed on the correct type, providing the necessary implementation for the visibility check.
this will animate things when toogling visibility
Added `System.Buffers.Text` namespace to using directives. Modified `SKColor` alpha calculation in `SolidColorPaint` to use base color's alpha value multiplied by geometry's opacity for more accurate visual results.
Refactored IVectorGeometry to inherit from IPaintable<TDrawingContext> instead of IDrawable<TDrawingContext>. Added a new private field `_opacityProperty` in VectorGeometry<TSegment>` and initialized it in the constructor. Implemented new properties `Stroke`, `Fill`, and `Opacity` in VectorGeometry<TSegment> to comply with IPaintable<TDrawingContext>. Updated `DrawPath` method to handle opacity, applying an opacity mask when both `Fill` and `Stroke` are null, and throwing NotImplementedException otherwise.
This is not handled by the axis, when the axis detects that there are no bounds, then it uses the default range (0 to 10)
This is not handled by the axis, when the axis detects that there are no bounds, then it uses the default range (0 to 10)
Introduce `_GeneralTests` class in `LiveChartsCore.UnitTesting.SeriesTests` namespace with resilience tests for Box, Column, Financial, Heat, Line, Row, Scatter, and StepLine series. Implement `ChartSut` and `CartesianSut` classes for chart setup. Ensure no significant memory leaks or geometry increases in `GenericResilenceTest`.
The entire _SharedPropertiesTests.cs file has been removed. This includes all using directives, the namespace declaration, and two test methods: Visibility and VisbilityAndPaintsTasks. The Visibility method tested the visibility changes of a LineSeries in a SKCartesianChart, and the VisbilityAndPaintsTasks method tested the visibility and paint tasks of a ColumnSeries in a SKCartesianChart.
Added new test methods `PieSeriesResilienceTests` and `PolarLineSeriesResilienceTests` to the `_GeneralTests` class. Introduced `PieSut` and `PolarSut` classes to set up `SKPieChart` and `SKPolarChart` with predefined properties. These tests use the `GenericResilenceTest` method to validate the resilience of `PieSeries` and `PolarLineSeries`.
This was referenced Oct 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Toggling the
Series.IsVisible
is just buggy...After trying #1654, I noticed Visibility needs a rework, a lot of things are wrong there.
This PR cleans the visibility logic in the library, toggling the visibility property now animates properly, and finally introduces multiple new and very useful unit tests.
Related issues: