Git Product home page Git Product logo

angular-directed-graph's Introduction

Directed Graph Component for Angular

This is a modular component to render an SVG graph of nodes connected by edges.

By default, each node is rendered as a box, with curved lines connecting them.

This can be customized by providing your own templates to render the node and edges.

Data is expected to be supplied to the graph as basic Node and Edge objects (see model.ts). These interfaces may be optionally parameterized to wrap custom data specific to you graph. Node and Edge objects are passed to the custom templates so you may access your custom data in your templates.

Example usage

Create a simple graph using the default rendering options:

@Component({
  template: `<directed-graph [graph]="myGraphData"></directed-graph>`,
  ...
})
export class MyGraph {
  node1 = {id: 'Node 1', width: 100, height: 50};
  node2 = {id: 'Node 2', width: 100, height: 50};
  edge1 = {src: this.node1, dest: this.node2, points: []};
  myGraphData = {
    nodes: [this.node1, this.node2],
    edges: [this.edge1],
  };
}

angular-directed-graph's People

Contributors

frigus02 avatar noranglemon avatar tfx-copybara avatar ydko avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

angular-directed-graph's Issues

Export Path Functions

There are a lot of functions in the paths module that are not exported. Many of them would be very useful utilities for drawing my own paths, instead of needing to start from scratch (or copying the whole file into my own project. If I opened a PR exporting more of them, would that be welcome?

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.