Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
phyunsj authored Jun 22, 2018
1 parent af0b72a commit 8741fa1
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
# node-red-custom-widget

## UI Widget : Table With Embedded Line Chart - D3
Based on [Creating your own UI widget for a Node-RED dashboard using an external charting library](http://noderedguide.com/tutorial-node-red-dashboards-creating-your-own-ui-widget-ii-using-external-charts/), create ui-widget with external source [Table With Embedded Line Chart - D3 Example](http://bl.ocks.org/llimllib/841dd138e429bb0545df)

Node-RED-Dashboard `ui-template` Porting. Source : http://bl.ocks.org/llimllib/841dd138e429bb0545df
## `ui-template`

```
<!-- external libraries -->
<script src="http://d3js.org/d3.v3.min.js"></script>
<link rel="stylesheet" href="http://billmill.org/css/style.css" />
<style>
...
</style>
;(function(scope) {
scope.msgReady = ... // ng-if
var timer = setInterval(function() { //check that D3 libs are loaded, if not wait
if (!window.d3) return;
clearInterval(timer);
scope.$watch('msg', function (msg) {
if (msg) {
d3.select("#datatable").selectAll("*").remove(); // Clear
var rows = msg.payload;
...
d3.select //
} // if (msg)
}); // scope.$watch()
}, 3000); // close out the setInterval
// 3 secs for spinner demo
})(scope);
```

## In Action

Expand Down

0 comments on commit 8741fa1

Please sign in to comment.