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
5311a658
Commit
5311a658
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: test colors
parent
f94c0b61
No related branches found
Branches containing commit
No related tags found
1 merge request
!7
Clhp map
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/lib/pages/widgets/cloropleth_map.dart
+11
-7
11 additions, 7 deletions
app/lib/pages/widgets/cloropleth_map.dart
with
11 additions
and
7 deletions
app/lib/pages/widgets/cloropleth_map.dart
+
11
−
7
View file @
5311a658
...
...
@@ -35,6 +35,13 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
late
MapShapeSource
mapShapeSource
;
late
final
MapZoomPanBehavior
_zoomPanBehavior
=
MapZoomPanBehavior
();
List
<
IceThicknessModel
>
iceThicknessList
=
<
IceThicknessModel
>[];
List
<
Color
>
testColors
=
[
// NB test color
const
Color
(
0xff8a003b
),
const
Color
(
0xff8a4300
),
const
Color
(
0xff8a7a00
),
const
Color
(
0xff538a00
),
const
Color
(
0xff007b8a
),
];
@override
void
initState
()
{
...
...
@@ -42,11 +49,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
final
Random
random
=
Random
();
for
(
int
i
=
0
;
i
<
=
120
;
i
++
)
{
int
red
=
random
.
nextInt
(
256
);
int
green
=
random
.
nextInt
(
256
);
int
blue
=
random
.
nextInt
(
256
);
Color
randomColor
=
Color
.
fromRGBO
(
red
,
green
,
blue
,
1
);
int
ran
=
random
.
nextInt
(
4
);
// NB test color
Color
randomColor
=
testColors
[
ran
];
int
randomNumber
=
random
.
nextInt
(
21
);
// 0 -> 20, NB: temp test data
iceThicknessList
.
add
(
IceThicknessModel
(
i
.
toString
(),
randomNumber
,
randomColor
));
...
...
@@ -68,8 +72,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
shapeColorValueMapper:
(
int
index
)
=
>
iceThicknessList
[
index
]
.
color
,
),
//color: Colors.blue.shade400, // Map color
//
zoomPanBehavior: _zoomPanBehavior,
//
strokeColor: Colors.black,
zoomPanBehavior:
_zoomPanBehavior
,
strokeColor:
Colors
.
black
,
// Shape selection
selectedIndex:
selectedIndex
,
onSelectionChanged:
(
int
index
)
{
...
...
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