dashboard-framework
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -527,9 +527,9 @@ (function(global, factory) { | ||
window.dashboardCharts !== undefined && | ||
chart.hasOwnProperty('identifier') && | ||
dashboardCharts.specifications[chart.identifier] !== undefined | ||
chart.hasOwnProperty('spec') && | ||
dashboardCharts.specifications[chart.spec] !== undefined | ||
) { | ||
//Capture and clone default chart specification given specification identifier specified in chart settings. | ||
var specification = _this.clone(dashboardCharts.specifications[chart.identifier]); //Attach specification identifier to specification -- seems recursive. | ||
var specification = _this.clone(dashboardCharts.specifications[chart.spec]); //Attach specification identifier to specification -- seems recursive. | ||
specification.identifier = chart.identifier; //Attach chart data to specification. | ||
specification.spec = chart.spec; //Attach chart data to specification. | ||
@@ -664,6 +664,5 @@ specification.data = chart.data; //Overwrite specification title with custom chart title. | ||
function callCreateControls(chart) { | ||
if (Array.isArray(chart.controlInputs) && chart.controlInputs.length) | ||
chart.controls = new webcharts.createControls(chart.containers.head.node(), { | ||
inputs: chart.controlInputs | ||
}); | ||
chart.controls = new webcharts.createControls(chart.containers.head.node(), { | ||
inputs: chart.controlInputs || [] | ||
}); | ||
} | ||
@@ -911,6 +910,5 @@ | ||
function callCreateControls$1(chart) { | ||
if (Array.isArray(chart.controlInputs) && chart.controlInputs.length) | ||
chart.controls = new webcharts.createControls(chart.containers.head.node(), { | ||
inputs: chart.controlInputs | ||
}); | ||
chart.controls = new webcharts.createControls(chart.containers.head.node(), { | ||
inputs: chart.controlInputs || [] | ||
}); | ||
} | ||
@@ -917,0 +915,0 @@ |
{ | ||
"name": "dashboard-framework", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "webpage framework in which to place charts in a grid", | ||
@@ -5,0 +5,0 @@ "module": "src/index.js", |
@@ -11,10 +11,10 @@ import checkArguments from './addChartList/checkArguments'; | ||
window.dashboardCharts !== undefined && | ||
chart.hasOwnProperty('identifier') && | ||
specifications[chart.identifier] !== undefined | ||
chart.hasOwnProperty('spec') && | ||
specifications[chart.spec] !== undefined | ||
) { | ||
//Capture and clone default chart specification given specification identifier specified in chart settings. | ||
const specification = this.clone(specifications[chart.identifier]); | ||
const specification = this.clone(specifications[chart.spec]); | ||
//Attach specification identifier to specification -- seems recursive. | ||
specification.identifier = chart.identifier; | ||
specification.spec = chart.spec; | ||
@@ -21,0 +21,0 @@ //Attach chart data to specification. |
import { createControls } from 'webcharts'; | ||
export default function callCreateControls(chart) { | ||
if (Array.isArray(chart.controlInputs) && chart.controlInputs.length) | ||
chart.controls = new createControls(chart.containers.head.node(), { | ||
inputs: chart.controlInputs | ||
}); | ||
chart.controls = new createControls(chart.containers.head.node(), { | ||
inputs: chart.controlInputs || [] | ||
}); | ||
} |
const dashboard = dashboardFramework('#container'); | ||
//Pass an array of data specification identifiers and data paths/arrays. | ||
// Pass an array of data specification identifiers and data paths/arrays. | ||
dashboard.addChartList([ | ||
{ | ||
identifier: 'enrollment', | ||
data: 'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/data-cleaning/dashboard-enrollment.csv', | ||
spec: 'accrual', | ||
data: 'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/data-cleaning/dashboard-accrual.csv', | ||
}, | ||
{ | ||
identifier: 'visitCompletion', | ||
spec: 'visitCompletion', | ||
data: 'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/data-cleaning/dashboard-visit-completion.csv' | ||
}, | ||
{ | ||
identifier: 'queries', | ||
spec: 'queries', | ||
data: 'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/data-cleaning/dashboard-queries.csv', | ||
}, | ||
{ | ||
identifier: 'enrollmentOverTime', | ||
data: 'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/data-cleaning/dashboard-enrollment-over-time.csv', | ||
spec: 'accrualOverTime', | ||
data: 'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/data-cleaning/dashboard-accrual-over-time.csv', | ||
}, | ||
{ | ||
identifier: 'forms', | ||
spec: 'forms', | ||
data: 'https://raw.githubusercontent.com/RhoInc/data-library/master/data/clinical-trials/data-cleaning/dashboard-forms.csv', | ||
@@ -27,3 +27,3 @@ }, | ||
//Add an additional chart. | ||
// Add an additional chart. | ||
dashboard.addChart({ | ||
@@ -59,3 +59,3 @@ settings: medicalSignsSettings, // settings | ||
//Initialize dashboard. | ||
// Initialize dashboard. | ||
dashboard.init(); |
95553
2225