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

Explicit range #1

Merged
merged 4 commits into from Feb 18, 2023
Merged

Explicit range #1

merged 4 commits into from Feb 18, 2023

Conversation

jakubpawlewicz
Copy link
Contributor

This PR implements possibility of using explicit functions to plot ranges.

Copy link
Contributor

@izabala123 izabala123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Jakub. I am not totally sure that this will break anything. I'll keep an eye on it

Copy link
Contributor

@izabala123 izabala123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Jakub. I am not totally sure that this will break anything. I'll keep an eye on it

Copy link
Contributor

@izabala123 izabala123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain a little the reason of this. Thank you.

Copy link
Contributor

@izabala123 izabala123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain a little the changes. Thank you!

@jakubpawlewicz
Copy link
Contributor Author

OK, here is the description of the changes.

  1. In f76c39a essential part of ScatterDraw::Plot() is extracted which creates polygon or closed polygon (i.e. a list of points) for a plot to DataAddPoints().
  2. e943a96 fixes a bug when one wants just to fill the range without drawing surrounding polygon.
  3. To shade a range which is enclosed by two curves (represented by two instances of DataSource) a polygon is created by taking points from two sequences. From one sequence they have to be reversed and then both sequences are merged. The previous implemented approach requested that DataSource is the list of points (i.e. cannot be explicit). In order to overcome this limitations DataSource based classes: DataReverse and DataAppend where changed to be views marked by two private members of DataSource: isAppend and isReverse. Then appropriate cases can be handled in DataAddPoints(). If it is append, add points of two sequences by calling recursively DataAddPoints on them. If it is reverse, call recursively DataAddPoints(), reverse list of points it produced and append such reversed list to the result. This is implemented in 8aa87b0.
  4. There was a strange thing when polygon was created. At the beginning null point was added which is (-inf, -inf). I do not know what was the original purpose of the author. I suspect it has a role of some kind of guards. The problem with it when polygon is shaded is that suddenly huge region towards (-inf, -inf) was shaded. This has made a serious damage to a visual part of a graph. I inspected the entire code whether null points are actually used anywhere and I didn't find any such place. So I concluded it was some old artifact needed for some older version of the packet but it is not used anymore. Therefore I simply removed addition of null points to solve the problem in 195f8f1 .

@izabala123 izabala123 merged commit 2b55e29 into anboto:main Feb 18, 2023
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.

None yet

2 participants