Skip to content

Commit f919129

Browse files
committed
Add gps coordinates to compressed data levels
1 parent 5322441 commit f919129

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

InterSpec_resources/D3TimeChart.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
541541
// console.log(this.state.data.formatted);
542542
this.state.data.unzoomedCompressionIndex = compressionIndex;
543543
}
544+
console.log(this.state.data.formatted)
544545

545546
// set dimensions of svg element and plot
546547
this.svg.attr("width", this.state.width).attr("height", this.state.height);
@@ -777,6 +778,7 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
777778
// unnecessary check, but added to make it clear that if you wanted to add extra functionality to "simple gesture" mode, then you should handle things differently.
778779
// handle foreground or background selection
779780

781+
// only enable highlighting if brush forward, for more alignment with expected behavior
780782
if (lIdx < rIdx) {
781783
// Defined from docs on Wt::KeyboardModifier
782784
var keyModifierMap = {
@@ -2981,6 +2983,7 @@ D3TimeChart.prototype.compress = function (data, n) {
29812983
var HAS_OCCUPANCY_DATA = false;
29822984
var HAS_SOURCE_TYPE_DATA = false;
29832985
var HAS_START_TIME_DATA = false;
2986+
var HAS_GPS_COORD_DATA = false;
29842987

29852988
// Add optional fields:
29862989
if (data.hasOwnProperty("neutronCounts")) {
@@ -3006,6 +3009,11 @@ D3TimeChart.prototype.compress = function (data, n) {
30063009
HAS_START_TIME_DATA = true;
30073010
}
30083011

3012+
if (data.hasOwnProperty("gpsCoordinates")) {
3013+
out.gpsCoordinates = [];
3014+
HAS_GPS_COORD_DATA = true;
3015+
}
3016+
30093017
// iterate over array with window of size n
30103018
var length = data.sampleNumbers.length;
30113019

@@ -3036,6 +3044,10 @@ D3TimeChart.prototype.compress = function (data, n) {
30363044
if (HAS_SOURCE_TYPE_DATA) {
30373045
out.sourceTypes[outIdx] = data.sourceTypes[i];
30383046
}
3047+
if (HAS_GPS_COORD_DATA) {
3048+
// use GPS coordinate at the start of the compressed interval
3049+
out.gpsCoordinates[outIdx] = data.gpsCoordinates[i];
3050+
}
30393051
var j = 0;
30403052
while (j < n && i + j < length) {
30413053
if (

0 commit comments

Comments
 (0)