[
    {
        "name": "Segment",
        "comment": " An alternative interpretation of paths that is convenient for mathematical operations.\n\nHere, a path is viewed as a list of segments with a start and end point.\n\n@docs Segment\n\n@docs fromPath, toPath\n\n# Operations\n@docs at, length, lengthWithOptions\n",
        "unions": [
            {
                "name": "Segment",
                "comment": " The four types of segments.\n\nFor segments, the `xAxisRotate` field is in radians.\n",
                "args": [],
                "cases": [
                    [
                        "LineSegment",
                        [
                            "Coordinate",
                            "Coordinate"
                        ]
                    ],
                    [
                        "Quadratic",
                        [
                            "Coordinate",
                            "Coordinate",
                            "Coordinate"
                        ]
                    ],
                    [
                        "Cubic",
                        [
                            "Coordinate",
                            "Coordinate",
                            "Coordinate",
                            "Coordinate"
                        ]
                    ],
                    [
                        "Arc",
                        [
                            "{ start : Coordinate, end : Coordinate, radii : ( Float, Float ), xAxisRotate : Float, arcFlag : ArcFlag, direction : Direction }"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [],
        "values": [
            {
                "name": "at",
                "comment": " Get the location at a point on the curve, only defined in the range [0, 1].\n",
                "type": "Float -> Segment -> ( Float, Float )"
            },
            {
                "name": "fromPath",
                "comment": " Create segments from a path\n",
                "type": "Path -> List Segment"
            },
            {
                "name": "length",
                "comment": " The approximate length of a segment\n",
                "type": "Segment -> Float"
            },
            {
                "name": "lengthWithOptions",
                "comment": " Supply the options for the approximation\n\n* `minDepth`: Minimum recursion depth for calculating the length of arc segments. Default is `10`.\n* `error`: Minimal amount of progress that an recursive step must make. Default is `1.0e-12`.\n",
                "type": "{ minDepth : Int, error : Float } -> Segment -> Float"
            },
            {
                "name": "toPath",
                "comment": " Convert a list of segments to a path\n\nIt is assumed that for every two adjacent segments in the list, the first segment's end point is the second segment's starting point\n",
                "type": "List Segment -> Path"
            }
        ],
        "binops": []
    },
    {
        "name": "Curve",
        "comment": "\n\n## Linear\n\n@docs linear, linearClosed\n\n## Step\n\n@docs step, stepBefore, stepAfter\n\n## Basis\n\n@docs basis, basisClosed, basisOpen, bundle\n\n## Cardinal\n\n@docs cardinal, cardinalClosed, cardinalOpen\n\n## Catmull-Rom\n\nCatmull-Rom splines are a special case of cardinal splines. These curves are great for animation, because the data points are\nhit exactly and the curve is smooth.\n\n@docs catmullRom, catmullRomClosed, catmullRomOpen\n\n## Monotone\n\nThe meaning of monotone is best illustrated:\n\n\n<img style=\"max-width: 100%;\" src=\"https://upload.wikimedia.org/wikipedia/en/f/fe/MonotCubInt.png\" />\n\nNotice that around 0.45, the cubic interpolation dives below the y-coordinate of the next point, whereas the monotone interpolation does not.\n\nMore formally, a monotone curve between two points is either increasing (staying flat or becoming higher) or decreasing (staying flat or becoming lower). It cannot\nfirst go down and then go up.\n\n@docs monotoneX, monotoneY\n\n## Natural\n\n@docs natural\n\n## Transformations\n\n@docs radial, toPolarWithCenter\n\n## WIP TEST\n@docs naturalControlPoints\n\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "basis",
                "comment": " Basis interpolation (also known as B-spline)\n\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/basis.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "basisClosed",
                "comment": " Closed Basis interpolation (also known as B-spline)\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/basisClosed.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "basisOpen",
                "comment": "\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/basisOpen.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "bundle",
                "comment": "\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/bundle.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "cardinal",
                "comment": "\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/cardinal.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "cardinalClosed",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/cardinalClosed.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "cardinalOpen",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/cardinalOpen.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "catmullRom",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/catmullRom.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "catmullRomClosed",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/catmullRomClosed.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "catmullRomOpen",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/catmullRomOpen.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "linear",
                "comment": " Draw straight lines between the data points.\n\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/linear.svg\" />\n\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "linearClosed",
                "comment": " Draw a straigt line between the data points, connecting the ends.\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/linearClosed.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "monotoneX",
                "comment": " Draw a curve monotone in y\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/monotoneX.svg\" />\n\nNote, does not deal well with coincident points\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "monotoneY",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/monotoneY.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "natural",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/natural.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "naturalControlPoints",
                "comment": " calculate the control points for natural spline interpolation\n",
                "type": "List (Vec2 Float) -> List (Vec3 (Vec2 Float))"
            },
            {
                "name": "radial",
                "comment": " Interpret a 2D vector as a `(angle, radius)` pair. The angle is in radians. The first argument is the center.\n\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/radial.svg\" />\n",
                "type": "Vec2 Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "step",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/step.svg\" />\n",
                "type": "Float -> List (Vec2 Float) -> Path"
            },
            {
                "name": "stepAfter",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/stepAfter.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "stepBefore",
                "comment": "\n<img style=\"max-width: 100%;\" src=\"https://rawgit.com/folkertdev/one-true-path-experiment/master/docs/stepBefore.svg\" />\n",
                "type": "List (Vec2 Float) -> Path"
            },
            {
                "name": "toPolarWithCenter",
                "comment": " Convert `(angle, radius)` pairs to `(x, y)` coordinates, relative to the given vector.\n\nThis function is used by radial and can be used to use radial with different interpolations, for instance.\n\n    radialNatural  : Vec2 Float -> List (Vec2 Float) -> Path\n    radialNatural ( x, y ) =\n        natural << toPolarWithCenter ( x, y )\n\n",
                "type": "Vec2 Float -> List (Vec2 Float) -> List (Vec2 Float)"
            }
        ],
        "binops": []
    },
    {
        "name": "Path",
        "comment": " Low-level module for constructing svg paths.\n\nThis module provides a wrapper around the svg path syntax. A path can be parsed from a string or build up using the\nsvg path primitives, and then converted to a string that can be used in the [`d` attribute][d-attribute] to render the path.\n\nNote that this is not the most convenient way of drawing. This package is mainly meant as a primitive to build other packages on top of.\nIf you want to visualize data, have a look at [elm-plot] and [elm-visualization]. If you want to draw geometry, check out [opensolid].\n\n\nFor more information on svg paths, see the [MDN documentation].\n\n[MDN documentation]: https://developer.mozilla.org/en/docs/Web/SVG/Tutorial/MixedPaths.\n[elm-plot]: http://package.elm-lang.org/packages/terezka/elm-plot/latest\n[elm-visualization]: http://package.elm-lang.org/packages/gampleman/elm-visualization/latest\n[opensolid]: http://package.elm-lang.org/packages/opensolid/geometry/latest\n[d-attribute]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d\n\n[`MoveTo`]: #MoveTo\n[`DrawTo`]: #DrawTo\n[with the spec]: https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands\n\n## Data Layout\n\nA path is a list of subpaths that are drawn in order. A subpath consists of a [`MoveTo`] instruction followed by a list of [`DrawTo`] instructions.\n\nThis package only supports absolute coordinates and instructions, but it is possible to parse strings with relative intructions.\nWhen a path is parsed, the first [`MoveTo`] instruction is always interpreted as absolute (this is in accordance [with the spec]),\nthus making sure  that there is always an absolute cursor position.\n\n\nThe constructors are exposed, so if you need an escape hatch it is available. As always though, never reach for it when there are other options.\n\n## Example\n\n```elm\nmyPoints : List (Float, Float)\n\n-- connect all the points with a straight line\nlinear : List Coordinate -> Path\nlinear points =\n    case points of\n        [] ->\n            []\n\n        p::ps ->\n            [ subpath (moveTo p) [ lineTo ps ] ]\n\n\nmain =\n    Svg.svg [ width \"400\", height \"400\" ]\n        [ Path.svgPath (linear myPoints) [ fill \"none\" ]\n        ]\n```\n\n## Data Structures\n@docs Coordinate, Path, SubPath\n\n## Constructing Paths\n@docs subpath, parse\n\n## Creating SVG\n@docs svgPath, toString\n\n## Modifying Paths\n@docs mapCoordinate, CursorState, mapWithCursorState, updateCursorState\n\n## Moving the cursor\n\n@docs MoveTo, moveTo\n\n## Drawing on the canvas\n\n@docs DrawTo\n\n## Straight lines\n@docs lineTo, horizontalTo, verticalTo\n\n## Close Path\n@docs closePath\n\n## Quadratic Beziers\n@docs quadraticCurveTo, quadraticCurveExtendTo\n\n## Cubic Beziers\n@docs cubicCurveTo, cubicCurveExtendTo\n\n## Arcs\n@docs arcTo, EllipticalArcArgument, Direction, clockwise, counterClockwise, ArcFlag, largestArc, smallestArc\n\n## Internal\n\nSome internal functions that need to be exposed in order to use them in tests.\n@docs toAbsoluteMoveTo, toAbsoluteDrawTo, toMixedDrawTo, toMixedMoveTo\n\n",
        "unions": [
            {
                "name": "DrawTo",
                "comment": " Constructors for DrawTo instructions\n",
                "args": [],
                "cases": [
                    [
                        "LineTo",
                        [
                            "List Coordinate"
                        ]
                    ],
                    [
                        "Horizontal",
                        [
                            "List Float"
                        ]
                    ],
                    [
                        "Vertical",
                        [
                            "List Float"
                        ]
                    ],
                    [
                        "CurveTo",
                        [
                            "List ( Coordinate, Coordinate, Coordinate )"
                        ]
                    ],
                    [
                        "SmoothCurveTo",
                        [
                            "List ( Coordinate, Coordinate )"
                        ]
                    ],
                    [
                        "QuadraticBezierCurveTo",
                        [
                            "List ( Coordinate, Coordinate )"
                        ]
                    ],
                    [
                        "SmoothQuadraticBezierCurveTo",
                        [
                            "List Coordinate"
                        ]
                    ],
                    [
                        "EllipticalArc",
                        [
                            "List EllipticalArcArgument"
                        ]
                    ],
                    [
                        "ClosePath",
                        []
                    ]
                ]
            },
            {
                "name": "MoveTo",
                "comment": " Constructors for MoveTo instructions\n",
                "args": [],
                "cases": [
                    [
                        "MoveTo",
                        [
                            "Coordinate"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "ArcFlag",
                "comment": " Determine which arc to draw\n",
                "args": [],
                "type": "ArcFlag"
            },
            {
                "name": "Coordinate",
                "comment": " A 2-tuple of floats representing a position in space\n",
                "args": [],
                "type": "( Float, Float )"
            },
            {
                "name": "CursorState",
                "comment": " Contains the start of the current subpath and the current cursor position.\n",
                "args": [],
                "type": "{ start : Coordinate, cursor : Coordinate }"
            },
            {
                "name": "Direction",
                "comment": " Determine which arc to draw\n",
                "args": [],
                "type": "Direction"
            },
            {
                "name": "EllipticalArcArgument",
                "comment": " The arguments for an Arc\n",
                "args": [],
                "type": "{ radii : ( Float, Float ), xAxisRotate : Float, arcFlag : ArcFlag, direction : Direction, target : Coordinate }"
            },
            {
                "name": "Path",
                "comment": " A path is a list of [`SubPath`](#SubPath)s.\n",
                "args": [],
                "type": "List SubPath"
            },
            {
                "name": "SubPath",
                "comment": " A subpath consists of a [`MoveTo`](#MoveTo) instruction followed by a list of [`DrawTo`](#DrawTo) instructions\n\n\n",
                "args": [],
                "type": "{ moveto : MoveTo, drawtos : List DrawTo }"
            }
        ],
        "values": [
            {
                "name": "arcTo",
                "comment": " An elliptical arc. The `A` instruction.\n",
                "type": "List EllipticalArcArgument -> DrawTo"
            },
            {
                "name": "clockwise",
                "comment": " Corresponds to a sweep flag of 1\n",
                "type": "Direction"
            },
            {
                "name": "closePath",
                "comment": " Draw a straight line from the cursor position to the starting position of the path. The `Z` instruction.\n",
                "type": "DrawTo"
            },
            {
                "name": "counterClockwise",
                "comment": " Corresponds to a sweep flag of 0\n",
                "type": "Direction"
            },
            {
                "name": "cubicCurveExtendTo",
                "comment": " A smooth extension to a cubic bezier segment. The `S` instruction.\n",
                "type": "List ( Coordinate, Coordinate ) -> DrawTo"
            },
            {
                "name": "cubicCurveTo",
                "comment": " A cubic bezier. The `C` instruction.\n",
                "type": "List ( Coordinate, Coordinate, Coordinate ) -> DrawTo"
            },
            {
                "name": "horizontalTo",
                "comment": " Specific version of `lineTo` that only moves horizontally. The `H` instruction.\n",
                "type": "List Float -> DrawTo"
            },
            {
                "name": "largestArc",
                "comment": " Corresponds to an arc flag of 1\n",
                "type": "ArcFlag"
            },
            {
                "name": "lineTo",
                "comment": " Draw a series of line segments to absolute positions. The `L` instruction.\n",
                "type": "List Coordinate -> DrawTo"
            },
            {
                "name": "mapCoordinate",
                "comment": " Manipulate the coordinates in your SVG. This can be useful for scaling the svg.\n\n    -- make the image twice as big in the x direction\n    [ subpath (moveTo (10,0)) [ lineTo [ (42, 42) ] ] ]\n        |> mapCoordinate (\\(x,y) -> (2 * x, y))\n             --> [ subpath (moveTo (20,0)) [ lineTo [ (84, 42) ] ] ]\n",
                "type": "(Coordinate -> Coordinate) -> Path -> Path"
            },
            {
                "name": "mapWithCursorState",
                "comment": " Map over the `DrawTo`s in a path with access to their starting point.\n\nMany mathematical operations (length, derivative, curvature) are only possible when a segment is fully specified. A `DrawTo` on its\nown misses its starting point - the current cursor position. This function makes the cursor position and the start of the current subpath available\nwhen mapping.\n",
                "type": "(CursorState -> DrawTo -> b) -> Path -> List b"
            },
            {
                "name": "moveTo",
                "comment": " Move to a position on the canvas without drawing.\n",
                "type": "Coordinate -> MoveTo"
            },
            {
                "name": "parse",
                "comment": " Parse a path string into a `Path`\n\n\n    parse \"M0,0 l42,73\"\n        --> Ok [{ moveto = MoveTo Absolute (0,0), drawtos = [ LineTo Relative  [(42, 73)]]}]\n\nOnly accepts valid complete subpaths (a sequences of a move followed by zero or more draws). Relative instructions are converted to absolute ones.\nThe types and constructors in the output are described [here](#internal-data-used-by-the-parser-).\n\nThe parser uses [`elm-tools/parser`](http://package.elm-lang.org/packages/elm-tools/parser/2.0.1/).\nThe error type is [`Parser.Error`](http://package.elm-lang.org/packages/elm-tools/parser/2.0.1/Parser#Error).\n",
                "type": "String -> Result Error Path"
            },
            {
                "name": "quadraticCurveExtendTo",
                "comment": " A smooth extension to a quadratic bezier segment. The `T` instruction.\n",
                "type": "List Coordinate -> DrawTo"
            },
            {
                "name": "quadraticCurveTo",
                "comment": " A quadratic bezier. The `Q` instruction.\n",
                "type": "List ( Coordinate, Coordinate ) -> DrawTo"
            },
            {
                "name": "smallestArc",
                "comment": " Corresponds to an arc flag of 0\n",
                "type": "ArcFlag"
            },
            {
                "name": "subpath",
                "comment": " Construct a subpath\n\n    subpath (moveTo (10,0)) [ lineTo [ (42, 73) ] ]\n",
                "type": "MoveTo -> List DrawTo -> SubPath"
            },
            {
                "name": "svgPath",
                "comment": " Construct an svg path element from a `Path` with the given attributes\n",
                "type": "Path -> List (Attribute msg) -> Svg msg"
            },
            {
                "name": "toAbsoluteDrawTo",
                "comment": " Exposed for testing\n",
                "type": "CursorState -> DrawTo -> ( DrawTo, CursorState )"
            },
            {
                "name": "toAbsoluteMoveTo",
                "comment": " Exposed for testing\n",
                "type": "CursorState -> MoveTo -> ( MoveTo, CursorState )"
            },
            {
                "name": "toMixedDrawTo",
                "comment": " Exposed for testing purposes\n",
                "type": "DrawTo -> DrawTo"
            },
            {
                "name": "toMixedMoveTo",
                "comment": " Exposed for testing purposes\n",
                "type": "MoveTo -> MoveTo"
            },
            {
                "name": "toString",
                "comment": " Turn a `MixedPath` into a `String`. The result is ready to be used with the `d` attribute.\n\n    Path.toString [ subpath (moveTo (0,0)) [ lineBy ( 42, 73 ) ] ]\n        --> \"M0,0 l42,73\"\n",
                "type": "Path -> String"
            },
            {
                "name": "updateCursorState",
                "comment": " Given a cursor state, simulate the effect that a `DrawTo` has on that cursor state\n",
                "type": "DrawTo -> CursorState -> CursorState"
            },
            {
                "name": "verticalTo",
                "comment": " Specific version of `lineTo` that only moves vertically. The `V` instruction\n",
                "type": "List Float -> DrawTo"
            }
        ],
        "binops": []
    }
]