Skip to content

Commit

Permalink
kibana5
Browse files Browse the repository at this point in the history
  • Loading branch information
chenryn committed Dec 22, 2016
1 parent 55aae65 commit f3c2ba4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 171 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Kibana Sankey Diagram Plugin

This is a sankey diagram visType plugin for Kibana 4.3+.
This is a sankey diagram visType plugin for Kibana 4.3+, 5.x.

This plugin was developped from <https://github.com/elastic/kibana/pull/4832>.

![](https://cloud.githubusercontent.com/assets/1219655/9702343/081607e6-548b-11e5-81cb-4523c8c9225d.png)
![](https://cloud.githubusercontent.com/assets/1219655/21418571/29e596d8-c85d-11e6-8060-11c0add8bf5b.png)

# Install

```
cd KIBANA_FOLDER_PATH/plugins/
git clone https://github.com/chenryn/kbn_sankey_vis.git
cd kbn_sankey_vis
npm install
npm run build
cp -R build/kbn_sankey_vis KIBANA_FOLDER_PATH/installedPlugins/
```

# Uninstall
Expand Down
7 changes: 0 additions & 7 deletions bower.json

This file was deleted.

118 changes: 0 additions & 118 deletions gulpfile.babel.js

This file was deleted.

37 changes: 2 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
{
"name": "kbn_sankey_vis",
"version": "0.1.0",
"version": "kibana",
"authors": [
"Chenryn <rao.chenlin@gmail.com>"
],
"description": "sankey diagram visualization plugin",
"main": "index.js",
"license": "Apache-2.0",
"homepage": "http://kibana.logstash.es/",
"scripts": {
"test": "gulp test",
"test:coverage": "gulp coverage",
"start": "gulp dev",
"postinstall": "bower install",
"precommit": "gulp lint",
"build": "gulp build"
},
"dependencies": {
"babel-eslint": "^4.1.8",
"babel-preset-es2015": "^6.5.0",
"babel-register": "^6.5.2",
"d3-plugins-sankey": "squidsolutions/d3-plugins-sankey",
"bluebird": "^3.3.4",
"bower": "^1.7.7",
"del": "^2.2.0",
"eslint": "^2.4.0",
"eslint-plugin-mocha": "^2.0.0",
"gulp": "^3.9.1",
"gulp-eslint": "^2.0.0",
"gulp-gzip": "^1.2.0",
"gulp-tar": "^1.8.0",
"gulp-util": "^3.0.7",
"gulp-zip": "3.1.0",
"husky": "^0.10.2",
"lodash": "^4.6.1",
"minimist": "1.2.0",
"mkdirp": "^0.5.1",
"rimraf": "^2.5.2",
"rsync": "^0.4.0"
},
"devDependencies": {
}
"homepage": "http://kibana.logstash.es/"
}
2 changes: 1 addition & 1 deletion public/kbn_sankey_vis_controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import d3 from 'd3';
import _ from 'lodash';
import $ from 'jquery';
import S from 'd3-plugins-sankey';
import S from './lib/d3-plugins-sankey/sankey';
import sankeyAggResponseProvider from './lib/agg_response';
import uiModules from 'ui/modules';

Expand Down
9 changes: 5 additions & 4 deletions public/lib/agg_response.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ define(function (require) {

function processEntry(aggConfig, metric, aggData, prevNode) {
_.each(aggData.buckets, function (b) {
if (isNaN(nodes[b.key])) {
nodes[b.key] = lastNode + 1;
var bkey = aggConfig.fieldFormatter()(b.key);
if (isNaN(nodes[bkey])) {
nodes[bkey] = lastNode + 1;
lastNode = _.max(_.values(nodes));
}
if (aggConfig._previous) {
var k = prevNode + 'sankeysplitchar' + nodes[b.key];
var k = prevNode + 'sankeysplitchar' + nodes[bkey];
if (isNaN(links[k])) {
links[k] = metric.getValue(b);
} else {
links[k] += metric.getValue(b);
}
}
if (aggConfig._next) {
processEntry(aggConfig._next, metric, b[aggConfig._next.id], nodes[b.key]);
processEntry(aggConfig._next, metric, b[aggConfig._next.id], nodes[bkey]);
}
});
}
Expand Down
1 change: 1 addition & 0 deletions public/lib/d3-plugins-sankey
Submodule d3-plugins-sankey added at 506061

0 comments on commit f3c2ba4

Please sign in to comment.