Skip to content

cimplex-project/cimplex-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cimplex-decoder

JavaScript library for communicating with the GLEAMviz Proxy Server.

Using the library

Include the following files from the dist folder in your HTML document

<script src="https://cdn.jsdelivr.net/npm/zip-js@0.0.2/WebContent/deflate.js"></script>
<script src="https://cdn.jsdelivr.net/npm/zip-js@0.0.2/WebContent/zip.js"></script>
<script src="https://cdn.jsdelivr.net/npm/zip-js@0.0.2/WebContent/inflate.js"></script>
<script src="https://cdn.jsdelivr.net/npm/zip-js@0.0.2/WebContent/z-worker.js"></script>
<script src="dist/gleamviz.js"></script>

API

// Login to the server
GleamViz.login(username, password)

// Logout from the server
GleamViz.logout(username, password)

// List all current simulations
GleamViz.listall()

// Create a new simulation
GleamViz.create(definition)

// Remove a simulation 
GleamViz.remove(id)

// Stop the calculation of a simulation 
GleamViz.stop(id)

// Get information regarding a specific simulation
GleamViz.getinfo(id)

// Get the definition of a specific simulation
GleamViz.getdef(id)

// Get  data of a specific simulation
GleamViz.getdata(id)

// Get parameters of a specific simulation
GleamViz.getparameters(id)

// Get simulationdata of a specific simulation
GleamViz.getsimulationdata(id)

Examples

// login to the server an fetch all simulation information
GleamViz.login("username", "password").then(userdata => {
    GleamViz.listall().then(simulations => {
        // simulations contains a list of all simulation informations
        GleamViz.logout();
    });
});

// login to the server and get a specific simulation
GleamViz.login("username", "password").then(userdata => {
    GleamViz.getsimulationdata("1486985747939.ASR")
        .then(data => {
            // data contains the simulation data
            GleamViz.logout();
        });
});

// login to the server and create a new simulation using a definition
GleamViz.login("username", "password").then(userdata => {
    GleamViz.create(definition)
        .then(data => {
            GleamViz.logout();
        });
});

How to build the library?

  1. Run npm install
  2. Run npm run build or npm run watch

Contributions

  • zip.js - A JavaScript library to zip and unzip files
  • browserify - Organize your browser code and load modules installed by npm
  • watchify - watch mode for browserify builds

Authors

Authors of this project (comprising ideas, architecture, and code) are:

This project and code was mainly developed by:

  • DFKI - German Research Center for Artificial Intelligence
  • ISI - Fondazione Istituto per l'Interscambio Scientifico

Parts of the project and code were developed as part of the EU H2020 project CIMPLEX - Bringing CItizens, Models and Data together in Participatory, Interactive SociaL EXploratories.

Futher partners that deliver data and simulations via webservice access are:

  • ETHZ (ETH Zurich)
  • UCL (University College of London)
  • Közép-európai Egyetem (Central European University, CEU)
  • CNR (National Research Council)
  • FBK (Bruno Kessler Foundation)
  • USTUTT (University of Stuttgart, Institute for Visualization and Interactive Systems)

License

See LICENSE.

Releases

No releases published

Packages

No packages published