diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a165d9b..0000000 --- a/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -.DS_STORE -node_modules -scripts/flow/*/.flowconfig -.flowconfig -*~ -*.pyc -.grunt -_SpecRunner.html -__benchmarks__ -build/ -remote-repo/ -coverage/ -.module-cache -fixtures/dom/public/react-dom.js -fixtures/dom/public/react.js -test/the-files-to-test.generated.js -*.log* -chrome-user-data -*.sublime-project -*.sublime-workspace -.idea -*.iml -.vscode -*.swp -*.swo - -packages/react-devtools-core/dist -packages/react-devtools-extensions/chrome/build -packages/react-devtools-extensions/chrome/*.crx -packages/react-devtools-extensions/chrome/*.pem -packages/react-devtools-extensions/firefox/build -packages/react-devtools-extensions/firefox/*.xpi -packages/react-devtools-extensions/firefox/*.pem -packages/react-devtools-extensions/shared/build -packages/react-devtools-extensions/.tempUserDataDir -packages/react-devtools-inline/dist -packages/react-devtools-shell/dist -packages/react-devtools-timeline/dist \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 251e60b..0000000 --- a/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Sigma.js full-featured demo - -This project aims to provide a full-features "real life" application using sigma.js. It was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and uses [react-sigma-v2](https://github.com/sim51/react-sigma-v2) to interface sigma.js with React. - -## Dataset - -The dataset has been kindly crafted by the [Sciences-Po médialab](https://medialab.sciencespo.fr/) and [OuestWare](https://www.ouestware.com/en/) teams using [Seealsology](https://densitydesign.github.io/strumentalia-seealsology/). It represents a network of Wikipedia pages, connected by ["See also"](https://en.wikipedia.org/wiki/See_also) links. It then was tagged by hand. - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:5000](http://localhost:5000) to view it in the browser. - -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. diff --git a/asset-manifest.json b/asset-manifest.json new file mode 100644 index 0000000..5308f23 --- /dev/null +++ b/asset-manifest.json @@ -0,0 +1,13 @@ +{ + "files": { + "main.css": "/gesara-entity-viz/static/css/main.ffef2fb8.css", + "main.js": "/gesara-entity-viz/static/js/main.ff804e72.js", + "index.html": "/gesara-entity-viz/index.html", + "main.ffef2fb8.css.map": "/gesara-entity-viz/static/css/main.ffef2fb8.css.map", + "main.ff804e72.js.map": "/gesara-entity-viz/static/js/main.ff804e72.js.map" + }, + "entrypoints": [ + "static/css/main.ffef2fb8.css", + "static/js/main.ff804e72.js" + ] +} \ No newline at end of file diff --git a/public/dataset_entities.json b/dataset_entities.json similarity index 100% rename from public/dataset_entities.json rename to dataset_entities.json diff --git a/public/favicon.ico b/favicon.ico similarity index 100% rename from public/favicon.ico rename to favicon.ico diff --git a/index.html b/index.html new file mode 100644 index 0000000..8ab4da0 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +
- Click a cluster to show/hide related pages from the network. -
-- {" "} - -
-- This visualisation represents a network of{" "} - - named entities - in English-language posts archived in a database of Telegram channels that have posted about GESARA. Each{" "} - node represents an entity, edges between nodes indicate that one or more posts contain both entities - . -
-- Some social media channels were identified by researchers from{" "} - - Bellingcat - {" "}and{" "} - - Lighthouse Reports - - , then several rounds of snowball sampling found forwarded channels that have posted about GESARA. - The entities were identified using {" "} - - spaCy - - . -
-- This web application has been developed by{" "} - - Bellingcat - - , using{" "} - - react - {" "} - and{" "} - - sigma.js - - . You can read the source code{" "} - - on GitHub - - . -
-- Node sizes are related to the number of times the entity was mentioned in the database. -
-- Nodes are colored based a{" "} - - community detection algorithm - . -
-- For visualisation purposes, edges were pruned using the{" "} - - Marginal Likelihood Filter - - . -
-0?(w=g*n[a+6]*A[o+6]/b,n[a+2]+=v*w,n[a+3]+=y*w):b<0&&(w=-g*n[a+6]*A[o+6]/Math.sqrt(b),n[a+2]+=v*w,n[a+3]+=y*w):b>0&&(w=g*n[a+6]*A[o+6]/b,n[a+2]+=v*w,n[a+3]+=y*w),(o=A[o+4])<0)break;continue}o=A[o+5]}else if((l=A[o+0])>=0&&l!==a&&(b=(v=n[a+0]-n[l+0])*v+(y=n[a+1]-n[l+1])*y,!0===O?b>0?(w=g*n[a+6]*n[l+6]/b,n[a+2]+=v*w,n[a+3]+=y*w):b<0&&(w=-g*n[a+6]*n[l+6]/Math.sqrt(b),n[a+2]+=v*w,n[a+3]+=y*w):b>0&&(w=g*n[a+6]*n[l+6]/b,n[a+2]+=v*w,n[a+3]+=y*w)),(o=A[o+4])<0)break}else for(g=t.scalingRatio,u=0;u a[1]&&(a[1]=_.zIndex))}for(var m in this.edgePrograms){if(!this.edgePrograms.hasOwnProperty(m))throw new Error('Sigma: could not find a suitable program for edge type "'+m+'"!');e||this.edgePrograms[m].allocate(x[m]||0),x[m]=0}this.settings.zIndex&&a[0]!==a[1]&&(E=(0,f.zIndexOrdering)(a,(function(e){return t.edgeDataCache[e].zIndex}),E));for(h=0,p=E.length;h =1)e=new Set(this.graph.nodes());else{var n=this.viewRectangle();e=new Set(this.quadtree.rectangle(n.x1,1-n.y1,n.x2,1-n.y2,n.height))}var r=this.labelGrid.getLabelsToDisplay(t.ratio,this.settings.labelDensity);this.displayedLabels=new Set;for(var i=this.canvasContexts.labels,o=0,a=r.length;o=1){for(var o in n){var f=n[o];for(var d in f)e.setNodeAttribute(o,d,f[d])}"function"===typeof a&&a()}else{for(var o in r=s(r),n){f=n[o];var h=c[o];for(var d in f)e.setNodeAttribute(o,d,f[d]*r+h[d]*(1-r))}p=(0,i.requestFrame)(t)}}(),function(){p&&(0,i.cancelFrame)(p)}}},4498:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cubicInOut=t.cubicOut=t.cubicIn=t.quadraticInOut=t.quadraticOut=t.quadraticIn=t.linear=void 0;t.linear=function(e){return e};t.quadraticIn=function(e){return e*e};t.quadraticOut=function(e){return e*(2-e)};t.quadraticInOut=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)};t.cubicIn=function(e){return e*e*e};t.cubicOut=function(e){return--e*e*e+1};t.cubicInOut=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)};var n={linear:t.linear,quadraticIn:t.quadraticIn,quadraticOut:t.quadraticOut,quadraticInOut:t.quadraticInOut,cubicIn:t.cubicIn,cubicOut:t.cubicOut,cubicInOut:t.cubicInOut};t.default=n},2583:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doEdgeCollideWithPoint=t.isPixelColored=void 0,t.isPixelColored=function(e,t,n){var r=new Uint8Array(4);return e.readPixels(t,e.drawingBufferHeight-n,1,1,e.RGBA,e.UNSIGNED_BYTE,r),r[3]>0},t.doEdgeCollideWithPoint=function(e,t,n,r,i,o,a){return!(e ' + func(text) + ' fred, barney, & pebbles=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1-1&&e%1==0&&eS(a,n))void 0!==s&&0>S(s,a)?(e[r]=s,e[u]=n,r=u):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==s&&0>S(s,n)))break e;e[r]=s,e[u]=n,r=u}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],L=[],T=1,O=null,P=3,A=!1,N=!1,M=!1;function j(e){for(var t=E(L);null!==t;){if(null===t.callback)k(L);else{if(!(t.startTime<=e))break;k(L),t.sortIndex=t.expirationTime,x(C,t)}t=E(L)}}function R(e){if(M=!1,j(e),!N)if(null!==E(C))N=!0,n(z);else{var t=E(L);null!==t&&r(R,t.startTime-e)}}function z(e,n){N=!1,M&&(M=!1,i()),A=!0;var o=P;try{for(j(n),O=E(C);null!==O&&(!(O.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=O.callback;if("function"===typeof a){O.callback=null,P=O.priorityLevel;var u=a(O.expirationTime<=n);n=t.unstable_now(),"function"===typeof u?O.callback=u:O===E(C)&&k(C),j(n)}else k(C);O=E(C)}if(null!==O)var s=!0;else{var l=E(L);null!==l&&r(R,l.startTime-n),s=!1}return s}finally{O=null,P=o,A=!1}}var D=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||A||(N=!0,n(z))},t.unstable_getCurrentPriorityLevel=function(){return P},t.unstable_getFirstCallbackNode=function(){return E(C)},t.unstable_next=function(e){switch(P){case 1:case 2:case 3:var t=3;break;default:t=P}var n=P;P=t;try{return e()}finally{P=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=D,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=P;P=e;try{return t()}finally{P=n}},t.unstable_scheduleCallback=function(e,o,a){var u=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0u?(e.sortIndex=a,x(L,e),null===E(C)&&e===E(L)&&(M?i():M=!0,r(R,a-u))):(e.sortIndex=s,x(C,e),N||A||(N=!0,n(z))),e},t.unstable_wrapCallback=function(e){var t=P;return function(){var n=P;P=t;try{return e.apply(this,arguments)}finally{P=n}}}},5296:function(e,t,n){"use strict";e.exports=n(6813)},9672:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(7465),a=n(157),u=i(n(4498)),s=n(6045),l=1.5,c=function(e){function t(){var t=e.call(this)||this;return t.x=.5,t.y=.5,t.angle=0,t.ratio=1,t.nextFrame=null,t.previousState=null,t.enabled=!0,t.previousState=t.getState(),t}return r(t,e),t.from=function(e){return(new t).setState(e)},t.prototype.enable=function(){return this.enabled=!0,this},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.getState=function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}},t.prototype.hasState=function(e){return this.x===e.x&&this.y===e.y&&this.ratio===e.ratio&&this.angle===e.angle},t.prototype.getPreviousState=function(){var e=this.previousState;return e?{x:e.x,y:e.y,angle:e.angle,ratio:e.ratio}:null},t.prototype.isAnimated=function(){return!!this.nextFrame},t.prototype.setState=function(e){return this.enabled?(this.previousState=this.getState(),"number"===typeof e.x&&(this.x=e.x),"number"===typeof e.y&&(this.y=e.y),"number"===typeof e.angle&&(this.angle=e.angle),"number"===typeof e.ratio&&(this.ratio=e.ratio),this.hasState(this.previousState)||this.emit("updated",this.getState()),this):this},t.prototype.animate=function(e,t,n){var r=this;if(this.enabled){var i=Object.assign({},a.ANIMATE_DEFAULTS,t),o="function"===typeof i.easing?i.easing:u.default[i.easing],l=Date.now(),c=this.getState(),f=function t(){var n=(Date.now()-l)/i.duration;if(n>=1)return r.nextFrame=null,r.setState(e),void(r.animationCallback&&(r.animationCallback.call(null),r.animationCallback=void 0));var a=o(n),u={};e.x&&(u.x=c.x+(e.x-c.x)*a),e.y&&(u.y=c.y+(e.y-c.y)*a),e.angle&&(u.angle=c.angle+(e.angle-c.angle)*a),e.ratio&&(u.ratio=c.ratio+(e.ratio-c.ratio)*a),r.setState(u),r.nextFrame=(0,s.requestFrame)(t)};this.nextFrame?((0,s.cancelFrame)(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=(0,s.requestFrame)(f)):f(),this.animationCallback=n}},t.prototype.animatedZoom=function(e){if(e){if("number"===typeof e)return this.animate({ratio:this.ratio/e});this.animate({ratio:this.ratio/(e.factor||l)},e)}else this.animate({ratio:this.ratio/l})},t.prototype.animatedUnzoom=function(e){if(e){if("number"===typeof e)return this.animate({ratio:this.ratio*e});this.animate({ratio:this.ratio*(e.factor||l)},e)}else this.animate({ratio:this.ratio*l})},t.prototype.animatedReset=function(e){this.animate({x:.5,y:.5,ratio:1,angle:0},e)},t.prototype.copy=function(){return t.from(this.getState())},t}(o.EventEmitter);t.default=c},5381:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n