bug(view/plot): inconsistent scaling
Problem
Currently, the viewBox height is computed from the functions image over the user specified domain. This leads to incosistent scaling when width: 100%
and height: 100%
are set on the SVG element.
Examples: (domain = [-10,10])
- f(x) = x -> width: max(domain) - min(domain) = 20 and height: max f(domain) - min f(domain) = 20
- f(x) = x^2 -> width: max(domain) - min(domain) = 20 and height: max f(domain) - min f(domain) = 100
Their respective viewBoxes are then:
viewBox="-10 -10 20 20"
viewBox="-10 -10 20 100"
Solution
Allow user to specify range just like they can for domain.
Edited by Zaba505