From 810d088d34ebc3840b28e350a8b6ea68aa665367 Mon Sep 17 00:00:00 2001
From: wimrijnders
Date: Tue, 8 Aug 2017 20:29:59 +0200
Subject: [PATCH] [Network] Dynamically adjust clustering when data changes.
(#3330)
* First working version of updating clustered edge
* Added fix for #1315 as well
* Enable unit testing for module Network
Adds mocks for certain components, in order to let module `Network` be run in unit tests.
Changes:
- Create a mock object for `hammer.js` when running browserless. The inspiration is taken from [here](https://github.com/uber/deck.gl/pull/658)
- Create a mock function for `window.requestAnimationFrame()` when running browserless in `network/modules/CanvasRenderer.js`
- Added unit test for `Network` to show that unit testing for it now works
- Fixed naming of container in `test/Graph3d.test.js`
Since `hammer.js` is also used in other modules, this fix is potentially an enabler for full-module unit tests for those as well.
* Cleanup unit test Network
* Added unit test for fix issue #1218
* Adding test for #1315 - Interim save
* Completed unit test and fixes for #1315
* Added fixes for #1291
* Added unit test for #1219
* Added header comment for Clustering.js, small fixes
* Fix for unit test
* Added example networks to unit test
* Fix error in loading disassemblerExample
* Network unit test final fixes
* Fixes for linting
* Fixed essential typo
* Fixed linting error
* Fixed unit test
* Fixed unit test again
---
.../disassemblerExample.html | 47 +--
.../disassemblerExample.js | 53 +++
lib/module/hammer.js | 28 +-
lib/network/Network.js | 33 +-
lib/network/modules/CanvasRenderer.js | 97 ++++-
lib/network/modules/Clustering.js | 393 ++++++++++++++++--
lib/network/modules/EdgesHandler.js | 42 +-
lib/network/modules/components/Edge.js | 19 +
test/Graph3d.test.js | 4 +-
test/Network.test.js | 332 +++++++++++++++
test/network/basicUsage.js | 21 +
11 files changed, 954 insertions(+), 115 deletions(-)
create mode 100644 examples/network/exampleApplications/disassemblerExample.js
create mode 100644 test/Network.test.js
create mode 100644 test/network/basicUsage.js
diff --git a/examples/network/exampleApplications/disassemblerExample.html b/examples/network/exampleApplications/disassemblerExample.html
index 8ecd8e39..a7ab0eb1 100644
--- a/examples/network/exampleApplications/disassemblerExample.html
+++ b/examples/network/exampleApplications/disassemblerExample.html
@@ -9,59 +9,16 @@
+
Use VisJS to diagram the Control-Flow-Graph (CFG) of a function from
a program you wish to analyze.