Socket
Socket
Sign inDemoInstall

@domoinc/notifier

Package Overview
Dependencies
3
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @domoinc/notifier

Notifier - Domo Widget


Version published
Weekly downloads
9
increased by350%
Maintainers
5
Install size
2.80 MB
Created
Weekly downloads
 

Readme

Source

Notifier

This component notifies the user if bad data is passed into a widget.

Config

this._config = {
	height: {										// Name of config Item
		name: 'Chart Height',						// [Optional] - This is the human readable name for this config item in Title Case. It should only be set if this is something that an end user would want to configure.
		description: 'Height of the chart.',		// Human readable description.
		type: 'number',								// [Optional] - Value type. Will be used for UI elements in future.
		value: 100									// Default value for item
	},
	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

//----------------------------------------------------------------------------------
// Notifier Interface
//
// In trumping order:
//
// WARNs are always consoled, NO_DATE trumps DISCARDED_VALID_DATA,
// SAMPLE_DATA trumps NO_DATA, and FAIL trumps all.
//----------------------------------------------------------------------------------

//ChartName, MessageType, 'Custom Message', 'Column Names, ...', [[Data], ...]

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

//Initialze the 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;}
    });

//Render the chart with data

//ChartName, MessageType, 'Custom Message', 'Column Names, ...', [[Bad Data], ...]
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!', "", []);

//var allMessages = {};
//    allMessages.warningMessages = [{chartName:"Notifier", type:"WARN", message:"Warning", expectedDataFormat:"", data:[]}];
//    allMessages.failMessages = [{chartName:"Notifier", type:"FAIL", message:"Fail", expectedDataFormat:"", data:[]}];
//    allMessages.noDataMessages = [{chartName:"Notifier", type:"NO_DATA", message:"No Data", expectedDataFormat:"", data:[]}];
//    allMessages.sampleDataMessages = [{chartName:"Notifier", type:"SAMPLE_DATA", message:"Sample Data", expectedDataFormat:"", data:[]}];
//chart.appendMessages(allMessages);

chart.showMessage(true);
chart.draw();


//chart.clearMessages();
//chart.draw();

Keywords

FAQs

Last updated on 02 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc