3.0.0-beta.54 • Published 5 years ago

fenix-ui-dashboard v3.0.0-beta.54

Weekly downloads
3
License
GPL-2.0
Repository
github
Last release
5 years ago

FENIX Dashboard

var Dashboard = require('fx-dashboard/start');

var dashboard = new Dashboard({
        uid : "FENIX_resource_uid",
        items : [
            { 
            id : "chart-1",
             /* item configuration goes here */ 
            }, 
            { ... }
        ]
    });
<div data-item='chart-1'></div>

Configuration

Check fx-dashboard/config/config.js to have a look of the default configuration.

Item configuration

API

//This is an example
dashboard.refresh({...});
  • new dashboard( config ) : dashboard creator
  • dashboard.refresh( values ) : refresh dashboard items with new filter values (FENIX filter plain format)
  • dashboard.on(event, callback[, context]) : pub/sub
  • dashboard.dispose() : dispose the dashboard instance

Events

  • ready : triggered when the dashboard and all its items are rendered

Process composition flow

FENIX dashboard composes dynamically the FENIX process to be use to retrieve the data for each dashboard item. The FENIX process composition is based on the nature (typeof) of item.filterFor: if it is defined as array or as object.

The request is actually performed by FENIX Bridge, using the process created by the FENIX dashboard

item.filterFor as array

  • dashboard.preProcess
  • item.preProcess
  • calculated filter step from item.filter and item.filterFor
  • item.postProcess
  • dashboard.postProcess

Example

...

filterFor : ["year"],
    
preProcess : [
    { 
        rid : "step_1",
        ...
    }
    ],

postProcess : [
    { 
        rid : "step_2",
        ...
    }
    ],
...

In the previous example the filter step will be placed between preProcess and postProcess

item.filterFor as object

  • dashboard.preProcess
  • item.preProcess
  • item.postProcess
  • dashboard.postProcess

item.filter is now applied as following: given item.filterFor as object, its key set represents the set of step to consider for filtering. Each key of the key set represents in fact a step rid (i.e. the identification of a step). The array relative to each key is used to calculate a FENIX process filter step that will extend the original step.

Example

...

filterFor : {
        step_1 : ["year"],
        step_2 : ["indicator"]
    },
    
preProcess : [
    { 
        rid : "step_1",
        ...
    }
    ],
preProcess : [
    { 
        rid : "step_2",
        ...
    }
    ],
...

In the previous example the filter step will extend step_1 ( for year values) and to step_2 ( for indicator values).

Custom Plugin

Mandatory configuration

Mandatory API

  • new plugin( config ) : plugin creator
  • plugin.refresh( values ) : refresh plugin with new filter values (FENIX filter plain format)
  • plugin.on(event, callback[, context]) : pub/sub
  • plugin.dispose() : dispose the plugin instance

Events

this.controller._trigger(event,data);

// Example use
this.controller._trigger('indicators_ready',{payload: {size: this.model.data.length}});
this.dashboard.on(event, handler);

// Example use
this.dashboard.on('indicators_ready', function (data) {
    if(data.payload.size > 0){
        $(this.el).show();
    }
});
3.0.0-beta.54

5 years ago

3.0.0-beta.53

5 years ago

3.0.0-beta.52

5 years ago

3.0.0-beta.51

5 years ago

3.0.0-beta.50

5 years ago

3.0.0-beta.49

6 years ago

3.0.0-beta.48

6 years ago

3.0.0-beta.47

7 years ago

3.0.0-beta.46

7 years ago

3.0.0-beta.45

7 years ago

3.0.0-beta.44

7 years ago

3.0.0-beta.43

7 years ago

3.0.0-beta.42

7 years ago

3.0.0-beta.41

7 years ago

3.0.0-beta.40

7 years ago

3.0.0-beta.39

7 years ago

3.0.0-beta.38

7 years ago

3.0.0-beta.37

7 years ago

3.0.0-beta.36

7 years ago

3.0.0-beta.35

7 years ago

3.0.0-beta.34

7 years ago

3.0.0-beta.33

7 years ago

3.0.0-beta.32

7 years ago

3.0.0-beta.31

7 years ago

3.0.0-beta.30

7 years ago

3.0.0-beta.29

7 years ago

3.0.0-beta.28

7 years ago

3.0.0-beta.27

7 years ago

3.0.0-beta.26

7 years ago

3.0.0-beta.25

7 years ago

3.0.0-beta.24

7 years ago

3.0.0-beta.23

7 years ago

3.0.0-beta.22

7 years ago

3.0.0-beta.21

7 years ago

3.0.0-beta.20

7 years ago

3.0.0-beta.19

7 years ago

3.0.0-beta.18

7 years ago

3.0.0-beta.17

7 years ago

3.0.0-beta.16

7 years ago

3.0.0-beta.15

7 years ago

3.0.0-beta.14

7 years ago

3.0.0-beta.13

7 years ago

3.0.0-beta.12

7 years ago

3.0.0-beta.11

7 years ago

3.0.0-beta.10

7 years ago

3.0.0-beta.9

7 years ago

3.0.0-beta.8

7 years ago

3.0.0-beta.7

7 years ago

3.0.0-beta.6

7 years ago

3.0.0-beta.5

8 years ago

3.0.0-beta.4

8 years ago

3.0.0-beta.3

8 years ago