Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Circle Mode deleted, Stats-dialog added #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Contributing
Hi there! If you want to contribute to build this alternative version of the Graf, you can do several things:

## Contribute with code
If you want to contribute by writing code, you can fork this repository, develop there, and then create a new pull request to merge your modifications into this repository.

All help is welcome, but please make sure to test your code before creating the pull request and don't create multiple pull requests about a single feature. Also, try to follow the style of the code already written, which will make it look clean. These are some of the conventions we use (adapted from https://github.com/opengovernment/opengovernment/blob/master/CONTRIBUTING.md):

* We indent using two spaces (soft tabs)
* We generally put spaces after list items and method parameters (`[1, 2, 3]`, not `[1,2,3]`) and around operators (`x += 1`, not `x+=1`). Some exceptions are when using increment and decrement operators (e.g. `i++`) or when multiplying, dividing, and even sometimes when summing or subtracting two numbers (e.g. `a*b`), although sometimes spaces are added to sums and subtractions to make it clear that multiplication and division have higher precedence (e.g. `a + b*c`).
* This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible.

### About CSS and JS files
For the sake of understandable code, we divide our JS scripts and CSS styles into multiples files.

Before, we concatenated all these JS and CSS files into two single files which were included into `graf.php`, but as we now have `modspeed` running in our server (an Apache mod which, apart from other things, can combine CSS and JS files when serving pages) and this procedure was complex and tiring, we no longer need to do this, so we are now including all JS and CSS files directly to the `graf.php` page for the sake of simplicity.

## Contribute filling in bug issues or feature requests
Did you find out something is not working, or do you have an awesome idea about the alternative Graf? It would be great if you filled in a new issue! But just before you do that, check out that another issue about the same topic doesn't exist.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 The Alternative Graf Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
70 changes: 3 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,10 @@
# Graf Alternatiu de la FME
## Independent interface for FME's graph

This project is an alternative read-only user-interface for FME's graph. It is compatible and user-friendly with mobile devices.
This project is an alternative read-only user-interface for the FME's graph. It is compatible and user-friendly with mobile devices.

## How to contibute
For the sake of safe and understandable code, we divide our JS scripts and CSS styles into multiples files. But, to make the page load faster, before a pull request, you should concatenate these files in the following manner. <br><br>

In the file script.js, concatenate: (order is important!)
<ol>
<li>circle-mode.js</li>
<li>graf.js</li>
<li>limit-years.js</li>
<li>search-bar.js</li>
<li>dialog.js</li>
<li>camera.js</li>
<li>easter-eg.js</li>
</ol>
<br><br>

In the file styles.css, concatenate: (order is important!)
<ol>
<li>general.css</li>
<li>graf.css</li>
<li>dialog.css</li>
<li>option-buttons.css</li>
<li>year-list.css</li>
<li>search-bar.css</li>
</ol>
Check out [CONTRIBUTING.md](CONTRIBUTING.md).

## Things to do
<ul>
<li>
Make limit-years prettier and incluse/exclusive with double check-boxes
</li>
<li>
Make statistics about the graph: biggest K_n, diameter, etc...
</li>
<li>
Make circle-mode + year-limit = smaller-circle-mode
</li>
<li>
Modify the autocomplete so that eliminated nodes don't appear
</li>
<li>
Separate non-connex nodes in circle-mode
</li>
</ul>


## Things done
<ul>
<li>
Search bar with autocomplete
</li>
<li>
Dialog for nodes
</li>
<li>
Easter egg
</li>
<li>
Limit years to a specific range
</li>
<li>
Circle visualization
</li>
<li>
Hide nodes inside erasing rectangle and very far from origin
</li>
<li>
Hide zoom buttons for tactile devices
</li>
</ul>
Check out [TODO.md](TODO.md).
15 changes: 15 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# TODO
1. Make limit-years prettier and inclusive/exclusive with double check-boxes
2. Make statistics about the graph: biggest K_n, diameter, etc...
3. Make circle-mode + year-limit = smaller-circle-mode
~~4. Modify the autocomplete so that eliminated nodes don't appear~~
5. Separate non-connex nodes in circle-mode
6. Add all these TODO items to the bug tracker

