All Projects → emiliorizzo → Vue D3 Network

emiliorizzo / Vue D3 Network

Licence: mit
Vue component to graph networks using d3-force

Projects that are alternatives of or similar to Vue D3 Network

V Chart Plugin
Easily bind a chart to the data stored in your Vue.js components.
Stars: ✭ 188 (-54.7%)
Mutual labels:  graph, component, chart, d3, d3v4
multi-verse
lit-element components for fast and modular multivariate analysis
Stars: ✭ 34 (-91.81%)
Mutual labels:  d3, chart, d3v4
React D3 Tree
🌳 React component to create interactive D3 tree graphs
Stars: ✭ 543 (+30.84%)
Mutual labels:  graph, chart, d3
Billboard.js
📊 Re-usable, easy interface JavaScript chart library based on D3.js
Stars: ✭ 5,032 (+1112.53%)
Mutual labels:  graph, chart, d3
Diffract
A set of d3 based visualization components built for React
Stars: ✭ 87 (-79.04%)
Mutual labels:  graph, chart, d3
React D3 Components
D3 Components for React
Stars: ✭ 1,599 (+285.3%)
Mutual labels:  graph, chart, d3
React Charts
⚛️ Simple, immersive & interactive charts for React
Stars: ✭ 1,302 (+213.73%)
Mutual labels:  component, chart, d3
C3
📊 A D3-based reusable chart library
Stars: ✭ 9,163 (+2107.95%)
Mutual labels:  graph, chart, d3
P2p Graph
Real-time P2P network visualization with D3
Stars: ✭ 245 (-40.96%)
Mutual labels:  graph, network, d3
multi-chart
lit-element building blocks for charts and visualization (based on d3.js v5)
Stars: ✭ 24 (-94.22%)
Mutual labels:  d3, chart, d3v4
d3.geometer
[NOT MAINTAINED] A D3js library for drawing polytopes, angles, coordinates, geometries and more.
Stars: ✭ 18 (-95.66%)
Mutual labels:  d3, d3v4
Ngx Charts
📊 Declarative Charting Framework for Angular
Stars: ✭ 4,057 (+877.59%)
Mutual labels:  chart, d3
d3-dotmatrix
Open Source Javascript library to render Dot Matrix Charts
Stars: ✭ 14 (-96.63%)
Mutual labels:  d3, chart
a2d3
Flexible and extensible D3 directives for Angular 2
Stars: ✭ 22 (-94.7%)
Mutual labels:  d3, chart
jelly-chart
Jelly-Chart is a chart library based on D3v4 and SVG.
Stars: ✭ 34 (-91.81%)
Mutual labels:  d3, chart
d3-sankey-circular
A fork of the d3-sankey library to allow circular links.
Stars: ✭ 65 (-84.34%)
Mutual labels:  d3, d3v4
Plottable
📊 A library of modular chart components built on D3
Stars: ✭ 2,834 (+582.89%)
Mutual labels:  chart, d3
Fl chart
A powerful Flutter chart library, currently supporting Line Chart, Bar Chart, Pie Chart, Scatter Chart and Radar Chart.
Stars: ✭ 3,882 (+835.42%)
Mutual labels:  graph, chart
d3-ng2-demo
Reusable visual power? A demo of using D3 version 4 with Angular 2+.
Stars: ✭ 53 (-87.23%)
Mutual labels:  d3, d3v4
comparative-layout-explorer
📊 x 📊 =❓An online gallery to explore the design space of comparative layouts
Stars: ✭ 16 (-96.14%)
Mutual labels:  d3, chart

GitHub issues GitHub license npm

vue-d3-network

Vue component to graph networks using d3-force

vue d3 network

Demo

Demo

Features

  • SVG render
  • Canvas render
  • Links and nodes selection
  • svg <-> canvas shared styles via css
  • Screenshots, export as svg or png (svg renderer), export as png (canvas renderer)
  • Touch support

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 node objects

net-links: Array of link objects

selection : Object, links and nodes selected

  • links: Object with node.ids as keys, node objects as values
  • nodes: Object with link.ids as keys, links objects as values

nodeSym: String, node sprite svg doc

nodeCb: Function(node) -> node, node formatter

linkCb: Function(link) -> link, node link formatter

simCb: Function(sim) -> sim, d3 simulation formatter

customForces: Object: { [d3Function]:args }

options:

  • canvas: Boolean, render as canvas, false = svg

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

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

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

  • forces Object:

    • Center: Boolean, use d3.forceCenter
    • X: strength, use d3.forceX
    • Y: strength, use d3.forceY
    • ManyBody: Boolean, use d3.forceManyBody, takes the negative value of 'force' option
    • Link: Boolean, use d3.forceLink
  • nodeSize: Number, node radius | size in px

  • linkWidth: Number, link thickness in px

  • nodeLabels: Boolean, show nodes names

  • linkLabels: Boolean, show links names

  • fontSize: Number, for node labels, px

  • strLinks: Boolean, draw links as rect lines

  • resizeListener:Boolean, defaults: true ,add listener to window.resize event

  • noNodes: Boolean, no render nodes

  • canvasStyles: Object

Events

  • node-click: fired when click on node, emits (event,node-object)
  • link-click: fired when click on link, emits (event, link-object)
  • screen-shot: fired when screenshot creation is done, emits (error)

Methods

  • screenShot (name, bgColor, toSVG, svgAllCss), all arguments are optional
    • name: file name
    • bgColor: CSS color, png background color
    • toSVG: Boolean, (svg renderer) true: export as svg, false : export as png
    • svgAllCss: Boolean (svg renderer) true: include all styles in svg false: include only matched styles. This option is useful, for example to include hover actions on exported svg file

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,
  • _cssClass: node css class name
  • _labelClass: node label css class name
  • svgSym: node icon, svg document (only works in svg renderer)
  • _size : node size (svg renderer only)
  • _width: node width (svg renderer only)
  • _height: node height (svg renderer only)
  • _svgAttrs: Object, svg node attributes

Link Object

  • id: link id. If not provided uses array index
  • name: node name. If not provided uses: 'link [link_id]'
  • tid: id of target node
  • sid: id of source node
  • _color: link color, e.g. red, #aa00bb,
  • _svgAttrs: Object, svg line attributes

Css style and canvas style

SVG css classes:

  • .node: nodes symbol
  • .link: link line
  • .node-label: nodes names
  • .node .selected: node selected
  • .link .selected link selected
  • .node .pinned: node pinned

To use this css styles in canvas we create 'ghosts' svg elements to pick up values from computed css properties. If you want, you can stylize the canvas elements directly, setting: options.canvasStyles, but these styles will not be applied to the svg graph.

see: src/canvasStyles.js

TODO

  • [x] Touch support
  • [ ] Optimization
  • [ ] Zoom
  • [x] Canvas Render
  • [x] Nodes sprites

More Examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].