Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.

Commit 41fd96f

Browse files
committed
Initial commit
0 parents  commit 41fd96f

8 files changed

+7362
-0
lines changed

package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "iknow-browser",
3+
"version": "0.0.1",
4+
"description": "iKnow graph browser",
5+
"main": "index.js",
6+
"dependencies": {
7+
"linkurious": "^1.5.2",
8+
"lodash": "^4.13.1"
9+
},
10+
"devDependencies": {
11+
"css-loader": "0.23.1",
12+
"exports-loader": "0.6.3",
13+
"expose-loader": "0.7.1",
14+
"html-webpack-plugin": "2.22.0",
15+
"file-loader": "0.8.5",
16+
"json-loader": "0.5.4",
17+
"node-sass": "3.10.1",
18+
"style-loader": "0.13.1",
19+
"url-loader": "0.5.7",
20+
"webpack": "1.13.2",
21+
"webpack-dev-server": "1.14.1",
22+
"imports-loader": "0.6.5"
23+
},
24+
"scripts": {
25+
"test": "echo \"Error: no test specified\" && exit 1",
26+
"demo": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --port 5000 --config webpack.demo.config.js --content-base dist/"
27+
},
28+
"main": "dist/iKnowBrowser.js",
29+
"author": "[email protected]",
30+
"license": "GPL-3.0"
31+
}

report.xml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<dfxml xmloutputversion='1.0'>
3+
<metadata
4+
xmlns='http://afflib.org/tcpflow/'
5+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
6+
xmlns:dc='http://purl.org/dc/elements/1.1/'>
7+
<dc:type>Feature Extraction</dc:type>
8+
</metadata>
9+
<creator version='1.0'>
10+
<program>TCPFLOW</program>
11+
<version>1.4.5</version>
12+
<build_environment>
13+
<compiler>5.2.1 (5.2.1 20151022)</compiler>
14+
<CPPFLAGS>-pthread -I/usr/local/include -I/usr/local/include -D_FORTIFY_SOURCE=2 -DUTC_OFFSET=+0000 </CPPFLAGS>
15+
<CFLAGS>-g -pthread -g -O3 -fstack-protector-strong -Wformat -Werror=format-security -MD -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wwrite-strings -Wcast-align -Waggregate-return -Wbad-function-cast -Wcast-qual -Wundef -Wredundant-decls -Wdisabled-optimization -Wfloat-equal -Wmultichar -Wc++-compat -Wmissing-noreturn -Wall -Wstrict-prototypes -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wwrite-strings -Wcast-align -Waggregate-return -Wbad-function-cast -Wcast-qual -Wundef -Wredundant-decls -Wdisabled-optimization -Wfloat-equal -Wmultichar -Wc++-compat -Wmissing-noreturn -Wall -Wstrict-prototypes</CFLAGS>
16+
<CXXFLAGS>-g -pthread -g -O3 -fstack-protector-strong -Wformat -Werror=format-security -Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wshadow -Wwrite-strings -Wcast-align -Wredundant-decls -Wdisabled-optimization -Wfloat-equal -Wmultichar -Wmissing-noreturn -Woverloaded-virtual -Wsign-promo -funit-at-a-time -Weffc++ -std=c++11 -Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wshadow -Wwrite-strings -Wcast-align -Wredundant-decls -Wdisabled-optimization -Wfloat-equal -Wmultichar -Wmissing-noreturn -Woverloaded-virtual -Wsign-promo -funit-at-a-time -Wstrict-null-sentinel -Weffc++ </CXXFLAGS>
17+
<LDFLAGS>-L/usr/local/lib -L/usr/local/lib -Wl,-Bsymbolic-functions -Wl,-z,relro</LDFLAGS>
18+
<LIBS>-lpcap -lcairo -lfontconfig -lfreetype -lpixman-1 -lexpat -lssl -lcrypto -lssl -lcrypto -ldl -lz </LIBS>
19+
<compilation_date>2015-10-24T03:49:33</compilation_date>
20+
<library name="boost" version="105800"/>
21+
</build_environment>
22+
<execution_environment>
23+
<os_sysname>Linux</os_sysname>
24+
<os_release>4.4.0-47-generic</os_release>
25+
<os_version>#68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016</os_version>
26+
<host>linuxbox</host>
27+
<arch>x86_64</arch>
28+
<command_line>tcpflow -p -c -i enp3s0 port 80</command_line>
29+
<uid>0</uid>
30+
<start_time>2016-12-01T13:13:10Z</start_time>
31+
</execution_environment>
32+
</creator>
33+
<configuration>
34+
</configuration>
35+
<tdelta>0</tdelta>

src/examples/demo.js

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*import { createElement, ClassAttributes } from 'react';
2+
import * as ReactDOM from 'react-dom';
3+
4+
import { Workspace, WorkspaceProps, DemoDataProvider } from '../index';
5+
*/
6+
var data = require("./relatedGraph.json")
7+
8+
var sigma = require("linkurious")
9+
require("imports-loader?sigma=linkurious,this=>window!linkurious/dist/plugins")
10+
11+
12+
var _ = require("lodash")
13+
14+
document.addEventListener('DOMContentLoaded', () => {
15+
const container = document.createElement('div');
16+
container.id = 'root';
17+
document.body.appendChild(container);
18+
19+
/*fetch("related/patient").then(function(response) {
20+
console.log(response.json);
21+
});*/
22+
23+
var g = {
24+
nodes: [],
25+
edges: []
26+
};
27+
var stopNodes = [0];//[0, 871, 213, 1059]
28+
_.each(data.graph.nodes, node => {
29+
if (!_.includes(stopNodes, node.id)) {
30+
g.nodes.push({
31+
id: node.id,
32+
label: node.label + ' ' + node.id,
33+
x: Math.random(),
34+
y: Math.random(),
35+
size: node.entities.frequency / 1000,
36+
color: '#aaa'
37+
})
38+
}
39+
});
40+
41+
var colors = {related: '#ff0000', similar: '#0000FF'};
42+
43+
_.each(data.graph.edges, edge => {
44+
if (!(_.includes(stopNodes, edge.origin) || _.includes(stopNodes, edge.destination))) {
45+
g.edges.push({
46+
id: 'e' + edge.origin + 'to' + edge.destination,
47+
source: edge.origin,
48+
target: edge.destination,
49+
/*size: Math.random(),*/
50+
color: colors[edge.type]
51+
});
52+
}
53+
});
54+
55+
// Instantiate sigma:
56+
var s = new sigma({
57+
graph: g,
58+
container: 'root'
59+
});
60+
61+
var fa = s.startForceAtlas2({worker: true, scalingRatio: 100, gravity: 1, barnesHutOptimize: true, adjustSizes: false, strongGravityMode: true});
62+
window.setTimeout(function() {s.stopForceAtlas2()}
63+
, 2000);
64+
65+
/*var props = {
66+
ref: function(browser) {
67+
// if you reuse this code you should check for workspace to be null on unmount
68+
if (browser) {
69+
const model = workspace.getModel();
70+
model.graph.on('action:iriClick', (iri: string) => {
71+
console.log(iri);
72+
});
73+
model.importLayout({
74+
dataProvider: new DemoDataProvider(),
75+
preloadedElements: {},
76+
preloadedLinks: [],
77+
layoutData: undefined,
78+
});
79+
}
80+
},
81+
};
82+
83+
ReactDOM.render(createElement(Workspace, props), container);
84+
*/
85+
});

0 commit comments

Comments
 (0)