# @domoinc/notifier

> Notifier - Domo Widget

Latest version **2.2.4** (published 2016-02-02) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @domoinc/notifier
pnpm add @domoinc/notifier
yarn add @domoinc/notifier
bun add @domoinc/notifier
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.4 |
| Published | 2016-02-02 |
| First published | 2016-01-26 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Domo Inc. |
| Maintainers | aharris88, jaxry, jmstewart, morganjohn12, nicksrandall |
| Keywords | domo, app |

## Links

- npm: https://www.npmjs.com/package/@domoinc/notifier
- npm.io page: https://npm.io/package/@domoinc/notifier

## Dependencies (2)

- [d3](https://npm.io/package/d3.md) ^3.5.14
- [d3.chart](https://npm.io/package/d3.chart.md) ^0.3.0

## Recent versions

- 2.2.4 (latest) — 2016-02-02
- 2.2.3 — 2016-02-01
- 2.2.2 — 2016-02-01
- 2.2.0 — 2016-01-26
- 2.1.0 — 2016-01-26

## README

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

## Config

``` js
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
``` js
//----------------------------------------------------------------------------------
// 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
``` js
//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();
```

---
_Source: https://npm.io/package/@domoinc/notifier · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
