test

Luminous

Luminous is a framework for creating dashboards within Phoenix Live View. It is somewhat inspired by grafana both conceptually and functionally in that:

Dashboards are defined at compile time using elixir code (see Luminous.Dashboard.define/5). At runtime, Luminous uses the following javascript libraries (as live view hooks) for supporting client-side visualizations and interactions with the live view process:

Luminous is currently used in production systems and has demonstrated solid performance and stability characteristics. At the same time, it is currently under development and some things may change.

Installation

The package is not yet published to hex.pm but can be installed directly from this repo by adding luminous to your list of dependencies in mix.exs like so:

def deps do
[
{:luminous, git: "https://github.com/elinverd/luminous.git", branch: "main"}
]
end

luminous assumes that it will be embedded in a standard Phoenix LiveView application with tailwindcss.

In order to be able to use the provided components, the library's javascript and CSS files must be imported to your project:

In assets/package.json:

...
"dependencies": {
"luminous": "file:../deps/luminous"
}

In assets/js/app.js:

import { ChartJSHook, TimeRangeHook } from "luminous"
let Hooks = {
TimeRangeHook: new TimeRangeHook(),
ChartJSHook: new ChartJSHook()
}
...
let liveSocket = new LiveSocket("/live", Socket, {
...
hooks: Hooks
})
...

Finally, in assets/css/app.css:

@import "luminous/dist/luminous";

Usage

A demo dashboard has been provided that showcases some of Luminous' capabilities.

The demo can be inspected live using the project's dev server (run mix dev in the project and then visit this page).

Luminous is a framework in the sense that the luminous client is responsible for specifying queries, variables etc. and Luminous.Live will call the client's code by setting up all the required plumbing.

In general, a custom dashboard needs to:

Features

Development

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/luminous.