Coder Social home page Coder Social logo

maurojr / vue-d3-network Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emiliorizzo/vue-d3-network

0.0 2.0 0.0 1.67 MB

Vue component to graph networks using d3-force

Home Page: https://emiliorizzo.github.io/vue-d3-network/

License: MIT License

JavaScript 13.28% HTML 2.54% CSS 10.55% Vue 73.63%

vue-d3-network's Introduction

vue-d3-network

Vue component to graph networks using d3-force

vue d3 network

Demo

Demo

Installation

npm install vue-d3-network --save

Usage

  ...  
  <d3-network :net-nodes="nodes" :net-links="links" :options="options" />
  ...
import D3Network from 'vue-d3-network'
...
  components: {
    D3Network
  },
....
<style src="vue-d3-network/dist/vue-d3-network.css"></style>

Or: import source component from: 'vue-d3-network/src/vue-d3-network.vue' And install devDependencies. (d3-force, stylus and pug) See: package.json)

Props

net-nodes: Array of nodes objects.

  • Node Object:

    • id: node id. If not provided uses array index
    • name: node name. If not provided uses: 'node [node_id]'
    • color: node color, e.g. red, #aa00bb

net-links: Array of links objects:

  • id: link id. If not provided uses array index
  • tid: id of target node
  • sid: id of source node

options:

  • size: Object, graph size. Default: container size

    • w: Number
    • h: Number
  • offset: Object, graph center offset

    • x: Number
    • y: Number
  • force: Number

  • nodeSize: Number, node radius | size in px

  • linkWidth: Number, link thickness in px

  • nodeLabels: Boolean, show nodes names

  • fontSize: Number, for node labels, px

  • strLinks: Boolean, draw links as rect lines

Events

  • node-click: fired when click on node, emits (event,node-object)
  • link-click: fired when click on link, emits (event, link-id)

TODO

  • Touch support

vue-d3-network's People

Contributors

emiliorizzo avatar

Watchers

 avatar  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.