The plugin is compatible with QGIS 3 only (minimum version 3.4.1).
In QGIS, open the "Plugins" > "Manage and install plugin" dialog. Install the "Graph Analysis" plugin.
The plugin installs the following UI elements:
-
The “Graph Analysis” toolbar is installed and visible by default. It can be hidden using the corresponding entry in the “View” > “Toolbars” menu. This toolbar contains the following tools:
- “Add a graph” button
- “Select Nodes or Edges” selection tool
Above, the toolbar with all the tools enabled, in the order described above.
This tool adds a graph to the map. It uses the model and Qt to read and and write the graph and is therefore limited to the formats supported by that library. Note also that the raster layer added by this tool does not have all the capabilities of a normal QGIS vector or raster layer: It is limited to visualization and modification using the provided tools.
Click on “Browse…” to select a file (graph, txt) and OK to load the graph.
As a result, a new layer is created in the Table of Content and is displayed on the map canvas.
Properties of the layer can be visualized by right-clicking on it: A dialog opens where some details about the layer are displayed, including the location of the graph file and the CRS that is applied to it. It is also possible to get the nodes and edges attributes types. The add Edge and add node attribute dialogs do not work although it has been implemented in the backend. The same goes for the graphical properties.
This tool lets you select and edit graph nodes or edges on the map. To edit a node/edge value, make a click on the toolbar and make the selection then a dialog window appears. Click on the corresponding value you want to modify. To confirm your changes, proceed this way:
-
If you have changed a node value, you have to click on the upper left corner icon to apply your changes
-
If you have changed an edge value, you have to click on the blank icon on the bottom left corner under "Add from vector layers"
The backend for the symbology has been implemented. To change the graphical style of the nodes/edges, you need a render.xml file. The one provided at the root of the plugin directory contains SVG shapes for the nodes. There is another example named "render2.xml". You can renamed it and replace the other render.xml to see the new style.
It is possible to apply your own style by modifying manually the render.xml file. This file contains some nodes IDs and edges start/end nodes IDs so you need to put the corresponding IDs in the render.xml. Here is an example with SVG shapes:
The corresponding xml code part for the nodes' shapes, the default shape is the "blé.svg" icon:
As you can see in the graph file (testgen.graph), the attribute t_2000 is the same for several nodes, hence the same SVG icon for several nodes: