Browse Source

replacing all ES6 imports with CJS require calls (#3063)

* replacing all ES6 imports with CJS require calls
resolves #2934
used the following regex to apply the changes in lib:
s/import\s+(\w+)\s+from\s+(.*);\s*$/var $1 = require($2).default;/
s/import\s+(\w+)\s+from\s+(.*)\s*$/var $1 = require($2).default;/

* cleaning up inconsistencies
gemini
Pat Sissons 7 years ago
committed by yotamberk
parent
commit
e25db74b4b
15 changed files with 67 additions and 67 deletions
  1. +18
    -18
      lib/network/Network.js
  2. +2
    -2
      lib/network/modules/Clustering.js
  3. +2
    -2
      lib/network/modules/EdgesHandler.js
  4. +2
    -2
      lib/network/modules/InteractionHandler.js
  5. +1
    -1
      lib/network/modules/LayoutEngine.js
  6. +2
    -2
      lib/network/modules/NodesHandler.js
  7. +8
    -8
      lib/network/modules/PhysicsEngine.js
  8. +2
    -2
      lib/network/modules/SelectionHandler.js
  9. +1
    -1
      lib/network/modules/View.js
  10. +5
    -5
      lib/network/modules/components/Edge.js
  11. +18
    -18
      lib/network/modules/components/Node.js
  12. +1
    -1
      lib/shared/Configurator.js
  13. +2
    -2
      lib/timeline/Graph2d.js
  14. +2
    -2
      lib/timeline/Timeline.js
  15. +1
    -1
      lib/timeline/component/ItemSet.js

+ 18
- 18
lib/network/Network.js View File

@ -10,24 +10,24 @@ let gephiParser = require('./gephiParser');
let Activator = require('../shared/Activator'); let Activator = require('../shared/Activator');
let locales = require('./locales'); let locales = require('./locales');
import Images from './Images';
import Groups from './modules/Groups';
import NodesHandler from './modules/NodesHandler';
import EdgesHandler from './modules/EdgesHandler';
import PhysicsEngine from './modules/PhysicsEngine';
import ClusterEngine from './modules/Clustering';
import CanvasRenderer from './modules/CanvasRenderer';
import Canvas from './modules/Canvas';
import View from './modules/View';
import InteractionHandler from './modules/InteractionHandler';
import SelectionHandler from "./modules/SelectionHandler";
import LayoutEngine from "./modules/LayoutEngine";
import ManipulationSystem from "./modules/ManipulationSystem";
import Configurator from "./../shared/Configurator";
import Validator from "./../shared/Validator";
import {printStyle} from "./../shared/Validator";
import {allOptions, configureOptions} from './options.js';
import KamadaKawai from "./modules/KamadaKawai.js"
var Images = require('./Images').default;
var Groups = require('./modules/Groups').default;
var NodesHandler = require('./modules/NodesHandler').default;
var EdgesHandler = require('./modules/EdgesHandler').default;
var PhysicsEngine = require('./modules/PhysicsEngine').default;
var ClusterEngine = require('./modules/Clustering').default;
var CanvasRenderer = require('./modules/CanvasRenderer').default;
var Canvas = require('./modules/Canvas').default;
var View = require('./modules/View').default;
var InteractionHandler = require('./modules/InteractionHandler').default;
var SelectionHandler = require("./modules/SelectionHandler").default;
var LayoutEngine = require("./modules/LayoutEngine").default;
var ManipulationSystem = require("./modules/ManipulationSystem").default;
var Configurator = require("./../shared/Configurator").default;
var Validator = require("./../shared/Validator").default;
var {printStyle} = require('./../shared/Validator');
var {allOptions, configureOptions} = require('./options.js');
var KamadaKawai = require("./modules/KamadaKawai.js").default;
/** /**

+ 2
- 2
lib/network/modules/Clustering.js View File

@ -1,6 +1,6 @@
let util = require("../../util"); let util = require("../../util");
import NetworkUtil from '../NetworkUtil';
import Cluster from './components/nodes/Cluster'
var NetworkUtil = require('../NetworkUtil').default;
var Cluster = require('./components/nodes/Cluster').default;
class ClusterEngine { class ClusterEngine {
constructor(body) { constructor(body) {

+ 2
- 2
lib/network/modules/EdgesHandler.js View File

@ -2,8 +2,8 @@ var util = require("../../util");
var DataSet = require('../../DataSet'); var DataSet = require('../../DataSet');
var DataView = require('../../DataView'); var DataView = require('../../DataView');
import Edge from "./components/Edge"
import Label from "./components/shared/Label"
var Edge = require("./components/Edge").default;
var Label = require("./components/shared/Label").default;
class EdgesHandler { class EdgesHandler {
constructor(body, images, groups) { constructor(body, images, groups) {

+ 2
- 2
lib/network/modules/InteractionHandler.js View File

@ -1,7 +1,7 @@
let util = require('../../util'); let util = require('../../util');
import NavigationHandler from './components/NavigationHandler'
import Popup from './../../shared/Popup'
var NavigationHandler = require('./components/NavigationHandler').default;
var Popup = require('./../../shared/Popup').default;
class InteractionHandler { class InteractionHandler {
constructor(body, canvas, selectionHandler) { constructor(body, canvas, selectionHandler) {

+ 1
- 1
lib/network/modules/LayoutEngine.js View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
let util = require('../../util'); let util = require('../../util');
import NetworkUtil from '../NetworkUtil';
var NetworkUtil = require('../NetworkUtil').default;
/** /**

+ 2
- 2
lib/network/modules/NodesHandler.js View File

@ -2,8 +2,8 @@ let util = require("../../util");
let DataSet = require('../../DataSet'); let DataSet = require('../../DataSet');
let DataView = require('../../DataView'); let DataView = require('../../DataView');
import Node from "./components/Node";
import Label from "./components/shared/Label";
var Node = require("./components/Node").default;
var Label = require("./components/shared/Label").default;
class NodesHandler { class NodesHandler {
constructor(body, images, groups, layoutEngine) { constructor(body, images, groups, layoutEngine) {

+ 8
- 8
lib/network/modules/PhysicsEngine.js View File

@ -1,11 +1,11 @@
import BarnesHutSolver from './components/physics/BarnesHutSolver';
import Repulsion from './components/physics/RepulsionSolver';
import HierarchicalRepulsion from './components/physics/HierarchicalRepulsionSolver';
import SpringSolver from './components/physics/SpringSolver';
import HierarchicalSpringSolver from './components/physics/HierarchicalSpringSolver';
import CentralGravitySolver from './components/physics/CentralGravitySolver';
import ForceAtlas2BasedRepulsionSolver from './components/physics/FA2BasedRepulsionSolver';
import ForceAtlas2BasedCentralGravitySolver from './components/physics/FA2BasedCentralGravitySolver';
var BarnesHutSolver = require('./components/physics/BarnesHutSolver').default;
var Repulsion = require('./components/physics/RepulsionSolver').default;
var HierarchicalRepulsion = require('./components/physics/HierarchicalRepulsionSolver').default;
var SpringSolver = require('./components/physics/SpringSolver').default;
var HierarchicalSpringSolver = require('./components/physics/HierarchicalSpringSolver').default;
var CentralGravitySolver = require('./components/physics/CentralGravitySolver').default;
var ForceAtlas2BasedRepulsionSolver = require('./components/physics/FA2BasedRepulsionSolver').default;
var ForceAtlas2BasedCentralGravitySolver = require('./components/physics/FA2BasedCentralGravitySolver').default;
var util = require('../../util'); var util = require('../../util');

+ 2
- 2
lib/network/modules/SelectionHandler.js View File

@ -1,5 +1,5 @@
import Node from './components/Node';
import Edge from './components/Edge';
var Node = require('./components/Node').default;
var Edge = require('./components/Edge').default;
let util = require('../../util'); let util = require('../../util');

+ 1
- 1
lib/network/modules/View.js View File

@ -1,6 +1,6 @@
let util = require('../../util'); let util = require('../../util');
import NetworkUtil from '../NetworkUtil';
var NetworkUtil = require('../NetworkUtil').default;
class View { class View {
constructor(body, canvas) { constructor(body, canvas) {

+ 5
- 5
lib/network/modules/components/Edge.js View File

@ -1,10 +1,10 @@
var util = require('../../../util'); var util = require('../../../util');
import Label from './shared/Label'
import CubicBezierEdge from './edges/CubicBezierEdge'
import BezierEdgeDynamic from './edges/BezierEdgeDynamic'
import BezierEdgeStatic from './edges/BezierEdgeStatic'
import StraightEdge from './edges/StraightEdge'
var Label = require('./shared/Label').default;
var CubicBezierEdge = require('./edges/CubicBezierEdge').default;
var BezierEdgeDynamic = require('./edges/BezierEdgeDynamic').default;
var BezierEdgeStatic = require('./edges/BezierEdgeStatic').default;
var StraightEdge = require('./edges/StraightEdge').default;
/** /**
* @class Edge * @class Edge

+ 18
- 18
lib/network/modules/components/Node.js View File

@ -1,23 +1,23 @@
var util = require('../../../util'); var util = require('../../../util');
import Label from './shared/Label'
import Box from './nodes/shapes/Box'
import Circle from './nodes/shapes/Circle'
import CircularImage from './nodes/shapes/CircularImage'
import Database from './nodes/shapes/Database'
import Diamond from './nodes/shapes/Diamond'
import Dot from './nodes/shapes/Dot'
import Ellipse from './nodes/shapes/Ellipse'
import Icon from './nodes/shapes/Icon'
import Image from './nodes/shapes/Image'
import Square from './nodes/shapes/Square'
import Star from './nodes/shapes/Star'
import Text from './nodes/shapes/Text'
import Triangle from './nodes/shapes/Triangle'
import TriangleDown from './nodes/shapes/TriangleDown'
import Validator from "../../../shared/Validator";
import {printStyle} from "../../../shared/Validator";
var Label = require('./shared/Label').default;
var Box = require('./nodes/shapes/Box').default;
var Circle = require('./nodes/shapes/Circle').default;
var CircularImage = require('./nodes/shapes/CircularImage').default;
var Database = require('./nodes/shapes/Database').default;
var Diamond = require('./nodes/shapes/Diamond').default;
var Dot = require('./nodes/shapes/Dot').default;
var Ellipse = require('./nodes/shapes/Ellipse').default;
var Icon = require('./nodes/shapes/Icon').default;
var Image = require('./nodes/shapes/Image').default;
var Square = require('./nodes/shapes/Square').default;
var Star = require('./nodes/shapes/Star').default;
var Text = require('./nodes/shapes/Text').default;
var Triangle = require('./nodes/shapes/Triangle').default;
var TriangleDown = require('./nodes/shapes/TriangleDown').default;
var Validator = require("../../../shared/Validator").default;
var { printStyle } = require("../../../shared/Validator");
/** /**

+ 1
- 1
lib/shared/Configurator.js View File

@ -1,6 +1,6 @@
var util = require('../util'); var util = require('../util');
import ColorPicker from './ColorPicker'
var ColorPicker = require('./ColorPicker').default;
/** /**
* The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options. * The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options.

+ 2
- 2
lib/timeline/Graph2d.js View File

@ -15,8 +15,8 @@ var printStyle = require('../shared/Validator').printStyle;
var allOptions = require('./optionsGraph2d').allOptions; var allOptions = require('./optionsGraph2d').allOptions;
var configureOptions = require('./optionsGraph2d').configureOptions; var configureOptions = require('./optionsGraph2d').configureOptions;
import Configurator from '../shared/Configurator';
import Validator from '../shared/Validator';
var Configurator = require('../shared/Configurator').default;
var Validator = require('../shared/Validator').default;
/** /**
* Create a timeline visualization * Create a timeline visualization

+ 2
- 2
lib/timeline/Timeline.js View File

@ -15,8 +15,8 @@ var printStyle = require('../shared/Validator').printStyle;
var allOptions = require('./optionsTimeline').allOptions; var allOptions = require('./optionsTimeline').allOptions;
var configureOptions = require('./optionsTimeline').configureOptions; var configureOptions = require('./optionsTimeline').configureOptions;
import Configurator from '../shared/Configurator';
import Validator from '../shared/Validator';
var Configurator = require('../shared/Configurator').default;
var Validator = require('../shared/Validator').default;
/** /**

+ 1
- 1
lib/timeline/component/ItemSet.js View File

@ -10,7 +10,7 @@ var BoxItem = require('./item/BoxItem');
var PointItem = require('./item/PointItem'); var PointItem = require('./item/PointItem');
var RangeItem = require('./item/RangeItem'); var RangeItem = require('./item/RangeItem');
var BackgroundItem = require('./item/BackgroundItem'); var BackgroundItem = require('./item/BackgroundItem');
import Popup from '../../shared/Popup';
var Popup = require('../../shared/Popup').default;
var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items

Loading…
Cancel
Save