Notifier
This component notifies the user if bad data is passed into a widget.
Config
this._config = {
height: {
name: 'Chart Height',
description: 'Height of the chart.',
type: 'number',
value: 100
},
width: {
name: 'Chart Width'
description: 'Width of the chart.',
type: 'number',
value: 100
},
chartName: {
description: 'Name of chart for Reporting.',
type: 'string',
value: 'Notifier'
}
};
Interface
chart.appendMessage('Notifier', 'WARN', 'Warning: Invalid Data', "Schema", [[Bad Data],...]);
chart.appendMessage("Notifier", "DISCARDED_VALID_DATA", "Why", "Schema", [[Discarded Data], ...]);
chart.appendMessage("Notifier", "NO_DATA", "No Data", "", []);
chart.appendMessage("Notifier", "SAMPLE_DATA", "Sample Data", "", []);
chart.appendMessage('Notifier', 'FAIL', 'O, Something Went Wrong!', "", []);
Create Widget
var chart = d3.select("#vis")
.append("svg")
.attr({
"width":800,
"height":800
})
.append("g")
.attr("transform", "translate(50,50)")
.chart("Notifier")
.config({
'width':250,
'height':function(){return 250;}
});
chart.appendMessage("Notifier", "NO_DATA", "No Data", "", []);
chart.appendMessage("Notifier", "SAMPLE_DATA", "No Data", "", []);
chart.appendMessage('Notifier', 'WARN', 'Warning', "", []);
chart.appendMessage('Notifier', 'FAIL', 'O, Something Went Wrong!', "", []);
chart.showMessage(true);
chart.draw();