testHex.pm

Luminous

Luminous is a framework for creating dashboards within Phoenix Live View.

Dashboards are defined using elixir code and consist of Panels which are responsible for visualizing the results of client-side Queries. Three different types of Panels are currently supported:

Dashboards can be parameterized by a time range (using the flatpickr) and by user-defined variables in the form of dropdown menus.

Features

Installation

The package can be installed from hex.pm as follows:

def deps do
  [
    {:luminous, "~> 2.1.0"}
  ]
end

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/js/app.js:

import { ChartJSHook, TableHook, TimeRangeHook } from "luminous"

let Hooks = {
  TimeRangeHook: new TimeRangeHook(),
  ChartJSHook: new ChartJSHook(),
  TableHook: new TableHook()
}

...

let liveSocket = new LiveSocket("/live", Socket, {
  ...
  hooks: Hooks
})
...

Finally, in assets/css/app.css:

@import "../../deps/luminous/dist/luminous.css";

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 client-side dashboard needs to: