virool-pivot
Version:
A web-based exploratory visualization UI for Druid.io
327 lines (326 loc) • 10.8 kB
HTML
<html lang="en">
<head>
<title>Code coverage report for common/models/drag-position/drag-position.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../prettify.css" />
<link rel="stylesheet" href="../../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../../index.html">all files</a> / <a href="index.html">common/models/drag-position/</a> drag-position.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">70% </span>
<span class="quiet">Statements</span>
<span class='fraction'>35/50</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">64% </span>
<span class="quiet">Branches</span>
<span class='fraction'>16/25</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70% </span>
<span class="quiet">Lines</span>
<span class='fraction'>35/50</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">27×</span>
<span class="cline-any cline-yes">27×</span>
<span class="cline-any cline-yes">27×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">41×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">23×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">24×</span>
<span class="cline-any cline-yes">24×</span>
<span class="cline-any cline-yes">12×</span>
<span class="cline-any cline-yes">24×</span>
<span class="cline-any cline-yes">12×</span>
<span class="cline-any cline-yes">24×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">34×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">"use strict";
var immutable_class_1 = require('immutable-class');
var general_1 = require('../../utils/general/general');
var check;
var DragPosition = (function () {
function DragPosition(parameters) {
this.insert = general_1.hasOwnProperty(parameters, 'insert') ? parameters.insert : null;
this.replace = general_1.hasOwnProperty(parameters, 'replace') ? parameters.replace : null;
<span class="missing-if-branch" title="if path not taken" >I</span>if (this.insert == null && this.replace == null)
<span class="cstat-no" title="statement not covered" > throw new Error('invalid drag position');</span>
}
DragPosition.isDragPosition = function (candidate) {
return immutable_class_1.isInstanceOf(candidate, DragPosition);
};
DragPosition.calculateFromOffset = <span class="fstat-no" title="function not covered" >function (offset, numItems, itemWidth, itemGap) {</span>
<span class="cstat-no" title="statement not covered" > if (!numItems) {</span>
<span class="cstat-no" title="statement not covered" > return new DragPosition({</span>
replace: 0
});
}
<span class="cstat-no" title="statement not covered" > if (offset < 0) {</span>
<span class="cstat-no" title="statement not covered" > return new DragPosition({</span>
insert: 0
});
}
<span class="cstat-no" title="statement not covered" > var sectionWidth = itemWidth + itemGap;</span>
<span class="cstat-no" title="statement not covered" > var sectionNumber = Math.floor(offset / sectionWidth);</span>
<span class="cstat-no" title="statement not covered" > if (numItems <= sectionNumber) {</span>
<span class="cstat-no" title="statement not covered" > return new DragPosition({</span>
replace: numItems
});
}
<span class="cstat-no" title="statement not covered" > var offsetWithinSection = offset - sectionWidth * sectionNumber;</span>
<span class="cstat-no" title="statement not covered" > if (offsetWithinSection < itemWidth) {</span>
<span class="cstat-no" title="statement not covered" > return new DragPosition({</span>
replace: sectionNumber
});
}
else {
<span class="cstat-no" title="statement not covered" > return new DragPosition({</span>
insert: sectionNumber + 1
});
}
};
DragPosition.fromJS = function (parameters) {
return new DragPosition(parameters);
};
DragPosition.prototype.valueOf = function () {
return {
insert: this.insert,
replace: this.replace
};
};
DragPosition.prototype.toJS = function () {
var js = {};
if (this.insert != null)
js.insert = this.insert;
if (this.replace != null)
js.replace = this.replace;
return js;
};
DragPosition.prototype.toJSON = function () {
return this.toJS();
};
DragPosition.prototype.toString = function () {
if (this.insert != null) {
return "[insert " + this.insert + "]";
}
else {
return "[replace " + this.replace + "]";
}
};
DragPosition.prototype.equals = function (other) {
return DragPosition.isDragPosition(other) &&
this.insert === other.insert &&
this.replace === other.replace;
};
DragPosition.prototype.isInsert = <span class="fstat-no" title="function not covered" >function () {</span>
<span class="cstat-no" title="statement not covered" > return this.insert !== null;</span>
};
DragPosition.prototype.isReplace = <span class="fstat-no" title="function not covered" >function () {</span>
<span class="cstat-no" title="statement not covered" > return this.replace !== null;</span>
};
return DragPosition;
}());
exports.DragPosition = DragPosition;
check = DragPosition;
</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Apr 28 2016 10:31:22 GMT-0700 (PDT)
</div>
</div>
<script src="../../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../../sorter.js"></script>
</body>
</html>