From d515e0bb57e3f6a9f763b8928520372049b95343 Mon Sep 17 00:00:00 2001 From: Ezequiel-Vega Date: Wed, 8 Sep 2021 17:45:26 -0300 Subject: [PATCH] Added tests palette and layout --- packages/mindplot/lib/components/Designer.js | 11 +- packages/mindplot/lib/components/Messages.js | 10 +- .../lib/components/PersistenceManager.js | 30 +- .../components/StandaloneActionDispatcher.js | 2 +- packages/mindplot/lib/components/Topic.js | 39 +- .../lib/components/TopicEventDispatcher.js | 4 +- .../lib/components/model/RelationshipModel.js | 2 +- .../lib/components/widget/FloatingTip.js | 8 +- .../components/widget/ModalDialogNotifier.js | 42 +- .../lib/components/widget/ToolbarNotifier.js | 17 +- .../lib/components/widget/ToolbarPaneItem.js | 49 +- .../mindplot/lib/components/widget/index.js | 12 +- packages/mindplot/lib/mindplot.js | 12 +- packages/mindplot/package.json | 5 +- .../test/javascript/static/layout.html | 311 ++++---- .../test/javascript/static/palette.html | 51 +- .../static/test/BalancedTestSuite.js | 571 ++++++++------ .../javascript/static/test/FreeTestSuite.js | 647 +++++++++------- .../static/test/SymmetricTestSuite.js | 378 ++++++---- .../test/javascript/static/test/TestSuite.js | 612 ++++++++------- .../test/javascript/static/test/testLayout.js | 14 + .../javascript/static/test/testPalette.js | 2 +- packages/mindplot/webpack.prod.js | 1 + packages/mindplot/webpack.test.js | 8 +- packages/web2d/webpack.test.js | 2 +- yarn.lock | 710 +++++++++++++++++- 26 files changed, 2271 insertions(+), 1279 deletions(-) diff --git a/packages/mindplot/lib/components/Designer.js b/packages/mindplot/lib/components/Designer.js index 7303976e..884dd417 100644 --- a/packages/mindplot/lib/components/Designer.js +++ b/packages/mindplot/lib/components/Designer.js @@ -977,8 +977,7 @@ const Designer = new Class( changeTopicShape: function (shape) { var validateFunc = function (topic) { return !( - topic.getType() == INodeModel.CENTRAL_TOPIC_TYPE && - shape == TopicShape.LINE + topic.getType() == INodeModel.CENTRAL_TOPIC_TYPE && shape == TopicShape.LINE ); }; @@ -1001,11 +1000,9 @@ const Designer = new Class( addIconType: function (iconType) { var topicsIds = this.getModel().filterTopicsIds(); if (topicsIds.length > 0) { - this._actionDispatcher.addFeatureToTopic( - topicsIds[0], - TopicFeature.Icon.id, - { id: iconType } - ); + this._actionDispatcher.addFeatureToTopic(topicsIds[0], TopicFeature.Icon.id, { + id: iconType, + }); } }, diff --git a/packages/mindplot/lib/components/Messages.js b/packages/mindplot/lib/components/Messages.js index 415473ea..93a16a42 100644 --- a/packages/mindplot/lib/components/Messages.js +++ b/packages/mindplot/lib/components/Messages.js @@ -21,17 +21,17 @@ const Messages = new Class({ init: function (locale) { locale = $defined(locale) ? locale : 'en'; var bundle = Messages.BUNDLES[locale]; - if (bundle == null && locale.indexOf("_") != -1) { + if (bundle == null && locale.indexOf('_') != -1) { // Try to locate without the specialization ... - locale = locale.substring(0, locale.indexOf("_")); + locale = locale.substring(0, locale.indexOf('_')); bundle = Messages.BUNDLES[locale]; } Messages.__bundle = bundle; - } - } + }, + }, }); -$msg = function (key) { +global.$msg = function (key) { if (!Messages.__bundle) { Messages.init('en'); } diff --git a/packages/mindplot/lib/components/PersistenceManager.js b/packages/mindplot/lib/components/PersistenceManager.js index 49236d76..1e3ef269 100644 --- a/packages/mindplot/lib/components/PersistenceManager.js +++ b/packages/mindplot/lib/components/PersistenceManager.js @@ -15,31 +15,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const Core = require('@wismapping/core-js') +const Core = require('@wismapping/core-js'); const core = Core(); const XMLSerializerFactory = require('./persistence/XMLSerializerFactory'); const PersistenceManager = new Class({ Static: { loadFromDom: function (mapId, mapDom) { - $assert(mapId, "mapId can not be null"); - $assert(mapDom, "mapDom can not be null"); + $assert(mapId, 'mapId can not be null'); + $assert(mapDom, 'mapDom can not be null'); var serializer = XMLSerializerFactory.getSerializerFromDocument(mapDom); return serializer.loadFromDom(mapDom, mapId); - } + }, }, - initialize: function () { - - }, + initialize: function () {}, save: function (mindmap, editorProperties, saveHistory, events, sync) { - $assert(mindmap, "mindmap can not be null"); - $assert(editorProperties, "editorProperties can not be null"); + $assert(mindmap, 'mindmap can not be null'); + $assert(editorProperties, 'editorProperties can not be null'); var mapId = mindmap.getId(); - $assert(mapId, "mapId can not be null"); + $assert(mapId, 'mapId can not be null'); var serializer = XMLSerializerFactory.getSerializerFromMindmap(mindmap); var domMap = serializer.toXML(mindmap); @@ -55,26 +53,26 @@ const PersistenceManager = new Class({ }, load: function (mapId) { - $assert(mapId, "mapId can not be null"); + $assert(mapId, 'mapId can not be null'); var domDocument = this.loadMapDom(mapId); return PersistenceManager.loadFromDom(mapId, domDocument); }, discardChanges: function (mapId) { - throw new Error("Method must be implemented"); + throw new Error('Method must be implemented'); }, loadMapDom: function (mapId) { - throw new Error("Method must be implemented"); + throw new Error('Method must be implemented'); }, saveMapXml: function (mapId, mapXml, pref, saveHistory, events, sync) { - throw new Error("Method must be implemented"); + throw new Error('Method must be implemented'); }, unlockMap: function (mindmap) { - throw new Error("Method must be implemented"); - } + throw new Error('Method must be implemented'); + }, }); PersistenceManager.init = function (instance) { diff --git a/packages/mindplot/lib/components/StandaloneActionDispatcher.js b/packages/mindplot/lib/components/StandaloneActionDispatcher.js index 92e8aab6..ebb7f74b 100644 --- a/packages/mindplot/lib/components/StandaloneActionDispatcher.js +++ b/packages/mindplot/lib/components/StandaloneActionDispatcher.js @@ -378,4 +378,4 @@ const CommandContext = new Class( } ); -export {StandaloneActionDispatcher, CommandContext} +export { StandaloneActionDispatcher, CommandContext }; diff --git a/packages/mindplot/lib/components/Topic.js b/packages/mindplot/lib/components/Topic.js index 50e710e6..d492aac9 100644 --- a/packages/mindplot/lib/components/Topic.js +++ b/packages/mindplot/lib/components/Topic.js @@ -15,8 +15,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const web2D = require('@wismapping/web2d') -const web2d = web2D() +const web2D = require('@wismapping/web2d'); +const web2d = web2D(); const NodeGraph = require('./NodeGraph').default; const { TopicShape } = require('./model/INodeModel'); const TopicStyle = require('./TopicStyle').default; @@ -240,10 +240,7 @@ const Topic = new Class( /** @return outer shape */ getOuterShape: function () { if (!$defined(this._outerShape)) { - var rect = this._buildShape( - Topic.OUTER_SHAPE_ATTRIBUTES, - TopicShape.ROUNDED_RECT - ); + var rect = this._buildShape(Topic.OUTER_SHAPE_ATTRIBUTES, TopicShape.ROUNDED_RECT); rect.setPosition(-2, -3); rect.setOpacity(0); this._outerShape = rect; @@ -991,9 +988,7 @@ const Topic = new Class( } var textShape = this.getTextShape(); - textShape.setVisibility( - this.getShapeType() != TopicShape.IMAGE ? value : false - ); + textShape.setVisibility(this.getShapeType() != TopicShape.IMAGE ? value : false); }, /** */ @@ -1091,10 +1086,7 @@ const Topic = new Class( outgoingLine.removeFromWorkspace(workspace); // Remove from workspace. - EventBus.instance.fireEvent( - EventBus.events.NodeDisconnectEvent, - this.getModel() - ); + EventBus.instance.fireEvent(EventBus.events.NodeDisconnectEvent, this.getModel()); // Change text based on the current connection ... var model = this.getModel(); @@ -1216,10 +1208,7 @@ const Topic = new Class( workspace.removeChild(line); } this._isInWorkspace = false; - EventBus.instance.fireEvent( - EventBus.events.NodeRemoved, - this.getModel() - ); + EventBus.instance.fireEvent(EventBus.events.NodeRemoved, this.getModel()); }, /** */ @@ -1228,20 +1217,14 @@ const Topic = new Class( workspace.append(elem); if (!this.isInWorkspace()) { if (!this.isCentralTopic()) { - EventBus.instance.fireEvent( - EventBus.events.NodeAdded, - this.getModel() - ); + EventBus.instance.fireEvent(EventBus.events.NodeAdded, this.getModel()); } if (this.getModel().isConnected()) - EventBus.instance.fireEvent( - EventBus.events.NodeConnectEvent, - { - parentNode: this.getOutgoingConnectedTopic().getModel(), - childNode: this.getModel(), - } - ); + EventBus.instance.fireEvent(EventBus.events.NodeConnectEvent, { + parentNode: this.getOutgoingConnectedTopic().getModel(), + childNode: this.getModel(), + }); } this._isInWorkspace = true; this._adjustShapes(); diff --git a/packages/mindplot/lib/components/TopicEventDispatcher.js b/packages/mindplot/lib/components/TopicEventDispatcher.js index 36a22302..fa5e0d84 100644 --- a/packages/mindplot/lib/components/TopicEventDispatcher.js +++ b/packages/mindplot/lib/components/TopicEventDispatcher.js @@ -17,7 +17,7 @@ */ const Events = require('./Events').default; const MultilineTextEditor = require('./MultilineTextEditor').default; -const TopicEvent = require('./Topic'); +//const TopicEvent = require('./Topic').default; const { TopicShape } = require('./model/INodeModel'); const TopicEventDispatcher = new Class({ @@ -78,7 +78,7 @@ const TopicEventDispatcher = new Class({ }, }); -TopicEvent = { +const TopicEvent = { EDIT: 'editnode', CLICK: 'clicknode', }; diff --git a/packages/mindplot/lib/components/model/RelationshipModel.js b/packages/mindplot/lib/components/model/RelationshipModel.js index 76a04491..40de76c1 100644 --- a/packages/mindplot/lib/components/model/RelationshipModel.js +++ b/packages/mindplot/lib/components/model/RelationshipModel.js @@ -17,7 +17,7 @@ */ const ConnectionLine = require('../ConnectionLine').default; -RelationshipModel = new Class( +const RelationshipModel = new Class( /** @lends RelationshipModel */ { Static: { _nextUUID: function () { diff --git a/packages/mindplot/lib/components/widget/FloatingTip.js b/packages/mindplot/lib/components/widget/FloatingTip.js index 168d42ac..a3f0b3e0 100644 --- a/packages/mindplot/lib/components/widget/FloatingTip.js +++ b/packages/mindplot/lib/components/widget/FloatingTip.js @@ -31,7 +31,7 @@ const FloatingTip = new Class({ content: '', delay: 0, container: false, - destroyOnExit: false + destroyOnExit: false, }, initialize: function (element, options) { @@ -41,11 +41,11 @@ const FloatingTip = new Class({ }, //FIXME: find a better way to do that... - _createPopover: function() { + _createPopover: function () { this.element.popover(this.options); var me = this; if (this.options.destroyOnExit) { - this.element.one('hidden.bs.popover', function() { + this.element.one('hidden.bs.popover', function () { me.element.popover('destroy'); me._createPopover(); }); @@ -62,7 +62,7 @@ const FloatingTip = new Class({ this.element.popover('hide'); this.fireEvent('hide'); return this; - } + }, }); export default FloatingTip; diff --git a/packages/mindplot/lib/components/widget/ModalDialogNotifier.js b/packages/mindplot/lib/components/widget/ModalDialogNotifier.js index 024d81a0..fdca16d4 100644 --- a/packages/mindplot/lib/components/widget/ModalDialogNotifier.js +++ b/packages/mindplot/lib/components/widget/ModalDialogNotifier.js @@ -17,38 +17,38 @@ */ const ModalDialogNotifier = new Class({ - initialize: function () {}, //FIXME: replace by alert() show: function (message, title) { - $assert(message, "message can not be null"); + $assert(message, 'message can not be null'); - var modalDialog = $(''); + var modalDialog = $( + '' + ); - var p = '

' + message + '

' - var h4 = title ? '

' + title + '

' : ""; + var p = '

' + message + '

'; + var h4 = title ? '

' + title + '

' : ''; modalDialog.find('.alert-content').append(h4 + p); modalDialog.modal(); - } + }, }); - var dialogNotifier = new ModalDialogNotifier(); -$notifyModal = dialogNotifier.show.bind(dialogNotifier); +const $notifyModal = dialogNotifier.show.bind(dialogNotifier); export default ModalDialogNotifier; diff --git a/packages/mindplot/lib/components/widget/ToolbarNotifier.js b/packages/mindplot/lib/components/widget/ToolbarNotifier.js index 74b55af0..fd735080 100644 --- a/packages/mindplot/lib/components/widget/ToolbarNotifier.js +++ b/packages/mindplot/lib/components/widget/ToolbarNotifier.js @@ -17,31 +17,32 @@ */ const ToolbarNotifier = new Class({ - - initialize:function () { + initialize: function () { this.container = $('#headerNotifier'); }, - hide:function () { + hide: function () { this.container.hide(); }, - logMessage:function (msg, fade) { + logMessage: function (msg, fade) { $assert(msg, 'msg can not be null'); // In case of print,embedded no message is displayed .... if (this.container && !this.container.data('transitioning')) { this.container.data('transitioning', true); this.container.text(msg); - this.container.css({top: "5px", left: ($(window).width() - this.container.width()) / 2 - 9}); + this.container.css({ + top: '5px', + left: ($(window).width() - this.container.width()) / 2 - 9, + }); this.container.show().fadeOut(5000); } this.container.data('transitioning', false); - } - + }, }); var toolbarNotifier = new ToolbarNotifier(); -$notify = function(msg) { +const $notify = function (msg) { toolbarNotifier.logMessage(msg); }; diff --git a/packages/mindplot/lib/components/widget/ToolbarPaneItem.js b/packages/mindplot/lib/components/widget/ToolbarPaneItem.js index 7c823836..1c473388 100644 --- a/packages/mindplot/lib/components/widget/ToolbarPaneItem.js +++ b/packages/mindplot/lib/components/widget/ToolbarPaneItem.js @@ -19,22 +19,22 @@ const ToolbarItem = require('./ToolbarItem').default; const FloatingTip = require('./FloatingTip').default; const ToolbarPaneItem = new Class({ - Extends:ToolbarItem, - initialize : function(buttonId, model) { - $assert(buttonId, "buttonId can not be null"); - $assert(model, "model can not be null"); + Extends: ToolbarItem, + initialize: function (buttonId, model) { + $assert(buttonId, 'buttonId can not be null'); + $assert(model, 'model can not be null'); this._model = model; var me = this; - var fn = function() { + var fn = function () { // Is the panel being displayed ? me.isVisible() ? me.hide() : me.show(); }; - this.parent(buttonId, fn, {topicAction:true,relAction:false}); + this.parent(buttonId, fn, { topicAction: true, relAction: false }); this._panelElem = this._init(); this._visible = false; }, - _init:function () { + _init: function () { // Load the context of the panel ... var panelElem = this.buildPanel(); panelElem.css('cursor', 'default'); @@ -44,34 +44,35 @@ const ToolbarPaneItem = new Class({ this._tip = new FloatingTip(buttonElem, { html: true, placement: 'bottom', - content: function() { + content: function () { return me._updateSelectedItem(); }, className: 'toolbarPaneTip', trigger: 'manual', - template: '' + template: + '', }); - this._tip.addEvent('hide', function() { - me._visible = false + this._tip.addEvent('hide', function () { + me._visible = false; }); - this._tip.addEvent('show', function() { - me._visible = true + this._tip.addEvent('show', function () { + me._visible = true; }); return panelElem; }, - getModel : function() { + getModel: function () { return this._model; }, - getPanelElem : function() { + getPanelElem: function () { return this._panelElem; }.protect(), - show : function() { + show: function () { if (!this.isVisible()) { this.parent(); this._tip.show(); @@ -79,7 +80,7 @@ const ToolbarPaneItem = new Class({ } }, - hide : function() { + hide: function () { if (this.isVisible()) { this.parent(); this._tip.hide(); @@ -87,11 +88,11 @@ const ToolbarPaneItem = new Class({ } }, - isVisible : function() { + isVisible: function () { return this._visible; }, - disable : function() { + disable: function () { this.hide(); var elem = this.getButtonElem(); if (this._enable) { @@ -106,7 +107,7 @@ const ToolbarPaneItem = new Class({ } }, - enable : function() { + enable: function () { var elem = this.getButtonElem(); if (!this._enable) { elem.bind('click', this._fn); @@ -116,11 +117,9 @@ const ToolbarPaneItem = new Class({ } }, - - buildPanel : function() { - throw "Method must be implemented"; - }.protect() - + buildPanel: function () { + throw 'Method must be implemented'; + }.protect(), }); export default ToolbarPaneItem; diff --git a/packages/mindplot/lib/components/widget/index.js b/packages/mindplot/lib/components/widget/index.js index ec2abf9f..169305ae 100644 --- a/packages/mindplot/lib/components/widget/index.js +++ b/packages/mindplot/lib/components/widget/index.js @@ -9,12 +9,12 @@ const linkEditor = require('./LinkEditor').default; const linkIconTooltip = require('./LinkIconTooltip').default; const listToolbarPanel = require('./ListToolbarPanel').default; const menu = require('./Menu').default; -const modalDialogNotifier = require('./ModalDialogNotifier'); -const noteEditor = require('./NoteEditor'); -const toolbarItem = require('./ToolbarItem'); -const toolbarNotifier = require('./ToolbarNotifier'); -const toolbarPanelItem = require('./ToolbarPaneItem'); -const topicShapePanel = require('./TopicShapePanel'); +const modalDialogNotifier = require('./ModalDialogNotifier').default; +const noteEditor = require('./NoteEditor').default; +const toolbarItem = require('./ToolbarItem').default; +const toolbarNotifier = require('./ToolbarNotifier').default; +const toolbarPanelItem = require('./ToolbarPaneItem').default; +const topicShapePanel = require('./TopicShapePanel').default; export const Widgets = { ColorPalettePanel: colorPalettePanel, diff --git a/packages/mindplot/lib/mindplot.js b/packages/mindplot/lib/mindplot.js index 32d901c8..662d4fb1 100644 --- a/packages/mindplot/lib/mindplot.js +++ b/packages/mindplot/lib/mindplot.js @@ -21,11 +21,11 @@ function mindplot() { const { Components } = require('./components'); return { - Commands, - Layout, - Models, - Persistence, - Widgets, - Components, + commands: Commands, + layout: Layout, + models: Models, + persistence: Persistence, + widget: Widgets, + component: Components, }; } diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index c57a84b6..a9fd116c 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -20,7 +20,9 @@ "url": "git+https://ezequielVega@bitbucket.org/lilabyus/wisemapping-frontend.git" }, "scripts": { - "build": "webpack --config webpack.prod.js", + "build": "yarn build:dev && yarn build:test", + "build:dev": "webpack --config webpack.prod.js", + "build:test": "webpack --config webpack.test.js", "start": "webpack serve --config webpack.dev.js" }, "dependencies": { @@ -32,7 +34,6 @@ "@babel/preset-env": "^7.14.7", "babel-loader": "^8.2.2", "clean-webpack-plugin": "^4.0.0-alpha.0", - "core-js": "^3.15.2", "webpack": "^5.44.0", "webpack-cli": "^4.7.2", "webpack-dev-server": "^3.11.2", diff --git a/packages/mindplot/test/javascript/static/layout.html b/packages/mindplot/test/javascript/static/layout.html index 134b3c38..83e7b90b 100644 --- a/packages/mindplot/test/javascript/static/layout.html +++ b/packages/mindplot/test/javascript/static/layout.html @@ -1,195 +1,180 @@ - + - - - + + + + - - - + + + - - - - - - - - + + - - + - - - - + + + + + + + diff --git a/packages/mindplot/test/javascript/static/palette.html b/packages/mindplot/test/javascript/static/palette.html index 943322db..c1bb8911 100644 --- a/packages/mindplot/test/javascript/static/palette.html +++ b/packages/mindplot/test/javascript/static/palette.html @@ -1,41 +1,16 @@ - + - - - + + + + + - - - - - - - - - - - - -
- The button -
- - - - \ No newline at end of file + + + + +
The button
+ + diff --git a/packages/mindplot/test/javascript/static/test/BalancedTestSuite.js b/packages/mindplot/test/javascript/static/test/BalancedTestSuite.js index edd77bed..832b7da6 100644 --- a/packages/mindplot/test/javascript/static/test/BalancedTestSuite.js +++ b/packages/mindplot/test/javascript/static/test/BalancedTestSuite.js @@ -15,374 +15,483 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.layout.BalancedTestSuite = new Class({ - Extends: mindplot.layout.TestSuite, +const TestSuite = require('./TestSuite').default; - initialize:function() { - $('#balancedTest').setStyle("display","block"); +const BalancedTestSuite = new Class({ + Extends: TestSuite, + + initialize: function () { + $('#balancedTest').css('display', 'block'); this.testBalanced(); this.testBalancedPredict(); this.testBalancedNodeDragPredict(); }, - testBalanced: function() { - console.log("testBalanced:"); - var position = {x:0, y:0}; - var plotsize = {width:1000, height:200}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testBalanced: function () { + console.log('testBalanced:'); + var position = { x: 0, y: 0 }; + var plotsize = { width: 1000, height: 200 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.layout(); - manager.plot("testBalanced1", plotsize); + manager.plot('testBalanced1', plotsize); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); manager.connectNode(0, 2, 1); manager.layout(); - manager.plot("testBalanced2", plotsize); + manager.plot('testBalanced2', plotsize); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); manager.connectNode(0, 3, 2); manager.layout(); - manager.plot("testBalanced3", plotsize); + manager.plot('testBalanced3', plotsize); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); manager.connectNode(0, 4, 3); manager.layout(); - manager.plot("testBalanced4", plotsize); + manager.plot('testBalanced4', plotsize); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); manager.connectNode(0, 5, 4); manager.layout(); - manager.plot("testBalanced5", plotsize); + manager.plot('testBalanced5', plotsize); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); manager.connectNode(0, 6, 5); manager.layout(); - manager.plot("testBalanced6", plotsize); + manager.plot('testBalanced6', plotsize); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.connectNode(3, 7, 0) - manager.connectNode(7, 8, 0) + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.connectNode(3, 7, 0); + manager.connectNode(7, 8, 0); manager.connectNode(7, 9, 1); manager.layout(); - manager.plot("testBalanced7", plotsize); + manager.plot('testBalanced7', plotsize); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.connectNode(6, 10, 0) - manager.connectNode(10, 11, 0) + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); + manager.addNode(12, TestSuite.NODE_SIZE, position); + manager.connectNode(6, 10, 0); + manager.connectNode(10, 11, 0); manager.connectNode(10, 12, 1); manager.layout(); - manager.plot("testBalanced8", plotsize); + manager.plot('testBalanced8', plotsize); - manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(13, TestSuite.NODE_SIZE, position); manager.connectNode(0, 13, 4); manager.layout(); - manager.plot("testBalanced9", {width:1000, height:400}); + manager.plot('testBalanced9', { width: 1000, height: 400 }); // Check orders have shifted accordingly - $assert(manager.find(5).getOrder() == 6, "Node 5 should have order 6"); + $assert(manager.find(5).getOrder() == 6, 'Node 5 should have order 6'); - manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(14, TestSuite.NODE_SIZE, position); manager.connectNode(0, 14, 5); manager.layout(); - manager.plot("testBalanced10", {width:1000, height:400}); + manager.plot('testBalanced10', { width: 1000, height: 400 }); // Check orders have shifted accordingly - $assert(manager.find(6).getOrder() == 7, "Node 6 should have order 7"); + $assert(manager.find(6).getOrder() == 7, 'Node 6 should have order 7'); - manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(15, TestSuite.NODE_SIZE, position); manager.connectNode(0, 15, 4); manager.layout(); - manager.plot("testBalanced11", {width:1000, height:400}); + manager.plot('testBalanced11', { width: 1000, height: 400 }); // Check orders have shifted accordingly - $assert(manager.find(13).getOrder() == 6, "Node 13 should have order 6"); - $assert(manager.find(5).getOrder() == 8, "Node 5 should have order 8"); + $assert(manager.find(13).getOrder() == 6, 'Node 13 should have order 6'); + $assert(manager.find(5).getOrder() == 8, 'Node 5 should have order 8'); - manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(16, TestSuite.NODE_SIZE, position); manager.connectNode(0, 16, 25); manager.layout(); - manager.plot("testBalanced12", {width:1000, height:400}); + manager.plot('testBalanced12', { width: 1000, height: 400 }); // Check orders have shifted accordingly - $assert(manager.find(16).getOrder() == 9, "Node 16 should have order 9"); + $assert(manager.find(16).getOrder() == 9, 'Node 16 should have order 9'); - manager.addNode(17, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(18, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(19, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(17, TestSuite.NODE_SIZE, position); + manager.addNode(18, TestSuite.NODE_SIZE, position); + manager.addNode(19, TestSuite.NODE_SIZE, position); manager.connectNode(0, 17, 11); manager.connectNode(0, 18, 13); manager.connectNode(0, 19, 10); manager.layout(); - manager.plot("testBalanced13", {width:1000, height:400}); + manager.plot('testBalanced13', { width: 1000, height: 400 }); // Check that everything is ok - $assert(manager.find(1).getPosition().x > manager.find(0).getPosition().x, - "even order nodes must be at right of central topic"); - $assert(manager.find(3).getPosition().x > manager.find(0).getPosition().x, - "even order nodes must be at right of central topic"); - $assert(manager.find(5).getPosition().x > manager.find(0).getPosition().x, - "even order nodes must be at right of central topic"); - $assert(manager.find(2).getPosition().x < manager.find(0).getPosition().x, - "odd order nodes must be at right of central topic"); - $assert(manager.find(4).getPosition().x < manager.find(0).getPosition().x, - "odd order nodes must be at right of central topic"); - $assert(manager.find(6).getPosition().x < manager.find(0).getPosition().x, - "odd order nodes must be at right of central topic"); - $assert(manager.find(7).getPosition().x > manager.find(3).getPosition().x, - "children of 1st level even order nodes must be to the right"); - $assert(manager.find(8).getPosition().x > manager.find(7).getPosition().x, - "children of 1st level even order nodes must be to the right"); - $assert(manager.find(9).getPosition().x > manager.find(7).getPosition().x, - "children of 1st level even order nodes must be to the right"); - $assert(manager.find(10).getPosition().x < manager.find(6).getPosition().x, - "children of 1st level odd order nodes must be to the left"); - $assert(manager.find(11).getPosition().x < manager.find(10).getPosition().x, - "children of 1st level odd order nodes must be to the left"); - $assert(manager.find(12).getPosition().x < manager.find(10).getPosition().x, - "children of 1st level odd order nodes must be to the left"); + $assert( + manager.find(1).getPosition().x > manager.find(0).getPosition().x, + 'even order nodes must be at right of central topic' + ); + $assert( + manager.find(3).getPosition().x > manager.find(0).getPosition().x, + 'even order nodes must be at right of central topic' + ); + $assert( + manager.find(5).getPosition().x > manager.find(0).getPosition().x, + 'even order nodes must be at right of central topic' + ); + $assert( + manager.find(2).getPosition().x < manager.find(0).getPosition().x, + 'odd order nodes must be at right of central topic' + ); + $assert( + manager.find(4).getPosition().x < manager.find(0).getPosition().x, + 'odd order nodes must be at right of central topic' + ); + $assert( + manager.find(6).getPosition().x < manager.find(0).getPosition().x, + 'odd order nodes must be at right of central topic' + ); + $assert( + manager.find(7).getPosition().x > manager.find(3).getPosition().x, + 'children of 1st level even order nodes must be to the right' + ); + $assert( + manager.find(8).getPosition().x > manager.find(7).getPosition().x, + 'children of 1st level even order nodes must be to the right' + ); + $assert( + manager.find(9).getPosition().x > manager.find(7).getPosition().x, + 'children of 1st level even order nodes must be to the right' + ); + $assert( + manager.find(10).getPosition().x < manager.find(6).getPosition().x, + 'children of 1st level odd order nodes must be to the left' + ); + $assert( + manager.find(11).getPosition().x < manager.find(10).getPosition().x, + 'children of 1st level odd order nodes must be to the left' + ); + $assert( + manager.find(12).getPosition().x < manager.find(10).getPosition().x, + 'children of 1st level odd order nodes must be to the left' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testBalancedPredict: function() { - console.log("testBalancedPredict:"); - var position = {x:0, y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testBalancedPredict: function () { + console.log('testBalancedPredict:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); - manager.connectNode(0,1,0); - manager.connectNode(0,2,1); - manager.connectNode(0,3,2); - manager.connectNode(0,4,3); - manager.connectNode(0,5,4); - manager.connectNode(4,7,0); - manager.connectNode(4,8,1); - manager.connectNode(8,9,0); - manager.connectNode(3,10,0); - manager.connectNode(3,11,1); + manager.connectNode(0, 1, 0); + manager.connectNode(0, 2, 1); + manager.connectNode(0, 3, 2); + manager.connectNode(0, 4, 3); + manager.connectNode(0, 5, 4); + manager.connectNode(4, 7, 0); + manager.connectNode(4, 8, 1); + manager.connectNode(8, 9, 0); + manager.connectNode(3, 10, 0); + manager.connectNode(3, 11, 1); manager.layout(); // Graph 1 - var graph1 = manager.plot("testBalancedPredict1", {width:1000, height:400}); + var graph1 = manager.plot('testBalancedPredict1', { width: 1000, height: 400 }); - console.log("\tAdded as child of node 0 and dropped at (165, -70):"); - var prediction1a = manager.predict(0, null, {x:165, y:-70}); + console.log('\tAdded as child of node 0 and dropped at (165, -70):'); + var prediction1a = manager.predict(0, null, { x: 165, y: -70 }); this._plotPrediction(graph1, prediction1a); - $assert(prediction1a.position.y < manager.find(1).getPosition().y && - prediction1a.position.x == manager.find(1).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction1a.order == 0, "Prediction order should be 0"); + $assert( + prediction1a.position.y < manager.find(1).getPosition().y && + prediction1a.position.x == manager.find(1).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1a.order == 0, 'Prediction order should be 0'); - console.log("\tAdded as child of node 0 and dropped at (165, -10):"); - var prediction1b = manager.predict(0, null, {x:165, y:-10}); + console.log('\tAdded as child of node 0 and dropped at (165, -10):'); + var prediction1b = manager.predict(0, null, { x: 165, y: -10 }); this._plotPrediction(graph1, prediction1b); - $assert(prediction1b.position.y > manager.find(1).getPosition().y && - prediction1b.position.y < manager.find(3).getPosition().y && - prediction1b.position.x == manager.find(1).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction1b.order == 2, "Prediction order should be 2"); + $assert( + prediction1b.position.y > manager.find(1).getPosition().y && + prediction1b.position.y < manager.find(3).getPosition().y && + prediction1b.position.x == manager.find(1).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1b.order == 2, 'Prediction order should be 2'); - console.log("\tAdded as child of node 0 and dropped at (145, 15):"); - var prediction1c = manager.predict(0, null, {x:145, y:15}); + console.log('\tAdded as child of node 0 and dropped at (145, 15):'); + var prediction1c = manager.predict(0, null, { x: 145, y: 15 }); this._plotPrediction(graph1, prediction1c); - $assert(prediction1c.position.y > manager.find(3).getPosition().y && - prediction1c.position.y < manager.find(5).getPosition().y && - prediction1c.position.x == manager.find(3).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction1c.order == 4, "Prediction order should be 4"); + $assert( + prediction1c.position.y > manager.find(3).getPosition().y && + prediction1c.position.y < manager.find(5).getPosition().y && + prediction1c.position.x == manager.find(3).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1c.order == 4, 'Prediction order should be 4'); - console.log("\tAdded as child of node 0 and dropped at (145, 70):"); - var prediction1d = manager.predict(0, null, {x:145, y:70}); + console.log('\tAdded as child of node 0 and dropped at (145, 70):'); + var prediction1d = manager.predict(0, null, { x: 145, y: 70 }); this._plotPrediction(graph1, prediction1d); - $assert(prediction1d.position.y > manager.find(5).getPosition().y && - prediction1d.position.x == manager.find(5).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction1d.order == 6, "Prediction order should be 6"); + $assert( + prediction1d.position.y > manager.find(5).getPosition().y && + prediction1d.position.x == manager.find(5).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1d.order == 6, 'Prediction order should be 6'); // Graph 2 - var graph2 = manager.plot("testBalancedPredict2", {width:1000, height:400}); + var graph2 = manager.plot('testBalancedPredict2', { width: 1000, height: 400 }); - console.log("\tAdded as child of node 0 and dropped at (-145, -50):"); - var prediction2a = manager.predict(0, null, {x:-145, y:-50}); + console.log('\tAdded as child of node 0 and dropped at (-145, -50):'); + var prediction2a = manager.predict(0, null, { x: -145, y: -50 }); this._plotPrediction(graph2, prediction2a); - $assert(prediction2a.position.y < manager.find(2).getPosition().y && - prediction2a.position.x == manager.find(2).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction2a.order == 1, "Prediction order should be 1"); + $assert( + prediction2a.position.y < manager.find(2).getPosition().y && + prediction2a.position.x == manager.find(2).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction2a.order == 1, 'Prediction order should be 1'); - console.log("\tAdded as child of node 0 and dropped at (-145, -10):"); - var prediction2b = manager.predict(0, null, {x:-145, y:-10}); + console.log('\tAdded as child of node 0 and dropped at (-145, -10):'); + var prediction2b = manager.predict(0, null, { x: -145, y: -10 }); this._plotPrediction(graph2, prediction2b); - $assert(prediction2b.position.y > manager.find(2).getPosition().y && - prediction2b.position.y < manager.find(4).getPosition().y && - prediction2b.position.x == manager.find(2).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction2b.order == 3, "Prediction order should be 3"); + $assert( + prediction2b.position.y > manager.find(2).getPosition().y && + prediction2b.position.y < manager.find(4).getPosition().y && + prediction2b.position.x == manager.find(2).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction2b.order == 3, 'Prediction order should be 3'); - console.log("\tAdded as child of node 0 and dropped at (-145, 40):"); - var prediction2c = manager.predict(0, null, {x:-145, y:400}); + console.log('\tAdded as child of node 0 and dropped at (-145, 40):'); + var prediction2c = manager.predict(0, null, { x: -145, y: 400 }); this._plotPrediction(graph2, prediction2c); - $assert(prediction2c.position.y > manager.find(4).getPosition().y && - prediction2c.position.x == manager.find(4).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction2c.order == 5, "Prediction order should be 5"); + $assert( + prediction2c.position.y > manager.find(4).getPosition().y && + prediction2c.position.x == manager.find(4).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction2c.order == 5, 'Prediction order should be 5'); // Graph 3 - console.log("\tPredict nodes added with no position:"); - var graph3 = manager.plot("testBalancedPredict3", {width:1000, height:400}); + console.log('\tPredict nodes added with no position:'); + var graph3 = manager.plot('testBalancedPredict3', { width: 1000, height: 400 }); var prediction3 = manager.predict(0, null, null); this._plotPrediction(graph3, prediction3); - $assert(prediction3.position.y > manager.find(4).getPosition().y && - prediction3.position.x == manager.find(4).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction3.order == 5, "Prediction order should be 5"); + $assert( + prediction3.position.y > manager.find(4).getPosition().y && + prediction3.position.x == manager.find(4).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction3.order == 5, 'Prediction order should be 5'); - console.log("\tPredict nodes added with no position:"); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, prediction3.position); - manager.connectNode(0,6,prediction3.order); + console.log('\tPredict nodes added with no position:'); + manager.addNode(6, TestSuite.NODE_SIZE, prediction3.position); + manager.connectNode(0, 6, prediction3.order); manager.layout(); - var graph4 = manager.plot("testBalancedPredict4", {width:1000, height:400}); + var graph4 = manager.plot('testBalancedPredict4', { width: 1000, height: 400 }); var prediction4 = manager.predict(0, null, null); this._plotPrediction(graph4, prediction4); - $assert(prediction4.position.y > manager.find(5).getPosition().y && - prediction4.position.x == manager.find(5).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction4.order == 6, "Prediction order should be 6"); + $assert( + prediction4.position.y > manager.find(5).getPosition().y && + prediction4.position.x == manager.find(5).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction4.order == 6, 'Prediction order should be 6'); - console.log("\tPredict nodes added only a root node:"); + console.log('\tPredict nodes added only a root node:'); manager.removeNode(1).removeNode(2).removeNode(3).removeNode(4).removeNode(5); manager.layout(); - var graph5 = manager.plot("testBalancedPredict5", {width:1000, height:400}); + var graph5 = manager.plot('testBalancedPredict5', { width: 1000, height: 400 }); var prediction5a = manager.predict(0, null, null); - var prediction5b = manager.predict(0, null, {x:40, y:100}); + var prediction5b = manager.predict(0, null, { x: 40, y: 100 }); this._plotPrediction(graph5, prediction5a); this._plotPrediction(graph5, prediction5b); - $assert(prediction5a.position.x > manager.find(0).getPosition().x && - prediction5a.position.y == manager.find(0).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction5a.order == 0, "Prediction order should be 0"); - $assert(prediction5a.position.x == prediction5b.position.x && - prediction5a.position.y == prediction5b.position.y, "Both predictions should be the same"); - $assert(prediction5a.order == prediction5b.order, "Both predictions should be the same"); + $assert( + prediction5a.position.x > manager.find(0).getPosition().x && + prediction5a.position.y == manager.find(0).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction5a.order == 0, 'Prediction order should be 0'); + $assert( + prediction5a.position.x == prediction5b.position.x && + prediction5a.position.y == prediction5b.position.y, + 'Both predictions should be the same' + ); + $assert(prediction5a.order == prediction5b.order, 'Both predictions should be the same'); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testBalancedNodeDragPredict: function() { - console.log("testBalancedNodeDragPredict:"); - var position = {x:0, y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testBalancedNodeDragPredict: function () { + console.log('testBalancedNodeDragPredict:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Graph 1 - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); manager.layout(); - var graph1 = manager.plot("testBalancedNodeDragPredict1", {width:800, height:400}); + var graph1 = manager.plot('testBalancedNodeDragPredict1', { width: 800, height: 400 }); - var prediction1a = manager.predict(0, 1, {x:50, y:50}); + var prediction1a = manager.predict(0, 1, { x: 50, y: 50 }); this._plotPrediction(graph1, prediction1a); - $assert(prediction1a.position.x == manager.find(1).getPosition().x && - prediction1a.position.y == manager.find(1).getPosition().y, - "Prediction position should be the same as node 1"); - $assert(prediction1a.order == manager.find(1).getOrder(), "Prediction order should be the same as node 1"); + $assert( + prediction1a.position.x == manager.find(1).getPosition().x && + prediction1a.position.y == manager.find(1).getPosition().y, + 'Prediction position should be the same as node 1' + ); + $assert( + prediction1a.order == manager.find(1).getOrder(), + 'Prediction order should be the same as node 1' + ); - - var prediction1b = manager.predict(0, 1, {x:50, y:-50}); + var prediction1b = manager.predict(0, 1, { x: 50, y: -50 }); this._plotPrediction(graph1, prediction1b); - $assert(prediction1b.position.x == manager.find(1).getPosition().x && - prediction1b.position.y == manager.find(1).getPosition().y, - "Prediction position should be the same as node 1"); - $assert(prediction1b.order == manager.find(1).getOrder(), "Prediction order should be the same as node 1"); + $assert( + prediction1b.position.x == manager.find(1).getPosition().x && + prediction1b.position.y == manager.find(1).getPosition().y, + 'Prediction position should be the same as node 1' + ); + $assert( + prediction1b.order == manager.find(1).getOrder(), + 'Prediction order should be the same as node 1' + ); - var prediction1c = manager.predict(0, 1, {x:-50, y:50}); + var prediction1c = manager.predict(0, 1, { x: -50, y: 50 }); this._plotPrediction(graph1, prediction1c); - $assert(prediction1c.position.x < manager.find(0).getPosition().x && - prediction1c.position.y == manager.find(0).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction1c.order == 1, "Prediction order should be the same as node 1"); + $assert( + prediction1c.position.x < manager.find(0).getPosition().x && + prediction1c.position.y == manager.find(0).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1c.order == 1, 'Prediction order should be the same as node 1'); - var prediction1d = manager.predict(0, 1, {x:-50, y:-50}); + var prediction1d = manager.predict(0, 1, { x: -50, y: -50 }); this._plotPrediction(graph1, prediction1d); - $assert(prediction1d.position.x < manager.find(0).getPosition().x && - prediction1d.position.y == manager.find(0).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction1d.order == 1, "Prediction order should be the same as node 1"); + $assert( + prediction1d.position.x < manager.find(0).getPosition().x && + prediction1d.position.y == manager.find(0).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1d.order == 1, 'Prediction order should be the same as node 1'); // Graph 2 manager.disconnectNode(1); manager.connectNode(0, 1, 1); manager.layout(); - var graph2 = manager.plot("testBalancedNodeDragPredict2", {width:800, height:400}); + var graph2 = manager.plot('testBalancedNodeDragPredict2', { width: 800, height: 400 }); - var prediction2a = manager.predict(0, 1, {x:50, y:50}); + var prediction2a = manager.predict(0, 1, { x: 50, y: 50 }); this._plotPrediction(graph2, prediction2a); - $assert(prediction2a.position.x > manager.find(0).getPosition().x && - prediction2a.position.y == manager.find(0).getPosition().y, "Prediction is positioned incorrectly"); - $assert(prediction2a.order == 0, "Prediction order should be 0"); + $assert( + prediction2a.position.x > manager.find(0).getPosition().x && + prediction2a.position.y == manager.find(0).getPosition().y, + 'Prediction is positioned incorrectly' + ); + $assert(prediction2a.order == 0, 'Prediction order should be 0'); - var prediction2b = manager.predict(0, 1, {x:50, y:-50}); + var prediction2b = manager.predict(0, 1, { x: 50, y: -50 }); this._plotPrediction(graph2, prediction2b); - $assert(prediction2b.position.x > manager.find(0).getPosition().x && - prediction2b.position.y == manager.find(0).getPosition().y, "Prediction is positioned incorrectly"); - $assert(prediction2b.order == 0, "Prediction order should be 0"); + $assert( + prediction2b.position.x > manager.find(0).getPosition().x && + prediction2b.position.y == manager.find(0).getPosition().y, + 'Prediction is positioned incorrectly' + ); + $assert(prediction2b.order == 0, 'Prediction order should be 0'); - var prediction2c = manager.predict(0, 1, {x:-50, y:50}); + var prediction2c = manager.predict(0, 1, { x: -50, y: 50 }); this._plotPrediction(graph2, prediction2c); - $assert(prediction2c.position.x == manager.find(1).getPosition().x && - prediction2c.position.y == manager.find(1).getPosition().y, - "Prediction position should be the same as node 1"); - $assert(prediction2c.order == manager.find(1).getOrder(), "Prediction order should be the same as node 1"); + $assert( + prediction2c.position.x == manager.find(1).getPosition().x && + prediction2c.position.y == manager.find(1).getPosition().y, + 'Prediction position should be the same as node 1' + ); + $assert( + prediction2c.order == manager.find(1).getOrder(), + 'Prediction order should be the same as node 1' + ); - var prediction2d = manager.predict(0, 1, {x:-50, y:-50}); + var prediction2d = manager.predict(0, 1, { x: -50, y: -50 }); this._plotPrediction(graph2, prediction2d); - $assert(prediction2d.position.x == manager.find(1).getPosition().x && - prediction2d.position.y == manager.find(1).getPosition().y, - "Prediction position should be the same as node 1"); - $assert(prediction2d.order == manager.find(1).getOrder(), "Prediction order should be the same as node 1"); + $assert( + prediction2d.position.x == manager.find(1).getPosition().x && + prediction2d.position.y == manager.find(1).getPosition().y, + 'Prediction position should be the same as node 1' + ); + $assert( + prediction2d.order == manager.find(1).getOrder(), + 'Prediction order should be the same as node 1' + ); // Graph 3 manager.disconnectNode(1); manager.connectNode(0, 1, 0); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,2,2); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 2); manager.layout(); - var graph3 = manager.plot("testBalancedNodeDragPredict3", {width:800, height:400}); + var graph3 = manager.plot('testBalancedNodeDragPredict3', { width: 800, height: 400 }); - var prediction3a = manager.predict(0, 1, {x:50, y:50}); + var prediction3a = manager.predict(0, 1, { x: 50, y: 50 }); this._plotPrediction(graph3, prediction3a); - $assert(prediction3a.position.x == manager.find(2).getPosition().x && - prediction3a.position.y > manager.find(2).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction3a.order == 4, "Prediction order should be 4"); + $assert( + prediction3a.position.x == manager.find(2).getPosition().x && + prediction3a.position.y > manager.find(2).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction3a.order == 4, 'Prediction order should be 4'); - var prediction3b = manager.predict(0, 1, {x:50, y:-50}); + var prediction3b = manager.predict(0, 1, { x: 50, y: -50 }); this._plotPrediction(graph3, prediction3b); - $assert(prediction3b.position.x == manager.find(1).getPosition().x && - prediction3b.position.y == manager.find(1).getPosition().y && - prediction3b.order == manager.find(1).getOrder(), "Prediction should be the exact same as dragged node"); + $assert( + prediction3b.position.x == manager.find(1).getPosition().x && + prediction3b.position.y == manager.find(1).getPosition().y && + prediction3b.order == manager.find(1).getOrder(), + 'Prediction should be the exact same as dragged node' + ); - var prediction3c = manager.predict(0, 1, {x:-50, y:50}); + var prediction3c = manager.predict(0, 1, { x: -50, y: 50 }); this._plotPrediction(graph3, prediction3c); - $assert(prediction3c.position.x < manager.find(0).getPosition().x && - prediction3c.position.y == manager.find(0).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction3c.order == 1, "Prediction order should be 1"); + $assert( + prediction3c.position.x < manager.find(0).getPosition().x && + prediction3c.position.y == manager.find(0).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction3c.order == 1, 'Prediction order should be 1'); - var prediction3d = manager.predict(0, 1, {x:-50, y:-50}); + var prediction3d = manager.predict(0, 1, { x: -50, y: -50 }); this._plotPrediction(graph3, prediction3d); - $assert(prediction3d.position.x < manager.find(0).getPosition().x && - prediction3d.position.y == manager.find(0).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction3d.order == 1, "Prediction order should be 1"); + $assert( + prediction3d.position.x < manager.find(0).getPosition().x && + prediction3d.position.y == manager.find(0).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction3d.order == 1, 'Prediction order should be 1'); - var prediction3e = manager.predict(0, 1, {x:50, y:0}); + var prediction3e = manager.predict(0, 1, { x: 50, y: 0 }); this._plotPrediction(graph3, prediction3e); - $assert(prediction3e.position.x == manager.find(1).getPosition().x && - prediction3e.position.y == manager.find(1).getPosition().y, - "Prediction position should be the same as node 1"); - $assert(prediction3e.order == manager.find(1).getOrder(), "Prediction order should be the same as node 1"); + $assert( + prediction3e.position.x == manager.find(1).getPosition().x && + prediction3e.position.y == manager.find(1).getPosition().y, + 'Prediction position should be the same as node 1' + ); + $assert( + prediction3e.order == manager.find(1).getOrder(), + 'Prediction order should be the same as node 1' + ); - console.log("OK!\n\n"); - } -}); \ No newline at end of file + console.log('OK!\n\n'); + }, +}); + +export default BalancedTestSuite; diff --git a/packages/mindplot/test/javascript/static/test/FreeTestSuite.js b/packages/mindplot/test/javascript/static/test/FreeTestSuite.js index 05361e17..367ffd80 100644 --- a/packages/mindplot/test/javascript/static/test/FreeTestSuite.js +++ b/packages/mindplot/test/javascript/static/test/FreeTestSuite.js @@ -15,11 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.layout.FreeTestSuite = new Class({ - Extends: mindplot.layout.TestSuite, +const TestSuite = require('./TestSuite').default; +const FreeTestSuite = new Class({ + Extends: TestSuite, - initialize:function() { - $('#freeTest').setStyle("display","block"); + initialize: function () { + $('#freeTest').css('display', 'block'); this.testFreePosition(); this.testFreePredict(); @@ -31,121 +32,133 @@ mindplot.layout.FreeTestSuite = new Class({ this.testFreeOverlap(); }, - testFreePosition: function() { - console.log("testFreePosition:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testFreePosition: function () { + console.log('testFreePosition:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(17, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(18, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(19, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(20, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(21, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(22, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); + manager.addNode(12, TestSuite.NODE_SIZE, position); + manager.addNode(13, TestSuite.NODE_SIZE, position); + manager.addNode(14, TestSuite.NODE_SIZE, position); + manager.addNode(15, TestSuite.NODE_SIZE, position); + manager.addNode(16, TestSuite.NODE_SIZE, position); + manager.addNode(17, TestSuite.NODE_SIZE, position); + manager.addNode(18, TestSuite.NODE_SIZE, position); + manager.addNode(19, TestSuite.NODE_SIZE, position); + manager.addNode(20, TestSuite.NODE_SIZE, position); + manager.addNode(21, TestSuite.NODE_SIZE, position); + manager.addNode(22, TestSuite.NODE_SIZE, position); - manager.connectNode(0,1,0).connectNode(0,2,1).connectNode(0,3,2).connectNode(0,4,3); - manager.connectNode(4,21,0).connectNode(4,22,0); - manager.connectNode(1,5,0); - manager.connectNode(5,6,0).connectNode(6,8,0).connectNode(8,9,0); - manager.connectNode(5,7,1).connectNode(7,10,0); - manager.connectNode(3,11,0).connectNode(11,14,0).connectNode(14,18,0).connectNode(14,19,1).connectNode(14,20,2); - manager.connectNode(3,12,1).connectNode(12,15,0).connectNode(12,16,1).connectNode(12,17,2); - manager.connectNode(3,13,2); + manager.connectNode(0, 1, 0).connectNode(0, 2, 1).connectNode(0, 3, 2).connectNode(0, 4, 3); + manager.connectNode(4, 21, 0).connectNode(4, 22, 0); + manager.connectNode(1, 5, 0); + manager.connectNode(5, 6, 0).connectNode(6, 8, 0).connectNode(8, 9, 0); + manager.connectNode(5, 7, 1).connectNode(7, 10, 0); + manager + .connectNode(3, 11, 0) + .connectNode(11, 14, 0) + .connectNode(14, 18, 0) + .connectNode(14, 19, 1) + .connectNode(14, 20, 2); + manager + .connectNode(3, 12, 1) + .connectNode(12, 15, 0) + .connectNode(12, 16, 1) + .connectNode(12, 17, 2); + manager.connectNode(3, 13, 2); manager.layout(); - manager.plot("testFreePosition1", {width:1400, height:600}); + manager.plot('testFreePosition1', { width: 1400, height: 600 }); - console.log("\tmove node 12 to (300,30):"); - manager.moveNode(12, {x:300, y:30}); + console.log('\tmove node 12 to (300,30):'); + manager.moveNode(12, { x: 300, y: 30 }); manager.layout(true); - manager.plot("testFreePosition2", {width:1400, height:600}); - this._assertFreePosition(manager, 12, {x:300, y:30}) + manager.plot('testFreePosition2', { width: 1400, height: 600 }); + this._assertFreePosition(manager, 12, { x: 300, y: 30 }); - console.log("\tmove node 13 to (340,180):"); - var node13Pos = {x:340, y:180}; + console.log('\tmove node 13 to (340,180):'); + var node13Pos = { x: 340, y: 180 }; manager.moveNode(13, node13Pos); manager.layout(true); - manager.plot("testFreePosition3", {width:1400, height:600}); + manager.plot('testFreePosition3', { width: 1400, height: 600 }); this._assertFreePosition(manager, 13, node13Pos); - console.log("\tmove node 11 to (250,-50):"); - manager.moveNode(11, {x:250, y:-50}); + console.log('\tmove node 11 to (250,-50):'); + manager.moveNode(11, { x: 250, y: -50 }); manager.layout(true); - manager.plot("testFreePosition4", {width:1400, height:600}); - this._assertFreePosition(manager, 11, {x:250, y:-50}); - $assert(manager.find(13).getPosition().x == node13Pos.x && manager.find(13).getPosition().y == node13Pos.y, - "Node 13 shouldn't have moved"); + manager.plot('testFreePosition4', { width: 1400, height: 600 }); + this._assertFreePosition(manager, 11, { x: 250, y: -50 }); + $assert( + manager.find(13).getPosition().x == node13Pos.x && + manager.find(13).getPosition().y == node13Pos.y, + "Node 13 shouldn't have moved" + ); - console.log("\tmove node 7 to (350,-190):"); - manager.moveNode(7, {x:350, y:-190}); + console.log('\tmove node 7 to (350,-190):'); + manager.moveNode(7, { x: 350, y: -190 }); manager.layout(true); - manager.plot("testFreePosition5", {width:1400, height:600}); - this._assertFreePosition(manager, 7, {x:350, y:-190}); + manager.plot('testFreePosition5', { width: 1400, height: 600 }); + this._assertFreePosition(manager, 7, { x: 350, y: -190 }); - console.log("\tadd node 23 to 12:"); - manager.addNode(23, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.connectNode(12,23,3); + console.log('\tadd node 23 to 12:'); + manager.addNode(23, TestSuite.NODE_SIZE, position); + manager.connectNode(12, 23, 3); manager.layout(true); - manager.plot("testFreePosition6", {width:1400, height:600}); + manager.plot('testFreePosition6', { width: 1400, height: 600 }); this._assertFreePosition(manager, null, null); - console.log("\tmove node 4 to (-300, 190):"); - manager.moveNode(4, {x:-300, y:190}); + console.log('\tmove node 4 to (-300, 190):'); + manager.moveNode(4, { x: -300, y: 190 }); manager.layout(true); - manager.plot("testFreePosition7", {width:1400, height:600}); - this._assertFreePosition(manager, 4, {x:-300, y:190}); + manager.plot('testFreePosition7', { width: 1400, height: 600 }); + this._assertFreePosition(manager, 4, { x: -300, y: 190 }); - console.log("\tadd node 24 to 3:"); - manager.addNode(24, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.connectNode(3,24,3); + console.log('\tadd node 24 to 3:'); + manager.addNode(24, TestSuite.NODE_SIZE, position); + manager.connectNode(3, 24, 3); manager.layout(true); - manager.plot("testFreePosition8", {width:1400, height:600}); + manager.plot('testFreePosition8', { width: 1400, height: 600 }); this._assertFreePosition(manager, null, null); - console.log("\tadd node 25 to 17:"); - manager.addNode(25, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.connectNode(17,25,0); + console.log('\tadd node 25 to 17:'); + manager.addNode(25, TestSuite.NODE_SIZE, position); + manager.connectNode(17, 25, 0); manager.layout(true); - manager.plot("testFreePosition9", {width:1400, height:600}); + manager.plot('testFreePosition9', { width: 1400, height: 600 }); this._assertFreePosition(manager, null, null); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testFreePredict: function() { - console.log("testFreePredict:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testFreePredict: function () { + console.log('testFreePredict:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.connectNode(0, 2, 1); @@ -160,50 +173,62 @@ mindplot.layout.FreeTestSuite = new Class({ manager.connectNode(2, 10, 1); manager.layout(); - var graph = manager.plot("testFreePredict1", {width:1000, height:400}); + var graph = manager.plot('testFreePredict1', { width: 1000, height: 400 }); - var pos1 = {x: 370, y:80}; + var pos1 = { x: 370, y: 80 }; var predict1 = manager.predict(5, 11, pos1, true); this._plotPrediction(graph, predict1); - $assert(predict1.position.x == pos1.x && predict1.position.y == pos1.y, "free predict should return the same position"); + $assert( + predict1.position.x == pos1.x && predict1.position.y == pos1.y, + 'free predict should return the same position' + ); - var pos2 = {x: -200, y:80}; + var pos2 = { x: -200, y: 80 }; var predict2 = manager.predict(0, 2, pos2, true); this._plotPrediction(graph, predict2); - $assert(predict2.position.x == pos2.x && predict2.position.y == pos2.y, "free predict should return the same position"); + $assert( + predict2.position.x == pos2.x && predict2.position.y == pos2.y, + 'free predict should return the same position' + ); - var pos3 = {x: 200, y:30}; + var pos3 = { x: 200, y: 30 }; var node5 = manager.find(5); var predict3 = manager.predict(3, 5, pos3, true); this._plotPrediction(graph, predict3); - $assert(predict3.position.x == node5.getPosition().x && predict3.position.y == pos3.y, "free predict should return the x-coordinate of the node"); + $assert( + predict3.position.x == node5.getPosition().x && predict3.position.y == pos3.y, + 'free predict should return the x-coordinate of the node' + ); - var pos4 = {x: -100, y:45}; + var pos4 = { x: -100, y: 45 }; var node10 = manager.find(10); var predict4 = manager.predict(2, 10, pos4, true); this._plotPrediction(graph, predict4); - $assert(predict4.position.x == node10.getPosition().x && predict4.position.y == pos4.y, "free predict should return the x-coordinate of the node"); + $assert( + predict4.position.x == node10.getPosition().x && predict4.position.y == pos4.y, + 'free predict should return the x-coordinate of the node' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testReconnectFreeNode: function() { - console.log("testReconnectFreeNode:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testReconnectFreeNode: function () { + console.log('testReconnectFreeNode:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.connectNode(0, 2, 1); @@ -218,265 +243,313 @@ mindplot.layout.FreeTestSuite = new Class({ manager.connectNode(2, 10, 1); manager.layout(); - manager.plot("testReconnectFreeNode1", {width:1000, height:400}); + manager.plot('testReconnectFreeNode1', { width: 1000, height: 400 }); - console.log("\tmove node 5"); - manager.moveNode(5, {x:250, y:30}); + console.log('\tmove node 5'); + manager.moveNode(5, { x: 250, y: 30 }); manager.layout(); - manager.plot("testReconnectFreeNode2", {width:1000, height:400}); - this._assertFreePosition(manager, 5, {x:250, y:30}); + manager.plot('testReconnectFreeNode2', { width: 1000, height: 400 }); + this._assertFreePosition(manager, 5, { x: 250, y: 30 }); - console.log("\treconnect node 5 to node 2"); + console.log('\treconnect node 5 to node 2'); manager.disconnectNode(5); - manager.connectNode(2,5,2); + manager.connectNode(2, 5, 2); manager.layout(); - manager.plot("testReconnectFreeNode3", {width:1000, height:400}); - $assert(manager.find(5).getPosition().y > manager.find(10).getPosition().y && - manager.find(5).getPosition().x == manager.find(10).getPosition().x, "Node 5 is incorrectly positioned" + manager.plot('testReconnectFreeNode3', { width: 1000, height: 400 }); + $assert( + manager.find(5).getPosition().y > manager.find(10).getPosition().y && + manager.find(5).getPosition().x == manager.find(10).getPosition().x, + 'Node 5 is incorrectly positioned' ); - $assert(manager.find(5).getOrder() == 2, "Node 5 should have order 2"); + $assert(manager.find(5).getOrder() == 2, 'Node 5 should have order 2'); - console.log("\tmove node 8"); - manager.moveNode(8, {x:-370, y:60}); + console.log('\tmove node 8'); + manager.moveNode(8, { x: -370, y: 60 }); manager.layout(); - manager.plot("testReconnectFreeNode4", {width:1000, height:400}); - this._assertFreePosition(manager, 8, {x:-370, y:60}); + manager.plot('testReconnectFreeNode4', { width: 1000, height: 400 }); + this._assertFreePosition(manager, 8, { x: -370, y: 60 }); - console.log("\treconnect node 5 to node 10"); + console.log('\treconnect node 5 to node 10'); manager.disconnectNode(5); - manager.connectNode(10,5,0); + manager.connectNode(10, 5, 0); manager.layout(); - manager.plot("testReconnectFreeNode5", {width:1000, height:400}); - $assert(manager.find(5).getPosition().y == manager.find(10).getPosition().y && - manager.find(5).getPosition().x < manager.find(10).getPosition().x, "Node 5 is incorrectly positioned" + manager.plot('testReconnectFreeNode5', { width: 1000, height: 400 }); + $assert( + manager.find(5).getPosition().y == manager.find(10).getPosition().y && + manager.find(5).getPosition().x < manager.find(10).getPosition().x, + 'Node 5 is incorrectly positioned' ); - $assert(manager.find(5).getOrder() == 0, "Node 5 should have order 0"); + $assert(manager.find(5).getOrder() == 0, 'Node 5 should have order 0'); - console.log("reconnect node 5 to node 3"); + console.log('reconnect node 5 to node 3'); manager.disconnectNode(5); - manager.connectNode(3,5,2); + manager.connectNode(3, 5, 2); manager.layout(); - manager.plot("testReconnectFreeNode6", {width:1000, height:400}); - $assert(manager.find(5).getPosition().y > manager.find(6).getPosition().y && - manager.find(5).getPosition().x == manager.find(6).getPosition().x, "Node 5 is incorrectly positioned" + manager.plot('testReconnectFreeNode6', { width: 1000, height: 400 }); + $assert( + manager.find(5).getPosition().y > manager.find(6).getPosition().y && + manager.find(5).getPosition().x == manager.find(6).getPosition().x, + 'Node 5 is incorrectly positioned' ); - $assert(manager.find(5).getOrder() == 2, "Node 5 should have order 2"); + $assert(manager.find(5).getOrder() == 2, 'Node 5 should have order 2'); - console.log("\tmove node 8"); - manager.moveNode(8, {x:370, y:30}); + console.log('\tmove node 8'); + manager.moveNode(8, { x: 370, y: 30 }); manager.layout(); - manager.plot("testReconnectFreeNode7", {width:1000, height:400}); - this._assertFreePosition(manager, 8, {x:370, y:30}); + manager.plot('testReconnectFreeNode7', { width: 1000, height: 400 }); + this._assertFreePosition(manager, 8, { x: 370, y: 30 }); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testSiblingOverlapping: function() { - console.log("testSiblingOverlapping:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testSiblingOverlapping: function () { + console.log('testSiblingOverlapping:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,2,0); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,3,1); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,4,2); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,5,3); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,6,4); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,7,5); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,8,6); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,9,4); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(1, 2, 0); + manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(1, 3, 1); + manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(1, 4, 2); + manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(1, 5, 3); + manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(1, 6, 4); + manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(1, 7, 5); + manager.addNode(8, TestSuite.NODE_SIZE, position).connectNode(1, 8, 6); + manager.addNode(9, TestSuite.NODE_SIZE, position).connectNode(0, 9, 4); manager.layout(); - manager.plot("testSiblingOverlapping1", {width:800, height:600}); + manager.plot('testSiblingOverlapping1', { width: 800, height: 600 }); - console.log("\tmove node 2"); - manager.moveNode(2, {x:250, y: -30}); + console.log('\tmove node 2'); + manager.moveNode(2, { x: 250, y: -30 }); manager.layout(); - manager.plot("testSiblingOverlapping2", {width:800, height:600}); - this._assertFreePosition(manager, 2, {x:250, y: -30}); + manager.plot('testSiblingOverlapping2', { width: 800, height: 600 }); + this._assertFreePosition(manager, 2, { x: 250, y: -30 }); - console.log("\tmove node 7"); - manager.moveNode(7, {x:250, y: 100}); + console.log('\tmove node 7'); + manager.moveNode(7, { x: 250, y: 100 }); manager.layout(); - manager.plot("testSiblingOverlapping3", {width:800, height:600}); - this._assertFreePosition(manager, 7, {x:250, y: 100}); + manager.plot('testSiblingOverlapping3', { width: 800, height: 600 }); + this._assertFreePosition(manager, 7, { x: 250, y: 100 }); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testRootNodeChildrenPositioning: function() { - console.log("testRootNodeChildrenPositioning:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testRootNodeChildrenPositioning: function () { + console.log('testRootNodeChildrenPositioning:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,2,1); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,3,2); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,4,3); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,5,4); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,6,5); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 1); + manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(0, 3, 2); + manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(0, 4, 3); + manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(0, 5, 4); + manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(0, 6, 5); manager.layout(); - manager.plot("testRootNodeChildrenPositioning1", {width:800, height:600}); + manager.plot('testRootNodeChildrenPositioning1', { width: 800, height: 600 }); - console.log("\tmove node 1"); - manager.moveNode(1, {x:150, y:0}); + console.log('\tmove node 1'); + manager.moveNode(1, { x: 150, y: 0 }); manager.layout(); - manager.plot("testRootNodeChildrenPositioning2", {width:800, height:600}); - this._assertFreePosition(manager, 1, {x:150, y:0}); + manager.plot('testRootNodeChildrenPositioning2', { width: 800, height: 600 }); + this._assertFreePosition(manager, 1, { x: 150, y: 0 }); - console.log("\tmove node 4"); - manager.moveNode(4, {x:-140, y:30}); + console.log('\tmove node 4'); + manager.moveNode(4, { x: -140, y: 30 }); manager.layout(); - manager.plot("testRootNodeChildrenPositioning3", {width:800, height:600}); - this._assertFreePosition(manager, 4, {x:-140, y:30}); + manager.plot('testRootNodeChildrenPositioning3', { width: 800, height: 600 }); + this._assertFreePosition(manager, 4, { x: -140, y: 30 }); - console.log("\tmove node 2"); - manager.moveNode(2, {x:-150, y:-50}); + console.log('\tmove node 2'); + manager.moveNode(2, { x: -150, y: -50 }); manager.layout(); - manager.plot("testRootNodeChildrenPositioning4", {width:800, height:600}); - this._assertFreePosition(manager, 2, {x:-150, y:-50}); + manager.plot('testRootNodeChildrenPositioning4', { width: 800, height: 600 }); + this._assertFreePosition(manager, 2, { x: -150, y: -50 }); //TODO(gb): fix this. It's not working -// console.log("\tmove node 6"); -// manager.moveNode(6, {x:-150, y:-50}); -// manager.layout(); -// manager.plot("testRootNodeChildrenPositioning5", {width:800, height:600}); -// this._assertFreePosition(manager, 6, {x:-150, y:-50}); + // console.log("\tmove node 6"); + // manager.moveNode(6, {x:-150, y:-50}); + // manager.layout(); + // manager.plot("testRootNodeChildrenPositioning5", {width:800, height:600}); + // this._assertFreePosition(manager, 6, {x:-150, y:-50}); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testBalancedFreePredict: function() { - console.log("testBalancedFreePredict:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testBalancedFreePredict: function () { + console.log('testBalancedFreePredict:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); manager.layout(); - var graph1 = manager.plot("testBalancedFreePredict1", {width:800, height:400}); + var graph1 = manager.plot('testBalancedFreePredict1', { width: 800, height: 400 }); - var predict1 = manager.predict(0, 1, {x:70, y:0}, true); + var predict1 = manager.predict(0, 1, { x: 70, y: 0 }, true); this._plotPrediction(graph1, predict1); - $assert(predict1.position.x == manager.find(1).getPosition().x, "Prediction x pos should be the same as node 1"); + $assert( + predict1.position.x == manager.find(1).getPosition().x, + 'Prediction x pos should be the same as node 1' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testFreeReorder: function() { - console.log("testFreeReorder:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testFreeReorder: function () { + console.log('testFreeReorder:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,4,0); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,5,1); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,6,2); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); + manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(1, 4, 0); + manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(1, 5, 1); + manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(1, 6, 2); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,2,2); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,7,0); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,8,1); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,9,2); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,10,3); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 2); + manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(2, 7, 0); + manager.addNode(8, TestSuite.NODE_SIZE, position).connectNode(2, 8, 1); + manager.addNode(9, TestSuite.NODE_SIZE, position).connectNode(2, 9, 2); + manager.addNode(10, TestSuite.NODE_SIZE, position).connectNode(2, 10, 3); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,3,4); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,11,0); - manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,12,1); - manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,13,2); - manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,14,3); - manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,15,4); - manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,16,5); + manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(0, 3, 4); + manager.addNode(11, TestSuite.NODE_SIZE, position).connectNode(3, 11, 0); + manager.addNode(12, TestSuite.NODE_SIZE, position).connectNode(3, 12, 1); + manager.addNode(13, TestSuite.NODE_SIZE, position).connectNode(3, 13, 2); + manager.addNode(14, TestSuite.NODE_SIZE, position).connectNode(3, 14, 3); + manager.addNode(15, TestSuite.NODE_SIZE, position).connectNode(3, 15, 4); + manager.addNode(16, TestSuite.NODE_SIZE, position).connectNode(3, 16, 5); manager.layout(); - manager.moveNode(14, {x:270, y:-160}); + manager.moveNode(14, { x: 270, y: -160 }); manager.layout(); - manager.plot("testFreeReorder1", {width:800, height:1200}); - $assert(manager.find(14).getPosition().y > manager.find(10).getPosition().y, "Node 14 should be below branch 2"); + manager.plot('testFreeReorder1', { width: 800, height: 1200 }); + $assert( + manager.find(14).getPosition().y > manager.find(10).getPosition().y, + 'Node 14 should be below branch 2' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testFreeOverlap: function() { - console.log("testFreeOverlap:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testFreeOverlap: function () { + console.log('testFreeOverlap:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,4,0); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,5,1); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,6,2); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); + manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(1, 4, 0); + manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(1, 5, 1); + manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(1, 6, 2); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,2,2); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,7,0); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,8,1); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,9,2); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,10,3); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 2); + manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(2, 7, 0); + manager.addNode(8, TestSuite.NODE_SIZE, position).connectNode(2, 8, 1); + manager.addNode(9, TestSuite.NODE_SIZE, position).connectNode(2, 9, 2); + manager.addNode(10, TestSuite.NODE_SIZE, position).connectNode(2, 10, 3); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,3,4); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,11,0); - manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,12,1); - manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,13,2); - manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,14,3); - manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,15,4); - manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,16,5); + manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(0, 3, 4); + manager.addNode(11, TestSuite.NODE_SIZE, position).connectNode(3, 11, 0); + manager.addNode(12, TestSuite.NODE_SIZE, position).connectNode(3, 12, 1); + manager.addNode(13, TestSuite.NODE_SIZE, position).connectNode(3, 13, 2); + manager.addNode(14, TestSuite.NODE_SIZE, position).connectNode(3, 14, 3); + manager.addNode(15, TestSuite.NODE_SIZE, position).connectNode(3, 15, 4); + manager.addNode(16, TestSuite.NODE_SIZE, position).connectNode(3, 16, 5); manager.layout(); - manager.plot("testFreeOverlap1", {width:800, height:1200}); + manager.plot('testFreeOverlap1', { width: 800, height: 1200 }); - manager.moveNode(14, {x:270, y:7}); + manager.moveNode(14, { x: 270, y: 7 }); manager.layout(); - manager.plot("testFreeOverlap2", {width:800, height:1200}); - $assert(manager.find(2).getPosition().y > manager.find(1).getPosition().y, "Branches 1 and 2 are overlapping"); + manager.plot('testFreeOverlap2', { width: 800, height: 1200 }); + $assert( + manager.find(2).getPosition().y > manager.find(1).getPosition().y, + 'Branches 1 and 2 are overlapping' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - _assertFreePosition: function(manager, id, position) { + _assertFreePosition: function (manager, id, position) { if (id != null && position.x != null && position.y != null) { var node = manager.find(id); - $assert(node.getPosition().x == position.x && node.getPosition().y == position.y, - "Freely moved node " + id + " is not left at free position (" + position.x + "," + position.y + "). " + - "Actual position: (" + node.getPosition().x + "," + node.getPosition().y + ")"); + $assert( + node.getPosition().x == position.x && node.getPosition().y == position.y, + 'Freely moved node ' + + id + + ' is not left at free position (' + + position.x + + ',' + + position.y + + '). ' + + 'Actual position: (' + + node.getPosition().x + + ',' + + node.getPosition().y + + ')' + ); } var treeSet = manager._treeSet; - _.each(treeSet._rootNodes, function(rootNode) { - var heightById = rootNode.getSorter().computeChildrenIdByHeights(treeSet, rootNode); - this._assertBranchCollision(treeSet, rootNode, heightById); - }, this); + _.each( + treeSet._rootNodes, + function (rootNode) { + var heightById = rootNode.getSorter().computeChildrenIdByHeights(treeSet, rootNode); + this._assertBranchCollision(treeSet, rootNode, heightById); + }, + this + ); }, - _assertBranchCollision: function(treeSet, node, heightById) { + _assertBranchCollision: function (treeSet, node, heightById) { var children = treeSet.getChildren(node); var childOfRootNode = treeSet._rootNodes.contains(node); - _.each(children, function(child) { - var height = heightById[child.getId()]; - var siblings = treeSet.getSiblings(child); - if (childOfRootNode) { - siblings = siblings.filter(function(sibling) { - return (child.getOrder() % 2) == (sibling.getOrder() % 2); - }) - } - _.each(siblings, function(sibling) { - this._branchesOverlap(child, sibling, heightById); - }, this); - }, this); + _.each( + children, + function (child) { + var height = heightById[child.getId()]; + var siblings = treeSet.getSiblings(child); + if (childOfRootNode) { + siblings = siblings.filter(function (sibling) { + return child.getOrder() % 2 == sibling.getOrder() % 2; + }); + } + _.each( + siblings, + function (sibling) { + this._branchesOverlap(child, sibling, heightById); + }, + this + ); + }, + this + ); - _.each(children, function(child) { - this._assertBranchCollision(treeSet, child, heightById); - }, this) + _.each( + children, + function (child) { + this._assertBranchCollision(treeSet, child, heightById); + }, + this + ); }, - _branchesOverlap: function(branchA, branchB, heightById) { - var topA = branchA.getPosition().y - heightById[branchA.getId()]/2; - var bottomA = branchA.getPosition().y + heightById[branchA.getId()]/2; - var topB = branchB.getPosition().y - heightById[branchB.getId()]/2; - var bottomB = branchB.getPosition().y + heightById[branchB.getId()]/2; + _branchesOverlap: function (branchA, branchB, heightById) { + var topA = branchA.getPosition().y - heightById[branchA.getId()] / 2; + var bottomA = branchA.getPosition().y + heightById[branchA.getId()] / 2; + var topB = branchB.getPosition().y - heightById[branchB.getId()] / 2; + var bottomB = branchB.getPosition().y + heightById[branchB.getId()] / 2; - $assert(topA >= bottomB || bottomA <= topB, "Branches " + branchA.getId() + " and " + branchB.getId() + " overlap"); - } -}); \ No newline at end of file + $assert( + topA >= bottomB || bottomA <= topB, + 'Branches ' + branchA.getId() + ' and ' + branchB.getId() + ' overlap' + ); + }, +}); + +export default FreeTestSuite; diff --git a/packages/mindplot/test/javascript/static/test/SymmetricTestSuite.js b/packages/mindplot/test/javascript/static/test/SymmetricTestSuite.js index 4620a0af..8706d63c 100644 --- a/packages/mindplot/test/javascript/static/test/SymmetricTestSuite.js +++ b/packages/mindplot/test/javascript/static/test/SymmetricTestSuite.js @@ -15,36 +15,38 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.layout.SymmetricTestSuite = new Class({ - Extends: mindplot.layout.TestSuite, +const TestSuite = require('./TestSuite').default; - initialize:function() { - $('#symmetricTest').setStyle("display","block"); +const SymmetricTestSuite = new Class({ + Extends: TestSuite, + + initialize: function () { + $('#symmetricTest').css('display', 'block'); this.testSymmetry(); this.testSymmetricPredict(); this.testSymmetricDragPredict(); }, - testSymmetry: function() { - console.log("testSymmetry:") - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testSymmetry: function () { + console.log('testSymmetry:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); + manager.addNode(12, TestSuite.NODE_SIZE, position); + manager.addNode(13, TestSuite.NODE_SIZE, position); + manager.addNode(14, TestSuite.NODE_SIZE, position); manager.connectNode(0, 14, 0); manager.connectNode(14, 13, 0); manager.connectNode(13, 1, 0); @@ -61,38 +63,53 @@ mindplot.layout.SymmetricTestSuite = new Class({ manager.connectNode(6, 12, 1); manager.layout(); - manager.plot("testSymmetry",{width:1600, height:400}); + manager.plot('testSymmetry', { width: 1600, height: 400 }); // All nodes should be positioned symmetrically with respect to their common ancestors - $assert(manager.find(14).getPosition().y == manager.find(13).getPosition().y, "Symmetry is not respected"); - $assert(manager.find(5).getPosition().y == manager.find(10).getPosition().y, "Symmetry is not respected"); - $assert(manager.find(11).getPosition().y - manager.find(6).getPosition().y == - -(manager.find(12).getPosition().y - manager.find(6).getPosition().y), "Symmetry is not respected"); - $assert(manager.find(8).getPosition().y - manager.find(1).getPosition().y == - -(manager.find(11).getPosition().y - manager.find(1).getPosition().y), "Symmetry is not respected"); - $assert(manager.find(9).getPosition().y - manager.find(1).getPosition().y == - -(manager.find(11).getPosition().y - manager.find(1).getPosition().y), "Symmetry is not respected"); + $assert( + manager.find(14).getPosition().y == manager.find(13).getPosition().y, + 'Symmetry is not respected' + ); + $assert( + manager.find(5).getPosition().y == manager.find(10).getPosition().y, + 'Symmetry is not respected' + ); + $assert( + manager.find(11).getPosition().y - manager.find(6).getPosition().y == + -(manager.find(12).getPosition().y - manager.find(6).getPosition().y), + 'Symmetry is not respected' + ); + $assert( + manager.find(8).getPosition().y - manager.find(1).getPosition().y == + -(manager.find(11).getPosition().y - manager.find(1).getPosition().y), + 'Symmetry is not respected' + ); + $assert( + manager.find(9).getPosition().y - manager.find(1).getPosition().y == + -(manager.find(11).getPosition().y - manager.find(1).getPosition().y), + 'Symmetry is not respected' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testSymmetricPredict: function() { - console.log("testSymmetricPredict:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testSymmetricPredict: function () { + console.log('testSymmetricPredict:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.connectNode(0, 2, 1); @@ -109,158 +126,221 @@ mindplot.layout.SymmetricTestSuite = new Class({ manager.layout(); // Graph - var graph1 = manager.plot("testSymmetricPredict1", {width:1000, height:400}); + var graph1 = manager.plot('testSymmetricPredict1', { width: 1000, height: 400 }); - console.log("\tAdded as child of node 9 and dropped at (-280, 45):"); - var prediction1a = manager.predict(9, null, {x:-280, y:45}); + console.log('\tAdded as child of node 9 and dropped at (-280, 45):'); + var prediction1a = manager.predict(9, null, { x: -280, y: 45 }); this._plotPrediction(graph1, prediction1a); - $assert(prediction1a.position.x < manager.find(9).getPosition().x && - prediction1a.position.y == manager.find(9).getPosition().y, "Prediction incorrectly positioned"); - $assert(prediction1a.order == 0, "Prediction order should be 0"); + $assert( + prediction1a.position.x < manager.find(9).getPosition().x && + prediction1a.position.y == manager.find(9).getPosition().y, + 'Prediction incorrectly positioned' + ); + $assert(prediction1a.order == 0, 'Prediction order should be 0'); - console.log("\tAdded as child of node 1 and dropped at (155, -90):"); - var prediction1b = manager.predict(1, null, {x:-155, y:-90}); + console.log('\tAdded as child of node 1 and dropped at (155, -90):'); + var prediction1b = manager.predict(1, null, { x: -155, y: -90 }); this._plotPrediction(graph1, prediction1b); - $assert(prediction1b.position.x > manager.find(1).getPosition().x && - prediction1b.position.y == manager.find(1).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction1b.order == 0, "Prediction order should be 0"); + $assert( + prediction1b.position.x > manager.find(1).getPosition().x && + prediction1b.position.y == manager.find(1).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1b.order == 0, 'Prediction order should be 0'); // Graph 2 - var graph2 = manager.plot("testSymmetricPredict2", {width:1000, height:400}); + var graph2 = manager.plot('testSymmetricPredict2', { width: 1000, height: 400 }); - console.log("\tAdded as child of node 5 and dropped at (380, -30):"); - var prediction2d = manager.predict(5, null, {x:380, y:-30}); + console.log('\tAdded as child of node 5 and dropped at (380, -30):'); + var prediction2d = manager.predict(5, null, { x: 380, y: -30 }); this._plotPrediction(graph2, prediction2d); - $assert(prediction2d.position.y < manager.find(7).getPosition().y && - prediction2d.position.x == manager.find(7).getPosition().x, "Prediction is incorrectly positioned" ); - $assert(prediction2d.order == 0, "Prediction order should be 0"); + $assert( + prediction2d.position.y < manager.find(7).getPosition().y && + prediction2d.position.x == manager.find(7).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction2d.order == 0, 'Prediction order should be 0'); - console.log("\tAdded as child of node 5 and dropped at (375, 15):"); - var prediction2a = manager.predict(5, null, {x:375, y:15}); + console.log('\tAdded as child of node 5 and dropped at (375, 15):'); + var prediction2a = manager.predict(5, null, { x: 375, y: 15 }); this._plotPrediction(graph2, prediction2a); - $assert(prediction2a.position.y > manager.find(7).getPosition().y && - prediction2a.position.y < manager.find(8).getPosition().y && - prediction2a.position.x == manager.find(7).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction2a.order == 1, "Prediction order should be 1"); + $assert( + prediction2a.position.y > manager.find(7).getPosition().y && + prediction2a.position.y < manager.find(8).getPosition().y && + prediction2a.position.x == manager.find(7).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction2a.order == 1, 'Prediction order should be 1'); - console.log("\tAdded as child of node 5 and dropped at (375, 45):"); - var prediction2b = manager.predict(5, null, {x:375, y:45}); + console.log('\tAdded as child of node 5 and dropped at (375, 45):'); + var prediction2b = manager.predict(5, null, { x: 375, y: 45 }); this._plotPrediction(graph2, prediction2b); - $assert(prediction2b.position.y > manager.find(8).getPosition().y && - prediction2b.position.y < manager.find(11).getPosition().y && - prediction2b.position.x == manager.find(7).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction2b.order == 2, "Prediction order should be 2"); + $assert( + prediction2b.position.y > manager.find(8).getPosition().y && + prediction2b.position.y < manager.find(11).getPosition().y && + prediction2b.position.x == manager.find(7).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction2b.order == 2, 'Prediction order should be 2'); - console.log("\tAdded as child of node 5 and dropped at (375, 45):"); - var prediction2c = manager.predict(5, null, {x:375, y:65}); + console.log('\tAdded as child of node 5 and dropped at (375, 45):'); + var prediction2c = manager.predict(5, null, { x: 375, y: 65 }); this._plotPrediction(graph2, prediction2c); - $assert(prediction2c.position.y > manager.find(11).getPosition().y && - prediction2c.position.x == manager.find(11).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction2c.order == 3, "Prediction order should be 3"); + $assert( + prediction2c.position.y > manager.find(11).getPosition().y && + prediction2c.position.x == manager.find(11).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction2c.order == 3, 'Prediction order should be 3'); // Graph 3 - var graph3 = manager.plot("testSymmetricPredict3", {width:1000, height:400}); + var graph3 = manager.plot('testSymmetricPredict3', { width: 1000, height: 400 }); - console.log("\tAdded as child of node 3 and dropped at (280, 45):"); - var prediction3a = manager.predict(3, null, {x:280, y:45}); + console.log('\tAdded as child of node 3 and dropped at (280, 45):'); + var prediction3a = manager.predict(3, null, { x: 280, y: 45 }); this._plotPrediction(graph3, prediction3a); - $assert(prediction3a.position.y > manager.find(5).getPosition().y && - prediction3a.position.y < manager.find(6).getPosition().y && - prediction3a.position.x == manager.find(5).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction3a.order == 2, "Prediction order should be 2"); + $assert( + prediction3a.position.y > manager.find(5).getPosition().y && + prediction3a.position.y < manager.find(6).getPosition().y && + prediction3a.position.x == manager.find(5).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction3a.order == 2, 'Prediction order should be 2'); - console.log("\tAdded as child of node 3 and dropped at (255, 110):"); - var prediction3b = manager.predict(3, null, {x:255, y:110}); + console.log('\tAdded as child of node 3 and dropped at (255, 110):'); + var prediction3b = manager.predict(3, null, { x: 255, y: 110 }); this._plotPrediction(graph3, prediction3b); - $assert(prediction3b.position.y > manager.find(6).getPosition().y && - prediction3b.position.x == manager.find(6).getPosition().x, "Prediction incorrectly positioned"); - $assert(prediction3b.order == 3, "Prediction order should be 3"); + $assert( + prediction3b.position.y > manager.find(6).getPosition().y && + prediction3b.position.x == manager.find(6).getPosition().x, + 'Prediction incorrectly positioned' + ); + $assert(prediction3b.order == 3, 'Prediction order should be 3'); // Graph 4 - console.log("\tAdded as child of node 2 and dropped at (-260, 0):"); - var graph4 = manager.plot("testSymmetricPredict4", {width:1000, height:400}); - var prediction4 = manager.predict(2, null, {x:-260, y:0}); + console.log('\tAdded as child of node 2 and dropped at (-260, 0):'); + var graph4 = manager.plot('testSymmetricPredict4', { width: 1000, height: 400 }); + var prediction4 = manager.predict(2, null, { x: -260, y: 0 }); this._plotPrediction(graph4, prediction4); - $assert(prediction4.position.y > manager.find(9).getPosition().y && - prediction4.position.y < manager.find(10).getPosition().y && - prediction4.position.x == manager.find(9).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction4.order == 1, "Prediction order should be 1"); + $assert( + prediction4.position.y > manager.find(9).getPosition().y && + prediction4.position.y < manager.find(10).getPosition().y && + prediction4.position.x == manager.find(9).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction4.order == 1, 'Prediction order should be 1'); // Graph 5 - console.log("\tPredict nodes added with no position:"); - var graph5 = manager.plot("testSymmetricPredict5", {width:1000, height:400}); + console.log('\tPredict nodes added with no position:'); + var graph5 = manager.plot('testSymmetricPredict5', { width: 1000, height: 400 }); var prediction5a = manager.predict(1, null, null); this._plotPrediction(graph5, prediction5a); - $assert(prediction5a.position.y == manager.find(1).getPosition().y && - prediction5a.position.x > manager.find(1).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction5a.order == 0, "Prediction order should be 0"); + $assert( + prediction5a.position.y == manager.find(1).getPosition().y && + prediction5a.position.x > manager.find(1).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction5a.order == 0, 'Prediction order should be 0'); var prediction5b = manager.predict(2, null, null); this._plotPrediction(graph5, prediction5b); - $assert(prediction5b.position.y > manager.find(10).getPosition().y && - prediction5b.position.x < manager.find(2).getPosition().x && - prediction5b.position.x == manager.find(10).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction5b.order == 2, "Prediction order should be 2"); + $assert( + prediction5b.position.y > manager.find(10).getPosition().y && + prediction5b.position.x < manager.find(2).getPosition().x && + prediction5b.position.x == manager.find(10).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction5b.order == 2, 'Prediction order should be 2'); var prediction5c = manager.predict(3, null, null); this._plotPrediction(graph5, prediction5c); - $assert(prediction5c.position.y > manager.find(6).getPosition().y && - prediction5c.position.x > manager.find(3).getPosition().x && - prediction5c.position.x == manager.find(6).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction5c.order == 3, "Prediction order should be 3"); - + $assert( + prediction5c.position.y > manager.find(6).getPosition().y && + prediction5c.position.x > manager.find(3).getPosition().x && + prediction5c.position.x == manager.find(6).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction5c.order == 3, 'Prediction order should be 3'); + var prediction5d = manager.predict(10, null, null); this._plotPrediction(graph5, prediction5d); - $assert(prediction5d.position.y == manager.find(10).getPosition().y && - prediction5d.position.x < manager.find(10).getPosition().x, "Prediction is incorrectly positioned"); - $assert(prediction5d.order == 0, "Prediction order should be 0"); + $assert( + prediction5d.position.y == manager.find(10).getPosition().y && + prediction5d.position.x < manager.find(10).getPosition().x, + 'Prediction is incorrectly positioned' + ); + $assert(prediction5d.order == 0, 'Prediction order should be 0'); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testSymmetricDragPredict: function() { - console.log("testSymmetricDragPredict:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0, 1, 1); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1, 2, 0); + testSymmetricDragPredict: function () { + console.log('testSymmetricDragPredict:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 1); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(1, 2, 0); manager.layout(); // Graph 1 - var graph1 = manager.plot("testSymmetricDragPredict1", {width:1000, height:400}); + var graph1 = manager.plot('testSymmetricDragPredict1', { width: 1000, height: 400 }); - var prediction1a = manager.predict(1, 2, {x:-250, y:-20}); + var prediction1a = manager.predict(1, 2, { x: -250, y: -20 }); this._plotPrediction(graph1, prediction1a); - $assert(prediction1a.position.x == manager.find(2).getPosition().x && - prediction1a.position.y == manager.find(2).getPosition().y, "Prediction position should be the same as node 2"); - $assert(prediction1a.order == manager.find(2).getOrder(), "Predicition order should be the same as node 2"); + $assert( + prediction1a.position.x == manager.find(2).getPosition().x && + prediction1a.position.y == manager.find(2).getPosition().y, + 'Prediction position should be the same as node 2' + ); + $assert( + prediction1a.order == manager.find(2).getOrder(), + 'Predicition order should be the same as node 2' + ); - var prediction1b = manager.predict(1, 2, {x:-250, y:20}); + var prediction1b = manager.predict(1, 2, { x: -250, y: 20 }); this._plotPrediction(graph1, prediction1b); - $assert(prediction1b.position.x == manager.find(2).getPosition().x && - prediction1b.position.y == manager.find(2).getPosition().y, "Prediction position should be the same as node 2"); - $assert(prediction1b.order == manager.find(2).getOrder(), "Predicition order should be the same as node 2"); + $assert( + prediction1b.position.x == manager.find(2).getPosition().x && + prediction1b.position.y == manager.find(2).getPosition().y, + 'Prediction position should be the same as node 2' + ); + $assert( + prediction1b.order == manager.find(2).getOrder(), + 'Predicition order should be the same as node 2' + ); - var prediction1c = manager.predict(0, 2, {x:-100, y:-20}); + var prediction1c = manager.predict(0, 2, { x: -100, y: -20 }); this._plotPrediction(graph1, prediction1c); - $assert(prediction1c.position.x == manager.find(1).getPosition().x && - prediction1c.position.y < manager.find(1).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction1c.order == 1, "Prediction order should be 1"); + $assert( + prediction1c.position.x == manager.find(1).getPosition().x && + prediction1c.position.y < manager.find(1).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1c.order == 1, 'Prediction order should be 1'); - var prediction1d = manager.predict(0, 2, {x:-100, y:20}); + var prediction1d = manager.predict(0, 2, { x: -100, y: 20 }); this._plotPrediction(graph1, prediction1d); - $assert(prediction1d.position.x == manager.find(1).getPosition().x && - prediction1d.position.y > manager.find(1).getPosition().y, "Prediction is incorrectly positioned"); - $assert(prediction1d.order == 3, "Prediction order should be 3"); + $assert( + prediction1d.position.x == manager.find(1).getPosition().x && + prediction1d.position.y > manager.find(1).getPosition().y, + 'Prediction is incorrectly positioned' + ); + $assert(prediction1d.order == 3, 'Prediction order should be 3'); - var prediction1e = manager.predict(1, 2, {x:-250, y:0}); + var prediction1e = manager.predict(1, 2, { x: -250, y: 0 }); this._plotPrediction(graph1, prediction1e); - $assert(prediction1e.position.x == manager.find(2).getPosition().x && - prediction1e.position.y == manager.find(2).getPosition().y, "Prediction position should be the same as node 2"); - $assert(prediction1e.order == manager.find(2).getOrder(), "Predicition order should be the same as node 2"); + $assert( + prediction1e.position.x == manager.find(2).getPosition().x && + prediction1e.position.y == manager.find(2).getPosition().y, + 'Prediction position should be the same as node 2' + ); + $assert( + prediction1e.order == manager.find(2).getOrder(), + 'Predicition order should be the same as node 2' + ); - console.log("OK!\n\n"); - } + console.log('OK!\n\n'); + }, +}); - -}); \ No newline at end of file +export default SymmetricTestSuite; diff --git a/packages/mindplot/test/javascript/static/test/TestSuite.js b/packages/mindplot/test/javascript/static/test/TestSuite.js index 092f59c1..3bb44962 100644 --- a/packages/mindplot/test/javascript/static/test/TestSuite.js +++ b/packages/mindplot/test/javascript/static/test/TestSuite.js @@ -15,13 +15,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.layout.TestSuite = new Class({ +const TestSuite = new Class({ Extends: mindplot.layout.ChildrenSorterStrategy, - initialize:function() { - $('#basicTest').setStyle("display","block"); + initialize: function () { + $('#basicTest').css('display', 'block'); -// this.testAligned(); + // this.testAligned(); this.testBaselineAligned1(); this.testBaselineAligned2(); this.testEvents(); @@ -33,143 +33,170 @@ mindplot.layout.TestSuite = new Class({ this.testReconnectSingleNode(); }, - testAligned: function() { - console.log("testAligned:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testAligned: function () { + console.log('testAligned:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1, 2, 0); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2, 3, 0); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3, 4, 0); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,5,2); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,6,4); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,7,6); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(1, 2, 0); + manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(2, 3, 0); + manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(3, 4, 0); + manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(0, 5, 2); + manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(0, 6, 4); + manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(0, 7, 6); manager.layout(); - manager.plot("testAligned", {width:1200,height:200}); + manager.plot('testAligned', { width: 1200, height: 200 }); // Child nodes should be vertically aligned - $assert(manager.find(1).getPosition().y == manager.find(2).getPosition().y, "Child nodes are not vertically aligned"); - $assert(manager.find(1).getPosition().y == manager.find(3).getPosition().y, "Child nodes are not vertically aligned"); - $assert(manager.find(1).getPosition().y == manager.find(4).getPosition().y, "Child nodes are not vertically aligned"); + $assert( + manager.find(1).getPosition().y == manager.find(2).getPosition().y, + 'Child nodes are not vertically aligned' + ); + $assert( + manager.find(1).getPosition().y == manager.find(3).getPosition().y, + 'Child nodes are not vertically aligned' + ); + $assert( + manager.find(1).getPosition().y == manager.find(4).getPosition().y, + 'Child nodes are not vertically aligned' + ); // Siblings should be horizontally aligned - $assert(manager.find(1).getPosition().x == manager.find(5).getPosition().x, "Sibling nodes are not horizontally aligned"); - $assert(manager.find(1).getPosition().x == manager.find(6).getPosition().x, "Sibling nodes are not horizontally aligned"); - $assert(manager.find(1).getPosition().x == manager.find(7).getPosition().x, "Sibling nodes are not horizontally aligned"); + $assert( + manager.find(1).getPosition().x == manager.find(5).getPosition().x, + 'Sibling nodes are not horizontally aligned' + ); + $assert( + manager.find(1).getPosition().x == manager.find(6).getPosition().x, + 'Sibling nodes are not horizontally aligned' + ); + $assert( + manager.find(1).getPosition().x == manager.find(7).getPosition().x, + 'Sibling nodes are not horizontally aligned' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testBaselineAligned1: function() { - console.log("testBaselineAligned1:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testBaselineAligned1: function () { + console.log('testBaselineAligned1:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1, 3, 0); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3, 5, 0); - manager.addNode(6, {width:140, height:130}, position).connectNode(3, 6, 1); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(6, 7, 0); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 8, 0); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 9, 1); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 10, 2); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 11, 3); - manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 12, 4); - manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 13, 5); - manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 14, 6); - manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 15, 7); - manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 16, 8); - manager.addNode(17, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(7, 17, 9); - manager.addNode(29, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(6, 29, 1); - manager.addNode(30, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(6, 30, 2); - manager.addNode(31, {width:100, height:50}, position).connectNode(6, 31, 3); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); + manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(1, 3, 0); + manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(3, 5, 0); + manager.addNode(6, { width: 140, height: 130 }, position).connectNode(3, 6, 1); + manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(6, 7, 0); + manager.addNode(8, TestSuite.NODE_SIZE, position).connectNode(7, 8, 0); + manager.addNode(9, TestSuite.NODE_SIZE, position).connectNode(7, 9, 1); + manager.addNode(10, TestSuite.NODE_SIZE, position).connectNode(7, 10, 2); + manager.addNode(11, TestSuite.NODE_SIZE, position).connectNode(7, 11, 3); + manager.addNode(12, TestSuite.NODE_SIZE, position).connectNode(7, 12, 4); + manager.addNode(13, TestSuite.NODE_SIZE, position).connectNode(7, 13, 5); + manager.addNode(14, TestSuite.NODE_SIZE, position).connectNode(7, 14, 6); + manager.addNode(15, TestSuite.NODE_SIZE, position).connectNode(7, 15, 7); + manager.addNode(16, TestSuite.NODE_SIZE, position).connectNode(7, 16, 8); + manager.addNode(17, TestSuite.NODE_SIZE, position).connectNode(7, 17, 9); + manager.addNode(29, TestSuite.NODE_SIZE, position).connectNode(6, 29, 1); + manager.addNode(30, TestSuite.NODE_SIZE, position).connectNode(6, 30, 2); + manager.addNode(31, { width: 100, height: 50 }, position).connectNode(6, 31, 3); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1, 4, 1); - manager.addNode(18, {width:80, height:70}, position).connectNode(4, 18, 0); - manager.addNode(19, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(18, 19, 0); - manager.addNode(20, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(19, 20, 0); - manager.addNode(21, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(20, 21, 0); + manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(1, 4, 1); + manager.addNode(18, { width: 80, height: 70 }, position).connectNode(4, 18, 0); + manager.addNode(19, TestSuite.NODE_SIZE, position).connectNode(18, 19, 0); + manager.addNode(20, TestSuite.NODE_SIZE, position).connectNode(19, 20, 0); + manager.addNode(21, TestSuite.NODE_SIZE, position).connectNode(20, 21, 0); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0, 2, 1); - manager.addNode(22, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2, 22, 0); - manager.addNode(24, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(22, 24, 0); + manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 1); + manager.addNode(22, TestSuite.NODE_SIZE, position).connectNode(2, 22, 0); + manager.addNode(24, TestSuite.NODE_SIZE, position).connectNode(22, 24, 0); - manager.addNode(23, {width:80, height:50}, position).connectNode(2, 23, 1); - manager.addNode(25, {width:80, height:40}, position).connectNode(23, 25, 0); - manager.addNode(26, {width:80, height:80}, position).connectNode(25, 26, 0); - manager.addNode(27, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(26, 27, 0); - manager.addNode(28, {width:80, height:80}, position).connectNode(27, 28, 0); + manager.addNode(23, { width: 80, height: 50 }, position).connectNode(2, 23, 1); + manager.addNode(25, { width: 80, height: 40 }, position).connectNode(23, 25, 0); + manager.addNode(26, { width: 80, height: 80 }, position).connectNode(25, 26, 0); + manager.addNode(27, TestSuite.NODE_SIZE, position).connectNode(26, 27, 0); + manager.addNode(28, { width: 80, height: 80 }, position).connectNode(27, 28, 0); -// manager.layout(); -// manager.plot("testBaselineAligned1", {width:1600,height:800}); + // manager.layout(); + // manager.plot("testBaselineAligned1", {width:1600,height:800}); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testBaselineAligned2: function() { - console.log("testBaselineAligned2:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); - - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.addNode(2, {width: 130, height:200}, position).connectNode(1, 2, 0); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2, 3, 0); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2, 4, 1); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2, 5, 2); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2, 6, 3); + testBaselineAligned2: function () { + console.log('testBaselineAligned2:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); + manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); + manager.addNode(2, { width: 130, height: 200 }, position).connectNode(1, 2, 0); + manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(2, 3, 0); + manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(2, 4, 1); + manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(2, 5, 2); + manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(2, 6, 3); manager.layout(); - manager.plot("testBaselineAligned2", {width:1600,height:800}); + manager.plot('testBaselineAligned2', { width: 1600, height: 800 }); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testEvents: function() { - console.log("testEvents:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testEvents: function () { + console.log('testEvents:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, {x:0, y: 60}); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, { x: 0, y: 60 }); manager.connectNode(0, 1, 0); manager.connectNode(0, 2, 1); manager.connectNode(1, 3, 0); var events = []; - manager.addEvent('change', function(event) { - console.log("\tUpdated nodes: {id:" + event.getId() + ", order: " + event.getOrder() + ",position: {" + event.getPosition().x + "," + event.getPosition().y + "}"); + manager.addEvent('change', function (event) { + console.log( + '\tUpdated nodes: {id:' + + event.getId() + + ', order: ' + + event.getOrder() + + ',position: {' + + event.getPosition().x + + ',' + + event.getPosition().y + + '}' + ); events.push(event); }); manager.layout(true); - manager.plot("testEvents1", {width:800, height:200}); + manager.plot('testEvents1', { width: 800, height: 200 }); - console.log("\t--- Layout without changes should not affect the tree ---"); + console.log('\t--- Layout without changes should not affect the tree ---'); events.empty(); manager.layout(true); - manager.plot("testEvents2", {width:800, height:200}); + manager.plot('testEvents2', { width: 800, height: 200 }); // Check no events where fired - $assert(events.length == 0, "Unnecessary tree updated."); + $assert(events.length == 0, 'Unnecessary tree updated.'); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testEventsComplex: function() { - console.log("testEventsComplex:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testEventsComplex: function () { + console.log('testEventsComplex:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, {x:0, y:60}); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, { x: 0, y: 60 }); manager.connectNode(0, 1, 0); manager.connectNode(0, 2, 1); manager.connectNode(0, 3, 2); @@ -177,39 +204,49 @@ mindplot.layout.TestSuite = new Class({ manager.connectNode(3, 5, 1); var events = []; - manager.addEvent('change', function(event) { - console.log("\tUpdated nodes: {id:" + event.getId() + ", order: " + event.getOrder() + ",position: {" + event.getPosition().x + "," + event.getPosition().y + "}"); + manager.addEvent('change', function (event) { + console.log( + '\tUpdated nodes: {id:' + + event.getId() + + ', order: ' + + event.getOrder() + + ',position: {' + + event.getPosition().x + + ',' + + event.getPosition().y + + '}' + ); events.push(event); }); manager.layout(true); - manager.plot("testEventsComplex1", {width:800, height:200}); + manager.plot('testEventsComplex1', { width: 800, height: 200 }); - console.log("\t--- Connect a new node ---"); + console.log('\t--- Connect a new node ---'); events.empty(); manager.connectNode(3, 6, 2); manager.layout(true); - manager.plot("testEventsComplex2", {width:800, height:200}); + manager.plot('testEventsComplex2', { width: 800, height: 200 }); // Check only 4 nodes were repositioned - $assert(events.length == 4, "Only 4 nodes should be repositioned."); + $assert(events.length == 4, 'Only 4 nodes should be repositioned.'); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testDisconnect: function() { - console.log("testDisconnect:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testDisconnect: function () { + console.log('testDisconnect:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.connectNode(1, 2, 0); manager.connectNode(1, 3, 1); @@ -219,55 +256,65 @@ mindplot.layout.TestSuite = new Class({ manager.connectNode(5, 7, 1); var events = []; - manager.addEvent('change', function(event) { + manager.addEvent('change', function (event) { var pos = event.getPosition(); - var posStr = pos ? ",position: {" + pos.x + "," + pos.y : ""; + var posStr = pos ? ',position: {' + pos.x + ',' + pos.y : ''; var node = manager.find(event.getId()); - console.log("\tUpdated nodes: {id:" + event.getId() + ", order: " + event.getOrder() + posStr + "}"); + console.log( + '\tUpdated nodes: {id:' + + event.getId() + + ', order: ' + + event.getOrder() + + posStr + + '}' + ); events.push(event); }); manager.layout(true); - manager.plot("testDisconnect1", {width:1200, height:400}); + manager.plot('testDisconnect1', { width: 1200, height: 400 }); - console.log("--- Disconnect node 2 ---"); + console.log('--- Disconnect node 2 ---'); events.empty(); manager.disconnectNode(2); manager.layout(true); - manager.plot("testDisconnect2", {width:1200, height:400}); + manager.plot('testDisconnect2', { width: 1200, height: 400 }); // Check that orders have been shifted accordingly - $assert(manager.find(2).getOrder() == 0, "Node 2 should have order 0"); - $assert(manager.find(3).getOrder() == 0, "Node 3 should now have order 0"); - $assert(manager.find(4).getOrder() == 1, "Node 4 should have order 1"); + $assert(manager.find(2).getOrder() == 0, 'Node 2 should have order 0'); + $assert(manager.find(3).getOrder() == 0, 'Node 3 should now have order 0'); + $assert(manager.find(4).getOrder() == 1, 'Node 4 should have order 1'); - console.log("--- Disconnect node 4 ---"); + console.log('--- Disconnect node 4 ---'); manager.disconnectNode(4); manager.layout(true); - manager.plot("testDisconnect3", {width:1200, height:400}); + manager.plot('testDisconnect3', { width: 1200, height: 400 }); // Check that nodes 1 and 3 are now vertically aligned - $assert(manager.find(1).getPosition().y == manager.find(3).getPosition().y, "Nodes 1 and 3 should now be vertically aligned"); + $assert( + manager.find(1).getPosition().y == manager.find(3).getPosition().y, + 'Nodes 1 and 3 should now be vertically aligned' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testReconnect: function() { - console.log("testReconnect:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testReconnect: function () { + console.log('testReconnect:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); + manager.addNode(12, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.connectNode(0, 2, 1); manager.connectNode(0, 3, 2); @@ -282,39 +329,52 @@ mindplot.layout.TestSuite = new Class({ manager.connectNode(6, 12, 1); manager.layout(); - manager.plot("testReconnect1",{width:1200, height:400}); + manager.plot('testReconnect1', { width: 1200, height: 400 }); // Reconnect node 6 to node 4 - console.log("\tReconnect node 6 to node 4"); + console.log('\tReconnect node 6 to node 4'); manager.disconnectNode(6); - manager.connectNode(4,6,0); + manager.connectNode(4, 6, 0); manager.layout(); - manager.plot("testReconnect2",{width:1200, height:400}); + manager.plot('testReconnect2', { width: 1200, height: 400 }); // Check nodes are left aligned correctly - $assert(manager.find(1).getPosition().y == manager.find(7).getPosition().y, "Nodes 1 and 7 should be vertically aligned"); - $assert(manager.find(4).getPosition().y == manager.find(6).getPosition().y, "Nodes 4 and 6 should be vertically aligned"); - $assert(manager.find(4).getPosition().x > manager.find(6).getPosition().x, "Node 6 and their children should be to the left of node 4"); - $assert(manager.find(6).getPosition().x > manager.find(11).getPosition().x && manager.find(11).getPosition().x == manager.find(12).getPosition().x, "Nodes 11 and 12 should be to the left of node 6 and horizontally aligned"); + $assert( + manager.find(1).getPosition().y == manager.find(7).getPosition().y, + 'Nodes 1 and 7 should be vertically aligned' + ); + $assert( + manager.find(4).getPosition().y == manager.find(6).getPosition().y, + 'Nodes 4 and 6 should be vertically aligned' + ); + $assert( + manager.find(4).getPosition().x > manager.find(6).getPosition().x, + 'Node 6 and their children should be to the left of node 4' + ); + $assert( + manager.find(6).getPosition().x > manager.find(11).getPosition().x && + manager.find(11).getPosition().x == manager.find(12).getPosition().x, + 'Nodes 11 and 12 should be to the left of node 6 and horizontally aligned' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testRemoveNode: function() { - console.log("testRemoveNode:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testRemoveNode: function () { + console.log('testRemoveNode:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, TestSuite.NODE_SIZE, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(6, TestSuite.NODE_SIZE, position); + manager.addNode(7, TestSuite.NODE_SIZE, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.connectNode(0, 5, 1); @@ -327,107 +387,126 @@ mindplot.layout.TestSuite = new Class({ manager.connectNode(3, 4, 0); var events = []; - manager.addEvent('change', function(event) { + manager.addEvent('change', function (event) { var pos = event.getPosition(); - var posStr = pos ? ",position: {" + pos.x + "," + event.getPosition().y : ""; + var posStr = pos ? ',position: {' + pos.x + ',' + event.getPosition().y : ''; events.push(event); }); manager.layout(true); - manager.plot("testRemoveNode1", {width:1000, height:200}); + manager.plot('testRemoveNode1', { width: 1000, height: 200 }); - console.log("\t--- Remove node 3 ---"); + console.log('\t--- Remove node 3 ---'); manager.removeNode(3); manager.layout(true); - manager.plot("testRemoveNode2", {width:1000, height:200}); + manager.plot('testRemoveNode2', { width: 1000, height: 200 }); // Check nodes are correctly aligned and node 6 is aligned with the root node - $assert(manager.find(1).getPosition().y == manager.find(2).getPosition().y, "Nodes 1 and 2 should be vertically algined"); - $assert(manager.find(6).getPosition().y == manager.find(0).getPosition().y, "Node 6 should be aligned to the root node"); + $assert( + manager.find(1).getPosition().y == manager.find(2).getPosition().y, + 'Nodes 1 and 2 should be vertically algined' + ); + $assert( + manager.find(6).getPosition().y == manager.find(0).getPosition().y, + 'Node 6 should be aligned to the root node' + ); - console.log("\t--- Remove node 6 ---"); + console.log('\t--- Remove node 6 ---'); manager.removeNode(6); manager.layout(true); - manager.plot("testRemoveNode3", {width:1000, height:200}); + manager.plot('testRemoveNode3', { width: 1000, height: 200 }); // Check orders were shifted accordingly - $assert(manager.find(8).getOrder() == 2, "Node 8 should have order 2"); + $assert(manager.find(8).getOrder() == 2, 'Node 8 should have order 2'); - console.log("\t--- Remove node 5 ---"); + console.log('\t--- Remove node 5 ---'); manager.removeNode(5); manager.layout(true); - manager.plot("testRemoveNode4", {width:1000, height:200}); + manager.plot('testRemoveNode4', { width: 1000, height: 200 }); // Check orders were shifted accordingly - $assert(manager.find(7).getOrder() == 1, "Node 7 should have order 1"); - $assert(manager.find(9).getOrder() == 3, "Node 9 should have order 3"); + $assert(manager.find(7).getOrder() == 1, 'Node 7 should have order 1'); + $assert(manager.find(9).getOrder() == 3, 'Node 9 should have order 3'); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testSize: function() { - console.log("testSize:"); - var position = {x:0, y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testSize: function () { + console.log('testSize:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - manager.addNode(1, {width: 60, height: 60}, position); - manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(3, {width: 260, height: 30}, position); - manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(7, {width: 80, height: 80}, position); - manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(9, {width: 30, height: 30}, position); - manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(12, {width: 100, height: 70}, position); - manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position); - manager.addNode(17, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, { width: 60, height: 60 }, position); + manager.addNode(2, TestSuite.NODE_SIZE, position); + manager.addNode(3, { width: 260, height: 30 }, position); + manager.addNode(4, TestSuite.NODE_SIZE, position); + manager.addNode(5, TestSuite.NODE_SIZE, position); + manager.addNode(7, { width: 80, height: 80 }, position); + manager.addNode(8, TestSuite.NODE_SIZE, position); + manager.addNode(9, { width: 30, height: 30 }, position); + manager.addNode(10, TestSuite.NODE_SIZE, position); + manager.addNode(11, TestSuite.NODE_SIZE, position); + manager.addNode(12, { width: 100, height: 70 }, position); + manager.addNode(13, TestSuite.NODE_SIZE, position); + manager.addNode(14, TestSuite.NODE_SIZE, position); + manager.addNode(15, TestSuite.NODE_SIZE, position); + manager.addNode(16, TestSuite.NODE_SIZE, position); + manager.addNode(17, TestSuite.NODE_SIZE, position); - manager.connectNode(0,1,0); - manager.connectNode(1,16,0); - manager.connectNode(0,2,1); - manager.connectNode(0,3,2); - manager.connectNode(0,4,3); - manager.connectNode(0,5,4); - manager.connectNode(4,7,0); - manager.connectNode(7,15,0); - manager.connectNode(7,17,1); - manager.connectNode(4,8,1); - manager.connectNode(8,9,0); - manager.connectNode(3,10,0); - manager.connectNode(3,11,1); - manager.connectNode(9,12,0); - manager.connectNode(9,13,1); - manager.connectNode(13,14,0); + manager.connectNode(0, 1, 0); + manager.connectNode(1, 16, 0); + manager.connectNode(0, 2, 1); + manager.connectNode(0, 3, 2); + manager.connectNode(0, 4, 3); + manager.connectNode(0, 5, 4); + manager.connectNode(4, 7, 0); + manager.connectNode(7, 15, 0); + manager.connectNode(7, 17, 1); + manager.connectNode(4, 8, 1); + manager.connectNode(8, 9, 0); + manager.connectNode(3, 10, 0); + manager.connectNode(3, 11, 1); + manager.connectNode(9, 12, 0); + manager.connectNode(9, 13, 1); + manager.connectNode(13, 14, 0); manager.layout(); - manager.plot("testSize1", {width: 1400, height: 400}); + manager.plot('testSize1', { width: 1400, height: 400 }); // Check that all enlarged nodes shift children accordingly - $assert(manager.find(10).getPosition().x > manager.find(3).getPosition().x && manager.find(10).getPosition().x == manager.find(11).getPosition().x, "Nodes 10 and 11 should be horizontally algined and to the right of enlarged node 3"); + $assert( + manager.find(10).getPosition().x > manager.find(3).getPosition().x && + manager.find(10).getPosition().x == manager.find(11).getPosition().x, + 'Nodes 10 and 11 should be horizontally algined and to the right of enlarged node 3' + ); var xPosNode7 = manager.find(7).getPosition().x; var xPosNode8 = manager.find(8).getPosition().x; - manager.updateNodeSize(4, {width:100, height:30}); + manager.updateNodeSize(4, { width: 100, height: 30 }); manager.layout(); - manager.plot("testSize2", {width: 1400, height: 400}); + manager.plot('testSize2', { width: 1400, height: 400 }); // Check that all enlarged nodes shift children accordingly - $assert(manager.find(2).getPosition().x - manager.find(4).getPosition().x == 10, "Node 4 should have been shifted by 10"); - $assert(xPosNode7 - manager.find(7).getPosition().x == 20, "Node 7 should have been shifted by 20"); - $assert(xPosNode8 - manager.find(8).getPosition().x == 20, "Node 8 should have been shifted by 20"); + $assert( + manager.find(2).getPosition().x - manager.find(4).getPosition().x == 10, + 'Node 4 should have been shifted by 10' + ); + $assert( + xPosNode7 - manager.find(7).getPosition().x == 20, + 'Node 7 should have been shifted by 20' + ); + $assert( + xPosNode8 - manager.find(8).getPosition().x == 20, + 'Node 8 should have been shifted by 20' + ); - var graph2 = manager.plot("testSize3", {width: 1400, height: 400}); - this._plotPrediction(graph2, manager.predict(0, null, {x:-145, y:400})); - this._plotPrediction(graph2, manager.predict(9, null, {x:-330, y:70})); - this._plotPrediction(graph2, manager.predict(9, null, {x:-330, y:120})); - this._plotPrediction(graph2, manager.predict(0, null, {x:15, y:20})); + var graph2 = manager.plot('testSize3', { width: 1400, height: 400 }); + this._plotPrediction(graph2, manager.predict(0, null, { x: -145, y: 400 })); + this._plotPrediction(graph2, manager.predict(9, null, { x: -330, y: 70 })); + this._plotPrediction(graph2, manager.predict(9, null, { x: -330, y: 120 })); + this._plotPrediction(graph2, manager.predict(0, null, { x: 15, y: 20 })); //TODO(gb): make asserts - var graph3 = manager.plot("testSize4", {width: 1400, height: 400}); + var graph3 = manager.plot('testSize4', { width: 1400, height: 400 }); this._plotPrediction(graph3, manager.predict(0, null, null)); this._plotPrediction(graph3, manager.predict(9, null, null)); this._plotPrediction(graph3, manager.predict(3, null, null)); @@ -435,52 +514,71 @@ mindplot.layout.TestSuite = new Class({ //TODO(gb): make asserts var yPosNode2 = manager.find(2).getPosition().y; - manager.updateNodeSize(7, {width:80, height:120}); + manager.updateNodeSize(7, { width: 80, height: 120 }); manager.layout(); - manager.plot("testSize5", {width: 1400, height: 400}); + manager.plot('testSize5', { width: 1400, height: 400 }); // Check that all enlarged nodes shift children accordingly - $assert(yPosNode2 - manager.find(2).getPosition().y == 20, "Node 2 should have been shifted by 20"); + $assert( + yPosNode2 - manager.find(2).getPosition().y == 20, + 'Node 2 should have been shifted by 20' + ); - console.log("OK!\n\n"); + console.log('OK!\n\n'); }, - testReconnectSingleNode: function() { - console.log("testReconnectSingleNode:"); - var position = {x:0,y:0}; - var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + testReconnectSingleNode: function () { + console.log('testReconnectSingleNode:'); + var position = { x: 0, y: 0 }; + var manager = new mindplot.layout.LayoutManager(0, TestSuite.ROOT_NODE_SIZE); // Prepare a sample graph ... - manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position); + manager.addNode(1, TestSuite.NODE_SIZE, position); manager.connectNode(0, 1, 0); manager.layout(); - var graph = manager.plot("testReconnectSingleNode1", {width:1000, height:400}); - var prediction = manager.predict(0, null, {x:-50, y:0}); + var graph = manager.plot('testReconnectSingleNode1', { width: 1000, height: 400 }); + var prediction = manager.predict(0, null, { x: -50, y: 0 }); this._plotPrediction(graph, prediction); // Check prediction is to the left of the root node - $assert(prediction.position.x < manager.find(0).getPosition().x, "Prediction should be to the left of the root node"); - $assert(prediction.order == 1, "Prediction should have order 1"); + $assert( + prediction.position.x < manager.find(0).getPosition().x, + 'Prediction should be to the left of the root node' + ); + $assert(prediction.order == 1, 'Prediction should have order 1'); manager.disconnectNode(1); - manager.connectNode(0,1,1); + manager.connectNode(0, 1, 1); manager.layout(); - manager.plot("testReconnectSingleNode2", {width:1000, height:400}); + manager.plot('testReconnectSingleNode2', { width: 1000, height: 400 }); // Check reconnected node is to the left of the root node - $assert(manager.find(1).getPosition().x < manager.find(0).getPosition().x, "Node 1 should now be to the left of the root node"); - $assert(manager.find(1).getOrder() == 1, "Node 1 should now have order 0"); + $assert( + manager.find(1).getPosition().x < manager.find(0).getPosition().x, + 'Node 1 should now be to the left of the root node' + ); + $assert(manager.find(1).getOrder() == 1, 'Node 1 should now have order 0'); }, - _plotPrediction: function(canvas, prediction) { + _plotPrediction: function (canvas, prediction) { var position = prediction.position; var order = prediction.order; - console.log("\t\tprediction {order:" + order + ", position: (" + position.x + "," + position.y + ")}"); - var cx = position.x + canvas.width / 2 - mindplot.layout.TestSuite.NODE_SIZE.width / 2; - var cy = position.y + canvas.height / 2 - mindplot.layout.TestSuite.NODE_SIZE.height / 2; - canvas.rect(cx, cy, mindplot.layout.TestSuite.NODE_SIZE.width, mindplot.layout.TestSuite.NODE_SIZE.height); - } + console.log( + '\t\tprediction {order:' + + order + + ', position: (' + + position.x + + ',' + + position.y + + ')}' + ); + var cx = position.x + canvas.width / 2 - TestSuite.NODE_SIZE.width / 2; + var cy = position.y + canvas.height / 2 - TestSuite.NODE_SIZE.height / 2; + canvas.rect(cx, cy, TestSuite.NODE_SIZE.width, TestSuite.NODE_SIZE.height); + }, }); -mindplot.layout.TestSuite.NODE_SIZE = {width:80, height:30}, -mindplot.layout.TestSuite.ROOT_NODE_SIZE = {width:120, height:40} \ No newline at end of file +(TestSuite.NODE_SIZE = { width: 80, height: 30 }), + (TestSuite.ROOT_NODE_SIZE = { width: 120, height: 40 }); + +export default TestSuite; diff --git a/packages/mindplot/test/javascript/static/test/testLayout.js b/packages/mindplot/test/javascript/static/test/testLayout.js index e69de29b..e30f516f 100644 --- a/packages/mindplot/test/javascript/static/test/testLayout.js +++ b/packages/mindplot/test/javascript/static/test/testLayout.js @@ -0,0 +1,14 @@ +const Mindplot = require('../../../../lib/mindplot'); +global.mindplot = Mindplot(); + +const TestSuite = require('./TestSuite').default; +const BalancedTestSuite = require('./BalancedTestSuite').default; +const SymmetricTestSuite = require('./SymmetricTestSuite').default; +const FreeTestSuite = require('./FreeTestSuite').default; + +window.addEventListener('DOMContentLoaded', function () { + var basicTest = new TestSuite(); + var balancedTest = new BalancedTestSuite(); + var symmetricTest = new SymmetricTestSuite(); + var freeTest = new FreeTestSuite(); +}); diff --git a/packages/mindplot/test/javascript/static/test/testPalette.js b/packages/mindplot/test/javascript/static/test/testPalette.js index c59c4540..67608c8f 100644 --- a/packages/mindplot/test/javascript/static/test/testPalette.js +++ b/packages/mindplot/test/javascript/static/test/testPalette.js @@ -11,6 +11,6 @@ window.addEventListener('load', function (e) { var palette = new mindplot.widget.ColorPalettePanel( 'myButton', model, - '/mindplot/src/main/javascript/widget' + '../../../lib/components/widget' ); }); diff --git a/packages/mindplot/webpack.prod.js b/packages/mindplot/webpack.prod.js index 0462e9b7..129a93b3 100644 --- a/packages/mindplot/webpack.prod.js +++ b/packages/mindplot/webpack.prod.js @@ -8,6 +8,7 @@ const prodConfig = { optimization: { splitChunks: { chunks: 'all', + minSize: 2000000, }, }, }; diff --git a/packages/mindplot/webpack.test.js b/packages/mindplot/webpack.test.js index 90aeed62..0abcd8a8 100644 --- a/packages/mindplot/webpack.test.js +++ b/packages/mindplot/webpack.test.js @@ -3,12 +3,16 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin'); /** @type {import('webpack').Configuration} */ module.exports = { - entry: './lib/mindplot', + entry: { + palette: path.resolve(__dirname, './test/javascript/static/test/testPalette'), + layout: path.resolve(__dirname, './test/javascript/static/test/testLayout'), + }, output: { path: path.resolve(__dirname, 'dist', 'test'), - filename: '[name].js', + filename: '[name].test.js', publicPath: '', }, + mode: 'production', module: { rules: [ { diff --git a/packages/web2d/webpack.test.js b/packages/web2d/webpack.test.js index 7d337713..0841db2d 100644 --- a/packages/web2d/webpack.test.js +++ b/packages/web2d/webpack.test.js @@ -5,7 +5,7 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin'); module.exports = { entry: './test/javascript/render/testing.js', output: { - path: path.resolve(__dirname, 'target', 'tests'), + path: path.resolve(__dirname, 'dist', 'tests'), filename: '[name].js', publicPath: '', }, diff --git a/yarn.lock b/yarn.lock index 8693a574..070e46cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2177,6 +2177,11 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818" integrity sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg== +"@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8": + version "7.0.9" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + "@types/json-stable-stringify@^1.0.32": version "1.0.32" resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e" @@ -2304,6 +2309,19 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/eslint-plugin@^4.31.0": + version "4.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz#9c3fa6f44bad789a962426ad951b54695bd3af6b" + integrity sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw== + dependencies: + "@typescript-eslint/experimental-utils" "4.31.0" + "@typescript-eslint/scope-manager" "4.31.0" + debug "^4.3.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/eslint-plugin@^4.8.1": version "4.15.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.1.tgz#835f64aa0a403e5e9e64c10ceaf8d05c3f015180" @@ -2328,6 +2346,28 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" +"@typescript-eslint/experimental-utils@4.31.0": + version "4.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz#0ef1d5d86c334f983a00f310e43c1ce4c14e054d" + integrity sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.31.0" + "@typescript-eslint/types" "4.31.0" + "@typescript-eslint/typescript-estree" "4.31.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^4.31.0": + version "4.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.0.tgz#87b7cd16b24b9170c77595d8b1363f8047121e05" + integrity sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w== + dependencies: + "@typescript-eslint/scope-manager" "4.31.0" + "@typescript-eslint/types" "4.31.0" + "@typescript-eslint/typescript-estree" "4.31.0" + debug "^4.3.1" + "@typescript-eslint/parser@^4.8.1": version "4.15.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.15.1.tgz#4c91a0602733db63507e1dbf13187d6c71a153c4" @@ -2344,10 +2384,23 @@ "@typescript-eslint/types" "4.15.1" "@typescript-eslint/visitor-keys" "4.15.1" +"@typescript-eslint/scope-manager@4.31.0": + version "4.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz#9be33aed4e9901db753803ba233b70d79a87fc3e" + integrity sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg== + dependencies: + "@typescript-eslint/types" "4.31.0" + "@typescript-eslint/visitor-keys" "4.31.0" + "@typescript-eslint/types@4.15.1": version "4.15.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.15.1.tgz#da702f544ef1afae4bc98da699eaecd49cf31c8c" +"@typescript-eslint/types@4.31.0": + version "4.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.0.tgz#9a7c86fcc1620189567dc4e46cad7efa07ee8dce" + integrity sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ== + "@typescript-eslint/typescript-estree@4.15.1": version "4.15.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.1.tgz#fa9a9ff88b4a04d901ddbe5b248bc0a00cd610be" @@ -2360,6 +2413,19 @@ semver "^7.3.2" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@4.31.0": + version "4.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz#4da4cb6274a7ef3b21d53f9e7147cc76f278a078" + integrity sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg== + dependencies: + "@typescript-eslint/types" "4.31.0" + "@typescript-eslint/visitor-keys" "4.31.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.15.1": version "4.15.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.1.tgz#c76abbf2a3be8a70ed760f0e5756bf62de5865dd" @@ -2367,6 +2433,14 @@ "@typescript-eslint/types" "4.15.1" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.31.0": + version "4.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz#4e87b7761cb4e0e627dc2047021aa693fc76ea2b" + integrity sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w== + dependencies: + "@typescript-eslint/types" "4.31.0" + eslint-visitor-keys "^2.0.0" + "@vue/compiler-core@3.0.5", "@vue/compiler-core@^3.0.0": version "3.0.5" resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.5.tgz#a6e54cabe9536e74c6513acd2649f311af1d43ac" @@ -2674,6 +2748,11 @@ resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.5.1.tgz#b5fde2f0f79c1e120307c415a4c1d5eb15a6f278" integrity sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw== +"@webpack-cli/serve@^1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.5.2.tgz#ea584b637ff63c5a477f6f21604b5a205b72c9ec" + integrity sha512-vgJ5OLWadI8aKjDlOH3rb+dYyPd2GTZuQC/Tihjct6F9GpXGZINo3Y/IVuZVTM1eDQB+/AOsjPUWH/WySDaXvw== + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -2708,6 +2787,11 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +acorn-import-assertions@^1.7.6: + version "1.7.6" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.7.6.tgz#580e3ffcae6770eebeec76c3b9723201e9d01f78" + integrity sha512-FlVvVFA1TX6l3lp8VjDnYYq7R1nyW6x3svAt4nDgrWQ9SBaSh9CnbwgSUTasgfNfOG5HlM1ehugCvM+hjo56LA== + acorn-jsx@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" @@ -2780,6 +2864,11 @@ ajv@^7.0.2: require-from-string "^2.0.2" uri-js "^4.2.2" +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= + ansi-colors@^3.0.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" @@ -2998,6 +3087,11 @@ async@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" +async@~0.2.6: + version "0.2.10" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" + integrity sha1-trvgsGdLnXGXCMo43owjfLUmw9E= + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -3102,6 +3196,16 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" +basic-auth-connect@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz#fdb0b43962ca7b40456a7c2bb48fe173da2d2122" + integrity sha1-/bC0OWLKe0BFanwrtI/hc9otISI= + +batch@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/batch/-/batch-0.5.0.tgz#fd2e05a7a5d696b4db9314013e285d8ff3557ec3" + integrity sha1-/S4Fp6XWlrTbkxQBPihdj/NVfsM= + batch@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" @@ -3245,6 +3349,11 @@ btoa-lite@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" +buffer-crc32@0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.1.tgz#be3e5382fc02b6d6324956ac1af98aa98b08534c" + integrity sha1-vj5TgvwCttYySVasGvmKqYsIU0w= + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -3276,6 +3385,16 @@ byte-size@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-5.0.1.tgz#4b651039a5ecd96767e71a3d7ed380e48bed4191" +bytes@0.2.1, bytes@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-0.2.1.tgz#555b08abcb063f8975905302523e4cd4ffdfdf31" + integrity sha1-VVsIq8sGP4l1kFMCUj5M1P/f3zE= + +bytes@0.3.0, bytes@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-0.3.0.tgz#78e2e0e28c7f9c7b988ea8aee0db4d5fa9941935" + integrity sha1-eOLg4ox/nHuYjqiu4NtNX6mUGTU= + bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -3529,6 +3648,13 @@ clean-webpack-plugin@^3.0.0: "@types/webpack" "^4.4.31" del "^4.1.1" +clean-webpack-plugin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-4.0.0.tgz#72947d4403d452f38ed61a9ff0ada8122aacd729" + integrity sha512-WuWE1nyTNAyW5T7oNyys2EN0cfP2fdRxhxnIQWiAp0bMabPdHhoGxM8A6YL2GhqwgrPnnaemVE7nv5XJ2Fhh2w== + dependencies: + del "^4.1.1" + clean-webpack-plugin@^4.0.0-alpha.0: version "4.0.0-alpha.0" resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-4.0.0-alpha.0.tgz#2aef48dfe7565360d128f5caa0904097d969d053" @@ -3536,6 +3662,14 @@ clean-webpack-plugin@^4.0.0-alpha.0: dependencies: del "^4.1.1" +cli-color@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-0.2.3.tgz#0a25ceae5a6a1602be7f77d28563c36700274e88" + integrity sha1-CiXOrlpqFgK+f3fShWPDZwAnTog= + dependencies: + es5-ext "~0.9.2" + memoizee "~0.2.5" + cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -3662,6 +3796,13 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-1.3.2.tgz#8a8f30ec670a6fdd64af52f1914b907d79ead5b5" + integrity sha1-io8w7GcKb91kr1LxkUuQfXnq1bU= + dependencies: + keypress "0.1.x" + commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -3706,6 +3847,11 @@ component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" +compressible@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-1.0.0.tgz#f83e49c1cb61421753545125a8011d68b492427d" + integrity sha1-+D5JwcthQhdTVFElqAEdaLSSQn0= + compressible@~2.0.16: version "2.0.18" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" @@ -3719,6 +3865,15 @@ compression-webpack-plugin@^7.1.2: schema-utils "^3.0.0" serialize-javascript "^5.0.1" +compression@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.0.0.tgz#8aeb85d48db5145d38bc8b181b6352d8eab26020" + integrity sha1-iuuF1I21FF04vIsYG2NS2OqyYCA= + dependencies: + bytes "0.2.1" + compressible "1.0.0" + negotiator "0.3.0" + compression@^1.7.4: version "1.7.4" resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" @@ -3764,6 +3919,42 @@ connect-history-api-fallback@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" +connect-timeout@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/connect-timeout/-/connect-timeout-1.0.0.tgz#12054799f90bb9566f8b274efe7842d6465d10bb" + integrity sha1-EgVHmfkLuVZviydO/nhC1kZdELs= + dependencies: + debug "*" + +connect@2.14.5: + version "2.14.5" + resolved "https://registry.yarnpkg.com/connect/-/connect-2.14.5.tgz#73217513152c152ebe049c499fa09211b8c476f4" + integrity sha1-cyF1ExUsFS6+BJxJn6CSEbjEdvQ= + dependencies: + basic-auth-connect "1.0.0" + bytes "0.3.0" + compression "1.0.0" + connect-timeout "1.0.0" + cookie-parser "1.0.1" + cookie-signature "1.0.3" + csurf "1.1.0" + debug ">= 0.7.3 < 1" + errorhandler "1.0.0" + express-session "1.0.2" + fresh "0.2.2" + method-override "1.0.0" + morgan "1.0.0" + multiparty "2.2.0" + pause "0.0.1" + qs "0.6.6" + raw-body "1.1.4" + response-time "1.0.0" + serve-index "1.0.1" + serve-static "1.1.0" + setimmediate "1.0.1" + static-favicon "1.0.2" + vhost "1.0.0" + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -3867,10 +4058,33 @@ convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" +cookie-parser@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.0.1.tgz#17bd622c9717cd0858a912a9fef4c0362360a7b0" + integrity sha1-F71iLJcXzQhYqRKp/vTANiNgp7A= + dependencies: + cookie "0.1.0" + cookie-signature "1.0.3" + +cookie-signature@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.3.tgz#91cd997cc51fb641595738c69cda020328f50ff9" + integrity sha1-kc2ZfMUftkFZVzjGnNoCAyj1D/k= + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" +cookie@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.1.0.tgz#90eb469ddce905c866de687efc43131d8801f9d0" + integrity sha1-kOtGndzpBchm3mh+/EMTHYgB+dA= + +cookie@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.1.2.tgz#72fec3d24e48a3432073d90c12642005061004b1" + integrity sha1-cv7D0k5Io0Mgc9kMEmQgBQYQBLE= + cookie@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" @@ -4056,6 +4270,14 @@ csstype@^3.0.2: version "3.0.6" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.6.tgz#865d0b5833d7d8d40f4e5b8a6d76aea3de4725ef" +csurf@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/csurf/-/csurf-1.1.0.tgz#5dd459df40df43b9eb828284d6d03132f42cb8b2" + integrity sha1-XdRZ30DfQ7nrgoKE1tAxMvQsuLI= + dependencies: + scmp "~0.0.3" + uid2 "~0.0.2" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -4135,6 +4357,22 @@ dayjs@^1.10.4, dayjs@^1.9.3: version "1.10.4" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2" +debug@*, debug@4.3.2, debug@^4.3.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + dependencies: + ms "2.1.2" + +debug@0.7.4: + version "0.7.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39" + integrity sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk= + +debug@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-0.8.0.tgz#0541ea91f0e503fdf0c5eed418a32550234967f0" + integrity sha1-BUHqkfDlA/3wxe7UGKMlUCNJZ/A= + debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -4153,11 +4391,10 @@ debug@4.3.1, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0: dependencies: ms "2.1.2" -debug@4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - dependencies: - ms "2.1.2" +"debug@>= 0.7.3 < 1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-0.8.1.tgz#20ff4d26f5e422cb68a1bacbbb61039ad8c1c130" + integrity sha1-IP9NJvXkIstoobrLu2EDmtjBwTA= debug@^3.1.0, debug@^3.1.1, debug@^3.2.6: version "3.2.7" @@ -4527,17 +4764,17 @@ enhanced-resolve@^4.0.0: memory-fs "^0.5.0" tapable "^1.0.0" -enhanced-resolve@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz#525c5d856680fbd5052de453ac83e32049958b5c" +enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.0: + version "5.8.2" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b" + integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" -enhanced-resolve@^5.8.0: - version "5.8.2" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b" - integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA== +enhanced-resolve@^5.7.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz#525c5d856680fbd5052de453ac83e32049958b5c" dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -4584,6 +4821,11 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +errorhandler@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/errorhandler/-/errorhandler-1.0.0.tgz#d74b37e8dc38c99afb3f5a79edcebaea022d042a" + integrity sha1-10s36Nw4yZr7P1p57c666gItBCo= + es-abstract@^1.18.0-next.1: version "1.18.0-next.2" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.2.tgz#088101a55f0541f595e7e057199e27ddc8f3a5c2" @@ -4620,6 +4862,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es5-ext@~0.9.2: + version "0.9.2" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.9.2.tgz#d2e309d1f223b0718648835acf5b8823a8061f8a" + integrity sha1-0uMJ0fIjsHGGSINaz1uII6gGH4o= + es6-promise@^4.0.3: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" @@ -4679,6 +4926,13 @@ eslint-utils@^2.0.0, eslint-utils@^2.1.0: dependencies: eslint-visitor-keys "^1.1.0" +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" @@ -4773,6 +5027,13 @@ etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" +event-emitter@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.2.2.tgz#c81e3724eb55407c5a0d5ee3299411f700f54291" + integrity sha1-yB43JOtVQHxaDV7jKZQR9wD1QpE= + dependencies: + es5-ext "~0.9.2" + event-stream@=3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" @@ -4888,6 +5149,18 @@ expand-template@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" +express-session@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.0.2.tgz#004478c742561774411ceb79733155a56b6d49eb" + integrity sha1-AER4x0JWF3RBHOt5czFVpWttSes= + dependencies: + buffer-crc32 "0.2.1" + cookie "0.1.0" + cookie-signature "1.0.3" + debug "0.7.4" + uid2 "0.0.3" + utils-merge "1.0.0" + express@^4.17.1: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" @@ -4923,6 +5196,24 @@ express@^4.17.1: utils-merge "1.0.1" vary "~1.1.2" +express@~3.5.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/express/-/express-3.5.3.tgz#af440e1ddad078934ec78241420b40bbc56dc2ad" + integrity sha1-r0QOHdrQeJNOx4JBQgtAu8Vtwq0= + dependencies: + buffer-crc32 "0.2.1" + commander "1.3.2" + connect "2.14.5" + cookie "0.1.2" + cookie-signature "1.0.3" + debug ">= 0.7.3 < 1" + fresh "0.2.2" + merge-descriptors "0.0.2" + methods "0.1.0" + mkdirp "0.4.0" + range-parser "1.0.0" + send "0.3.0" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -5201,10 +5492,20 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" +fresh@0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.2.2.tgz#9731dcf5678c7faeb44fb903c4f72df55187fa77" + integrity sha1-lzHc9WeMf660T7kDxPct9VGH+nc= + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" +fresh@~0.2.1: + version "0.2.4" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.2.4.tgz#3582499206c9723714190edd74b4604feb4a614c" + integrity sha1-NYJJkgbJcjcUGQ7ddLRgT+tKYUw= + from2@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" @@ -5471,6 +5772,18 @@ globby@^11.0.1: merge2 "^1.3.0" slash "^3.0.0" +globby@^11.0.3: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -5519,6 +5832,15 @@ handlebars@^4.7.6: optionalDependencies: uglify-js "^3.1.4" +handlebars@~2.0.0-alpha.2: + version "2.0.0" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-2.0.0.tgz#6e9d7f8514a3467fa5e9f82cc158ecfc1d5ac76f" + integrity sha1-bp1/hRSjRn+l6fgswVjs/B1ax28= + dependencies: + optimist "~0.3" + optionalDependencies: + uglify-js "~2.3" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -5950,7 +6272,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" @@ -6546,6 +6868,11 @@ jss@10.5.1, jss@^10.5.1: array-includes "^3.1.2" object.assign "^4.1.2" +keypress@0.1.x: + version "0.1.0" + resolved "https://registry.yarnpkg.com/keypress/-/keypress-0.1.0.tgz#4a3188d4291b66b4f65edb99f806aa9ae293592a" + integrity sha1-SjGI1CkbZrT2XtuZ+AaqmuKTWSo= + killable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -6824,6 +7151,11 @@ lodash@^4.17.21: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +lodash@~2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e" + integrity sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4= + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" @@ -6986,6 +7318,15 @@ media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" +memoizee@~0.2.5: + version "0.2.6" + resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.2.6.tgz#bb45a7ad02530082f1612671dab35219cd2e0741" + integrity sha1-u0WnrQJTAILxYSZx2rNSGc0uB0E= + dependencies: + es5-ext "~0.9.2" + event-emitter "~0.2.2" + next-tick "0.1.x" + memory-fs@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -7045,6 +7386,11 @@ meow@^8.0.0: type-fest "^0.18.0" yargs-parser "^20.2.3" +merge-descriptors@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-0.0.2.tgz#c36a52a781437513c57275f39dd9d317514ac8c7" + integrity sha1-w2pSp4FDdRPFcnXzndnTF1FKyMc= + merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" @@ -7063,10 +7409,22 @@ merge2@^1.2.3, merge2@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" -methods@~1.1.2: +method-override@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/method-override/-/method-override-1.0.0.tgz#9e5bfbd80f3b9e043801dd3fe60bbab0f15b5f61" + integrity sha1-nlv72A87ngQ4Ad0/5gu6sPFbX2E= + dependencies: + methods "*" + +methods@*, methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" +methods@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/methods/-/methods-0.1.0.tgz#335d429eefd21b7bacf2e9c922a8d2bd14a30e4f" + integrity sha1-M11Cnu/SG3us8unJIqjSvRSjDk8= + micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -7106,6 +7464,11 @@ mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.19, dependencies: mime-db "1.45.0" +mime@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.2.11.tgz#58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10" + integrity sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA= + mime@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" @@ -7215,6 +7578,11 @@ mkdirp@*: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" +mkdirp@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.4.0.tgz#291ac2a2d43a19c478662577b5be846fe83b5923" + integrity sha1-KRrCotQ6GcR4ZiV3tb6Eb+g7WSM= + mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.4, mkdirp@^0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -7234,10 +7602,12 @@ mootools@1.4.5: resolved "https://registry.yarnpkg.com/mootools/-/mootools-1.4.5.tgz#124ed9dae06f2a7f8b694e178e9e0146d732c314" integrity sha1-Ek7Z2uBvKn+LaU4Xjp4BRtcywxQ= -mootools@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/mootools/-/mootools-1.5.2.tgz#1fddf1b4e0a9e65d20d483b9b4b08e1e87b1161a" - integrity sha1-H93xtOCp5l0g1IO5tLCOHoexFho= +morgan@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.0.0.tgz#83cf74b9f2d841901f1a9a6b8fa7a468d2e47a8d" + integrity sha1-g890ufLYQZAfGpprj6ekaNLkeo0= + dependencies: + bytes "~0.2.0" move-concurrently@^1.0.1: version "1.0.1" @@ -7286,6 +7656,14 @@ multimatch@^3.0.0: arrify "^1.0.1" minimatch "^3.0.4" +multiparty@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/multiparty/-/multiparty-2.2.0.tgz#a567c2af000ad22dc8f2a653d91978ae1f5316f4" + integrity sha1-pWfCrwAK0i3I8qZT2Rl4rh9TFvQ= + dependencies: + readable-stream "~1.1.9" + stream-counter "~0.2.0" + mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -7334,6 +7712,16 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +negotiator@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.3.0.tgz#706d692efeddf574d57ea9fb1ab89a4fa7ee8f60" + integrity sha1-cG1pLv7d9XTVfqn7GriaT6fuj2A= + +negotiator@0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.4.2.tgz#8c43ea7e4c40ddfe40c3c0234c4ef77500b8fd37" + integrity sha1-jEPqfkxA3f5Aw8AjTE73dQC4/Tc= + negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -7342,6 +7730,11 @@ neo-async@^2.6.0, neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" +next-tick@0.1.x: + version "0.1.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-0.1.0.tgz#1912cce8eb9b697d640fbba94f8f00dec3b94259" + integrity sha1-GRLM6OubaX1kD7upT48A3sO5Qlk= + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -7669,6 +8062,13 @@ opn@^5.5.0: dependencies: is-wsl "^1.1.0" +optimist@~0.3, optimist@~0.3.5: + version "0.3.7" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9" + integrity sha1-yQlBrVnkJzMokjB00s8ufLxuwNk= + dependencies: + wordwrap "~0.0.2" + optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -7887,6 +8287,11 @@ parse5@^6.0.0, parse5@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" +parseurl@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.0.1.tgz#2e57dce6efdd37c3518701030944c22bf388b7b4" + integrity sha1-Llfc5u/dN8NRhwEDCUTCK/OIt7Q= + parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -7974,6 +8379,11 @@ pause-stream@0.0.11: dependencies: through "~2.3" +pause@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/pause/-/pause-0.0.1.tgz#1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d" + integrity sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10= + pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -8172,6 +8582,11 @@ prettier@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" +prettier@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== + pretty-bytes@^5.4.1: version "5.5.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.5.0.tgz#0cecda50a74a941589498011cf23275aa82b339e" @@ -8302,6 +8717,11 @@ q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" +qs@0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/qs/-/qs-0.6.6.tgz#6e015098ff51968b8a3c819001d5f2c89bc4b107" + integrity sha1-bgFQmP9RlouKPIGQAdXyyJvEsQc= + qs@6.7.0: version "6.7.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" @@ -8357,10 +8777,27 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" +range-parser@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.0.0.tgz#a4b264cfe0be5ce36abe3765ac9c2a248746dbc0" + integrity sha1-pLJkz+C+XONqvjdlrJwqJIdG28A= + range-parser@^1.2.1, range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" +range-parser@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.0.3.tgz#6872823535c692e2c2a0103826afd82c2e0ff175" + integrity sha1-aHKCNTXGkuLCoBA4Jq/YLC4P8XU= + +raw-body@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-1.1.4.tgz#f0b5624388d031f63da07f870c86cb9ccadcb67d" + integrity sha1-8LViQ4jQMfY9oH+HDIbLnMrctn0= + dependencies: + bytes "~0.3.0" + raw-body@2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" @@ -8394,6 +8831,15 @@ react-dom@^17.0.0, react-dom@^17.0.1: object-assign "^4.1.1" scheduler "^0.20.1" +react-dom@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" + integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + scheduler "^0.20.2" + react-ga@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.3.0.tgz#c91f407198adcb3b49e2bc5c12b3fe460039b3ca" @@ -8490,6 +8936,14 @@ react@^17.0.0, react@^17.0.1: loose-envify "^1.1.0" object-assign "^4.1.1" +react@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + read-cmd-shim@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz#87e43eba50098ba5a32d0ceb583ab8e43b961c16" @@ -8586,6 +9040,16 @@ read@1, read@~1.0.1: string_decoder "^1.1.1" util-deprecate "^1.0.1" +readable-stream@~1.1.8, readable-stream@~1.1.9: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readdir-scoped-modules@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" @@ -8843,6 +9307,11 @@ resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.9 is-core-module "^2.2.0" path-parse "^1.0.6" +response-time@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/response-time/-/response-time-1.0.0.tgz#c2bc8d08f3c359f97eae1d6da86eead175fabdc9" + integrity sha1-wryNCPPDWfl+rh1tqG7q0XX6vck= + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -8949,6 +9418,14 @@ scheduler@^0.20.1: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" @@ -8974,6 +9451,20 @@ schema-utils@^3.0.0: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +scmp@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/scmp/-/scmp-0.0.3.tgz#3648df2d7294641e7f78673ffc29681d9bad9073" + integrity sha1-NkjfLXKUZB5/eGc//CloHZutkHM= + select-hose@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" @@ -9011,6 +9502,13 @@ semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: dependencies: lru-cache "^6.0.0" +semver@^7.3.5: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + send@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -9029,6 +9527,17 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" +send@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.3.0.tgz#9718324634806fc75bc4f8f5e51f57d9d66606e7" + integrity sha1-lxgyRjSAb8dbxPj15R9X2dZmBuc= + dependencies: + buffer-crc32 "0.2.1" + debug "0.8.0" + fresh "~0.2.1" + mime "1.2.11" + range-parser "~1.0.0" + serialize-javascript@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" @@ -9042,6 +9551,14 @@ serialize-javascript@^6.0.0: dependencies: randombytes "^2.1.0" +serve-index@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.0.1.tgz#2782ee8ede6cccaae54957962c4715e8ce1921a6" + integrity sha1-J4Lujt5szKrlSVeWLEcV6M4ZIaY= + dependencies: + batch "0.5.0" + negotiator "0.4.2" + serve-index@^1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" @@ -9054,6 +9571,14 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" +serve-static@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.1.0.tgz#454dfa05bb3ddd4e701a8915b83a278aa91c5643" + integrity sha1-RU36Bbs93U5wGokVuDoniqkcVkM= + dependencies: + parseurl "1.0.1" + send "0.3.0" + serve-static@1.14.1: version "1.14.1" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" @@ -9076,6 +9601,11 @@ set-value@^2.0.0, set-value@^2.0.1: is-plain-object "^2.0.3" split-string "^3.0.1" +setimmediate@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.1.tgz#a9ca56ccbd6a4c3334855f060abcdece5c42ebb7" + integrity sha1-qcpWzL1qTDM0hV8GCrzezlxC67c= + setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" @@ -9289,6 +9819,13 @@ source-map@^0.7.3, source-map@~0.7.2: version "0.7.3" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" +source-map@~0.1.7: + version "0.1.43" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" + integrity sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y= + dependencies: + amdefine ">=0.0.4" + sourcemap-codec@^1.4.4: version "1.4.8" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" @@ -9413,6 +9950,11 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +static-favicon@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/static-favicon/-/static-favicon-1.0.2.tgz#7c15920dda2bf33f414b0e60aebbd65cdd2a1d2f" + integrity sha1-fBWSDdor8z9BSw5grrvWXN0qHS8= + "statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -9423,6 +9965,13 @@ stream-combiner@~0.0.4: dependencies: duplexer "~0.1.1" +stream-counter@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stream-counter/-/stream-counter-0.2.0.tgz#ded266556319c8b0e222812b9cf3b26fa7d947de" + integrity sha1-3tJmVWMZyLDiIoErnPOyb6fZR94= + dependencies: + readable-stream "~1.1.8" + stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" @@ -9509,6 +10058,11 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -9914,6 +10468,16 @@ ts-loader@^8.0.11: micromatch "^4.0.0" semver "^7.3.4" +ts-loader@^9.2.5: + version "9.2.5" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.5.tgz#127733a5e9243bf6dafcb8aa3b8a266d8041dca9" + integrity sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ== + dependencies: + chalk "^4.1.0" + enhanced-resolve "^5.0.0" + micromatch "^4.0.0" + semver "^7.3.4" + ts-node@^9.0.0: version "9.1.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" @@ -9939,6 +10503,13 @@ tsutils@^3.17.1: dependencies: tslib "^1.8.1" +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -9990,14 +10561,38 @@ typescript@^4.0, typescript@^4.1.2: version "4.1.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" +typescript@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" + integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== + uglify-js@^3.1.4: version "3.12.8" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.12.8.tgz#a82e6e53c9be14f7382de3d068ef1e26e7d4aaf8" +uglify-js@~2.3: + version "2.3.6" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.3.6.tgz#fa0984770b428b7a9b2a8058f46355d14fef211a" + integrity sha1-+gmEdwtCi3qbKoBY9GNV0U/vIRo= + dependencies: + async "~0.2.6" + optimist "~0.3.5" + source-map "~0.1.7" + uid-number@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +uid2@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/uid2/-/uid2-0.0.3.tgz#483126e11774df2f71b8b639dcd799c376162b82" + integrity sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I= + +uid2@~0.0.2: + version "0.0.4" + resolved "https://registry.yarnpkg.com/uid2/-/uid2-0.0.4.tgz#033f3b1d5d32505f5ce5f888b9f3b667123c0a44" + integrity sha512-IevTus0SbGwQzYh3+fRsAMTVVPOoIVufzacXcHPmdlle1jUpq7BRL+mw3dgeLanvGZdwwbWhRV6XrcFNdBmjWA== + umask@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" @@ -10137,6 +10732,11 @@ utila@~0.4: version "0.4.0" resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" +utils-merge@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" + integrity sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg= + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -10178,6 +10778,11 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vhost@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/vhost/-/vhost-1.0.0.tgz#654513f289a4f898aab745bbd633e40180c9c4c0" + integrity sha1-ZUUT8omk+Jiqt0W71jPkAYDJxMA= + wait-on@5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-5.2.1.tgz#05b66fcb4d7f5da01537f03e7cf96e8836422996" @@ -10271,6 +10876,25 @@ webpack-cli@^4.7.2: v8-compile-cache "^2.2.0" webpack-merge "^5.7.3" +webpack-cli@^4.8.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.8.0.tgz#5fc3c8b9401d3c8a43e2afceacfa8261962338d1" + integrity sha512-+iBSWsX16uVna5aAYN6/wjhJy1q/GKk4KjKvfg90/6hykCTSgozbfz5iRgDTSJt/LgSbYxdBX3KBHeobIs+ZEw== + dependencies: + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^1.0.4" + "@webpack-cli/info" "^1.3.0" + "@webpack-cli/serve" "^1.5.2" + colorette "^1.2.1" + commander "^7.0.0" + execa "^5.0.0" + fastest-levenshtein "^1.0.12" + import-local "^3.0.2" + interpret "^2.2.0" + rechoir "^0.7.0" + v8-compile-cache "^2.2.0" + webpack-merge "^5.7.3" + webpack-dev-middleware@^3.7.2: version "3.7.3" resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz#0639372b143262e2b84ab95d3b91a7597061c2c5" @@ -10341,6 +10965,16 @@ webpack-merge@^5.8.0: clone-deep "^4.0.1" wildcard "^2.0.0" +webpack-server@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/webpack-server/-/webpack-server-0.1.2.tgz#549c051bc4e6361a6666b3f9005e5f5f77a85911" + integrity sha1-VJwFG8TmNhpmZrP5AF5fX3eoWRE= + dependencies: + cli-color "~0.2.3" + express "~3.5.0" + handlebars "~2.0.0-alpha.2" + lodash "~2.4.1" + webpack-sources@^1.0.2: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" @@ -10363,6 +10997,11 @@ webpack-sources@^2.3.0: source-list-map "^2.0.1" source-map "^0.6.1" +webpack-sources@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.0.tgz#b16973bcf844ebcdb3afde32eda1c04d0b90f89d" + integrity sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw== + webpack@^5.44.0: version "5.44.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.44.0.tgz#97b13a02bd79fb71ac6301ce697920660fa214a1" @@ -10392,6 +11031,36 @@ webpack@^5.44.0: watchpack "^2.2.0" webpack-sources "^2.3.0" +webpack@^5.52.0: + version "5.52.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.52.0.tgz#88d997c2c3ebb62abcaa453d2a26e0fd917c71a3" + integrity sha512-yRZOat8jWGwBwHpco3uKQhVU7HYaNunZiJ4AkAVQkPCUGoZk/tiIXiwG+8HIy/F+qsiZvSOa+GLQOj3q5RKRYg== + dependencies: + "@types/eslint-scope" "^3.7.0" + "@types/estree" "^0.0.50" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.4.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.8.0" + es-module-lexer "^0.7.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.4" + json-parse-better-errors "^1.0.2" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.2.0" + webpack-sources "^3.2.0" + webpack@^5.6.0: version "5.22.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.22.0.tgz#8505158bc52dcbbdb01ac94796a8aed61badf11a" @@ -10484,6 +11153,11 @@ wordwrap@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + wrap-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba"