About Pretty Parametric Plots
as inline SVG images, using the relatively new <SVG> tag in HTML5.
The algorithm is designed to quickly create very accurate, smooth curves, using a small number of data points. Each plot is defined using a cubic Bézier spline. Rather than spacing the component curves equally in the parameter, , the algorithm adaptively computes the interval, , because regions of high curvature require smaller intervals than regions of low curvature. This is illustrated in the image below.
The above image shows a zoomed-in plot with quite stringent quality settings. The gray points indicate nodes (the endpoints of the individual Bézier curves within the spline). Note that sharp turns are handled efficiently by simply limiting the distance between nodes; the shortest allowed interval is approximately one third of a pixel width on the host computer's display device. This also prevents the application from wasting time on sub-pixel structures, such as tiny loops. With additional effort, the total number of points could greatly be reduced, while retaining accuracy. Since this optimization also significantly slows the plotting operation, the application does not take this extra step.
- Enable radial gradients (currently, only linear gradients are supported).
- Enable gradients along the path.
- Allow the user to specify the direction of the linear gradient.
- Allow transparency (alpha channel) in the gradients.
- Present the user with a list of examples.
- Implement a context menu in the plotting area. The context menu might have a "transform" option to let the user scale, flip, and rotate the plot. It might also allow the user to modify the quality constraints that are currently not adjustable.
- Allow the user to download an SVG image file containing the path generated by the application.