fabiommendes / elm-svg-editor / Svg.Editor.Config

Global application configuration


type alias Config =
Internal.Types.Config

The config object. Usually should be created using init or the config utilitiy function

init : Config

Default config

Custom config

config : List (Config -> Config) -> Config

Create a custom config from a list of properties, e.g.

config
    [ groups [ "routes", "rock-faces", "elements" ]
    , pointRadius 2
    , controls { zoom = False, pan = True, drag = False }
    ]

controls : { zoom : Basics.Bool, pan : Basics.Bool, drag : Basics.Bool } -> Config -> Config

Enable/disable zoom and pan controls in the UI

groups : List Types.Label -> Config -> Config

List of allowed groups in scene.

Each element can be in at most a single group and have a unique index in that group.

This is useful, for instance, to mark routes or other highlights on the topo map and have numbers identifying each element.

pointRadius : Basics.Float -> Config -> Config

Radius of points, when rendered as circles.

sceneId : String -> Config -> Config

Change the default scene id.

This is necessary if two scenes are present in the same screen. Each scene must have a unique id.

editable : Basics.Bool -> Config -> Config

Control if editor is editable or not.

shape : ( Basics.Float, Basics.Float ) -> Config -> Config

Initial shape, (width, height), of the viewing area.

Scale is in meters.

readOnly : Basics.Bool -> Config -> Config

Initialize editor in a read-only state if boolean is true.