Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
2b206cd2
Commit
2b206cd2
authored
6 years ago
by
Esko Ikkala
Browse files
Options
Downloads
Patches
Plain Diff
Add pie chart to analysis view
parent
6fa128bb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/client/components/Pie.js
+3
-0
3 additions, 0 deletions
src/client/components/Pie.js
src/client/containers/MapApp.js
+31
-30
31 additions, 30 deletions
src/client/containers/MapApp.js
with
34 additions
and
30 deletions
src/client/components/Pie.js
+
3
−
0
View file @
2b206cd2
...
...
@@ -65,6 +65,9 @@ const combineSmallGroups = (dataArray) => {
let
Pie
=
(
props
)
=>
{
const
{
classes
,
data
,
query
}
=
props
;
const
resultCount
=
data
.
length
;
if
(
resultCount
<
1
)
{
return
''
;
}
const
grouped
=
_
.
groupBy
(
data
,
'
typeLabel
'
);
let
dataArray
=
[];
for
(
let
key
in
grouped
)
{
...
...
This diff is collapsed.
Click to expand it.
src/client/containers/MapApp.js
+
31
−
30
View file @
2b206cd2
...
...
@@ -11,6 +11,7 @@ import Grid from '@material-ui/core/Grid';
import
Immutable
from
'
immutable
'
;
import
VirtualizedTable
from
'
../components/VirtualizedTable
'
;
import
LeafletMap
from
'
../components/map/LeafletMap
'
;
import
Pie
from
'
../components/Pie
'
;
import
{
getVisibleResults
,
...
...
@@ -55,6 +56,9 @@ const styles = theme => ({
mainContainer
:
{
marginTop
:
64
,
height
:
'
calc(100% - 64px)
'
},
map
:
{
height
:
'
50%
'
}
});
...
...
@@ -62,34 +66,6 @@ let MapApp = (props) => {
const
{
classes
,
error
,
analysisView
}
=
props
;
console
.
log
(
props
.
results
);
const
resultsSection
=
(
<
VirtualizedTable
list
=
{
Immutable
.
List
(
props
.
results
)}
resultValues
=
{
props
.
resultValues
}
search
=
{
props
.
search
}
sortResults
=
{
props
.
sortResults
}
toggleDataset
=
{
props
.
toggleDataset
}
updateResultsFilter
=
{
props
.
updateResultsFilter
}
updateQuery
=
{
props
.
updateQuery
}
fetchResults
=
{
props
.
fetchResults
}
clearResults
=
{
props
.
clearResults
}
fetchSuggestions
=
{
props
.
fetchSuggestions
}
clearSuggestions
=
{
props
.
clearSuggestions
}
updateResultFormat
=
{
props
.
updateResultFormat
}
analysisView
=
{
props
.
analysisView
}
/
>
);
//resultsView = <Pie data={props.results} query={props.search.query} />;
const
map
=
(
<
LeafletMap
sliderValue
=
{
100
}
results
=
{
props
.
results
}
geoJSON
=
{
props
.
geoJSON
}
geoJSONKey
=
{
props
.
geoJSONKey
}
getGeoJSON
=
{
props
.
getGeoJSON
}
/
>
);
return
(
<
div
className
=
{
classes
.
root
}
>
<
div
className
=
{
classes
.
appFrame
}
>
...
...
@@ -105,10 +81,35 @@ let MapApp = (props) => {
<
/AppBar
>
<
Grid
container
className
=
{
classes
.
mainContainer
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
analysisView
?
8
:
4
}
>
{
resultsSection
}
<
VirtualizedTable
list
=
{
Immutable
.
List
(
props
.
results
)}
resultValues
=
{
props
.
resultValues
}
search
=
{
props
.
search
}
sortResults
=
{
props
.
sortResults
}
toggleDataset
=
{
props
.
toggleDataset
}
updateResultsFilter
=
{
props
.
updateResultsFilter
}
updateQuery
=
{
props
.
updateQuery
}
fetchResults
=
{
props
.
fetchResults
}
clearResults
=
{
props
.
clearResults
}
fetchSuggestions
=
{
props
.
fetchSuggestions
}
clearSuggestions
=
{
props
.
clearSuggestions
}
updateResultFormat
=
{
props
.
updateResultFormat
}
analysisView
=
{
props
.
analysisView
}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
sm
=
{
analysisView
?
4
:
8
}
>
{
map
}
<
div
className
=
{
classes
.
map
}
>
<
LeafletMap
sliderValue
=
{
100
}
results
=
{
props
.
results
}
geoJSON
=
{
props
.
geoJSON
}
geoJSONKey
=
{
props
.
geoJSONKey
}
getGeoJSON
=
{
props
.
getGeoJSON
}
/
>
<
/div
>
<
div
className
=
{
classes
.
map
}
>
<
Pie
data
=
{
props
.
results
}
query
=
{
props
.
search
.
query
}
/
>
<
/div
>
<
/Grid
>
<
/Grid
>
<
/div
>
...
...
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