Giter VIP home page Giter VIP logo

graphosaurus's Introduction

Graphosaurus

Build Status npm version

A three-dimensional static graph viewer.

(click the image to try it out)

Demos

Documentation

JSDoc generated API documentation can be found here.

Twenty second tutorial

<html>
  <head>
    <style>
    #graph {
      width: 500px;
      height: 500px;
      border: 1px solid grey;
    }
    </style>
  </head>
  <body>
    <div id="graph"></div>

    <script src="graphosaurus.min.js"></script>
    <script>
      // JavaScript will go here
    </script>
  </body>
</html>

If you open this up in your web browser, you'll see something that looks like this:

Look at that amazing square! Now let's create a graph, a couple nodes, and an edge between the nodes:

var graph = G.graph()

// Create a red node with cartesian coordinates x=0, y=0, z=0
var redNode = G.node([0, 0, 0], {color: "red"});
graph.addNode(redNode);

// You can also use the addTo method to add to the graph
var greenNode = G.node([1, 1, 1], {color: "green"}).addTo(graph);

var edge = G.edge([redNode, greenNode], {color: "blue"});
graph.addEdge(edge);  // or edge.addTo(graph)

// Render the graph in the HTML element with id='graph'
graph.renderIn("graph");

After inserting this JavaScript in the <script> block, you should see this:

While this is a very basic example, I hope I've demonstrated how simple it is to create graphs with Graphosaurus.

Build

  1. Run git clone https://github.com/frewsxcv/graphosaurus.git to clone this repository
  2. Install node, npm, and grunt-cli
  3. Run npm install to install all the build requirements
  4. Run grunt to build Graphosaurus. The resulting compiled JavaScript will be in dist/ and the docs will be in doc/

Mascot

gryposaurus

John Conway's illustration of our glorious leader, the gryposaurus graphosaurus.

Similar projects

Copyright

All files in this repository are licensed under version two of the Mozilla Public License.

Graphosaurus has some third party dependencies listed in the package.json file in the devDependencies and dependencies sections. Their licenses can be found on their respective project pages.

graphosaurus's People

Contributors

coyotebush avatar frewsxcv avatar mwozniczak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphosaurus's Issues

Nodes/edges not fully deleted and leaking into memory?

Seems like the functions for purging nodes and edges (which, admittedly, I added) are missing deletion of some representation(s?) of themselves in the data, causing the memory to slowly but surely overflow on multiple addition/deletion operations.

Animations and front-end interface

For a personal project, I used graphosaurus and extended it to animation nodes with an interface written in angularjs. In the interface one can add static nodes (drawn using existing nodes), add animation nodes to particular frames, create groups while adding, edit colours, size, opacity, texture etc. All the controls are live bound with class variables. Do you think such a functionality can be a part of the main project?

Ignore overlapping edges/nodes?

If the user of the library attempts to add an edge between two nodes where an edge already exists, should we ignore it? Similarly, if someone adds a node at the same coordinates as an existing node, should we ignore it? On the one hand, if we ignore, we don't end up with unnecessary geometries. On the other hand, we are not performing the task the user requested and it's their fault for adding overlapping geometries.

events?

Hi, does this library have some nodes/edges events? I mean clicknode, clickedges, hovers..

change node position, adding edges dynamically

Hi Corey, just a question.
¿Is it posible to add nodes, change position, or add an edge dynamically?
i don't know if is not possible now or is an error.

Maybe some graph method to redraw?
Thanks! great project.
Santiago

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.