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

Visibility rework #1656

Merged
merged 25 commits into from
Oct 19, 2024
Merged

Visibility rework #1656

merged 25 commits into from
Oct 19, 2024

Conversation

beto-rodriguez
Copy link
Owner

@beto-rodriguez beto-rodriguez commented Oct 19, 2024

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:

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
Add new constructors to StepLineSeries<TModel> class

Introduce three constructors to StepLineSeries<TModel>:
1. Parameterless constructor.
2. Constructor with ICollection<TModel>? values.
3. Constructor with params TModel[] values.
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`.
@beto-rodriguez beto-rodriguez merged commit 36c8b18 into dev Oct 19, 2024
4 checks passed
@beto-rodriguez beto-rodriguez deleted the fix-1164 branch October 19, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant