Compare commits
4 Commits
swg-allow-
...
plot-wait-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b5bfb8047 | ||
|
|
1a23f2b390 | ||
|
|
4df6d6141b | ||
|
|
1c97138607 |
@@ -66,7 +66,7 @@ define([
|
||||
if (request && request.hasOwnProperty(prop)) {
|
||||
workerRequest[prop] = request[prop];
|
||||
}
|
||||
if (!workerRequest[prop]) {
|
||||
if (!workerRequest.hasOwnProperty(prop)) {
|
||||
workerRequest[prop] = REQUEST_DEFAULTS[prop];
|
||||
}
|
||||
workerRequest[prop] = Number(workerRequest[prop]);
|
||||
|
||||
20
package.json
20
package.json
@@ -3,16 +3,16 @@
|
||||
"version": "0.13.3-SNAPSHOT",
|
||||
"description": "The Open MCT core platform",
|
||||
"dependencies": {
|
||||
"d3-array": "^1.0.2",
|
||||
"d3-axis": "^1.0.4",
|
||||
"d3-collection": "^1.0.2",
|
||||
"d3-color": "^1.0.2",
|
||||
"d3-format": "^1.0.2",
|
||||
"d3-interpolate": "^1.1.3",
|
||||
"d3-scale": "^1.0.4",
|
||||
"d3-selection": "^1.0.3",
|
||||
"d3-time": "^1.0.4",
|
||||
"d3-time-format": "^2.0.3",
|
||||
"d3-array": "1.2.x",
|
||||
"d3-axis": "1.0.x",
|
||||
"d3-collection": "1.0.x",
|
||||
"d3-color": "1.0.x",
|
||||
"d3-format": "1.2.x",
|
||||
"d3-interpolate": "1.1.x",
|
||||
"d3-scale": "1.0.x",
|
||||
"d3-selection": "1.3.x",
|
||||
"d3-time": "1.0.x",
|
||||
"d3-time-format": "2.1.x",
|
||||
"express": "^4.13.1",
|
||||
"minimist": "^1.1.1",
|
||||
"request": "^2.69.0",
|
||||
|
||||
@@ -90,7 +90,7 @@ define(['./Type'], function (Type) {
|
||||
/**
|
||||
* Retrieve a registered type by its key.
|
||||
* @method get
|
||||
* @param {string} typeKey the key for htis type
|
||||
* @param {string} typeKey the key for this type
|
||||
* @memberof module:openmct.TypeRegistry#
|
||||
* @returns {module:openmct.Type} the registered type
|
||||
*/
|
||||
|
||||
55
src/api/types/TypeRegistrySpec.js
Normal file
55
src/api/types/TypeRegistrySpec.js
Normal file
@@ -0,0 +1,55 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
define(['./TypeRegistry', './Type'], function (TypeRegistry, Type) {
|
||||
describe('The Type API', function () {
|
||||
var typeRegistryInstance;
|
||||
|
||||
beforeEach(function () {
|
||||
typeRegistryInstance = new TypeRegistry ();
|
||||
typeRegistryInstance.addType('testType', {
|
||||
name: 'Test Type',
|
||||
description: 'This is a test type.',
|
||||
creatable: true
|
||||
});
|
||||
});
|
||||
|
||||
it('types can be standardized', function () {
|
||||
typeRegistryInstance.addType('standardizationTestType', {
|
||||
label: 'Test Type',
|
||||
description: 'This is a test type.',
|
||||
creatable: true
|
||||
});
|
||||
typeRegistryInstance.standardizeType(typeRegistryInstance.types.standardizationTestType);
|
||||
expect(typeRegistryInstance.get('standardizationTestType').definition.label).toBeUndefined();
|
||||
expect(typeRegistryInstance.get('standardizationTestType').definition.name).toBe('Test Type');
|
||||
});
|
||||
|
||||
it('new types are registered successfully and can be retrieved', function () {
|
||||
expect(typeRegistryInstance.get('testType').definition.name).toBe('Test Type');
|
||||
});
|
||||
|
||||
it('type registry contains new keys', function () {
|
||||
expect(typeRegistryInstance.listKeys ()).toContain('testType');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -82,6 +82,10 @@ define([
|
||||
};
|
||||
|
||||
PlotController.prototype.loadSeriesData = function (series) {
|
||||
if (this.$element[0].offsetWidth === 0) {
|
||||
this.scheduleLoad(series);
|
||||
return;
|
||||
}
|
||||
this.startLoading();
|
||||
var options = {
|
||||
size: this.$element[0].offsetWidth,
|
||||
@@ -92,6 +96,26 @@ define([
|
||||
.then(this.stopLoading.bind(this));
|
||||
};
|
||||
|
||||
PlotController.prototype.scheduleLoad = function (series) {
|
||||
if (!this.scheduledLoads) {
|
||||
this.startLoading();
|
||||
this.scheduledLoads = [];
|
||||
this.checkForSize = setInterval(function () {
|
||||
if (this.$element[0].offsetWidth === 0) {
|
||||
return;
|
||||
}
|
||||
this.stopLoading();
|
||||
this.scheduledLoads.forEach(this.loadSeriesData, this);
|
||||
delete this.scheduledLoads;
|
||||
clearInterval(this.checkForSize);
|
||||
delete this.checkForSize;
|
||||
}.bind(this));
|
||||
}
|
||||
if (this.scheduledLoads.indexOf(series) === -1) {
|
||||
this.scheduledLoads.push(series);
|
||||
}
|
||||
};
|
||||
|
||||
PlotController.prototype.addSeries = function (series) {
|
||||
this.listenTo(series, 'change:yKey', function () {
|
||||
this.loadSeriesData(series);
|
||||
@@ -126,6 +150,10 @@ define([
|
||||
PlotController.prototype.destroy = function () {
|
||||
configStore.untrack(this.config.id);
|
||||
this.stopListening();
|
||||
if (this.checkForSize) {
|
||||
clearInterval(this.checkForSize);
|
||||
delete this.checkForSize;
|
||||
}
|
||||
};
|
||||
|
||||
PlotController.prototype.loadMoreData = function (range, purge) {
|
||||
|
||||
Reference in New Issue
Block a user