Graphstream core

Related tags

Testing gs-core
Overview

GraphStream

Build Status

The GraphStream project is a java library that provides an API to model, analyze and visualize graphs and dynamic graphs.

Check out the Website http://www.graphstream-project.org/ for more information.

Installing GraphStream

The release comes with a pre-packaged jar file named gs-core.jar that contains the GraphStream classes. To start using GraphStream, simply put it in your class path. You can download GraphStream on the github releases pages, or on the website http://www.graphstream-project.org/.

Maven users may include major releases of gs-core as a dependency:

<dependencies>
    <dependency>
        <groupId>org.graphstream</groupId>
        <artifactId>gs-core</artifactId>
        <version>2.0</version>
    </dependency>
</dependencies>

Development Versions

Using https://jitpack.io one can also use any development version. Simply add the jitpack repository to the pom.xml of the project:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

then, add the gs-core to your dependencies:

<dependencies>
    <dependency>
        <groupId>com.github.graphstream</groupId>
        <artifactId>gs-core</artifactId>
        <version>dev-SNAPSHOT</version>
    </dependency>
</dependencies>

You can use any version of gs-core you need. Simply specify the desired version in the <version> tag. The version can be a git tag name (e.g. 2.0), a commit number, or a branch name followed by -SNAPSHOT (e.g. dev-SNAPSHOT). More details on the possible versions on jitpack.

User interface

gs-core does not ship any default user interface anymore. In order to display graphs, one need a GraphStream viewer (mainly gs-ui-javafx or gs-ui-swing). These are the steps to get a viewer:

  1. Download a GraphStream viewer and add the jar to your classpath (or as a dependency to pom.xml, for maven users).
  2. Set a system property to tell gs-core which viewer to use :
         System.setProperty("org.graphstream.ui", "javafx");
  1. Enjoy Graph.display() as usual.

Help

You may check the documentation on the website http://www.graphstream-project.org/. You may also share your questions on the mailing list at http://sympa.litislab.fr/sympa/subscribe/graphstream-users.

License

See the COPYING file.

