Hi julians, I’m really pleased to announce the release of my first julia package:
Matte.jl
Matte is a package for creating interactive dashboards in julia, inspired/based on material design. This simple example of interactive plotting shows the basic functionality.
I’m a long-time Shiny user, and that sort of functionality is what I had in mind for Matte.
Give it a try for yourself by installing from the General repository and then creating and running the included hello_world
app (there are other examples too)
]add Matte
using Matte, Revise
matte_example("hello_world", "hello_world")
includet("app.jl")
run_app(HelloWorldApp)
Navigate your favourite browser to localhost:8000
/ 0.0.0.0:8000
and (after a bit of a lag as julia compiles everything) you should see your brand new app.
You can find documentation here.
Some caveats
Matte is very experimental!
I am very much not a web developer, so I apologise to anyone who is and looks at my code. I’m sure it’ll be very ugly and I have done things a totally terrible way.
Matte isn’t well tested – it’s just been me messing around with it. There are likely to
be many bugs. Please report any you find on github
Basic structure
Matte apps comprise three key elements:
- A module that defines the app
- A function that creates the UI
- A module that defines the server-side logic
Matte has a simple logic: each function in the server module is an output in the UI. You access the output from these functions by using the function name as the id
for output elements in the UI. Inputs work similarly: you assign each input in the UI an id
; you access the value of the input by using its id
as an argument to a function in the server module.
Let’s make this concrete with an example. Suppose we want to create an app that adds two numbers specified by our users. We define in our server module:
function my_add(number1, number2)
number1 + number2
end
This relationship is expressed in our app accordingly:
The docs go in to lots more detail, so have a look at those if you’re interested and want
to learn more:
Acknowledgements
Matte leans very heavily on a whole bunch of great packages – Genie and HTTP on the julia side and the javascript packages Vue and Vuetify.