Output elements
Matte.text_output
— Functiontext_output(id)
Render the output from the server as raw text.
This is best used with a formatting tag (such as p()
or heading h1()
etc)
Matte.datatable_output
— Functiondatatable_output(id::AbstractString; rows_per_page::Integer
Render a table of data in your UI. The function id
in your Server module should return a table that is a subtype of either AbstractDataFrame
or Table
(from Tables.jl
).
Matte.plots_output
— Functionplots_output(id)
Render a plot. Supports plots created by the Plots
package.
Plots are slow to render, and so should not be directly hooked up to inputs that rapidly request updates to the server – like sliders. If you wish to use these input types, add a button to refresh the plot input and only return the plot when that is true
(otherwise return nothing
).
Side effects / manually pushing updates to the UI
Matte.update_output
— Functionui_update(id, value, session)
Manually update a UI variable/element id
to value
. Use inside server-side functions for other outputs when you want calculations to have side effects in the UI.
session
is the optional session
argument to server-side functions that provides stateful variables. See the guides on server-side state and side effects for more information.
update_output
is a way to manually change the value of an output variable in the UI from within the function for a different output variable. This is not the typical Matte computation model, but can be useful for logic flows like:
- Setting and unsetting loading animations for long-running computations
- Creating 'onclick' listeners for buttons that then change multiple elements
update_output
must be passed an argument called session, and that variable must be an argument to the function from within which it is called. See the guide on server-side state for more details.