GithubHelp home page GithubHelp logo

lanicon / wpfgraph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielpalme/wpfgraph

0.0 1.0 0.0 92 KB

WpfGraph is a tool to create animations of graph algorithms using a WPF based 3D rendering engine.

License: Apache License 2.0

C# 100.00%

wpfgraph's Introduction

WpfGraph

WPFGraph is a tool to create animations of graph algorithms using a WPF based 3D rendering engine.
You can create a graph by adding nodes and edges to the UI simply by using your mouse.
Then you can execute a graph algorithm like Dijkstra on the created graph.

Additional information about the implementation can be found under Resources.

Author: Daniel Palme
Blog: www.palmmedia.de
Twitter: @danielpalme

Sample Animation

Watch a video of a sample animation:

Sample animation

Usage

  • By clicking on an empty area, a new node is created
  • By clicking on two nodes within one second (not necessarily different nodes), a new edge is created
  • By clicking at a node or edge, its properties can be edited in the panel on the right
  • All graph algorithms can be executed by selecting the corresponding entry in the menu

Implement custom graph algorithms

The application already contains several graph algorithms like Dijkstra or Kruskal. To create your own algorithms, add a new class to the solution and implement the interface IGraphAlgorithm. After recompiling the solution, your algorithm will be listed in the menu.

Creating animations is quite simple, some extension methods make things even easier. In the following example, we add two nodes to the graph, then we flash the two nodes for 3 seconds. After the flashing is finished, both nodes are moved to another position.

public void Execute(IGraph<NodeData, EdgeData> graph)
{
    graph.Clear();

    this.node1 = graph.AddNode(new NodeData(new Point3D(0, 25, 0)));
    this.node2 = graph.AddNode(new NodeData(new Point3D(0, -25, 0)));

    this.graph.AddEdge(this.node1, this.node2);

    this.node1.Blink(3000);
    this.node2.Blink(3000, this.Callback);
}

private void Callback()
{
    this.node1.Move(new Point3D(25, 0, 0), 4000);
    this.node2.Move(new Point3D(-25, 0, 0), 4000);
}

Resources

wpfgraph's People

Contributors

danielpalme avatar

Watchers

 avatar

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.