Skip to content

Add style interfaces to plottables#3666

Merged
swharden merged 18 commits intomainfrom
3658
Apr 16, 2024
Merged

Add style interfaces to plottables#3666
swharden merged 18 commits intomainfrom
3658

Conversation

@swharden
Copy link
Member

@swharden swharden commented Apr 15, 2024

This PR tracks creation of abstract "style properties" classes which can be inherited by plottable classes which have objects like LabelStyle, LineStyle, MarkerStyle, etc. to provide top-level shortcut properties to things like LabelRotation, LineWidth, and MarkerSize.

This strategy minimizes code duplication inside plottables and standardizes how these configurations are set (e.g., TextSize vs. FontSize)

Resolves #3658

  • LabelStyle
  • LineStyle
  • FillStyle
  • MarkerStyle
  • ArrowStyle

@swharden swharden marked this pull request as ready for review April 15, 2024 22:16
@swharden swharden enabled auto-merge April 15, 2024 22:16
@swharden swharden disabled auto-merge April 15, 2024 22:16
@swharden
Copy link
Member Author

swharden commented Apr 15, 2024

Oof... can't do multiple inheritance in C# 💀

I can use interfaces, but that's a pain because the plottable developer will have to implement tons of little helper methods. I may have to rethink this strategy.

So close! Default interface implementation methods were added in C# 8, but I can't use them since the app targets .NET Framework 😩

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface#default-interface-members

LabelStyle is the worst so if I can only pick one, I'll implement LabelStyleProperties

work needs to be done in #3669 for the same properties to apply to all plottables
@swharden swharden changed the title Add style properties classes Add style interfaces to plottables Apr 16, 2024
@swharden swharden enabled auto-merge April 16, 2024 00:05
@swharden swharden merged commit 6c0e4f9 into main Apr 16, 2024
@swharden swharden deleted the 3658 branch April 16, 2024 00:06
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.

LabelStyle: add interface and helper base class

1 participant