Giter Site home page Giter Site logo

ramonmeffert / elm-gossip Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.71 MB

A user-friendly web tool for exploring dynamic gossip.

Home Page: https://r3n.nl/elm-gossip/

License: GNU General Public License v3.0

Elm 83.12% SCSS 14.78% HTML 1.48% JavaScript 0.62%
gossip elm bachelor-project dynamic-gossip gossip-protocol webapp

elm-gossip's Introduction

ElmGossip: Explore dynamic gossip in your browser

Website License

ElmGossip is a web tool for exploring and analysing dynamic gossip, built in Elm. The tool is available online, or you can follow the instructions below to run the tool locally. In general, we advise using the online version unless you plan to do anything with the source code.

About

This tool began its life as part of my bachelor's thesis. Since finishing my thesis, I have been working on implementing new features and polishing the tool.

Features

  • πŸ‘ Visualise gossip graphs
  • ☎️ See which calls are allowed for any protocol
  • βœ… Validate and execute call sequences
  • ⏰ Time-travel between multiple graph states after executing calls
  • πŸ›  Create your own custom gossip protocols
  • 🌳 Generate execution trees
  • ⚠️ Helpful and human-oriented error messages
  • πŸͺΆ Lightweight1

In progress

  • Successfulness analysis
    That is, whether some protocol is weakly/strongly successful on a given graph
  • GraphViz and LaTeX export
    Making it easy to use graphs and protocol formulae in other places
  • Saving the state of the tool to LocalStorage
    So you don't lose your work when navigating away from the page
  • Saving and loading custom protocols
    Transferability!
  • Dark mode
    🌚

You can track the progress of these features on the issues page.

