Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
Flutter App for Memri
Commits
0c10bba4
Commit
0c10bba4
authored
2 years ago
by
Koen van der Veen
Browse files
Options
Download
Email Patches
Plain Diff
opacity based on y, extra data
parent
a1f97b84
Pipeline
#11440
failed with stages
in 2 minutes and 1 second
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
lib/constants/app_settings.dart
+4
-0
lib/constants/app_settings.dart
lib/constants/app_settings.dart.prod
+3
-0
lib/constants/app_settings.dart.prod
lib/constants/app_settings.dart.qa
+3
-0
lib/constants/app_settings.dart.qa
lib/constants/app_settings.dart.uat
+3
-0
lib/constants/app_settings.dart.uat
lib/providers/importer_provider.dart
+2
-1
lib/providers/importer_provider.dart
lib/screens/workspace/apps/apps_plots_screen.dart
+22
-8
lib/screens/workspace/apps/apps_plots_screen.dart
lib/screens/workspace/apps/plot_contacts/contacts.dart
+23
-2
lib/screens/workspace/apps/plot_contacts/contacts.dart
with
60 additions
and
11 deletions
+60
-11
lib/constants/app_settings.dart
+
4
-
0
View file @
0c10bba4
...
...
@@ -38,6 +38,10 @@ class AppSettings {
final
String
twitterContainer
=
'registry.digitalocean.com/polis/memri-plugins:twitter-dev-latest'
;
///
final
String
sampleDataSetBranch
=
'dev'
;
/// Google Colab
final
String
colabLink
=
'https://githubtocolab.com/memri/colab-notebooks/blob/dev/nbs/finetune_model.ipynb'
;
...
...
This diff is collapsed.
Click to expand it.
lib/constants/app_settings.dart.prod
+
3
-
0
View file @
0c10bba4
...
...
@@ -42,6 +42,9 @@ class AppSettings {
final String colabLink =
'https://githubtocolab.com/memri/colab-notebooks/blob/main/nbs/finetune_model.ipynb';
///
final String sampleDataSetBranch = 'main';
/// DIO
final int dioConnectTimeout = 10000;
final int dioReceiveTimeout = 5000;
...
...
This diff is collapsed.
Click to expand it.
lib/constants/app_settings.dart.qa
+
3
-
0
View file @
0c10bba4
...
...
@@ -42,6 +42,9 @@ class AppSettings {
final String colabLink =
'https://githubtocolab.com/memri/colab-notebooks/blob/qa/nbs/finetune_model.ipynb';
///
final String sampleDataSetBranch = 'qa';
/// DIO
final int dioConnectTimeout = 10000;
final int dioReceiveTimeout = 5000;
...
...
This diff is collapsed.
Click to expand it.
lib/constants/app_settings.dart.uat
+
3
-
0
View file @
0c10bba4
...
...
@@ -42,6 +42,9 @@ class AppSettings {
final String colabLink =
'https://githubtocolab.com/memri/colab-notebooks/blob/uat/nbs/finetune_model.ipynb';
///
final String sampleDataSetBranch = 'uat';
/// DIO
final int dioConnectTimeout = 10000;
final int dioReceiveTimeout = 5000;
...
...
This diff is collapsed.
Click to expand it.
lib/providers/importer_provider.dart
+
2
-
1
View file @
0c10bba4
...
...
@@ -20,6 +20,7 @@ import 'package:memri/core/services/pod_service.dart';
import
'package:memri/providers/oauth_provider.dart'
;
import
'package:memri/providers/project_provider.dart'
;
import
'package:memri/utilities/extensions/collection.dart'
;
import
'package:memri/utilities/helpers/app_helper.dart'
;
class
_Result
{
final
List
<
Item
>
items
;
...
...
@@ -209,7 +210,7 @@ class ImporterProvider with ChangeNotifier {
final
fileContent
=
await
_gitlabService
.
getTextFileContent
(
projectPath:
'memri/sample-dataset'
,
filepath:
'output/output.json'
,
branch:
'main'
,
branch:
app
.
settings
.
sampleDataSetBranch
,
);
final
json
=
jsonDecode
(
fileContent
)
as
Map
<
String
,
dynamic
>;
...
...
This diff is collapsed.
Click to expand it.
lib/screens/workspace/apps/apps_plots_screen.dart
+
22
-
8
View file @
0c10bba4
...
...
@@ -212,6 +212,7 @@ class _MessageScatterState extends State<MessageScatter> {
Map
<
int
,
Item
>
spotIndex2item
=
{};
Color
greyColor
=
Colors
.
grey
;
Color
dotColor
=
Color
(
0xffFFFFFF
);
late
double
maxX
;
late
VisualizationProvider
provider
;
...
...
@@ -522,8 +523,8 @@ class _MessageScatterState extends State<MessageScatter> {
children:
[
PhotoWidget
(
photoItem:
currentclickedItem
?.
edgeItem
(
'
messageChannel
'
)
?.
edgeItem
(
'p
hoto
'
),
?.
edgeItem
(
'
sender
'
)
?.
edgeItem
(
'p
rofilePicture
'
),
altTitle:
currentclickedItem
?.
edgeItem
(
'messageChannel'
)
?.
get
(
'name'
)
?
[
0
]
??
...
...
@@ -585,15 +586,28 @@ class _MessageScatterState extends State<MessageScatter> {
return
channel
==
null
||
channel
.
isEmpty
?
''
:
channel
[
0
]
.
id
;
}
Color
getColor
(
Item
message
,
bool
isSelected
)
{
Color
getColor
(
Item
message
,
bool
isSelected
,
{
double
?
y
}
)
{
if
(
isSelected
)
{
return
app
.
colors
.
brandViolet
;
}
if
(
shouldHighlightMessage
(
message
))
{
else
if
(
shouldHighlightMessage
(
message
))
{
return
provider
.
label2color
[
message
.
edgeItem
(
'label'
)
?.
get
(
'value'
)
??
'neutral'
]
!
;
}
return
greyColor
;
else
if
(
y
!=
null
){
double
yRange
=
maxY
-
minY
;
double
relativeY
=
(
y
-
minY
)
/
yRange
;
double
opacity
;
if
(
relativeY
<
0.35
){
opacity
=
relativeY
;
return
dotColor
.
withOpacity
(
max
(
opacity
*
2
,
0.2
));
}
else
{
return
dotColor
;
}
}
else
{
return
dotColor
;
}
}
bool
shouldHighlightMessage
(
Item
message
)
{
...
...
@@ -643,12 +657,12 @@ class _MessageScatterState extends State<MessageScatter> {
// modulo maxX, so we get how much space is left to fill the row
double
x
=
i
.
toDouble
()
%
(
maxX
-
2
)
+
1
;
// how many rows can we fit in y direction, and then subtract 10 (miny = -10)
double
y
=
(
i
~/
(
maxX
-
2
)
+
1
)
as
double
;
double
y
=
(
i
~/
(
maxX
-
2
)
+
1
)
-
10
as
double
;
if
(
y
<
maxY
&&
y
>
minY
)
{
int
index
=
scatterSpots
.
length
;
bool
isSelected
=
index
==
selectedIndex
&&
showClickedLabel
;
scatterSpots
.
add
(
ScatterSpot
(
x
,
y
,
color:
getColor
(
message
,
isSelected
),
color:
getColor
(
message
,
isSelected
,
y:
y
),
radius:
getRadius
(
message
,
isSelected
)));
spotIndex2item
[
index
]
=
message
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/screens/workspace/apps/plot_contacts/contacts.dart
+
23
-
2
View file @
0c10bba4
import
'dart:math'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:memri/core/models/item.dart'
;
...
...
@@ -22,7 +24,7 @@ class Contacts extends StatelessWidget {
scrollDirection:
Axis
.
horizontal
,
shrinkWrap:
true
,
itemExtent:
70
,
itemCount:
messageProvider
.
channels
.
length
,
itemCount:
min
(
messageProvider
.
channels
.
length
,
17
),
itemBuilder:
(
context
,
index
)
{
return
CircleAvatar
(
radius:
70.0
,
...
...
@@ -39,7 +41,7 @@ class Contacts extends StatelessWidget {
// altTitle: messageProvider.channels[index]
// .get('name')?[0]),
child:
FakePhotoWidget
(
assetPath:
fakeImages
[
index
],
assetPath:
(
fakeImages
.
length
>
index
)
?
fakeImages
[
index
]
:
''
,
altTitle:
messageProvider
.
channels
[
index
]
.
get
(
'name'
)
?
[
0
]),
),
...
...
@@ -70,6 +72,25 @@ const fakeImages = [
'assets/sample_chat_icons/7166823476648341883.jpg'
,
'assets/sample_chat_icons/7221565429424613315.jpg'
,
'assets/sample_chat_icons/7932492146479504056.jpg'
,
// duplicates from here
'assets/sample_chat_icons/-804299332990991959.jpg'
,
'assets/sample_chat_icons/-1090041471730476681.jpg'
,
'assets/sample_chat_icons/-2044898294407989843.jpg'
,
'assets/sample_chat_icons/-3486075430532779128.jpg'
,
'assets/sample_chat_icons/-5384405533004571291.jpg'
,
'assets/sample_chat_icons/-6215098287953231213.jpg'
,
'assets/sample_chat_icons/-7017760285679863159.jpg'
,
'assets/sample_chat_icons/-8567945017203434434.jpg'
,
'assets/sample_chat_icons/-8620612455525401290.jpg'
,
'assets/sample_chat_icons/241475461177773299.jpg'
,
'assets/sample_chat_icons/922739639816941969.jpg'
,
'assets/sample_chat_icons/935860701117196264.jpg'
,
'assets/sample_chat_icons/2967616992222779619.jpg'
,
'assets/sample_chat_icons/4596825756406858163.jpg'
,
'assets/sample_chat_icons/6282496287081754523.jpg'
,
'assets/sample_chat_icons/7166823476648341883.jpg'
,
'assets/sample_chat_icons/7221565429424613315.jpg'
,
'assets/sample_chat_icons/7932492146479504056.jpg'
,
];
class
FakePhotoWidget
extends
StatelessWidget
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets