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
dbc5fa01
Commit
dbc5fa01
authored
Apr 04, 2023
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Grijalva charts
parent
bad755f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
index.html
public/grijalva/index.html
+8
-8
grijalva_functions.js
public/js/grijalva_functions.js
+5
-1
No files found.
public/grijalva/index.html
View file @
dbc5fa01
...
@@ -115,28 +115,28 @@
...
@@ -115,28 +115,28 @@
<div
class=
"row h-50 border-bottom"
>
<div
class=
"row h-50 border-bottom"
>
<div
class=
"col-6 border-right"
>
<div
class=
"col-6 border-right"
>
<div
class=
"row h-100"
>
<div
class=
"row h-100"
>
<div
id=
"area-graph"
class=
"w-100"
></div>
<div
id=
"area-graph"
></div>
<div
id=
"radarChart"
class=
"w-100"
></div>
<div
id=
"radarChart"
></div>
</div>
</div>
</div>
</div>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
<div
class=
"row h-100"
>
<div
class=
"row h-100"
>
<div
id=
"perimeter-graph"
class=
"w-100"
></div>
<div
id=
"perimeter-graph"
></div>
<div
id=
"lineChart"
class=
"w-100"
></div>
<div
id=
"lineChart"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row h-50"
>
<div
class=
"row h-50"
>
<div
class=
"col-6 border-right"
>
<div
class=
"col-6 border-right"
>
<div
class=
"row h-100"
>
<div
class=
"row h-100"
>
<div
id=
"costa-graph"
class=
"w-100"
></div>
<div
id=
"costa-graph"
></div>
<div
id=
"areaChart"
class=
"w-100"
></div>
<div
id=
"areaChart"
></div>
</div>
</div>
</div>
</div>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
<div
class=
"row h-100"
>
<div
class=
"row h-100"
>
<div
id=
"df-graph"
class=
"w-100"
></div>
<div
id=
"df-graph"
></div>
<div
id=
"barChart"
class=
"w-100"
></div>
<div
id=
"barChart"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
public/js/grijalva_functions.js
View file @
dbc5fa01
...
@@ -379,6 +379,8 @@ const populateMap = async (mapData) => {
...
@@ -379,6 +379,8 @@ const populateMap = async (mapData) => {
// Highlight plot title according to selected option
// Highlight plot title according to selected option
let
option
=
$
(
"#indicatorSelect"
).
val
();
// option selected from dropdrown
let
option
=
$
(
"#indicatorSelect"
).
val
();
// option selected from dropdrown
d3
.
select
(
indicatorVars
[
option
].
container
).
select
(
"svg text.title"
).
classed
(
"active"
,
true
);
d3
.
select
(
indicatorVars
[
option
].
container
).
select
(
"svg text.title"
).
classed
(
"active"
,
true
);
$
(
`
${
indicatorVars
[
indicator
].
container
}
`
).
css
(
"width"
,
indicatorVars
[
indicator
].
chart
.
width
());
});
});
...
@@ -455,7 +457,7 @@ const populateMap = async (mapData) => {
...
@@ -455,7 +457,7 @@ const populateMap = async (mapData) => {
makeBaseMap
();
// basemap.js
makeBaseMap
();
// basemap.js
// fix for leaflet-mapbox-gl v. 0.0.11 that adds map's to tile pane:
// fix for leaflet-mapbox-gl v. 0.0.11 that adds map's to tile pane:
// get children of map tile pane, create array from it and iterate
// get children of map tile pane, create array from it and iterate
// setting their z-index
// setting their z-index
let
glmapChildren
=
map
.
getPanes
().
tilePane
.
children
,
let
glmapChildren
=
map
.
getPanes
().
tilePane
.
children
,
children
=
Array
.
from
(
glmapChildren
);
children
=
Array
.
from
(
glmapChildren
);
...
@@ -526,12 +528,14 @@ const updateCharts = async () => {
...
@@ -526,12 +528,14 @@ const updateCharts = async () => {
let
allData
=
await
getDataInSelection
();
let
allData
=
await
getDataInSelection
();
indicators
.
map
(
async
indicator
=>
{
indicators
.
map
(
async
indicator
=>
{
indicatorVars
[
indicator
].
chart
.
data
(
summarizeData
(
allData
,
indicator
)
);
indicatorVars
[
indicator
].
chart
.
data
(
summarizeData
(
allData
,
indicator
)
);
$
(
`
${
indicatorVars
[
indicator
].
container
}
`
).
css
(
"width"
,
indicatorVars
[
indicator
].
chart
.
width
());
});
});
}
else
{
}
else
{
// otherwise use all data
// otherwise use all data
let
allData
=
await
getData
();
let
allData
=
await
getData
();
indicators
.
map
(
async
indicator
=>
{
indicators
.
map
(
async
indicator
=>
{
indicatorVars
[
indicator
].
chart
.
data
(
allData
[
indicator
]);
indicatorVars
[
indicator
].
chart
.
data
(
allData
[
indicator
]);
$
(
`
${
indicatorVars
[
indicator
].
container
}
`
).
css
(
"width"
,
indicatorVars
[
indicator
].
chart
.
width
());
});
});
}
}
$
(
".loader"
).
hide
(
"fade"
,
750
);
$
(
".loader"
).
hide
(
"fade"
,
750
);
...
...
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