Skip to content

Commit

Permalink
1.0.0 Release
Browse files Browse the repository at this point in the history
- Support subscribing to array of pubnub channels
- Add support for channel groups (fix #5)
- under_score to camelCase to match PubNub JS SDK v4
- Add new channel_groups example
- Document bower, npm, and github pages hotlinking (fix #7)
- Fix demos up
  • Loading branch information
ianjennings committed Oct 18, 2016
1 parent 4d5b43e commit c747a3b
Show file tree
Hide file tree
Showing 21 changed files with 417 additions and 207 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eon-chart",
"version": "0.7.3",
"version": "1.0.0",
"homepage": "https://github.com/pubnub/eon-chart",
"authors": [
"Ian Jennings <ian@meetjennings.com>"
Expand Down
14 changes: 11 additions & 3 deletions examples/axis.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<html>
<head>

<script src="https://pubnub.github.io/eon/v/eon/0.1.0/eon.js" type="text/javascript"></script>
<link href="https://pubnub.github.io/eon/v/eon/0.1.0/eon.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="../pubnub-c3.js"></script>

</head>
<body>
Expand All @@ -17,7 +22,7 @@
var channel = "c3-spline-test-test-test";

eon.chart({
channel: channel,
channels: [channel],
flow: true,
pubnub: pubnub,
generate: {
Expand All @@ -41,6 +46,9 @@
<script>
setInterval(function(){

console.log(pubnub)
console.log(pubnub.publish)

pubnub.publish({
channel: channel,
message: {
Expand Down
12 changes: 8 additions & 4 deletions examples/bar.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<html>
<head>

<script src="https://pubnub.github.io/eon/v/eon/0.1.0/eon.js" type="text/javascript"></script>
<link href="https://pubnub.github.io/eon/v/eon/0.1.0/eon.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="../pubnub-c3.js"></script>

</head>
<body>
Expand All @@ -18,8 +23,7 @@

eon.chart({
pubnub: pubnub,
channel: channel,
debug: true,
channels: [channel],
generate: {
bindto: '#chart',
data: {
Expand Down
4 changes: 1 addition & 3 deletions examples/local_files.html → examples/bower.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
var channel = "c3-spline-history";

eon.chart({
debug: true,
channel: channel,
channels: [channel],
flow: true,
pubnub: pubnub,
history: true,
generate: {
bindto: '#chart',
data: {
Expand Down
100 changes: 100 additions & 0 deletions examples/channel_groups.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="../pubnub-c3.js"></script>

</head>
<body>
<div id="chart"></div>
<script>

var pubnub = new PubNub({
publishKey: 'pub-c-6dbe7bfd-6408-430a-add4-85cdfe856b47',
subscribeKey: 'sub-c-2a73818c-d2d3-11e3-9244-02ee2ddab7fe'
});

var channels = ['pubnub-c3-1', 'pubnub-c3-2', 'pubnub-c3-3'];

// create channel group
pubnub.channelGroups.addChannels(
{
channels: channels,
channelGroup: "pubnub-c3-example"
},
function(status) {
if (status.error) {
console.log("operation failed w/ status: ", status);
} else {
console.log("operation done!")

// list channels
pubnub.channelGroups.listChannels(
{
channelGroup: "pubnub-c3-example"
},
function (status, response) {
if (status.error) {
console.log("operation failed w/ error:", status);
return;
}

console.log("listing push channel for device")
response.channels.forEach( function (channel) {
console.log(channel)
})
}
);

}
}
);


eon.chart({
channelGroups: ['pubnub-c3-example'],
history: true,
flow: true,
pubnub: pubnub,
connect: connect,
generate: {
bindto: '#chart',
data: {
type: 'spline',
labels: false
}
}
});

function publish(pointId, channel) {

var m = {
eon:{}
};
m.eon[pointId] = Math.floor(Math.random() * 99);

pubnub.publish({
channel: channel,
message: m
});

}

function connect() {

console.log('connect')

setInterval(function(){
publish('first', channels[0]);
publish('second', channels[1]);
publish('third', channels[2]);
}, 1000);

};
</script>
</body>
</html>
11 changes: 8 additions & 3 deletions examples/custom_keys.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<html>
<head>

<script src="https://pubnub.github.io/eon/v/eon/0.1.0/eon.js" type="text/javascript"></script>
<link href="https://pubnub.github.io/eon/v/eon/0.1.0/eon.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="../pubnub-c3.js"></script>

</head>
<body>
Expand All @@ -18,7 +23,7 @@

eon.chart({
pubnub: pubnub,
channel: channel,
channels: [channel],
flow: {
duration: 100
},
Expand Down
16 changes: 10 additions & 6 deletions examples/distributed.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<html>
<head>

<script src="https://pubnub.github.io/eon/v/eon/0.1.0/eon.js" type="text/javascript"></script>
<link href="https://pubnub.github.io/eon/v/eon/0.1.0/eon.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="../pubnub-c3.js"></script>

</head>
<body>
Expand All @@ -17,15 +22,14 @@
var channel = "c3-spline-history" + Math.random();

eon.chart({
channel: channel,
channels: [channel],
flow: true,
limit: 100,
debug: false,
pubnub: pubnub,
rate: 500,
debug: true,
x_type: 'custom',
x_id: 'yesterday',
xType: 'custom',
xId: 'yesterday',
generate: {
bindto: '#chart',
data: {
Expand Down
11 changes: 7 additions & 4 deletions examples/double.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="https://pubnub.github.io/eon/v/eon/0.1.0/eon.js" type="text/javascript"></script>
<link href="https://pubnub.github.io/eon/v/eon/0.1.0/eon.css" type="text/css" rel="stylesheet" />

<script src="../pubnub-c3.js"></script>
</head>
<body>
<div id="chart"></div>
Expand All @@ -17,7 +20,7 @@
var channel = "c3-spline" + Math.random();

eon.chart({
channel: channel,
channels: [channel],
flow: true,
pubnub: pubnub,
debug: false,
Expand Down
15 changes: 9 additions & 6 deletions examples/eons.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<html>
<head>

<script src="https://pubnub.github.io/eon/v/eon/0.1.0/eon.js" type="text/javascript"></script>
<link href="https://pubnub.github.io/eon/v/eon/0.1.0/eon.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="../pubnub-c3.js"></script>
</head>
<body>
<div id="chart"></div>
Expand All @@ -17,13 +21,12 @@
var channel = "c3-spline-" + new Date().getTime();

eon.chart({
channel: channel,
debug: true,
channels: [channel],
flow: true,
pubnub: pubnub,
limit: 100,
x_type: 'custom',
x_id: 'pub_time',
xType: 'custom',
xId: 'pub_time',
generate: {
bindto: '#chart',
data: {
Expand Down
10 changes: 7 additions & 3 deletions examples/gauge.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<html>
<head>

<script src="https://pubnub.github.io/eon/v/eon/0.1.0/eon.js" type="text/javascript"></script>
<link href="https://pubnub.github.io/eon/v/eon/0.1.0/eon.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../bower_components/c3/c3.min.css">
<script src="../bower_components/pubnub/dist/web/pubnub.min.js"></script>
<script src="../bower_components/d3/d3.min.js"></script>
<script src="../bower_components/c3/c3.min.js"></script>
<script src="../bower_components/visibilityjs/lib/visibility.core.js"></script>

<script src="../pubnub-c3.js"></script>
</head>
<body>
<div id="chart"></div>
Expand All @@ -18,7 +22,7 @@

eon.chart({
pubnub: pubnub,
channel: channel,
channels: [channel],
generate: {
bindto: '#chart',
data: {
Expand Down
Loading

0 comments on commit c747a3b

Please sign in to comment.