## Things done
1. Search bar with autocomplete
2. Dialog for nodes
3. Limit years to a specific range
4. Circle visualization
5. Hide nodes inside erasing rectangle and very far from origin
6. Hide zoom buttons for tactile devices
66 changes: 33 additions & 33 deletions api.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?php
require_once("config.php");
class write {
public static function output($json) {
print_r(json_encode($json));
exit();
}
public static function error($n, $msg) {
self::output(["error" => $n, "msg" => $msg]);
}
}
function get_graph() {
global $conf;
return json_decode(file_get_contents($conf["apiurl"]), true);
}
if (!isset($_GET["action"])) {
write::error(1, "No action provided");
}
switch ($_GET["action"]) {
case "getgraf":
$graf = file_get_contents($conf["apiurl"]);
echo $graf;
break;
default:
write::error(2, "Unknown action");
}
?>
<?php
require_once("config.php");

class write {
public static function output($json) {
print_r(json_encode($json));
exit();
}

public static function error($n, $msg) {
self::output(["error" => $n, "msg" => $msg]);
}
}

function get_graph() {
global $conf;
return json_decode(file_get_contents($conf["apiurl"]), true);
}

if (!isset($_GET["action"])) {
write::error(1, "No action provided");
}

switch ($_GET["action"]) {
case "getgraf":
$graf = file_get_contents($conf["apiurl"]);
echo $graf;
break;

default:
write::error(2, "Unknown action");
}
?>
50 changes: 25 additions & 25 deletions assistant/en.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"new_to_graph": "It seems like {person} is new to the graph, because they don't share any edges with another person.",
"edges_1": "Alright, {person} shares an edge with {count}: {edges}.",
"edges_2": "Ok, {person} shares an edge with {count}: {edges}.",
"edges_3": "{person} shares an edge with {count}: {edges}.",
"edges_display": "{person} shares an edge with {count}.",
"count_singular": "one person",
"count_plural": "{count} people",
"not_found": "I'm sorry, but I didn't find anyone called {person} in the graph.",
"random_fact": "Here's a random fact: {fact}",
"num_vertices": "The number of vertices in the graph is {count}.",
"num_edges": "The number of edges in the graph is {count}.",
"didyouknow_last_edge": "did you know that the last edge is the one between {person1} and {person2}?",
"didyouknow_num_vertices": "Did you know that the number of vertices in the graph is {count}?",
"didyouknow_num_edges": "Did you know that the number of edges in the graph is {count}?",
"didyouknow_k3": "did you know that the first three vertices of the graph form a K3?",
"didyouknow_creator": "Did you know that Dario currently hosts the graph and that he is thought to be its creator?",
"didyouknow_groph": "did you know that for a while, the graph wasn't connex and the smallest component was named 'the groph'? Fortunately, right now the Groph is connected to the rest of the graph.",
"followup_1": "Is there anything else I can do for you?",
"followup_2": "Now, is there anything else you want to know?",
"followup_3": "Is there anything else you want to know?",
"latest_news": "<speak>These are the latest edges in the graph: {edges}.</speak>",
"latest_news_count": "<speak>These are the last {count} edges in the graph: {edges}.</speak>",
"and": "and"
}
{
"new_to_graph": "It seems like {person} is new to the graph, because they don't share any edges with another person.",
"edges_1": "Alright, {person} shares an edge with {count}: {edges}.",
"edges_2": "Ok, {person} shares an edge with {count}: {edges}.",
"edges_3": "{person} shares an edge with {count}: {edges}.",
"edges_display": "{person} shares an edge with {count}.",
"count_singular": "one person",
"count_plural": "{count} people",
"not_found": "I'm sorry, but I didn't find anyone called {person} in the graph.",
"random_fact": "Here's a random fact: {fact}",
"num_vertices": "The number of vertices in the graph is {count}.",
"num_edges": "The number of edges in the graph is {count}.",
"didyouknow_last_edge": "did you know that the last edge is the one between {person1} and {person2}?",
"didyouknow_num_vertices": "Did you know that the number of vertices in the graph is {count}?",
"didyouknow_num_edges": "Did you know that the number of edges in the graph is {count}?",
"didyouknow_k3": "did you know that the first three vertices of the graph form a K3?",
"didyouknow_creator": "Did you know that Dario currently hosts the graph and that he is thought to be its creator?",
"didyouknow_groph": "did you know that for a while, the graph wasn't connex and the smallest component was named 'the groph'? Fortunately, right now the Groph is connected to the rest of the graph.",
"followup_1": "Is there anything else I can do for you?",
"followup_2": "Now, is there anything else you want to know?",
"followup_3": "Is there anything else you want to know?",
"latest_news": "<speak>These are the latest edges in the graph: {edges}.</speak>",
"latest_news_count": "<speak>These are the last {count} edges in the graph: {edges}.</speak>",
"and": "and"
}
4 changes: 2 additions & 2 deletions css/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
color: black;
z-index: 120;
overflow-y: auto;
}
}

