https://github.com/csicar/elm-mathui
https://github.com/csicar/elm-mathui
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/csicar/elm-mathui
- Owner: csicar
- Created: 2017-10-19T05:27:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-25T08:20:53.000Z (almost 9 years ago)
- Last Synced: 2026-06-12T01:32:10.133Z (about 2 months ago)
- Language: Elm
- Size: 638 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Elm-MathUi
==========
Installation
------------
```bash
elm package install csicar/elm-mathui
```
Usage
-----
### minimal Example
[in action](https://csicar.github.io/elm-mathui/example/Example1.html)
```elm
module Main exposing (..)
import Html exposing (div, span)
import Html.Attributes exposing (..)
import MathUi exposing (sigma, equals, Exp(..), infinity, plus, elemIn, sqrtOp, divide, vectorsymbol)
main =
Html.beginnerProgram { model = model, view = view, update = update }
type alias Model =
{ mathUi : MathUi.Model
}
model : Model
model =
{ mathUi =
{ expression =
plus
(Hole)
(Id "a")
, breadCrum = []
}
}
type Msg
= MathUiMsg MathUi.Msg
update : Msg -> Model -> Model
update msg model =
case msg of
MathUiMsg msg ->
{ model | mathUi = MathUi.update msg model.mathUi }
view : Model -> Html.Html Msg
view model =
div [] [ Html.map MathUiMsg (MathUi.view model.mathUi) ]
```