@google/earthengine 0.1.415 → 0.1.417
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/browser.js +1038 -370
- package/build/ee_api_js.js +605 -603
- package/build/ee_api_js_debug.js +1015 -347
- package/build/ee_api_js_npm.js +1038 -370
- package/build/main.js +1038 -370
- package/package.json +1 -1
- package/src/apiclient.js +1 -1
- package/src/examples/UserInterface/OceanTimeseriesInvestigator.js +35 -19
package/package.json
CHANGED
package/src/apiclient.js
CHANGED
|
@@ -24,7 +24,7 @@ const {trustedResourceUrl} = goog.require('safevalues');
|
|
|
24
24
|
/** @namespace */
|
|
25
25
|
const apiclient = {};
|
|
26
26
|
|
|
27
|
-
const API_CLIENT_VERSION = '0.1.
|
|
27
|
+
const API_CLIENT_VERSION = '0.1.417';
|
|
28
28
|
|
|
29
29
|
exports.VERSION = apiVersion.VERSION;
|
|
30
30
|
exports.API_CLIENT_VERSION = API_CLIENT_VERSION;
|
|
@@ -52,8 +52,14 @@ inspectorPanel.add(ui.Label('[Legend]'));
|
|
|
52
52
|
* Chart setup
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
+
// Displays the given UI component (a chart or a message) in the inspector
|
|
56
|
+
// panel, at the position of the chart.
|
|
57
|
+
var displayChart = function(component) {
|
|
58
|
+
inspectorPanel.widgets().set(2, component);
|
|
59
|
+
}
|
|
60
|
+
|
|
55
61
|
// Generates a new time series chart of SST for the given coordinates.
|
|
56
|
-
var generateChart = function
|
|
62
|
+
var generateChart = function(coords) {
|
|
57
63
|
// Update the lon/lat panel with values from the click event.
|
|
58
64
|
lon.setValue('lon: ' + coords.lon.toFixed(2));
|
|
59
65
|
lat.setValue('lat: ' + coords.lat.toFixed(2));
|
|
@@ -65,25 +71,35 @@ var generateChart = function (coords) {
|
|
|
65
71
|
mapPanel.layers().set(1, dot);
|
|
66
72
|
|
|
67
73
|
// Make a chart from the time series.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
displayChart(ui.Label('Processing location...', {'height': '200px'}));
|
|
75
|
+
var selectionSize = composite.sampleRegions(point).size();
|
|
76
|
+
selectionSize.evaluate(function(size) {
|
|
77
|
+
if (!size) {
|
|
78
|
+
var badSelection = ui.Label(
|
|
79
|
+
'Invalid location. Please select a different location',
|
|
80
|
+
{'color': 'red', 'height': '200px'});
|
|
81
|
+
displayChart(badSelection);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
var sstChart = ui.Chart.image.series(sst, point, ee.Reducer.mean(), 500);
|
|
85
|
+
|
|
86
|
+
// Customize the chart.
|
|
87
|
+
sstChart.setOptions({
|
|
88
|
+
title: 'Sea surface temp: time series',
|
|
89
|
+
vAxis: {title: 'Temp (C)'},
|
|
90
|
+
hAxis: {title: 'Date', format: 'MM-yy', gridlines: {count: 7}},
|
|
91
|
+
series: {
|
|
92
|
+
0: {
|
|
93
|
+
color: 'blue',
|
|
94
|
+
lineWidth: 0,
|
|
95
|
+
pointsVisible: true,
|
|
96
|
+
pointSize: 2,
|
|
97
|
+
},
|
|
81
98
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
inspectorPanel.widgets().set(2, sstChart);
|
|
99
|
+
legend: {position: 'right'},
|
|
100
|
+
});
|
|
101
|
+
displayChart(sstChart);
|
|
102
|
+
})
|
|
87
103
|
};
|
|
88
104
|
|
|
89
105
|
|