[{"name":"PanZoom","comment":" This module implements a pannable and zoomable component.\n\n\n# Config\n\n@docs Config, defaultConfig, ElementFilter, ClassList\n\n\n# State\n\n@docs Model, init, view, update, MouseEvent\n\n\n## Getters\n\n@docs getScale, Scale, getPosition, Coordinate, getMousePosition\n\n\n# Transformations\n\n\n## Panning\n\n@docs moveBy, moveTo\n\n\n## Zooming\n\n@docs scaleBy, scaleTo, Anchor, getViewport, Viewport\n\n","unions":[{"name":"Anchor","comment":" The anchor point to scale the content box with respect to.\n\nTo use the `ViewportCenter` you need to provide a [`Viewport`](PanZoom#Viewport) which can be created with [`getViewport`](PanZoom#getViewport).\n\n","args":[],"cases":[["Point",["PanZoom.Coordinate"]],["ViewportCenter",["PanZoom.Viewport"]],["ContentCenter",[]]]},{"name":"ElementFilter","comment":" Filters elements by class name.\n\n  - `Include` - dragging the content box will **only** be possible on child elements with any of these class names.\n  - `Exclude` - dragging the content box will **not** be possible on child elements with any of these class names.\n\n","args":[],"cases":[["Include",["PanZoom.ClassList"]],["Exclude",["PanZoom.ClassList"]]]},{"name":"MouseEvent","comment":" Mouse events.\n","args":[],"cases":[["MouseMoved",["PanZoom.Mouse.Position"]],["MousePressed",["PanZoom.Mouse.Position","PanZoom.ClassList"]],["MouseReleased",[]],["WheelScrolled",["PanZoom.Mouse.Position","PanZoom.Mouse.ScrollDirection"]]]},{"name":"Viewport","comment":" Viewport position and dimensions.\n\nCan only be created with [`getViewport`](PanZoom#getViewport).\n\n","args":[],"cases":[]}],"aliases":[{"name":"ClassList","comment":" List of classes.\n","args":[],"type":"List.List String.String"},{"name":"Config","comment":" Configuration options for the component.\n\n  - `id` - Adds an `id` HTML attribute to the viewport element. Needs to be set for [`getViewport`](PanZoom#getViewport) to return a `Just`.\n\n  - `width` - Width of the content box in pixels.\n\n    **WARNING:** this can be overriden by adding the `width` CSS property to the content box, but this will break the scaling logic.\n\n  - `height` - Height of the content box in pixels.\n\n    **WARNING:** this can be overriden by adding the `width` CSS property to the content box, but this will break the scaling logic.\n\n  - `minScale` - Set a minimum possible scale. This will decide how far you can zoom out.\n\n  - `maxScale` - Set a maximum possible scale. This will decide how far you can zoom in.\n\n  - `scrollScaleFactor` - The factor to scale by when scrolling. For example setting this to `1.1` will scale the content box by 10 % on every scroll.\n\n  - `draggableOnChildren` - If you want to disable the panning logic when dragging on child elements in the content box.\n\n  - `toSelf` -- Map this component's [`MouseEvent`](PanZoom#MouseEvent)s to a `Msg` so that the parent can properly [`update`](PanZoom#update) the component.\n\n**Note:** the viewport's default height is `100vh` but can be overriden by adding your own style attribute in [`view`](PanZoom#view).\n\n","args":["msg"],"type":"{ id : Maybe.Maybe String.String, width : Basics.Float, height : Basics.Float, minScale : Maybe.Maybe PanZoom.Scale, maxScale : Maybe.Maybe PanZoom.Scale, scrollScaleFactor : Basics.Float, draggableOnChildren : PanZoom.ElementFilter, toSelf : PanZoom.MouseEvent -> msg }"},{"name":"Coordinate","comment":" Two dimensional vector that can represent a point or direction.\n","args":[],"type":"{ x : Basics.Float, y : Basics.Float }"},{"name":"Model","comment":" Contains config and internal state.\n","args":["msg"],"type":"{ state : PanZoom.State, config : PanZoom.Config msg }"},{"name":"Scale","comment":" Scale of the content box.\n","args":[],"type":"Basics.Float"}],"values":[{"name":"defaultConfig","comment":" Default configuration:\n\n    { id = Nothing\n    , width = 1920\n    , height = 1080\n    , minScale = Nothing\n    , maxScale = Nothing\n    , scrollScaleFactor = 1.1\n    , draggableOnChildren = Exclude []\n    , toSelf = toSelf\n    }\n\n","type":"(PanZoom.MouseEvent -> msg) -> PanZoom.Config msg"},{"name":"getMousePosition","comment":" Get the mouse position if the content box is being dragged.\n","type":"PanZoom.Model msg -> Maybe.Maybe PanZoom.Coordinate"},{"name":"getPosition","comment":" Get the position of the content box.\n","type":"PanZoom.Model msg -> PanZoom.Coordinate"},{"name":"getScale","comment":" Get the scaling of the content box.\n","type":"PanZoom.Model msg -> PanZoom.Scale"},{"name":"getViewport","comment":" Maybe creates a [`Cmd`](https://package.elm-lang.org/packages/elm/core/latest/Platform-Cmd#Cmd) to get the dimensions of the viewport.\n\nThe function will return `Nothing` if `model.config.id == Nothing`.\n\n","type":"PanZoom.Model msg -> Maybe.Maybe (Platform.Cmd.Cmd (Result.Result Browser.Dom.Error PanZoom.Viewport))"},{"name":"init","comment":" Creates a `Model` with a [`Config`](PanZoom#config) and an initial state.\n","type":"PanZoom.Config msg -> { scale : PanZoom.Scale, position : PanZoom.Coordinate } -> PanZoom.Model msg"},{"name":"moveBy","comment":" Move the content box by a relative distance.\n\nGiven a model where\n\n    getPosition model == { x = 10, y = 20 }\n\nthe following holds\n\n    getPosition (model |> moveBy { x = -15, y = 5 }) == { x = -5, y = 25 }\n\n","type":"PanZoom.Coordinate -> PanZoom.Model msg -> PanZoom.Model msg"},{"name":"moveTo","comment":" Move the content box to a point.\n\nGiven a model where\n\n    getPosition model == { x = 10, y = 20 }\n\nthe following holds\n\n    getPosition (model |> moveTo { x = -15, y = 5 }) == { x = -15, y = 5 }\n\n","type":"PanZoom.Coordinate -> PanZoom.Model msg -> PanZoom.Model msg"},{"name":"scaleBy","comment":" Scale the content box by a relative value.\n\nGiven a model where\n\n    getScale model == scale\n\nthe following holds\n\n    getScale (model |> scaleBy factor ContentCenter) == scale * factor\n\n","type":"Basics.Float -> PanZoom.Anchor -> PanZoom.Model msg -> Maybe.Maybe (PanZoom.Model msg)"},{"name":"scaleTo","comment":" Scale the content box to an absolute scaling.\n\nGiven a model where\n\n    getScale model == scale\n\nthe following holds\n\n    getScale (model |> scaleTo newScale ContentCenter) == newScale\n\n","type":"PanZoom.Scale -> PanZoom.Anchor -> PanZoom.Model msg -> Maybe.Maybe (PanZoom.Model msg)"},{"name":"update","comment":" Process an event and return a new model.\n","type":"PanZoom.MouseEvent -> PanZoom.Model msg -> PanZoom.Model msg"},{"name":"view","comment":" Show the component with some content.\n\nThe elements provided in `content` will become direct descendants of the content box.\n\nIt is possible to provide additional HTML attributes to the viewport and content box.\nFor example it is recommended to add the `user-select` CSS property so that any text is not selected while dragging.\n\n**WARNING:** Some attributes/styles should not be overriden for proper function.\nFor the viewport these are:\n\n  - `id` HTML attribute (set in [`Config`](PanZoom#Config) instead)\n  - `overflow` CSS property\n\nFor the content box these are:\n\n  - `transform` CSS property\n  - `position` CSS property\n  - `width` CSS property (set in [`Config`](PanZoom#Config) instead)\n  - `height` CSS property (set in [`Config`](PanZoom#Config) instead)\n\n","type":"PanZoom.Model msg -> { viewportAttributes : List.List (Html.Attribute msg), contentAttributes : List.List (Html.Attribute msg), content : List.List (Html.Html msg) } -> Html.Html msg"}],"binops":[]},{"name":"PanZoom.Mouse","comment":" This module includes abstractions for handling mouse events.\n\n\n# Custom event listeners\n\n@docs onMouseMove, onMouseDown, onWheelScroll\n\n\n# Mouse position\n\n@docs Position, asCoordinate, Coordinate, delta\n\n\n# Scroll wheel\n\n@docs ScrollDirection\n\n","unions":[{"name":"Position","comment":" Mouse position.\n","args":[],"cases":[]},{"name":"ScrollDirection","comment":" Scroll wheel direction.\n","args":[],"cases":[["ScrollUp",[]],["ScrollHorizontal",[]],["ScrollDown",[]]]}],"aliases":[{"name":"Coordinate","comment":" Two dimensional vector that can represent a point or direction.\n","args":[],"type":"{ x : Basics.Float, y : Basics.Float }"}],"values":[{"name":"asCoordinate","comment":" Mouse position as coordinate record.\n","type":"PanZoom.Mouse.Position -> PanZoom.Mouse.Coordinate"},{"name":"delta","comment":" Delta/difference vector between two mouse `Position`s.\n\n    delta (Position { x = 50, y = 10 }) (Position { x = 20, y = -10 }) == { x = -30, y = -20 }\n\n    delta (Position { x = 50, y = 10 }) (Position { x = 20, y = -10 }) == { x = -30, y = -20 }\n\n","type":"PanZoom.Mouse.Position -> PanZoom.Mouse.Position -> PanZoom.Mouse.Coordinate"},{"name":"onMouseDown","comment":" Custom event listener for `mousedown` that returns the mouse `Position` and the classes of the target element that was clicked.\n","type":"(PanZoom.Mouse.Position -> List.List String.String -> msg) -> Html.Attribute msg"},{"name":"onMouseMove","comment":" Custom event listener for `mousemove` that returns the mouse `Position`.\n","type":"(PanZoom.Mouse.Position -> msg) -> Html.Attribute msg"},{"name":"onWheelScroll","comment":" Custom event listener for `wheel` that returns the mouse `Position` and the `ScrollDirection` of the wheel.\n","type":"(PanZoom.Mouse.Position -> PanZoom.Mouse.ScrollDirection -> msg) -> Html.Attribute msg"}],"binops":[]}]