Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
4a5debef
Commit
4a5debef
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: sort of working group ID rendering?
parent
60fc7af0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/data_classes.dart
+3
-0
3 additions, 0 deletions
app/lib/data_classes.dart
app/lib/widgets/choropleth_map.dart
+7
-9
7 additions, 9 deletions
app/lib/widgets/choropleth_map.dart
with
10 additions
and
9 deletions
app/lib/data_classes.dart
+
3
−
0
View file @
4a5debef
...
@@ -34,6 +34,7 @@ class Measurement {
...
@@ -34,6 +34,7 @@ class Measurement {
class
SubDiv
{
class
SubDiv
{
String
sub_div_id
;
String
sub_div_id
;
int
groupID
;
int
groupID
;
String
group_id
;
double
minThickness
;
double
minThickness
;
double
avgThickness
;
double
avgThickness
;
LatLng
center
;
LatLng
center
;
...
@@ -44,6 +45,7 @@ class SubDiv {
...
@@ -44,6 +45,7 @@ class SubDiv {
SubDiv
({
SubDiv
({
required
this
.
sub_div_id
,
required
this
.
sub_div_id
,
required
this
.
groupID
,
required
this
.
groupID
,
required
this
.
group_id
,
required
this
.
minThickness
,
required
this
.
minThickness
,
required
this
.
avgThickness
,
required
this
.
avgThickness
,
required
this
.
center
,
required
this
.
center
,
...
@@ -56,6 +58,7 @@ class SubDiv {
...
@@ -56,6 +58,7 @@ class SubDiv {
return
SubDiv
(
return
SubDiv
(
sub_div_id:
json
[
'SubdivID'
]
.
toString
(),
sub_div_id:
json
[
'SubdivID'
]
.
toString
(),
groupID:
json
[
'GroupID'
],
groupID:
json
[
'GroupID'
],
group_id:
''
,
// Initialise empty, will be set later
minThickness:
json
[
'MinThickness'
],
minThickness:
json
[
'MinThickness'
],
avgThickness:
json
[
'AvgThickness'
],
avgThickness:
json
[
'AvgThickness'
],
center:
LatLng
(
json
[
'CenLatitude'
],
json
[
'CenLongitude'
]),
center:
LatLng
(
json
[
'CenLatitude'
],
json
[
'CenLongitude'
]),
...
...
This diff is collapsed.
Click to expand it.
app/lib/widgets/choropleth_map.dart
+
7
−
9
View file @
4a5debef
...
@@ -46,24 +46,22 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
...
@@ -46,24 +46,22 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
super
.
initState
();
super
.
initState
();
// Extract all subdivisions from list of measurements
// Extract all subdivisions from list of measurements
for
(
Measurement
measurement
in
widget
.
measurements
)
{
for
(
Measurement
measurement
in
widget
.
measurements
)
{
String
measurement_id
=
measurement
.
measurementID
.
toString
();
for
(
SubDiv
subdivision
in
measurement
.
subDivs
)
{
for
(
SubDiv
subdivision
in
measurement
.
subDivs
)
{
// Construct concatenated group ID for rendering of groups
subdivision
.
group_id
=
measurement_id
+
"-"
+
subdivision
.
groupID
.
toString
();
print
(
"Constructued groupID:
${subdivision.group_id}
"
);
subdivisions
.
add
(
subdivision
);
subdivisions
.
add
(
subdivision
);
}
}
};
}
// ?Should the map be pre-divided into groups?
// Parse relation to json
// Make a list of key value pairs (key: groupID, value: appended shapes)
// Parse back to Uint8list
// Initialise data source
// Initialise data source
dataSource
=
MapShapeSource
.
memory
(
dataSource
=
MapShapeSource
.
memory
(
widget
.
relation
,
widget
.
relation
,
shapeDataField:
'
sub_div
_id'
,
shapeDataField:
'
group
_id'
,
dataCount:
subdivisions
.
length
,
dataCount:
subdivisions
.
length
,
primaryValueMapper:
(
int
index
)
=
>
primaryValueMapper:
(
int
index
)
=
>
subdivisions
[
index
]
.
sub_div
_id
,
subdivisions
[
index
]
.
group
_id
,
shapeColorValueMapper:
(
int
index
)
=
>
shapeColorValueMapper:
(
int
index
)
=
>
subdivisions
[
index
]
.
avgThickness
,
// NB will later be minThickness, fix in server first
subdivisions
[
index
]
.
avgThickness
,
// NB will later be minThickness, fix in server first
shapeColorMappers:
const
[
shapeColorMappers:
const
[
...
...
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