Plottable: IHasLine, IHasMarker, and IHlightable#1660
Plottable: IHasLine, IHasMarker, and IHlightable#1660swharden merged 33 commits intoScottPlot:masterfrom
Conversation
…ghtable` interfaces - Adatpation of the existing properties declarations - Added `IsHighlighted` and `HighlightCoefficient` properties to toggle higlight and set its weight on thicknesses - Modified `Render` to take highlight effect into account
…hlightable` interfaces - Adaptation of the existing properties declarations - Added `MarkerShape` property to authorize user to change signal Marker. - Added `IsHighlighted` and `HighlightCoefficient` properties to toggle higlight and set its weight on thicknesses - Modified `Render` to take highlight effect into account
…of `PointF` - Hopefully this allows to have customizeable markers in `SignalPlots` without much performance impact (to be verified, but first test do not seem to make much difference) - In `DrawMarkers` , `eks`, `cross`, `asterisk`, `verticalbar` are plotted with `DrawLine` instead of `DrawString`. A performance improvement is expected but is to be verified
|
Here are some views of the new functionalities
test.mp4
test2.mp4 |
I'm not 100% on this either ... Inter-dependent PRs can get pretty complicated, especially if I decide to refactor the PR this one depends on. My strategy will be to focus solely on #1660, refactor as necessary, merge it, then come back here, cross my fingers, and hold my breath and see what broke 😅 I recommend not making new commits on either of these PRs until I'm done working on them. In the future, smallest-possible PRs are probably the solution to this 👍 E.g., refactoring the You already did a lot of work (fantastic work!) here and in #1655, so I'll pick it up where it is and try to get it merged today or tomorrow 🤞 PS: In the next major version of ScottPlot (in a magical world with rainbows and unicorns, lol) each |
Removes logical optimizations introduced in ScottPlot#1667 These optimizations will be added in a future issue/PR ScottPlot#1668
|
I ran out of time and have to put this down tonight 😝 To be honest I got super overwhelmed with the modifications to the shape rendering code, so I took all of that out of this PR and stored it in #1660 so we can review it later when I have more availability to review/test it. I think this PR is in a better/simpler place now, but I haven't had time to adequately test it yet, and testing on Linux and MacOS will be extremely important since we are twiddling with marker alignment and it's been a problem in the past (#340) 👍 PS: Marker rendering will be significantly reworked in ScottPlot 5, so I'm not highly motivated to micro-optimize System.Drawing marker rendering routines at this time. My main goal is to avoid introducing new bugs or or changes to existing behavior. Thanks again for your work on this @BambOoxX! Hopefully I can merge this tomorrow night 🚀 |
Not problem with me, I was just surprised that
Thanks, I'm just trying to help when I can. I saw an opportunity to try something...
Wouldn't that be problematic ? Some plots may have different markers depending on the point in the dataset, but for |
It's a good improvement! Lots of this work will translate to the next version of ScottPlot too 👍🚀
This is true.... but perhaps I didn't describe my proposed change well here. Overall the the new behavior will be the essentially the same. I'll implement it soon in ScottPlot5 (e.g., Since I'll be working in Marker land in #1668, it may be a good time to practice lightly refactoring ScottPlot 4's Marker rendering system to see if I can make it more modular without any breaking changes. I'll probably prioritize this over ScottPlot 5 development, and hopefully it'll be a quick refactor! Famous last words 🙃 |
|
@BambOoxX are you familiar with Docker? I'm struggling to run the unit tests in Linux in local docker container I can use WSL to run the tests locally for now, but a Docker solution would be much more elegant 🐋 |
|
I confirmed the pixel offset is still required when drawing circles on Linux 😝 #340 Looks like
ScottPlot/src/tests/Misc/OS.cs Lines 12 to 30 in 21b11c9 Tested using WSL/ubuntu |
Improves alignment between lines and markers This may because Linux/MacOS define pixel locations as the center of pixels vs. the top-left corner 🤷♀️
|
@swharden No, I have no clue about docker images. These always feel like magic to me 😅 |
It was worth a shot! @bclehmann your suggestion to run tests using WSL has been helpful. Do you have enough experience with Docker to know why the tests won't run in the dotnet SDK Docker image? (#1677) |
The only things I can think of is either a native dependency isn't installed (i.e. libgdiplus) or if the dockerfile has conflicting dependency version requirements. |



This PR implements the interfaces discussed in #1655, which has been rebased on this branch (not sure if it was the right thing to do though).
IHasLine,IHasMarkerandIIsHighlightable.DrawMarkersis proposed to support customizeable markers inSignalPlots, as well as new implementations for marker plotting avoidingDrawStringwhen possible.MarkerShapesare implemented :openTriangleandfilledTriangleHopefully this will have some use beyond just interactive plotting.