new visualize()
Module for visualization of charts and tables.
- Source:
Methods
(static) chart(params, data) → {Element}
Creates new charts depending on what the user requires. It can generate scatter, histograms, columns, lines, timelines, etc. It creates a new div space for each chart generated.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | Contains: charType, id, drawing options (see google charts docs). |
data |
Object | Contains: data as JS nd-array. |
- Source:
Returns:
Chart appended to new div in body.
- Type
- Element
Example
hydro.visualize.chart({params: {chartType: 'column', id: 'id', options: {'some options'}}, data: [data1, data2,...]});
(static) draw(params, args, data) → {Element}
Preset styles for both charts and tables. The user can access by passing parameters of data, type(chart or table).
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | Contains: type (chart, table, or json), name. |
args |
Object | Contains: charttype (column, scatter, line, timeline) only use if drawing charts. |
data |
Object | Contains: data as JS nd-array. |
- Source:
Returns:
Chart (graph, table, or json render) appended in body of HTML document.
- Type
- Element
Example
hydro.visualize.draw({params: {type: 'chart', name: 'someName'}, args: {charttype: 'column'}}, data: [data1, data2,...]});
(static) prettyPrint(params, data) → {Element}
Returns a space in screen to visualize JSON formart objects saved in the local storage. Will be expanded to visualize other types of data.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | Contains: input (single or all objects), type (currently only JSON) |
data |
Object | Contains: data as JS Objects. |
- Source:
Returns:
Renders to screen the json object to render.
- Type
- Element
Example
hydro.visualize.prettyPrint({params: {input: 'all', type: 'JSON'} data: {Objects}})
(static) table(params, data) → {Element}
Generates a new table for the data given by the user.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | contanis: id, dataType and applicable options. |
data |
Object | Contains: data |
- Source:
Returns:
Table appended to new div in body.
- Type
- Element
Example
hydro.visualize.table({params: {id: "new", dataType: ["string", "number"]}, data: [data1, data2...]});