You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
soil/soil/web
J. Fernando Sánchez 50bca88362 Fix pre-release version of v1.0.0rc1 1 year ago
..
static Fix pre-release version of v1.0.0rc1 1 year ago
templates merge visualization branch 5 years ago
.gitignore Merge commit '8fec544772c13efb1dc8a0589240551b9bad27cb' as 'soil/web' 5 years ago
README.md Merge commit '8fec544772c13efb1dc8a0589240551b9bad27cb' as 'soil/web' 5 years ago
__init__.py Formatted with black 2 years ago
__main__.py Formatted with black 2 years ago
config.yml WIP 2 years ago
run.py Formatted with black 2 years ago

README.md

Graph Visualization with D3.js

The aim of this software is to provide a useful tool for visualising and analysing the result of different simulations based on graph. Once you run the simulation, you will be able to interact with the simulation in real time.

For this purpose, a model which tries to simulate the spread of information to comprehend the radicalism spread in a society is included. Whith all this, the main project goals could be divided in five as it is shown in the following.

  • Simulate the spread of information through a network applied to radicalism.
  • Visualize the results of the simulation.
  • Interact with the simulation in real time.
  • Extract data from the results.
  • Show data in a right way for its research.

Deploying the server

For deploying the application, you will only need to run the following command.

python3 run.py [--name NAME] [--dump] [--port PORT] [--verbose]

Where the options are detailed in the following table.

Option Description
--name NAME The name of the simulation. It will appear on the app.
--dump For dumping the results in server side.
--port PORT The port where the server will listen.
--verbose Verbose mode.

You can dump the results of the simulation in server side. Anyway, you will be able to download them in GEXF or JSON Graph format directly from the browser.

Visualization Params

The configuration of the simulation is based on the simulator configuration. In this case, it follows the SOIL configuration syntax and for visualising the results in a more comfortable way, more params can be added in visualization_params dictionary.

  • For setting a background image, the tag needed is background image. You can also add a background_opacity and background_filter_color if the image is so clear than you can difficult view the nodes.
  • For setting colors to the nodes, you can do it based on their properties values. Using the color tag, you will need to indicate the attribute key and value, and then the color you want to apply.
  • The shapes applied to a group of nodes are always the same. This means than it won't change dynamically, so you will have to indicate the property with the shape_property tag and add a dictionary called shapes in which for each value, you indicate the shape. All shapes have to had been downloaded before in SVG format and added to the server.

An example of this configuration applied to the TerroristNetworkModel is presented.

visualization_params:
  # Icons downloaded from https://www.iconfinder.com/
  shape_property: agent
  shapes:
    TrainingAreaModel: target
    HavenModel: home
    TerroristNetworkModel: person
  colors:
    - attr_id: 0
      color: '#40de40'
    - attr_id: 1
      color: red
    - attr_id: 2
      color: '#c16a6a'
  background_image: 'map_4800x2860.jpg'
  background_opacity: '0.9'
  background_filter_color: 'blue'