Future ideas

  • Mobile support (#75)
  • Turn the site into a Progressive Web App for offline access

Running locally

If you want to build this project yourself, you'll need yarn (or, alternatively, npm).

To install:

yarn install # or npm install

Building and running

If you just want to run the project, you can run a live-reload server in development mode:

yarn start # or npm start

If you want to build a release, you can run the following command:

yarn build # or npm build

This will generate a docs2 directory. You can upload this directory to a web server or run a local web server from this directory (e.g. python3 -m http.server) to see the project. Since Elm is compiled to Javascript, uploading the compiled files is all you need to do – you don't have to start a web server as everything runs client side.


1 The entire application, bundled for production, weighs in at around 200kb. That includes compiled js, css, images and all favicons – most of which you won't even load, since they are platform-specific. For example, when loading the application on Firefox, only 129.29KB (45.73KB gzipped) is downloaded.
2 The application is configured for deployment to GitHub Pages, which expects a docs directory.

elm-gossip's People

Contributors

dependabot[bot] avatar ramonmeffert avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

elm-gossip's Issues

Clean up rendering

  • (Re)move logic from update function in main
  • Replace raw output with user-friendly output (e.g. instead of "Sun Graph: yes" show an icon, or at least have a neatly formatted section with graph details)

Also #21

Improve Readme

Add some information about the what and why of the project. Also probably mention some of the important packages used and include a license

Input validation for gossip graphs

  • The identity relation for N and S should always be satisfied
    • either Flag input as incorrect w/ error;
      • πŸ˜• bad ux
      • πŸ˜ƒ easy
    • or Give a warning and add implied identity relations.
      • πŸ˜ƒ good ux
      • πŸ˜• might be unclear to some users
  • Input should be in correct format
    • Numeric (03-20-123 0-1-2-3) or alphabetic (Abc ABC abC)
    • Different separators
      • either always allow multiple (possibly arbitrary) separators in input, and give a warning when more than one is used
        • πŸ˜ƒ good ux
        • πŸ˜• how would number input work, as it needs 2 different separators?
      • or reject input when separators are inconsistent
        • πŸ˜• bad ux
        • πŸ˜ƒ easy
  • Input should not contain unconnected nodes (?)
    • If no one can reach a node, it will never be included in any ca

Information about the graph should be explained more clearly

The information about the graph graph relations (i.e. weakly/strongly connected, sun graph) is unclear.

  • It is probably not clear that you can hover over these items to see more information
  • It might also not be clear why this information is present in the first place

To solve the first issue, it might be a good idea to move this information below the graph and just have the expanded view be the one visible all the time. To solve the second issue, another ? button could be added to that section with some information on what these properties represent and why they might be useful in the context of gossip graphs/protocols.

Errors show up too quickly when typing in the input fields

While typing in the input fields, the errors show immediately when there is an error. This can give users the wrong impression that their input is wrong before they are even done typing, causing them to think there is something wrong even though they weren't done typing. A short delay before showing errors could solve this.

Improve error reporting

Instead of the error being just a string, make it a record so the rendering can be improved. Something like:

type alias Error =
    { title : String
    , message : String
    , cause : String
    , advice : String
    }

Successfulness

  • Generate call sequence leading to complete graph if possible
    • Weakly successful
    • Strongly successful
  • Colored calls based on which call leads to a complete graph
  • Rendering which execution tree branches lead to complete graph (smiley or something)

Impossible secret distributions are allowed

A gossip graph like Abc ABc abC cannot result from an initial gossip distribution Abc aBc abC (i.e. every agent only knows their own secret). It might be a good idea to show a warning for this.

Make sure title attributes are set where relevant

title attributes can be helpful in explaining the UI. Right now, there are some elements that do have a title attribute, but many don't.

Elements that benefit from title attributes:

  • Input elements (<input>, <button>, <select> + <option>)
  • Images (for this app mainly the FontAwesome icons)
  • Any other interactive element (for example, the possible calls can be clicked. these might need to be turned into <button>s to make them more semantically correct anyway though)

Input validation is too strict

Gossip graph input: A⎡B⎡C is accepted as an input, but A⎡⎡B⎡C and A⎡B⎡C⎡ are not. This should not be as strict. A similar problem might exist with the Call Sequence input.

Add help page

A page for a more in-depth explanation of what is happening on the page

Save call sequences in reverse

Changes lookup time of the last call from O(n) to O(1). It seems like the last call is needed (way) more frequently than the first call.

Normalized Agent String

i.e. even if the input is something like Fxl fEXl fL, generate a string like Acd aBCd aCD D (or its numerical equivalent)

Generate execution tree

Idea: integrate this in the β€œCall History” section. Something like the following:

ExecutionTreeConcept

Protocol editor is a bit intimidating

The protocol editor is potentially a bit intimidating, especially for new users. It might be nice to hide it somehow, for example by showing by default just the dropdown with the available protocols, along with an edit button that toggles the protocol editor.

State history

It would be very nice if you could use cmd / ctrl + z (undo) and cmd / shift + z / ctrl + y (redo) to undo or redo the most recent actions.

Graph Analysis

  • Connectedness
    • Weak
    • Strong
  • Sun Graph Y/N
  • Canonical representation

Switch to Browser.Application

Browser.sandbox is generally considered too limited. Changing to a different program type is somewhat involved, so doing it earlier is better – some functionality is not available in sandbox.

Export options

  • Gossip graph
    • To GraphViz DOT code
    • To LaTeX file
  • Execution tree
    • To GraphViz DOT code
    • To LaTeX file

Show version number in GUI

It would be nice to show the version number in the GUI. At this moment, this would need to be done manually. I will look into using either Elms versioning system (elm bump etc), but I'm not sure that'll work for this since that is aimed at APIs. Another would be defining it in package.json and providing it as a flag to Elm or something.

Add β€œTo Graph Codeβ€œ button

The code to create GraphViz code already exists, so this is pretty easy. However, the GraphViz graph will look (significantly) different from the graph rendered on the page. That might be unexpected.

Improve Graph Rendering

  • Consider rendering the first N agents in a circle to improve quality of rendered graph
  • Look at how GraphViz renders graph (probably very hard)
  • At the very least, make sure nodes do not overlap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.