You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -48,16 +51,18 @@ julia> app.layout = html_div() do
48
51
)
49
52
)
50
53
end
54
+
51
55
julia> run_server(app, "0.0.0.0", 8080)
52
56
```
53
-
* The `DashApp` struct represent dashboard application.
57
+
58
+
* The `DashApp` struct represents a dashboard application.
54
59
* To make `DashApp` struct use `dash(layout_maker::Function, name::String; external_stylesheets::Vector{String} = Vector{String}(), url_base_pathname="/", assets_folder::String = "assets")`` where `layout_maker` is a function with signature ()::Component
55
-
* Unlike the python version where each Dash component is represented as a separate class, all components in Dash.jl are represented by struct `Component`.
56
-
* You can create `Component` specific for concrete Dash component by the set of functions in the form ``lowercase(<component package>)_lowercase(<component name>)``. For example, in python html `<div>` element is represented as `HTML.Div` in Dasboards it is created using function `html_div`
57
-
* The list of all supported components is available in docstring for Dasboards module
58
-
* All functions for a component creation have the signature `(;kwargs...)::Component`. List of key arguments specific for the concrete component is available in the docstring for each function
59
-
* Functions for creation components which have `children` property have two additional methods ``(children::Any; kwargs...)::Component`` and ``(children_maker::Function; kwargs..)::Component``. `children` must by string or number or single component or collection of components
60
-
*``make_handler(app::Dash; debug::Bool = false)`` makes handler function for using in HTTP package
60
+
* Unlike the Python version where each Dash component is represented as a separate class, all components in Dash.jl are represented by struct `Component`.
61
+
* You can create `Component` specific for concrete Dash component by the set of functions in the form ``lowercase(<component package>)_lowercase(<component name>)``. For example, in Python html `<div>` element is represented as `HTML.Div` in Dasboards it is created using function `html_div`
62
+
* The list of all supported components is available in docstring for Dasboards module.
63
+
* All functions for a component creation have the signature `(;kwargs...)::Component`. List of key arguments specific for the concrete component is available in the docstring for each function.
64
+
* Functions for creation components which have `children` property have two additional methods ``(children::Any; kwargs...)::Component`` and ``(children_maker::Function; kwargs..)::Component``. `children` must by string or number or single component or collection of components.
65
+
*``make_handler(app::Dash; debug::Bool = false)`` makes a handler function for using in HTTP package.
61
66
62
67
63
68
__Once you have run the code to create the Dashboard, go to `http://127.0.0.1:8080` in your browser to view the Dashboard!__
@@ -66,6 +71,9 @@ __Once you have run the code to create the Dashboard, go to `http://127.0.0.1:80
@@ -76,17 +84,21 @@ julia> app.layout = html_div() do
76
84
julia> callback!(app, callid"my-id.value => my-div.children") do input_value
77
85
"You've entered $(input_value)"
78
86
end
79
-
julia> run_server(app, "0.0.0.0", 8080)
80
87
88
+
julia> run_server(app, "0.0.0.0", 8080)
81
89
```
90
+
82
91
* You can make your dashboard interactive by register callbacks for changes in frontend with function ``callback!(func::Function, app::Dash, id::CallbackId)``
83
92
* Inputs and outputs (and states, see below) of callback are described by struct `CallbackId` which can easily created by string macro `callid""`
84
93
*`callid""` parse string in form ``"[{state1 [,...]}] input1[,...] => output1[,...]"`` where all items is ``"<element id>.<property name>"``
85
-
* Callback function must have the signature(states..., inputs...), and provide a return value comparable (in terms of number of elements) to the outputs being updated.
94
+
* Callback functions must have the signature(states..., inputs...), and provide a return value comparable (in terms of number of elements) to the outputs being updated.
Be careful - in Dash.jl states came first in arguments list
172
+
Be careful - in Dash.jl states come first in an arguments list.
161
173
162
-
### json:
163
-
I use JSON2 for json serialization/deserialization, so in callbacks all JSON objects are `NamedTuples` rather than dictionaries. Within component properties you can use both `Dict` and `NamedTuple` for json objects.
174
+
### JSON:
175
+
I use JSON2.jl for JSON serialization/deserialization, so in callbacks all JSON objects are `NamedTuples` rather than dictionaries. Within component properties you can use both `Dict` and `NamedTuple` for JSON objects.
164
176
165
177
Note when declaring elements with a single properly that `layout = (title = "Test graph")` is not interpreted as a `NamedTuple` by Julia - you'll need to add a comma when declaring the layout, e.g. `layout = (title = "Test graph",)`
0 commit comments