Commit d16ca034 authored by Luca Braun's avatar Luca Braun

Updated Cluster querying

parent 05c7962e
2021/03/15-14:11:37.409 2e54 Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.6980f546\flutter_tools_chrome_device.99ecf2dc\Default\AutofillStrikeDatabase/MANIFEST-000001
2021/03/15-17:09:04.000 282c Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.feb939e7\flutter_tools_chrome_device.d8bc148a\Default\AutofillStrikeDatabase/MANIFEST-000001
2021/03/15-17:09:04.000 282c Recovering log #3
2021/03/15-17:09:04.000 282c Reusing old log C:\Users\Luca\AppData\Local\Temp\flutter_tools.feb939e7\flutter_tools_chrome_device.d8bc148a\Default\AutofillStrikeDatabase/000003.log
2021/03/15-14:11:37.379 1fec Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.6980f546\flutter_tools_chrome_device.99ecf2dc\Default\BudgetDatabase/MANIFEST-000001
2021/03/15-17:09:03.997 1d00 Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.feb939e7\flutter_tools_chrome_device.d8bc148a\Default\BudgetDatabase/MANIFEST-000001
2021/03/15-17:09:03.997 1d00 Recovering log #3
2021/03/15-17:09:03.997 1d00 Reusing old log C:\Users\Luca\AppData\Local\Temp\flutter_tools.feb939e7\flutter_tools_chrome_device.d8bc148a\Default\BudgetDatabase/000003.log
......@@ -19,15 +19,15 @@ define("main_module.bootstrap", ["web_entrypoint.dart", "dart_sdk"], function(ap
main();
});
}
window.$dartAppId = "aIrnYDz2m2snmv1C+RRpHQ==";
window.$dartAppId = "rj27DCk9qhDMkSLqPeMc+A==";
window.$dartReloadConfiguration = "ReloadConfiguration.none";
window.$dartModuleStrategy = "require-js";
window.$loadModuleConfig = require;
window.$dwdsVersion = "7.1.1";
window.$dwdsDevHandlerPath = "http://localhost:55339/$dwdsSseHandler";
window.$dwdsDevHandlerPath = "http://localhost:54077/$dwdsSseHandler";
window.$dartEntrypointPath = "main_module.bootstrap.js";
window.$requireLoader.forceLoadModule("dwds/src/injected/client");
window.$dartExtensionUri = "http://127.0.0.1:55341/$debug";
window.$dartExtensionUri = "ws://127.0.0.1:54079/$debug";
} else {
if(window.$dartMainExecuted){
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+8\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.5\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-03-15 14:15:50.497365","version":"2.0.1"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+8\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.5\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-03-15 17:08:16.625001","version":"2.0.1"}
\ No newline at end of file
......@@ -4,5 +4,5 @@ class Community {
Community(this.name, this.trust, this.posts);
final String name;
final double trust;
final List<Post> posts;
List<Post> posts;
}
import 'package:circlegraph/circlegraph.dart';
import 'package:dashboard/querying/datagetter.dart';
import 'package:dashboard/ui/theme/color_holder.dart';
import 'package:dashboard/ui/util/logged_in_appbar.dart';
import 'package:enhanced_future_builder/enhanced_future_builder.dart';
import 'package:flutter/cupertino.dart';
......@@ -77,7 +78,7 @@ class UserGraphViewPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
backgroundColor: ColorHolder.color3,
appBar: LoggedInAppBar("User: $username"),
body: Container(
constraints: BoxConstraints.expand(),
......
import 'package:dashboard/exceptions/login_exception.dart';
import 'package:dashboard/loading.dart';
import 'package:dashboard/querying/cluster.dart';
import 'package:dashboard/ui/graphs/community/index.dart';
import 'package:dashboard/ui/sign_in/loginpage.dart';
import 'package:dashboard/util/loginhelper.dart';
......@@ -28,15 +29,18 @@ class _MyAppState extends State<MyApp> {
}
@override
Widget build(BuildContext context) => MaterialApp(
home: EnhancedFutureBuilder<BackendUser>(
future: _checkLoginStuff(),
whenNotDone: LoadingScreen(),
rememberFutureResult: false,
whenDone: (BackendUser snapshotData) {
if (snapshotData == null) return LoginPage();
return CommunityMetaGraphViewPage();
},
),
);
Widget build(BuildContext context) {
ClusterGetter().getClusters();
return MaterialApp(
home: EnhancedFutureBuilder<BackendUser>(
future: _checkLoginStuff(),
whenNotDone: LoadingScreen(),
rememberFutureResult: false,
whenDone: (BackendUser snapshotData) {
if (snapshotData == null) return LoginPage();
return CommunityMetaGraphViewPage();
},
),
);
}
}
import 'package:dashboard/data/community.dart';
import 'package:dashboard/data/post.dart';
import 'package:dashboard/querying/datagetter.dart';
import 'package:dashboard/util/loginhelper.dart';
......@@ -5,7 +6,8 @@ import 'package:dashboard/util/user.dart';
import 'package:logger/logger.dart';
class ClusterGetter {
Future<Map<String, dynamic>> getNodesfromLayer(String layerName) async {
Map<String, List<Community>> clusterMap;
Future<List<Community>> getNodesfromLayer(String layerName) async {
String url =
"https://articonf1.itec.aau.at:30101/api/use-cases/reddit/tables/reddit/layers/$layerName/nodes";
Logger().i(url);
......@@ -20,25 +22,39 @@ class ClusterGetter {
await DataGetter.getJsonList(url, headers: headers);
Logger().i(nodesList.toString());
Map<String, List<Post>> resultMap = {};
List<Community> communityList = [];
for (Map<String, dynamic> entry in nodesList) {
if (resultMap[entry["subreddit"]] == null)
resultMap[entry["subreddit"]] = [];
bool communityExists = false;
Community community;
for (Community tmpCommunity in communityList) {
if (tmpCommunity.name == entry["subreddit"]) {
community = tmpCommunity;
communityExists = true;
break;
}
}
resultMap[entry["subreddit"]].add(Post(
if (!communityExists) {
community = Community(entry["subreddit"], 1, []);
communityList.add(community);
}
community.posts.add(Post(
entry["title"],
entry["content"],
entry["user_id"],
entry["subreddit"],
entry["percentage_upvoted"],
entry["n_comments"]));
Logger().i(community.posts.toString());
}
Logger().i(resultMap.toString());
return resultMap;
return communityList;
}
Future<Map<String, dynamic>> getClusters() async {
Future<Map<String, List<Community>>> getClustersFuture() async {
List<String> layers = [
"Upvotes_Layer",
"Percentage_Layer",
......@@ -46,7 +62,7 @@ class ClusterGetter {
"Time_Layer",
];
Map<String, dynamic> clusterMap = {};
Map<String, List<Community>> clusterMap = {};
for (String layer in layers) {
clusterMap[layer] = await getNodesfromLayer(layer);
}
......
......@@ -4,8 +4,9 @@ import 'package:flutter/material.dart';
class LoggedInAppBar extends PreferredSize {
final String title;
Widget bottom;
LoggedInAppBar(this.title);
LoggedInAppBar(this.title, {this.bottom});
@override
Size get preferredSize => Size.fromHeight(60);
......@@ -23,6 +24,7 @@ class LoggedInAppBar extends PreferredSize {
Widget build(BuildContext context) {
return AppBar(
backgroundColor: Colors.blue,
bottom: bottom,
title: Text(title),
actions: [
Padding(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment