Fixed imports, deleted unnecessary js

master
Rohan Vazarkar 2016-07-26 20:04:48 -04:00
parent 8f30b4f40d
commit d693573a6b
19 changed files with 4 additions and 38123 deletions

View File

@ -2,14 +2,14 @@
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<title>Bloodhound</title>
<link type="text/css" rel="stylesheet" href="src/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet" href="src/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="src/css/styles.css">
<script>window.$ = window.jQuery = require('jquery');</script>
<script>window.sigma = require('linkurious');</script>
<script src="src/js/plugins.min.js" type="text/javascript"></script>
<script src="src/js/bootstrap3-typeahead.min.js" type="text/javascript"></script>
<script src="node_modules/linkurious/dist/plugins.min.js" type="text/javascript"></script>
<script src="node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js" type="text/javascript"></script>
</head>
<body>
<div id="root">

View File

@ -4,21 +4,11 @@ import Icon from '../icon'
import { escapeRegExp } from '../../js/utils.js';
import TabContainer from './tabcontainer'
require('bootstrap-3-typeahead')
export default class SearchContainer extends Component {
constructor(props){
super(props)
this.state = {
data : [
{id: 1, name: 'John'},
{id: 2, name: 'Miles'},
{id: 3, name: 'Charles'},
{id: 4, name: 'Herbie'},
],
mainvalue : "",
pathvalue : "",
mainPlaceholder:"Start typing to search for a node...",
pathfindingIsOpen: false
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

13
src/js/plugins.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
(function(a){"use strict";function b(a){var b=";base64,";if(-1==a.indexOf(b)){var c=a.split(","),d=c[0].split(":")[1],e=decodeURIComponent(c[1]);return new Blob([e],{type:d})}for(var c=a.split(b),d=c[0].split(":")[1],e=window.atob(c[1]),f=e.length,g=new Uint8Array(f),h=0;f>h;++h)g[h]=e.charCodeAt(h);return new Blob([g],{type:d})}function c(a,c,d){if(d=d||"graph."+c,navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(b(a),d);else if(navigator.msSaveBlob)navigator.msSaveBlob(b(a),d);else{var e=document.createElement("a");e.setAttribute("href",a),e.setAttribute("download",d),document.body.appendChild(e),e.click(),document.body.removeChild(e)}}function d(a,b,c){var d=Math.min(c/a,c/b);return{width:a*d,height:b*d}}function e(a,b,c){var d;return d=sigma.utils.getBoundaries(a.graph,b.camera.readPrefix),d.minX/=c.zoomRatio,d.minY/=c.zoomRatio,d.maxX/=c.zoomRatio,d.maxY/=c.zoomRatio,d}function f(a,b,c){var f,g=c.margin||0,h={width:b.width,height:b.height};return c.clips||c.size?c.size&&c.size>=1&&(h=d(b.width,b.height,c.size)):(f=e(a,b,c),h={width:f.maxX-f.minX+2*f.sizeMax,height:f.maxY-f.minY+2*f.sizeMax}),h.width+=g,h.height+=g,h}function g(a,b,d){if(d=d||{},d.format&&!(d.format in i))throw Error('sigma.renderers.image: unsupported format "'+d.format+'".');var e=f(a,b,d),g=a.settings("batchEdgesDrawing");g&&a.settings("batchEdgesDrawing",!1),d.clip||this.clone(a,d,e);var h=this.draw(b,d,e);a.settings("batchEdgesDrawing",g);var j=h.toDataURL(i[d.format||"png"]);return d.download&&c(j,d.format||"png",d.filename),j}if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.plugins");var h,i,j,k;h=["scene","edges","nodes","labels"],i={png:"image/png",jpg:"image/jpeg",gif:"image/gif",tiff:"image/tiff"},g.prototype.clone=function(a,b,c){b.tmpContainer=b.tmpContainer||"image-container";var d=document.getElementById(b.tmpContainer);d||(d=document.createElement("div"),d.id=b.tmpContainer,document.body.appendChild(d)),d.setAttribute("style","width:"+c.width+"px;height:"+Math.round(c.height)+"px;");var e=a.addRenderer({container:document.getElementById(b.tmpContainer),type:"canvas",settings:{batchEdgesDrawing:!0,drawLabels:!!b.labels}});e.camera.ratio=b.zoomRatio>0?b.zoomRatio:1;var f=e instanceof sigma.renderers.webgl,g=!1,i=[];j=document.createElement("canvas"),k=j.getContext("2d"),a.refresh(),h.forEach(function(a){if(e.contexts[a]&&(b.labels!==!1||"labels"!==a)){var d=e.domElements[a]||e.domElements.scene,h=e.contexts[a];g||(j.width=c.width,j.height=c.height,f&&h instanceof WebGLRenderingContext&&(j.width*=.5,j.height*=.5),g=!0),h instanceof WebGLRenderingContext?k.drawImage(d,0,0,d.width/2,d.height/2):k.drawImage(d,0,0),~i.indexOf(h)||i.push(h)}}),i=[],a.killRenderer(e),d.parentNode.removeChild(d)},g.prototype.draw=function(a,b,c){(!b.size||b.size<1)&&(b.size=window.innerWidth);var e=a instanceof sigma.renderers.webgl,f=!1,g=[],i=document.createElement("canvas"),k=i.getContext("2d");return h.forEach(function(h){if(a.contexts[h]&&(b.labels!==!1||"labels"!==h)){var l=a.domElements[h]||a.domElements.scene,m=a.contexts[h];if(!~g.indexOf(m)){if(!f){var n,o;b.clip?(n=l.width,o=l.height,c=d(n,o,b.size)):(n=j.width,o=j.height),i.width=c.width,i.height=c.height,!e&&!m instanceof WebGLRenderingContext&&(i.width*=2,i.height*=2),f=!0,b.background&&(k.rect(0,0,i.width,i.height),k.fillStyle=b.background,k.fill())}b.clip?k.drawImage(l,0,0,i.width,i.height):k.drawImage(j,0,0,i.width,i.height),g.push(m)}}}),g=[],i};var l=null;sigma.plugins.image=function(a,b,c){return sigma.plugins.killImage(),l||(l=new g(a,b,c)),l},sigma.plugins.killImage=function(){l instanceof g&&(l=null,j=null,k=null)}}).call(this);
//# sourceMappingURL=sigma.exporters.image.min.js.map

View File

@ -1,2 +0,0 @@
(function(a){"use strict";function b(a,b){var c,d,b=b||"",e=-(1/0),f=1/0,g=1/0,h=-(1/0),i=-(1/0);for(c=0,d=a.length;d>c;c++)e=Math.max(a[c][b+"size"],e),h=Math.max(a[c][b+"x"],h),f=Math.min(a[c][b+"x"],f),i=Math.max(a[c][b+"y"],i),g=Math.min(a[c][b+"y"],g);return e=e||1,{sizeMax:e,minX:f,minY:g,maxX:h,maxY:i}}function c(a,b,c,d,e){return(e-d)*(a-b)/(c-b)+d}function d(a,b,d){return{x:c(a.x,b.minX,b.maxX,d.minX,d.maxX),y:c(a.y,b.minY,b.maxY,d.minY,d.maxY)}}function e(){if("undefined"==typeof dagre)throw new Error("dagre is not declared");if("undefined"==typeof dagre.graphlib)throw new Error("dagre.graphlib is not declared");var a,c=this;this.init=function(a,b){if(b=b||{},b.nodes&&(this.nodes=b.nodes,delete b.nodes),b.boundingBox&&(this.boundingBox=b.boundingBox,delete b.boundingBox),this.sigInst=a,this.config=sigma.utils.extend(b,f),this.easing=b.easing,this.duration=b.duration,this.easing&&(!sigma.plugins||"undefined"==typeof sigma.plugins.animate))throw new Error("sigma.plugins.animate is not declared");this.running=!1},this.start=function(){if(!this.running){this.running=!0,a=new dagre.graphlib.Graph({directed:this.config.directed,multigraph:this.config.multigraph,compound:this.config.compound}),a.setGraph(this.config);for(var d=this.nodes||this.sigInst.graph.nodes(),e=0;e<d.length;e++)d[e].fixed||a.setNode(d[e].id,{});this.boundingBox===!0&&(this.boundingBox=b(d));for(var f=this.sigInst.graph.edges(),e=0;e<f.length;e++)null!=a.node(f[e].source)&&null!=a.node(f[e].target)&&a.setEdge(f[e].source,f[e].target,{id:f[e].id});h[c.sigInst.id].dispatchEvent("start"),dagre.layout(a);var g;a.edges().map(function(b){g=c.sigInst.graph.edges(a.edge(b).id),g.points=a.edge(b).points}),this.stop()}},this.stop=function(){if(a){var e,f=a.nodes().map(function(a){return c.sigInst.graph.nodes(a)||c.sigInst.graph.nodes(Number(a))});if(this.boundingBox)var g=b(a.nodes().map(function(b){return a.node(b)}));if(this.running=!1,this.easing){for(var i=0;i<f.length;i++)this.boundingBox?(e=d(a.node(f[i].id),g,c.boundingBox),f[i].dagre_x=e.x,f[i].dagre_y=e.y):(f[i].dagre_x=a.node(f[i].id).x,f[i].dagre_y=a.node(f[i].id).y);h[c.sigInst.id].dispatchEvent("interpolate"),sigma.plugins.animate(c.sigInst,{x:"dagre_x",y:"dagre_y"},{nodes:f,easing:c.easing,onComplete:function(){for(var a=0;a<f.length;a++)f[a].dagre_x=null,f[a].dagre_y=null;h[c.sigInst.id].dispatchEvent("stop"),c.sigInst.refresh()},duration:c.duration})}else{var j;a.nodes().forEach(function(b){j=c.sigInst.graph.nodes(b),j.x=a.node(b).x,j.y=a.node(b).y}),h[c.sigInst.id].dispatchEvent("stop"),this.sigInst.refresh()}}},this.kill=function(){this.sigInst=null,this.config=null,this.easing=null}}if("undefined"==typeof sigma)throw new Error("sigma is not declared");("undefined"==typeof dagre||"undefined"==typeof dagre.graphlib)&&console.warn("to use the dagre plugin, you have to include dagre and dagre.graphlib"),sigma.utils.pkg("sigma.layouts.dagre");var f={directed:!0,multigraph:!0,compound:!1,rankDir:"TB"},g={},h={};sigma.layouts.dagre.configure=function(a,b){if(!a)throw new Error('Missing argument: "sigInst"');if(!b)throw new Error('Missing argument: "config"');return g[a.id]||(g[a.id]=new e,h[a.id]={},sigma.classes.dispatcher.extend(h[a.id]),a.bind("kill",function(){g[a.id].kill(),g[a.id]=null,h[a.id]=null})),g[a.id].init(a,b),h[a.id]},sigma.layouts.dagre.start=function(a,b){if(!a)throw new Error('Missing argument: "sigInst"');return b&&this.configure(a,b),g[a.id].start(),h[a.id]},sigma.layouts.dagre.isRunning=function(a){if(!a)throw new Error('Missing argument: "sigInst"');return!!g[a.id]&&g[a.id].running}}).call(this);
//# sourceMappingURL=sigma.layouts.dagre.min.js.map

View File

@ -1 +0,0 @@
(function(n){"use strict";function i(){var n=this;this.init=function(n,i){if(i=i||{},this.sigInst=n,this.config=sigma.utils.extend(i,s),this.easing=i.easing,this.duration=i.duration,i.nodes&&(this.nodes=i.nodes,delete i.nodes),!sigma.plugins||"undefined"==typeof sigma.plugins.animate)throw new Error("sigma.plugins.animate is not declared");this.running=!1},this.atomicGo=function(){if(!this.running||this.iterCount<1)return!1;var i,s,t,o,e,d,r,g,a,f,c,h,l,u,p,x,_,m,y,M,z,v=this.nodes||this.sigInst.graph.nodes(),I=v.length,E=1/0,N=-(1/0),S=1/0,w=-(1/0);for(this.iterCount--,this.running=!1,i=0;I>i;i++)s=v[i],s.dn.dx=0,s.dn.dy=0,E=Math.min(E,s.dn_x-(s.dn_size*n.config.scaleNodes+n.config.nodeMargin)),N=Math.max(N,s.dn_x+(s.dn_size*n.config.scaleNodes+n.config.nodeMargin)),S=Math.min(S,s.dn_y-(s.dn_size*n.config.scaleNodes+n.config.nodeMargin)),w=Math.max(w,s.dn_y+(s.dn_size*n.config.scaleNodes+n.config.nodeMargin));for(o=N-E,e=w-S,d=(E+N)/2,r=(S+w)/2,E=d-n.config.permittedExpansion*o/2,N=d+n.config.permittedExpansion*o/2,S=r-n.config.permittedExpansion*e/2,w=r+n.config.permittedExpansion*e/2,g={},a=0;a<n.config.gridSize;a++)for(g[a]={},f=0;f<n.config.gridSize;f++)g[a][f]=[];for(i=0;I>i;i++)for(s=v[i],m=s.dn_x-(s.dn_size*n.config.scaleNodes+n.config.nodeMargin),y=s.dn_x+(s.dn_size*n.config.scaleNodes+n.config.nodeMargin),M=s.dn_y-(s.dn_size*n.config.scaleNodes+n.config.nodeMargin),z=s.dn_y+(s.dn_size*n.config.scaleNodes+n.config.nodeMargin),c=Math.floor(n.config.gridSize*(m-E)/(N-E)),h=Math.floor(n.config.gridSize*(y-E)/(N-E)),l=Math.floor(n.config.gridSize*(M-S)/(w-S)),u=Math.floor(n.config.gridSize*(z-S)/(w-S)),f=c;h>=f;f++)for(a=l;u>=a;a++)g[a][f].push(s.id);for(p={},a=0;a<n.config.gridSize;a++)for(f=0;f<n.config.gridSize;f++)g[a][f].forEach(function(i){for(p[i]||(p[i]=[]),x=Math.max(0,a-1);x<=Math.min(a+1,n.config.gridSize-1);x++)for(_=Math.max(0,f-1);_<=Math.min(f+1,n.config.gridSize-1);_++)g[x][_].forEach(function(n){n!==i&&-1===p[i].indexOf(n)&&p[i].push(n)})});for(i=0;I>i;i++)t=v[i],p[t.id].forEach(function(i){var s=n.sigInst.graph.nodes(i),d=s.dn_x-t.dn_x,r=s.dn_y-t.dn_y,g=Math.sqrt(d*d+r*r),a=g<t.dn_size*n.config.scaleNodes+n.config.nodeMargin+(s.dn_size*n.config.scaleNodes+n.config.nodeMargin);a&&(n.running=!0,g>0?(s.dn.dx+=d/g*(1+t.dn_size),s.dn.dy+=r/g*(1+t.dn_size)):(s.dn.dx+=.01*o*(.5-Math.random()),s.dn.dy+=.01*e*(.5-Math.random())))});for(i=0;I>i;i++)s=v[i],s.fixed||(s.dn_x=s.dn_x+.1*s.dn.dx*n.config.speed,s.dn_y=s.dn_y+.1*s.dn.dy*n.config.speed);return this.running&&this.iterCount<1&&(this.running=!1),this.running},this.go=function(){for(this.iterCount=this.config.maxIterations;this.running;)this.atomicGo();this.stop()},this.start=function(){if(!this.running){var i=this.sigInst.graph.nodes(),s=this.sigInst.renderers[n.config.rendererIndex].options.prefix;this.running=!0;for(var t=0;t<i.length;t++)i[t].dn_x=i[t][s+"x"],i[t].dn_y=i[t][s+"y"],i[t].dn_size=i[t][s+"size"],i[t].dn={dx:0,dy:0};o[n.sigInst.id].dispatchEvent("start"),this.go()}},this.stop=function(){var i=this.sigInst.graph.nodes();if(this.running=!1,this.easing)o[n.sigInst.id].dispatchEvent("interpolate"),sigma.plugins.animate(n.sigInst,{x:"dn_x",y:"dn_y"},{easing:n.easing,onComplete:function(){n.sigInst.refresh();for(var s=0;s<i.length;s++)i[s].dn=null,i[s].dn_x=null,i[s].dn_y=null;o[n.sigInst.id].dispatchEvent("stop")},duration:n.duration});else{for(var s=0;s<i.length;s++)i[s].x=i[s].dn_x,i[s].y=i[s].dn_y;this.sigInst.refresh();for(var s=0;s<i.length;s++)i[s].dn=null,i[s].dn_x=null,i[s].dn_y=null;o[n.sigInst.id].dispatchEvent("stop")}},this.kill=function(){this.sigInst=null,this.config=null,this.easing=null}}if("undefined"==typeof sigma)throw new Error("sigma is not declared");sigma.utils.pkg("sigma.layouts.noverlap");var s={speed:3,scaleNodes:1.2,nodeMargin:5,gridSize:20,permittedExpansion:1.1,rendererIndex:0,maxIterations:500},t={},o={};sigma.prototype.configNoverlap=function(n){var s=this;if(!n)throw new Error('Missing argument: "config"');return t[s.id]||(t[s.id]=new i,o[s.id]={},sigma.classes.dispatcher.extend(o[s.id]),s.bind("kill",function(){t[s.id].kill(),t[s.id]=null,o[s.id]=null})),t[s.id].init(s,n),o[s.id]},sigma.prototype.startNoverlap=function(n){var i=this;return n&&this.configNoverlap(i,n),t[i.id].start(),o[i.id]},sigma.prototype.isNoverlapRunning=function(){var n=this;return!!t[n.id]&&t[n.id].running}}).call(this);

7
src/js/sigma.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
(function(a){"use strict";if("undefined"==typeof sigma)throw"sigma.renderers.glyphs: sigma not in scope.";sigma.utils.pkg("sigma.settings");var b={glyphScale:.5,glyphFillColor:"white",glyphTextColor:"black",glyphStrokeColor:"black",glyphLineWidth:2,glyphFont:"Arial",glyphFontStyle:"normal",glyphFontScale:1,glyphTextThreshold:7,glyphStrokeIfText:!1,glyphThreshold:1,drawGlyphs:!0};sigma.settings=sigma.utils.extend(sigma.settings||{},b)}).call(this),function(a){"use strict";function b(a){return a*Math.PI/180}function c(a,b){return"function"==typeof a?a.call(b):a}function d(a){function d(a,b){if(a.draw&&a.x&&a.y&&a.radius>a.threshold){var c=a.x,d=a.y;switch(a.position){case"top-right":c+=a.nodeSize*A,d+=a.nodeSize*B;break;case"top-left":c+=a.nodeSize*y,d+=a.nodeSize*z;break;case"bottom-left":c+=a.nodeSize*w,d+=a.nodeSize*x;break;case"bottom-right":c+=a.nodeSize*u,d+=a.nodeSize*v}if(b.fillStyle=a.fillColor,a.strokeColor!==b.strokeStyle&&(b.strokeStyle=a.strokeColor),b.beginPath(),b.arc(c,d,a.radius,2*Math.PI,!1),b.closePath(),(!a.strokeIfText||a.radius>a.textThreshold)&&b.stroke(),b.fill(),a.radius>a.textThreshold){var e=Math.round(a.fontScale*a.radius),f=a.fontStyle+" "+e+"px "+a.font;f!==b.font&&(b.font=f),b.fillStyle=a.textColor,b.fillText(a.content,c,d)}}}a=a||{};var e=a.font||this.settings("glyphFont"),f=a.fontStyle||this.settings("glyphFontStyle"),g=a.fontScale||this.settings("glyphFontScale"),h=a.strokeColor||this.settings("glyphStrokeColor"),i=a.lineWidth||this.settings("glyphLineWidth"),j=a.fillColor||this.settings("glyphFillColor"),k=a.scale||this.settings("glyphScale"),l=a.textColor||this.settings("glyphTextColor"),m=a.textThreshold||this.settings("glyphTextThreshold"),n="strokeIfText"in a?a.strokeIfText:this.settings("glyphStrokeIfText"),o=a.threshold||this.settings("glyphThreshold"),p="draw"in a?a.draw:this.settings("drawGlyphs");if(p){this.domElements.glyphs||(this.initDOM("canvas","glyphs"),this.domElements.glyphs.width=this.container.offsetWidth,this.domElements.glyphs.height=this.container.offsetHeight,this.container.insertBefore(this.domElements.glyphs,this.domElements.glyphs.previousSibling)),this.drawingContext=this.domElements.glyphs.getContext("2d"),this.drawingContext.textAlign="center",this.drawingContext.textBaseline="middle",this.drawingContext.lineWidth=i,this.drawingContext.strokeStyle=h;var q,r=this,s=this.nodesOnScreen||[],t=this.options.prefix||"",u=Math.cos(b(45)),v=Math.sin(b(45)),w=Math.cos(b(135)),x=Math.sin(b(135)),y=Math.cos(b(225)),z=Math.sin(b(225)),A=Math.cos(b(315)),B=Math.sin(b(315));s.forEach(function(a){a.glyphs&&a.glyphs.forEach(function(b){q=!a.hidden,q&&"draw"in b&&(q=b.draw),d({x:a[t+"x"],y:a[t+"y"],nodeSize:a[t+"size"]||0,position:b.position,radius:b.size||a[t+"size"]*k,content:(b.content||"").toString()||"",lineWidth:b.lineWidth||i,fillColor:c(b.fillColor,a)||j,textColor:c(b.textColor,a)||l,strokeColor:c(b.strokeColor,a)||h,strokeIfText:"strokeIfText"in b?b.strokeIfText:n,fontStyle:b.fontStyle||f,font:b.font||e,fontScale:b.fontScale||g,threshold:b.threshold||o,textThreshold:b.textThreshold||m,draw:q},r.drawingContext)})})}}if("undefined"==typeof sigma)throw"sigma is not declared";sigma.renderers.canvas.prototype.glyphs=d}.call(this);
//# sourceMappingURL=sigma.renderers.glyphs.min.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff