Skip to content

Commit

Permalink
Merge pull request #1303 from OpenGeoscience/internal-vgl
Browse files Browse the repository at this point in the history
refactor: Move vgl locally
  • Loading branch information
manthey authored Nov 7, 2023
2 parents 8484ce7 + 82f5234 commit d2a3db1
Show file tree
Hide file tree
Showing 50 changed files with 4,596 additions and 71 deletions.
12 changes: 6 additions & 6 deletions docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ so there is no need to rerun this command unless you add a new file.

There are a number of utilities present in the file ``tests/test-utils.js``
that developers can use to make better unit tests. For example, a mocked
vgl renderer can be used to hit code paths within webgl rendered layers. There
are also methods for mocking global methods like ``requestAnimationFrame``
to test complex, asynchronous code paths in a stable and repeatable manner.
The `Sinon <https://sinonjs.org/>`_ testing library is also available to
generate stubs, spies, and mocked methods. Because all tests share
a global scope, they should be careful to clean up all mocking and
webgl renderer can be used to hit code paths within webgl rendered layers.
There are also methods for mocking global methods like
``requestAnimationFrame`` to test complex, asynchronous code paths in a stable
and repeatable manner. The `Sinon <https://sinonjs.org/>`_ testing library is
also available to generate stubs, spies, and mocked methods. Because all tests
share a global scope, they should be careful to clean up all mocking and
instrumentation after running. Ideally, each test should be runnable
independently and use jasmines ``beforeEach`` and ``afterEach`` methods
for setup and tear down.
Expand Down
13 changes: 1 addition & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"kdbush": "^4.0.0",
"mousetrap": "^1.6.5",
"polybooljs": "git+https://github.com/manubb/polybooljs#eps-logic",
"proj4": "^2.7.5",
"vgl": "0.3.11"
"proj4": "^2.7.5"
},
"optionalDependencies": {
"@egjs/hammerjs": "^2.0.8",
Expand Down
7 changes: 2 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
/*
* Bundled with the following libraries:
*
* vgl
* @copyright 2014-2016, Kitware, Inc.
* @license Apache-2.0
*
* Proj4js
* @copyright 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf
* @license MIT
Expand Down Expand Up @@ -99,7 +95,8 @@ module.exports = $.extend({
svg: require('./svg'),
vtkjs: require('./vtkjs'),
webgl: require('./webgl'),
gui: require('./ui')
gui: require('./ui'),
vgl: require('./vgl')
}, require('./registry'));

if (window && !window.$) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ var util = {
* is the correct size, return it. Otherwise, allocate a new buffer; any
* data in an old buffer is discarded.
*
* @param {vgl.geometryData} geom The geometry to reference and modify.
* @param {geo.vgl.geometryData} geom The geometry to reference and modify.
* @param {string} srcName The name of the source.
* @param {number} len The number of elements for the array.
* @param {number} [allowLarger=0.2] If the existing buffer is larger than
Expand Down
4 changes: 2 additions & 2 deletions src/util/mockVGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {};
*/
module.exports.mockWebglRenderer = function mockWebglRenderer(supported) {
'use strict';
var vgl = require('vgl');
var vgl = require('../vgl');

if (supported === undefined) {
supported = true;
Expand Down Expand Up @@ -189,7 +189,7 @@ module.exports.mockWebglRenderer = function mockWebglRenderer(supported) {
* @alias geo.util.restoreWebglRenderer
*/
module.exports.restoreWebglRenderer = function () {
var vgl = require('vgl');
var vgl = require('../vgl');

if (vgl._mocked) {
vgl.renderWindow = _renderWindow;
Expand Down
Loading

0 comments on commit d2a3db1

Please sign in to comment.