Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fordecyt_2019
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodrigo Tapia-McClung
fordecyt_2019
Commits
4a13c3ed
Commit
4a13c3ed
authored
Sep 03, 2019
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loader mask for async requests. Clean up console.logs
parent
6ac7e518
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
grijalva_charts.js
public/js/grijalva_charts.js
+0
-1
grijalva_functions.js
public/js/grijalva_functions.js
+5
-3
No files found.
public/js/grijalva_charts.js
View file @
4a13c3ed
...
@@ -106,7 +106,6 @@ const summarizeData = (allData, indicator) => {
...
@@ -106,7 +106,6 @@ const summarizeData = (allData, indicator) => {
});
});
// order data[i].values.date
// order data[i].values.date
data
.
forEach
(
d
=>
d
.
values
.
sort
(
sortByDateAscending
));
data
.
forEach
(
d
=>
d
.
values
.
sort
(
sortByDateAscending
));
console
.
log
(
data
)
return
data
;
return
data
;
}
}
...
...
public/js/grijalva_functions.js
View file @
4a13c3ed
...
@@ -305,7 +305,7 @@ const setupMap = (dates) => {
...
@@ -305,7 +305,7 @@ const setupMap = (dates) => {
return
refMap
.
unproject
(
pt
,
zoom
);
return
refMap
.
unproject
(
pt
,
zoom
);
}
}
console
.
log
(
userFiles
);
//
console.log(userFiles);
// query db to get min/max values per month and indicator and store them in an object
// query db to get min/max values per month and indicator and store them in an object
queryFiles
().
then
(
minmax
=>
{
queryFiles
().
then
(
minmax
=>
{
minmax
.
map
(
minmaxMonth
=>
{
minmax
.
map
(
minmaxMonth
=>
{
...
@@ -451,7 +451,7 @@ const populateMap = async (mapData) => {
...
@@ -451,7 +451,7 @@ const populateMap = async (mapData) => {
}
}
const
updateMap
=
(
mapData
)
=>
{
const
updateMap
=
(
mapData
)
=>
{
console
.
log
(
userFiles
);
//
console.log(userFiles);
// clear tiles
// clear tiles
currentTiles
=
{};
currentTiles
=
{};
...
@@ -506,6 +506,7 @@ const updateMap = (mapData) => {
...
@@ -506,6 +506,7 @@ const updateMap = (mapData) => {
const
updateCharts
=
async
()
=>
{
const
updateCharts
=
async
()
=>
{
$
(
".loader"
).
css
(
"display"
,
"block"
);
// TODO: add mask while fetching async data
// TODO: add mask while fetching async data
// if user has drawn polygons, update chart with data inside selection
// if user has drawn polygons, update chart with data inside selection
if
(
drawnItems
.
toGeoJSON
().
features
.
length
!=
0
)
{
if
(
drawnItems
.
toGeoJSON
().
features
.
length
!=
0
)
{
...
@@ -520,6 +521,7 @@ const updateCharts = async () => {
...
@@ -520,6 +521,7 @@ const updateCharts = async () => {
indicatorVars
[
indicator
].
chart
.
data
(
allData
[
indicator
]);
indicatorVars
[
indicator
].
chart
.
data
(
allData
[
indicator
]);
});
});
}
}
$
(
".loader"
).
hide
(
"fade"
,
750
);
}
}
// define MVT layer for given month table and all indicators
// define MVT layer for given month table and all indicators
...
@@ -656,7 +658,7 @@ L.TimeDimension.Layer.Tile = L.TimeDimension.Layer.extend({
...
@@ -656,7 +658,7 @@ L.TimeDimension.Layer.Tile = L.TimeDimension.Layer.extend({
});
});
//console.time("process");
//console.time("process");
console
.
log
(
"data for"
,
monthYear
);
//
console.log("data for", monthYear);
//console.log(currentTiles)
//console.log(currentTiles)
Object
.
keys
(
allTiles
).
forEach
(
layer
=>
{
Object
.
keys
(
allTiles
).
forEach
(
layer
=>
{
if
(
layer
!==
monthYear
)
{
// hide all other months
if
(
layer
!==
monthYear
)
{
// hide all other months
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment