Skip to content

ScottPlot 4+5: Implemented a class derived from axis line that snaps to specified positions on its axis.#2006

Closed
Agorath wants to merge 4 commits intoScottPlot:mainfrom
Agorath:main
Closed

ScottPlot 4+5: Implemented a class derived from axis line that snaps to specified positions on its axis.#2006
Agorath wants to merge 4 commits intoScottPlot:mainfrom
Agorath:main

Conversation

@Agorath
Copy link
Contributor

@Agorath Agorath commented Aug 6, 2022

Purpose:
This pull request aims to provide an implementation of an axis line that snaps to a defined list of positions on either the horizontal or vertical axis.
The implementation tries to reuse as much code as possible while guaranteeing the proper function of the new snap mechanic for axis lines.

The general idea was to provide a feature for draggable axis lines similar to what the DraggableMarkerPlotInVector offers for draggable markers.

As this is my first pull request, I hope I correctly followed what is mentioned in CONTRIBUTING.md.
Minus the creation of an issue before starting the implementation... I started the implementation as a test balloon to get familiar with the code base and more or less because I just wanted to try it out. As it was very easy to implement, I was done faster than I first anticipated and then I got around to reading CONTRIBUTING.md but was already done...

I hope you like the new plottable. I'm looking forward to your feedback! :-)

2022-08-06.22-37-27.mp4
var yPositions = DataGen.Consecutive(11, 0.2D, -1D);
var hLineWithSnap = plt.AddHorizontalLineWithSnap(0.8D, yPositions);
hLineWithSnap.DragEnabled = true;
hLineWithSnap.DragLimitMin = -1;
hLineWithSnap.DragLimitMax = 1;

var xPositions = DataGen.Consecutive(11, 5D);
var vLineWithSnap = plt.AddVerticalLineWithSnap(25, xPositions);
vLineWithSnap.DragEnabled = true;
vLineWithSnap.DragLimitMin = 0;
vLineWithSnap.DragLimitMax = 50;

Sebastian Schäfer and others added 4 commits August 6, 2022 22:16
…st of positions on either the horizontal or vertical axis.

The implementation tries to reuse as much code as possible while guaranteeing the proper function of the new snap mechanic for axis lines.
@swharden
Copy link
Member

swharden commented Aug 6, 2022

solved in #2008, see discussion in #2007

Thanks again for getting the ball rolling on this @Agorath! 🚀

@swharden swharden closed this Aug 6, 2022
@swharden swharden mentioned this pull request Aug 7, 2022
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.

2 participants