Comments
  • mouse clicks not working

    mouse clicks not working

    I implemented the "Retrieving mouse clicks on the viewer" part of the tutorial just the same as it was and it is not working at all... it is not doing anything when I click my mouse...

    opened by sanaz-afzali 14
  • Concurrent event in Graph: NoSuchElementException in GraphListeners

    Concurrent event in Graph: NoSuchElementException in GraphListeners

    Hi,

    I have a Graph, Nodes and Edges that are concurrently modified.

    Since the Graph is attached to a Viewer, GraphListeners is responsible of piping the events from the graph to the viewer.

    Sometimes, when there are concurrent modification of the elements of the graph, I get the following exception:

    java.util.NoSuchElementException
    	at java.util.LinkedList.removeFirst(LinkedList.java:270)
    	at java.util.LinkedList.remove(LinkedList.java:685)
    	at org.graphstream.stream.SourceBase.manageEvents(SourceBase.java:872)
    	at org.graphstream.stream.SourceBase.sendAttributeChangedEvent(SourceBase.java:810)
    	at org.graphstream.util.GraphListeners.sendAttributeChangedEvent(GraphListeners.java:73)
    	at org.graphstream.graph.implementations.AbstractEdge.attributeChanged(AbstractEdge.java:106)
    	at org.graphstream.graph.implementations.AbstractElement.addAttribute(AbstractElement.java:544)
    	at org.graphstream.graph.implementations.AbstractElement.setAttribute(AbstractElement.java:560)
    

    I tried using Graphs.synchronizedGraph but it doesn't solve the problem, because this is not about concurrent modification of ONE element, but concurrent emission of events to theGraphListeners.

    There seem to be no way to have this pipe behave correctly with concurrence. Is there something I am missing or is this a bug?

    opened by victornoel 14
  • Sprites moving attached to nodes.

    Sprites moving attached to nodes.

    I just wanna check if this is the expected behaviour for sprites. I've tested with a few scenarios, sprites under the nodes (with different z-indexes), sprites over nodes, etc..and all had the same result, as you can see on the example video below. Video Link

    I just want to make sure if its the correct behaviour or not, or maybe it can be a bug, i dont know. Is this correct? While clicking on the sprites, or moving the other nodes, they move to different locations other than follow the attached node?

    opened by matheus1lva 14
  • Pinning node positions in layouts

    Pinning node positions in layouts

    A feature where positions of some nodes could be pinned so that they don't get moved by the layout algorithm would probably be quite useful. This feature is known as pinning in GraphViz. This arises in many graph visualization tasks (eg. artificial neural networks) where there are somehow 'special' nodes (eg. input and output) that should be easy to find in a graph visualization.

    There seems to be a "freezing" feature in BarnesHutLayout, but freezing nodes doesn't seem to do anything and all the implemented layout algorithms in both gs-core and gs-algo seem to ignore it. If this functionality can be implemented in the current system, then this is probably a documentation bug.

    opened by jampekka 12
  • Not able to parse css file

    Not able to parse css file

    Error:

    WARNING: Error while parsing style sheet for graph 'GraphicGraph_3863'. java.io.IOException: Encountered " "myStyle "" at line 1, column 1. Was expecting one of: "graph" ... "edge" ... "node" ... "sprite" ... ...

    Css file:

    node { size: 3px; fill-color: #777; text-mode: hidden; z-index: 0; }

    edge { shape: line; fill-color: #222; arrow-size: 3px, 2px; }

    opened by galactro50 9
  • Cannot change the background color of my graph dynamically

    Cannot change the background color of my graph dynamically

    1. I create a graph embedded in my netbeans-top-component as follows:

      Graph gsGraph = new MultiGraph("Nodeviewgraph"); gsGraph.addAttribute("ui.stylesheet", "graph { fill-color: red; }"); Viewer viewer = new Viewer(gsGraph, Viewer.ThreadingModel.GRAPH_IN_SWING_THREAD); viewer.enableAutoLayout();

      View view = viewer.addDefaultView(false); this.add(view, BorderLayout.CENTER); view.doLayout();

    2. When the user clicks a certain button on the UI, the graph should be cleared and the background color should change. This is the code from the corresponding swing-action-listener:

      gsGraph.clear(); gsGraph.addAttribute("ui.stylesheet", "graph { fill-color: blue; }");

    The graph indeed gets cleared, but the color changes to "white" (default) and not to "blue". Am I doing something wrong?

    regards R4DIUM

    opened by agallus 8
  • freeplane generates java.lang.ArrayIndexOutOfBoundsException

    freeplane generates java.lang.ArrayIndexOutOfBoundsException

    Hello

    I'm trying to get the "freeplane" style working, but actually had no luck. The graph seems crippled and the code generates continuous "Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException". I get the same problem if I use "edge { shape: cubic-curve; }" as CSS. So I guess I'm doing something wrong in the "curvy edge" area.

    However, if I use a different style, the same code works.

            public static void main(String[] args) {
            System.setProperty("org.graphstream.ui.renderer",
                    "org.graphstream.ui.j2dviewer.J2DGraphRenderer");
            Graph graph = new MultiGraph("Tutorial 1");
    
            graph.setAttribute(
                    "ui.stylesheet",
                    "node { shape: freeplane; fill-color: white; stroke-mode: plain; size-mode: fit; } edge { shape: freeplane; }");
    
            graph.addNode("Mind");
            graph.addNode("one");
            graph.addNode("two");
            graph.addNode("three");
            graph.addNode("four");
            graph.addEdge("EdgeMindone", "Mind", "one");
            graph.addEdge("EdgeMindtwo", "Mind", "two");
            graph.addEdge("EdgeMindthree", "Mind", "three");
            graph.addEdge("EdgeMindfour", "Mind", "four");
    
            graph.display();
    
        }
    
    opened by boessu 8
  • node shape: rounded-box not apply

    node shape: rounded-box not apply

    Hi everyone, firstly: nice job with this library!! However, with the next code i have one problem (using 1.1 libraries):

    Node n = g.getNode(nodeLabel); n.addAttribute("ui.style" , ("size: 10px, 10px; fill-color: #3d5689; shape: rounded-box; stroke-mode: plain; stroke-color: yellow;"); n.setAttribute("label",nodeLabel);

    With the above code, nodes perform the change of size and fill-color well, but not shape, stroke-mode and stroke-color. In edges does not work shape forms.

    Edge e = g.getEdge(from+to); e.addAttribute("ui.style" , "cubic-curve;");

    Any suggestion? Best regards !

    opened by rmaestre 8
  • Maven dependency resolution

    Maven dependency resolution

    Hello,

    i'm trying to use GS in my project witch is managed by Maven. I looked the documentation ( http://graphstream-project.org/doc/Tutorials/Create-a-gs-based-Eclipse-project-using-Maven_1.0/ ) . But Maven doesn't resolve dependency cause your libs aren't in the maven central repository. Perhaps the libraries are shared on another (your own ?) Maven repository. Do you have any Maven PluginRepository URL that contains graphstream libraries ?

    Thank you, Philippe

    maven 
    opened by ghost 8
  • Publish the library on maven central

    Publish the library on maven central

    Hi, I see that older versions of the library were published on Maven Central. I'd like to integrate graphstream with a scientific simulator for pervasive computing, but I need to depend on libraries published on Central, as the simulator is hosted (also) there.

    Any chance for the release 2.0.0 to be made available there?

    Thanks

    opened by DanySK 7
  • HTTPSource requires too many dependencies

    HTTPSource requires too many dependencies

    The new version (2.x branch) of HTTPSource depends on many external libraries (Spark, apache.commons, apache.httpcomponent) that add up to the payload of the gs-core jar file when building a dependency-included archive.

    The archive with those deps is around 3.4 MB while it stays below 1MB without those deps.

    Should we pull HTTPSource from gs-core and put it in its own project (gs-httpsource) ?

    cc: @MaSven cc: @gsavin

    gs-core 
    opened by pigne 7
  • getPathWeight() compatibility with Float

    getPathWeight() compatibility with Float

    When using getPathWeight(), the attributes are of type long when calculating the sum, so it makes it impossible to get a total path weight with Floats.

    "class java.lang.Float cannot be cast to class java.lang.Double"

    opened by Wiziard38 0
  • Change Y value calculation when autoLayout = true

    Change Y value calculation when autoLayout = true

    Where the value of x,y is calculated when autoLayout = true? I need to create a level attribute, which forces the value of y, but I want to keep the x calculated by autoLayout.

    I thought about changing at the point that the x,y position is calculated automatically. It would read an attribute and change the value of Y setting to value of attribute. Am I right?

    Where can I change the code? I using gs-ui-android and gs-core

    opened by desenvolvedor-apanheidoexcel 0
  • Running layout without visual optimization

    Running layout without visual optimization

    Hey,

    we use graphstream in our software MZmine (JavaFX) and really like the library, thanks for the hard work on it.

    Auto-layout uses naps in the LayoutRunner to show the optimization to the user. We would like to run the layout calculation on a separate thread and without the visual optimization of the layout.

    1. do you have an example of how to do this? (calculating the layout in the background and then flushing it onto the viever
    2. any other tips for performance on huge networks?

    Best regards Robin

    opened by robinschmid 0
  • Intersection between square shaped nodes and edges

    Intersection between square shaped nodes and edges

    Hi everyone, nice job with this library!! However, I have a problem with the library

    I want to write a program that counts the number of intersections between the nodes that are represented as a square with a specified size. The main Problem is that, the nodes will be visualized as squares but if the coordinates of these nodes are just points x,y and here is exactly my Problem, because I want to check the intersections with the edges with the x,y coordinates but I can not do this properly!
    because in some cases the corner of the square or its edges intersect with the edges but the original point that represents the square or the node in graphstream does not, I tried all the possible solutions with collinear points , slopes and everything but nothing worked for me, the question is, is there anyway in Grpahstream so that I can find out the coordinates of the edges or the corners of the square so that I can check with the line segment equation if they intersect ?

    I mean something like that as shown in the picture github graphstream

    Best regards !

    opened by legolie 0
  • Right click on node

    Right click on node

    Hi all, is there any way to have a listener for right-mouse-click? ViewerListener only has mouse over and mouse pushed, I am not sure how to have a listener for right-click. Thanks.

    opened by farshad1982 0
Releases(2.0)
Core System of LANSERVER

LanEssential Core System of LANSERVER This is a minecraft plugin for paper 1.17.1 server. This plugin has many features, but many bugs too. It's on al

lanthanide 0 Aug 11, 2022
Core library of SinoCraft Mods

Core library of SinoCraft Mods

SinoCraft Project Team 4 Aug 8, 2022
Core for open source libraries, included some important Classes for those libs.

OpenSource Core You could also read the CHINESE version of README This is a very useful Java class library. In this update, we have merged the origina

Theodore Hills 10 Nov 16, 2022
The ultimate KitPvP Core with a ton of features! Fully configurable & Open source.

KitPvP-Core The ultimate KitPvP Core with a ton of features! Fully configurable & Open source. Placeholders My core plugin offers several features wit

ImGqbbo 1 Nov 14, 2022
Astranaut's core classes

Astranaut Core Brief This project contains classes describing a tree, primarily an abstract syntax tree (AST) of some programming language, and functi

CQFN 2 Sep 13, 2022
Randomized Testing (Core JUnit Runner, ANT, Maven)

RANDOMIZED TESTING ================== JUnit test runner and plugins for running JUnit tests with pseudo-randomness. See the following for more infor

null 167 Dec 26, 2022
Google core libraries for Java

Guava: Google Core Libraries for Java Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multi

Google 46.5k Jan 1, 2023
Apache Maven core

Apache Maven Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can man

The Apache Software Foundation 3.4k Jan 2, 2023
Core part of Jackson that defines Streaming API as well as basic shared abstractions

Overview This project contains core low-level incremental ("streaming") parser and generator abstractions used by Jackson Data Processor. It also incl

FasterXML, LLC 2.1k Jan 1, 2023
Stanford CoreNLP: A Java suite of core NLP tools.

Stanford CoreNLP Stanford CoreNLP provides a set of natural language analysis tools written in Java. It can take raw human language text input and giv

Stanford NLP 8.8k Jan 9, 2023
[Minecraft] Configs from Spigot core

SpigotConfigLibrary [Minecraft] Configs from Spigot core English This is a cut-out piece of config code from the Spigot core. You can use it for conve

Charles_Grozny 5 Sep 9, 2022
SoupPvP core, with kits, guilds, configurability and more.

SoupPvP Wiki Before you read any of this, most/all of this information and even more can be found on the wiki. The wiki states all information that yo

damt 10 Jul 21, 2022
Core part of pipes framework plus some commonly used extensions

Pipes Pipes is a simple, lightweight data processing framework for Java. This repo comes with the core part plus three extensions (For Google Big Quer

null 7 Oct 4, 2022
Core classes for Skija, JWM and HumbleUI

Core types for Skija, JWM and HumbleUI Dependency Key Value groupId io.github.humbleui artifactId types version Building from source Prerequisites: Sh

Humble UI 5 Apr 24, 2022
Dcl372-2022-jan-04 - DCL-372: Core Spring 5

DCL-372: Core Spring 5 These projects are created as part of the following training: DCL-372 "Core Spring 5" Please follow the link for the complete t

Binnur KURT 3 Jan 10, 2022
Core ORMLite functionality that provides a lite Java ORM in conjunction with ormlite-jdbc or ormlite-android

ORMLite Core This package provides the core functionality for the JDBC and Android packages. Users that are connecting to SQL databases via JDBC shoul

Gray 547 Dec 25, 2022
Core Java Library + PDF/A, xtra and XML Worker

iText 5 is EOL, and has been replaced by iText 7. Only security fixes will be added Known Security Issues org.apache.santuario:xmlsec vul

iText 1.4k Jan 9, 2023