Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
earth-in-flux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Water Mission Area
VizLab
earth-in-flux
Commits
28634fa4
Commit
28634fa4
authored
6 months ago
by
Hayley Corson-Dosch
Browse files
Options
Downloads
Patches
Plain Diff
sort cards for project pages
parent
8c42fbac
No related branches found
No related tags found
2 merge requests
!39
Althea beaufort refinement
,
!37
Re org
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/assets/content/ChartGrid.js
+6
-0
6 additions, 0 deletions
src/assets/content/ChartGrid.js
src/components/ChartGrid.vue
+6
-6
6 additions, 6 deletions
src/components/ChartGrid.vue
with
12 additions
and
6 deletions
src/assets/content/ChartGrid.js
+
6
−
0
View file @
28634fa4
...
...
@@ -9,6 +9,7 @@ export default {
vizRoute
:
'
inland-fish-threats
'
,
img_src
:
'
ThreatBumpChart_thumbnail.png
'
,
alt
:
''
,
chartOrder
:
1
,
description
:
'
Inland fisheries are threatened.
'
},
{
...
...
@@ -18,6 +19,7 @@ export default {
vizRoute
:
'
glacier-scan
'
,
img_src
:
'
glacial_xray_thumbnail.png
'
,
alt
:
''
,
chartOrder
:
1
,
description
:
'
Researchers are studying glacial ice.
'
},
{
...
...
@@ -27,6 +29,7 @@ export default {
vizRoute
:
'
inland-rec-fish-value
'
,
img_src
:
'
circle-pack-thumbnail.png
'
,
alt
:
''
,
chartOrder
:
1
,
description
:
'
Inland recreational fishing contributes economic value.
'
},
{
...
...
@@ -36,6 +39,7 @@ export default {
vizRoute
:
'
beaufort-sea-ice-coring
'
,
img_src
:
'
BeaufortSeaCore_thumbnail.PNG
'
,
alt
:
''
,
chartOrder
:
1
,
description
:
'
Sediment cores can help build past and present climates.
'
},
{
...
...
@@ -45,6 +49,7 @@ export default {
vizRoute
:
'
beaufort-sea-species
'
,
img_src
:
'
BeaufortSeaSpecies_thumbnail.png
'
,
alt
:
''
,
chartOrder
:
2
,
description
:
'
Microfossils can be used to indicate these changes.
'
},
{
...
...
@@ -54,6 +59,7 @@ export default {
vizRoute
:
'
beaufort-sea-timeline
'
,
img_src
:
'
BeaufortSeaTimeline_thumbnail.PNG
'
,
alt
:
''
,
chartOrder
:
3
,
description
:
'
Communities of microorganisms on the sea floor are affected.
'
}
]
...
...
This diff is collapsed.
Click to expand it.
src/components/ChartGrid.vue
+
6
−
6
View file @
28634fa4
<
template
>
<div
id=
"chartGrid"
class=
"padded"
>
<ChartCard
@
click.enter=
"showSubPage(item.project, item.vizRoute)"
v-for=
"(item, index) in
randomiz
edChartContent"
:key=
"index"
<ChartCard
@
click.enter=
"showSubPage(item.project, item.vizRoute)"
v-for=
"(item, index) in
sort
edChartContent"
:key=
"index"
:id=
"item.vizRoute"
:src=
"getThumb(item.img_src)"
:alt=
"item.alt"
...
...
@@ -31,12 +31,12 @@
// set up filtered chart data as computed property
const
filteredChartContent
=
computed
(()
=>
{
return
props
.
view
==
'
all
'
?
chartContent
:
chartContent
.
filter
(
d
=>
d
.
project
.
replace
(
/
\s
+/g
,
'
-
'
).
toLowerCase
()
===
props
.
view
)
return
props
.
view
==
'
all
'
?
chartContent
:
chartContent
.
filter
(
d
=>
d
.
project
.
replace
(
/
\s
+/g
,
'
-
'
).
toLowerCase
()
===
props
.
view
)
.
sort
((
a
,
b
)
=>
(
a
.
chartOrder
>
b
.
chartOrder
)
?
1
:
((
b
.
chartOrder
>
a
.
chartOrder
)
?
-
1
:
0
))
});
// computed property for randomized chart content
const
randomiz
edChartContent
=
computed
(()
=>
{
return
shuffle
([...
filteredChartContent
.
value
]);
// clone array to avoid mutating original
// computed property for randomized chart content
- only randomized on landing view
const
sort
edChartContent
=
computed
(()
=>
{
return
props
.
view
==
'
all
'
?
shuffle
([...
filteredChartContent
.
value
])
:
filteredChartContent
.
value
;
// clone array to avoid mutating original
});
// Declare behavior on mounted
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment