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

Restrict graph lines to positive values #2673

Closed
nikolas opened this issue Aug 18, 2023 · 1 comment
Closed

Restrict graph lines to positive values #2673

nikolas opened this issue Aug 18, 2023 · 1 comment

Comments

@nikolas
Copy link
Member

nikolas commented Aug 18, 2023

The lines in an EconPractice graph should only display in the positive X and Y domains. This is sort of achieved with an ugly workaround - blocking off the area beneath the axes lines with white blocks, in Graph.postMake(): https://github.com/ccnmtl/econplayground/blob/master/media/js/src/graphs/Graph.js#L146

It doesn't always work.

We can consider restricting lines to never render themselves when in the invalid domain, as described here:
https://groups.google.com/g/jsxgraph/c/jhEaxh225VA/m/iHUsTKxJAQAJ

nikolas added a commit that referenced this issue Aug 18, 2023
* Reduce bounding box closer to the axes, so the invalid domains are not
  visible. This is a roundabout way to resolve issues #2673, as it seems
  there is no general way to add this restriction to jsxgraph's Line
  element, according to the thread referenced in that issue.
* Use Label's [autoPosition](https://jsxgraph.uni-bayreuth.de/docs/symbols/Label.html#autoPosition)
  option for the demand-supply graph's line labels. This option is new
  in jsxgraph 1.1.0, and will give us some better dynamic position for
  the line labels, through my testing. The auto-positioning isn't ideal
  (see: jsxgraph/jsxgraph#575), but it looks
  like it's an improvement.
@nikolas
Copy link
Member Author

nikolas commented Jul 18, 2024

This is a lower priority and doesn't really need its own ticket - I'm just going to close this.

@nikolas nikolas closed this as completed Jul 18, 2024
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

No branches or pull requests

1 participant