#backdrop {
display: none;
Expand Down Expand Up @@ -75,4 +75,4 @@
font-weight: bold;
font-size: 20px;
margin: 0;
}
}
1 change: 0 additions & 1 deletion css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ html, body {
user-select: none !important;
font-family: 'Roboto';
}

2 changes: 1 addition & 1 deletion css/graf.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
span {
position: relative;
z-index: -1;
}
}
4 changes: 2 additions & 2 deletions css/option-buttons.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ********** HERE STARTS search-bar.css ****** */
#circle-mode {
#stats {
position: absolute;
right: 10px;
bottom: 210px;
Expand Down Expand Up @@ -40,4 +40,4 @@

#zoomout.touch {
display: none;
}
}
14 changes: 9 additions & 5 deletions css/search-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
}

.md-google-search__search-btn svg, .md-google-search__empty-btn svg {
padding: 7px;
padding: 3px;
margin: 4px;
margin-top: 11px;
}

.md-google-search__field-container {
Expand All @@ -59,9 +60,10 @@
}

.md-google-search__field {
border: none;
border: none;
vertical-align: middle;
font: normal 16px Roboto, sans-serif;
height: 24px;
height:43px;
outline: none;
padding: 11px 0 11px 16px;
width: 100%;
Expand Down Expand Up @@ -102,6 +104,8 @@
color: black;
box-shadow: 0 2px 5px 0 rgba(255, 255, 255, 0.258824), 0 2px 10px 0
rgba(255, 255, 255, 0.156863) !important;
max-height: 510px;
overflow-y: auto;
}

.autocomplete-item {
Expand All @@ -117,7 +121,7 @@
.autocomplete-year {
position: relative;
z-index: 120;

color: #222;
}

Expand All @@ -133,4 +137,4 @@
#min-dialog {
display: block !important;
}
}
}
40 changes: 40 additions & 0 deletions css/stats-dialog.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* ********** HERE STARTS dialog.css ****** */

#stats-dialog {
position: absolute;
top: 0px;
left: 0px;
width: 300px;
height: 100%;
background-color: white;
color: black;
z-index: 120;
overflow-y: auto;
}

.small-screen {
padding: 10px;
}

#ranking {
list-style-position: disc;
}

#stats-dialog h2 {
font-weight: bold;
font-size: 20px;
text-align: center;
}

#stats-dialog h3 {
font-weight: bold;
font-size: 16px;
margin-bottom: 0;
}

#stats-quit-dialog, #stats-quit2-dialog {
position: absolute;
top: 8px;
right: 8px;
}

Loading