[Code Style] Run gulp fixstyle

...to apply code style settings from #142.
This commit is contained in:
Victor Woeltjen
2016-05-19 11:29:13 -07:00
parent f12b9704d9
commit fa77139077
440 changed files with 1885 additions and 1662 deletions

View File

@@ -38,8 +38,8 @@ define(
this.c2d = canvas.getContext('2d');
this.width = canvas.width;
this.height = canvas.height;
this.dimensions = [ this.width, this.height ];
this.origin = [ 0, 0 ];
this.dimensions = [this.width, this.height];
this.origin = [0, 0];
if (!this.c2d) {
throw new Error("Canvas 2d API unavailable.");

View File

@@ -57,7 +57,7 @@ define(
Listen for changes to the domain object and update the object's
children.
*/
this.mutationListener = this.domainObject.getCapability('mutation').listen(function(model) {
this.mutationListener = this.domainObject.getCapability('mutation').listen(function (model) {
if (self.hasCompositionChanged(self.composition, model.composition)) {
self.updateChildren();
}
@@ -70,7 +70,7 @@ define(
$scope.xAxisForm = this.plotOptionsForm.xAxisForm;
$scope.yAxisForm = this.plotOptionsForm.yAxisForm;
$scope.$on("$destroy", function() {
$scope.$on("$destroy", function () {
//Clean up any listeners on destruction of controller
self.mutationListener();
});
@@ -82,10 +82,10 @@ define(
* Setup a number of watches for changes to form values. On
* change, update the model configuration via mutation
*/
$scope.$watchCollection('configuration.plot.yAxis', function(newValue, oldValue){
$scope.$watchCollection('configuration.plot.yAxis', function (newValue, oldValue) {
self.updateConfiguration(newValue, oldValue);
});
$scope.$watchCollection('configuration.plot.xAxis', function(newValue, oldValue){
$scope.$watchCollection('configuration.plot.xAxis', function (newValue, oldValue) {
self.updateConfiguration(newValue, oldValue);
});
@@ -98,8 +98,8 @@ define(
* child objects)
* @private
*/
PlotOptionsController.prototype.clearSeriesWatches = function() {
this.watches.forEach(function(watch) {
PlotOptionsController.prototype.clearSeriesWatches = function () {
this.watches.forEach(function (watch) {
watch();
});
this.watches = [];
@@ -109,16 +109,16 @@ define(
* Attach watches for each object in the plot's composition
* @private
*/
PlotOptionsController.prototype.watchSeries = function() {
PlotOptionsController.prototype.watchSeries = function () {
var self = this;
this.clearSeriesWatches();
(self.$scope.children || []).forEach(function(child, index){
(self.$scope.children || []).forEach(function (child, index) {
self.watches.push(
self.$scope.$watchCollection(
'configuration.plot.series[' + index + ']',
function(newValue, oldValue){
function (newValue, oldValue) {
self.updateConfiguration(newValue, oldValue);
}
)
@@ -132,13 +132,13 @@ define(
*
* @private
*/
PlotOptionsController.prototype.hasCompositionChanged = function(oldComposition, newComposition){
PlotOptionsController.prototype.hasCompositionChanged = function (oldComposition, newComposition) {
// Framed slightly strangely, but the boolean logic is
// easier to follow for the unchanged case.
var isUnchanged = oldComposition === newComposition ||
(
oldComposition.length === newComposition.length &&
oldComposition.every( function (currentValue, index) {
oldComposition.every(function (currentValue, index) {
return newComposition[index] && currentValue === newComposition[index];
})
);
@@ -163,12 +163,12 @@ define(
* plot options model
* @private
*/
PlotOptionsController.prototype.updateChildren = function() {
PlotOptionsController.prototype.updateChildren = function () {
var self = this;
this.domainObject.useCapability('composition').then(function(children){
this.domainObject.useCapability('composition').then(function (children) {
self.$scope.children = children;
self.composition = self.domainObject.getModel().composition;
children.forEach(function(child, index){
children.forEach(function (child, index) {
self.configuration.plot.series[index] =
self.configuration.plot.series[index] || {'id': child.getId()};
});
@@ -181,9 +181,9 @@ define(
* object
* @private
*/
PlotOptionsController.prototype.updateConfiguration = function() {
PlotOptionsController.prototype.updateConfiguration = function () {
var self = this;
this.domainObject.useCapability('mutation', function(model){
this.domainObject.useCapability('mutation', function (model) {
model.configuration = model.configuration || {};
model.configuration.plot = self.configuration.plot;
});

View File

@@ -37,7 +37,7 @@ define(
Defined below are the form structures for the plot options.
*/
this.xAxisForm = {
'name':'x-axis',
'name': 'x-axis',
'sections': [{
'name': 'x-axis',
'rows': [
@@ -46,30 +46,30 @@ define(
'control': 'select',
'key': 'key',
'options': [
{'name':'SCET', 'value': 'scet'},
{'name':'SCLK', 'value': 'sclk'},
{'name':'LST', 'value': 'lst'}
{'name': 'SCET', 'value': 'scet'},
{'name': 'SCLK', 'value': 'sclk'},
{'name': 'LST', 'value': 'lst'}
]
}
]
}]};
}]};
this.yAxisForm = {
'name':'y-axis',
'sections': [{
// Will need to be repeated for each y-axis, with a
// distinct name for each. Ideally the name of the axis
// itself.
'name': 'y-axis',
'rows': [
'sections': [{
// Will need to be repeated for each y-axis, with a
// distinct name for each. Ideally the name of the axis
// itself.
'name': 'y-axis',
'rows': [
{
'name': 'Range',
'control': 'select',
'key': 'key',
'options': [
{'name':'EU', 'value': 'eu'},
{'name':'DN', 'value': 'dn'},
{'name':'Status', 'value': 'status'}
{'name': 'EU', 'value': 'eu'},
{'name': 'DN', 'value': 'dn'},
{'name': 'Status', 'value': 'status'}
]
},
{
@@ -95,7 +95,7 @@ define(
}]
};
this.plotSeriesForm = {
'name':'Series Options',
'name': 'Series Options',
'sections': [
{
rows: [
@@ -106,7 +106,7 @@ define(
}]
},
{
'rows':[
'rows': [
{
'name': 'Markers',
'control': 'checkbox',
@@ -116,7 +116,7 @@ define(
]
},
{
'rows':[
'rows': [
{
'name': 'No Line',
'control': 'radio',

View File

@@ -67,7 +67,7 @@ define(
* implies that there is no range data displayed either
* @returns {boolean} true if domain data exists for the current pan/zoom level
*/
SubPlot.prototype.hasDomainData = function() {
SubPlot.prototype.hasDomainData = function () {
return this.panZoomStack &&
this.panZoomStack.getDimensions()[0] > 0;
};
@@ -109,7 +109,7 @@ define(
// associated with conversion to a 32-bit floating point
// format (which is needed in the chart area itself, by WebGL.)
SubPlot.prototype.toDisplayable = function (position) {
return [ position[0] - this.domainOffset, position[1] ];
return [position[0] - this.domainOffset, position[1]];
};
// Update the current hover coordinates
@@ -145,7 +145,7 @@ define(
end: this.toDisplayable(
this.mousePositionToDomainRange(this.mousePosition)
),
color: [1, 1, 1, 0.5 ]
color: [1, 1, 1, 0.5]
}] : undefined;
};
@@ -189,7 +189,7 @@ define(
this.panZoomStack
);
delta = [ current[0] - start[0], current[1] - start[1] ];
delta = [current[0] - start[0], current[1] - start[1]];
nextOrigin = [
this.panStartBounds.origin[0] - delta[0],
this.panStartBounds.origin[1] - delta[1]

View File

@@ -35,7 +35,7 @@ define(
function PlotLineBuffer(domainOffset, initialSize, maxSize) {
this.buffer = new Float32Array(initialSize * 2);
this.rangeExtrema =
[ Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY ];
[Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];
this.length = 0;
this.domainOffset = domainOffset;
this.initialSize = initialSize;

View File

@@ -30,36 +30,36 @@ define(
// describe colors in several ways (as RGB 0-255, as
// RGB 0.0-1.0, or as stylesheet-appropriate #-prefixed colors).
var integerPalette = [
[ 0x20, 0xB2, 0xAA ],
[ 0x9A, 0xCD, 0x32 ],
[ 0xFF, 0x8C, 0x00 ],
[ 0xD2, 0xB4, 0x8C ],
[ 0x40, 0xE0, 0xD0 ],
[ 0x41, 0x69, 0xFF ],
[ 0xFF, 0xD7, 0x00 ],
[ 0x6A, 0x5A, 0xCD ],
[ 0xEE, 0x82, 0xEE ],
[ 0xCC, 0x99, 0x66 ],
[ 0x99, 0xCC, 0xCC ],
[ 0x66, 0xCC, 0x33 ],
[ 0xFF, 0xCC, 0x00 ],
[ 0xFF, 0x66, 0x33 ],
[ 0xCC, 0x66, 0xFF ],
[ 0xFF, 0x00, 0x66 ],
[ 0xFF, 0xFF, 0x00 ],
[ 0x80, 0x00, 0x80 ],
[ 0x00, 0x86, 0x8B ],
[ 0x00, 0x8A, 0x00 ],
[ 0xFF, 0x00, 0x00 ],
[ 0x00, 0x00, 0xFF ],
[ 0xF5, 0xDE, 0xB3 ],
[ 0xBC, 0x8F, 0x8F ],
[ 0x46, 0x82, 0xB4 ],
[ 0xFF, 0xAF, 0xAF ],
[ 0x43, 0xCD, 0x80 ],
[ 0xCD, 0xC1, 0xC5 ],
[ 0xA0, 0x52, 0x2D ],
[ 0x64, 0x95, 0xED ]
[0x20, 0xB2, 0xAA],
[0x9A, 0xCD, 0x32],
[0xFF, 0x8C, 0x00],
[0xD2, 0xB4, 0x8C],
[0x40, 0xE0, 0xD0],
[0x41, 0x69, 0xFF],
[0xFF, 0xD7, 0x00],
[0x6A, 0x5A, 0xCD],
[0xEE, 0x82, 0xEE],
[0xCC, 0x99, 0x66],
[0x99, 0xCC, 0xCC],
[0x66, 0xCC, 0x33],
[0xFF, 0xCC, 0x00],
[0xFF, 0x66, 0x33],
[0xCC, 0x66, 0xFF],
[0xFF, 0x00, 0x66],
[0xFF, 0xFF, 0x00],
[0x80, 0x00, 0x80],
[0x00, 0x86, 0x8B],
[0x00, 0x8A, 0x00],
[0xFF, 0x00, 0x00],
[0x00, 0x00, 0xFF],
[0xF5, 0xDE, 0xB3],
[0xBC, 0x8F, 0x8F],
[0x46, 0x82, 0xB4],
[0xFF, 0xAF, 0xAF],
[0x43, 0xCD, 0x80],
[0xCD, 0xC1, 0xC5],
[0xA0, 0x52, 0x2D],
[0x64, 0x95, 0xED]
], stringPalette = integerPalette.map(function (arr) {
// Convert to # notation for use in styles
return '#' + arr.map(function (c) {

View File

@@ -50,8 +50,8 @@ define(
// For other stacks, do a push, but repeat
// their current range axis bounds.
stack.pushPanZoom(
[ origin[0], stack.getOrigin()[1] ],
[ dimensions[0], stack.getDimensions()[1] ]
[origin[0], stack.getOrigin()[1]],
[dimensions[0], stack.getDimensions()[1]]
);
}
});

View File

@@ -60,7 +60,7 @@ define(
// Note that range is reversed from the y-axis in pixel space
//(positive range points up, positive pixel-y points down)
this.position =
[ x / width, (height - y) / height ].map(convert);
[x / width, (height - y) / height].map(convert);
}
}

View File

@@ -27,7 +27,9 @@
define(
function () {
function identity(x) { return x; }
function identity(x) {
return x;
}
/**
* The PlotPreparer is responsible for handling data sets and

View File

@@ -71,7 +71,7 @@ define(
// Used in the reduce step of updateExtrema
function reduceExtrema(a, b) {
return [ Math.min(a[0], b[0]), Math.max(a[1], b[1]) ];
return [Math.min(a[0], b[0]), Math.max(a[1], b[1])];
}
// Convert a domain/range extrema to plot dimensions
@@ -173,9 +173,9 @@ define(
}).reduce(reduceExtrema);
// Calculate best-fit dimensions
this.dimensions = [ this.domainExtrema, this.rangeExtrema ]
this.dimensions = [this.domainExtrema, this.rangeExtrema]
.map(dimensionsOf);
this.origin = [ this.domainExtrema, this.rangeExtrema ]
this.origin = [this.domainExtrema, this.rangeExtrema]
.map(originOf);
// Enforce some minimum visible area

View File

@@ -89,7 +89,7 @@ define(
*/
function PlotModeOptions(telemetryObjects, subPlotFactory) {
this.options = telemetryObjects.length > 1 ?
[ OVERLAID, STACKED ] : [ OVERLAID ];
[OVERLAID, STACKED] : [OVERLAID];
this.mode = this.options[0]; // Initial selection (overlaid)
this.telemetryObjects = telemetryObjects;
this.subPlotFactory = subPlotFactory;

View File

@@ -38,7 +38,7 @@ define(
telemetryObjects,
this.panZoomStack
);
this.subplots = [ this.subplot ];
this.subplots = [this.subplot];
}
PlotOverlayMode.prototype.plotTelemetry = function (updater) {