All Projects → ChenCyl → vue-network-d3

ChenCyl / vue-network-d3

Licence: MIT License
D3 Force-Directed Graph as Vue Component. D3 力导向图作为 Vue 组件。

Programming Languages

Vue
7211 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue-network-d3

d3-force-graph
Force-directed graph using D3-force and WebGL, support massive data rendering and custom style.
Stars: ✭ 74 (+111.43%)
Mutual labels:  d3, d3-force
d3-force-webgl-integration-demo
Integrating WebGL and D3-force to improve performance. 👻
Stars: ✭ 44 (+25.71%)
Mutual labels:  d3, d3-force
vx-typescript-kitchensink
Repo to test type definitions for vx
Stars: ✭ 16 (-54.29%)
Mutual labels:  d3
secret-islands
A virtual land scuttlebutt client
Stars: ✭ 17 (-51.43%)
Mutual labels:  d3
Manhattan-skyscraper-explorer
Demo application for 3D building exploration in Manhattan.
Stars: ✭ 28 (-20%)
Mutual labels:  d3
twic
Topic Words in Context (TWiC) is a highly-interactive, browser-based visualization for MALLET topic models
Stars: ✭ 51 (+45.71%)
Mutual labels:  d3
svg-time-series
SVG time-series charting library
Stars: ✭ 18 (-48.57%)
Mutual labels:  d3
coincharts
Cryptocurrency Price Chart (GDAX)
Stars: ✭ 75 (+114.29%)
Mutual labels:  d3
reusable-d3-charts
Reusable charts built with D3. Built on Web standards, fully customisable.
Stars: ✭ 33 (-5.71%)
Mutual labels:  d3
real-time-data-viz-d3-crossfilter-websocket-tutorial
Tutorial on real-time data visualization. Python websocket server & d3.js + crossfilter.js frontend
Stars: ✭ 32 (-8.57%)
Mutual labels:  d3
britecharts-react
Britecharts-react is a React wrapper for the Britecharts charting library. It allows the use of Britecharts charts within a React application.
Stars: ✭ 110 (+214.29%)
Mutual labels:  d3
d3-gridding
grids for rapid D3 charts mockups
Stars: ✭ 100 (+185.71%)
Mutual labels:  d3
ocaml-d3
OCaml bindings for D3.js
Stars: ✭ 71 (+102.86%)
Mutual labels:  d3
react-d3-integration
An example on how to integrate D3 into React
Stars: ✭ 14 (-60%)
Mutual labels:  d3
o2d3m
Wavefront OBJ to Doom3 map converter.
Stars: ✭ 15 (-57.14%)
Mutual labels:  d3
covid-19
Current and historical coronavirus covid-19 confirmed, recovered, deaths and active case counts segmented by country and region. Includes csv, json and sqlite data along with an interactive website explorer.
Stars: ✭ 15 (-57.14%)
Mutual labels:  d3
d3-list-graph
D3 layout for a graph composed of adjacent lists of nodes
Stars: ✭ 16 (-54.29%)
Mutual labels:  d3
k8s-graph
Visualize your Kubernetes (k8s) cluster
Stars: ✭ 23 (-34.29%)
Mutual labels:  d3
visited-countries
🌎 Countries I Have visited
Stars: ✭ 25 (-28.57%)
Mutual labels:  d3
react-search-example
📉📈 An example of using React with D3, Lunr.js and an autocomplete UI to build an accessible keyboard-centric search experience. Also – service workers for offline caching, and desktop app with Electron.
Stars: ✭ 15 (-57.14%)
Mutual labels:  d3

vue-network-d3

中文文档

D3 Force-Directed Graph as Vue Component.

Demo

Install

npm install vue-network-d3 --save

Quick Start

<template>
  <div id="app">
    <network :nodeList="nodes" :linkList="links"></network>
  </div>
</template>

<script>
import Network from "vue-network-d3";

export default {
  name: "app",
  components: {
    Network
  },
  data() {
    return {
      nodes: [
      	{"id": "Myriel", "group": 1},
      	{"id": "Napoleon", "group": 1},
        {"id": "Labarre", "group": 2},
        {"id": "Valjean", "group": 2}
      ],
      links: [
        {"source": "Napoleon", "target": "Myriel", "value": 1},
        {"source": "Valjean", "target": "Labarre", "value": 1},
        {"source": "Napoleon", "target": "Valjean", "value": 2},
      ]
    };
  },
};
</script>

<style>
body {
  margin: 0;
}
</style>

Props

Overview

props: {
    nodeList: Array,
    linkList: Array,
    // node related:
    nodeSize: {
      type: Number,
      default: 14
    },
    nodeTextKey: {
      type: String,
      default: "id"
    },
    nodeTypeKey: {
      type: String,
      default: "group"
    },
    nodeTextFontSize: {
      type: Number,
      default: 14
    },
    bodyStrength: {
      type: Number,
      default: -150
    },
    // link related:
    linkWidth: {
      type: Number,
      default: 2
    },
    showLinkText: {
      type: Boolean,
      default: false
    },
    linkTextKey: {
      type: String,
      default: "value"
    },
    linkTypeKey: {
      type: String,
      default: "type"
    },
    linkTextFrontSize: {
      type: Number,
      default: 10
    },
    linkDistance: {
      type: Number,
      default: 50
    },
    // svg raleted:
    svgSize: {
      type: Object,
      default: () => {
        return {
          width: window.innerWidth,
          height: window.innerHeight
        };
      }
    },
    svgTheme: {
      type: String,
      default: "light" // dark or light
    },
    // others:
    highlightNodes: {
      type: Array,
      default: () => {
        return [];
      }
    }
}

Detailed Design

」​ means necessary

  • nodeList: Array of Node Object which has

    • id: Number or String. Node id and also node name (can be changed by nodeTextKey)
    • group: Number or String. like node type (can be changed by nodeTypeKey)
  • linkList: Array of Link Object which has

    • source: Number or String. Id of source node.
    • target: Number or String. Id of target node.
    • value: Number or String. Link name (can be changed by linkTextKey)
  • nodeSize: Number.

  • nodeTextKey: String. Key of node text/name. The default value is 'id', you need to set it to 'name' if your node object is like:

    {
      id: 1010,
      name: 'Myriel'
    }
  • nodeTypeKey: String. Key of node type. The default value is 'group', you need to set it to 'type' if your node object is like:

    {
      id: 'Myriel',
      type: 1
    }
  • nodeTextFontSize: Number.

  • linkWidth: Number.

  • showLinkText: Boolean. Show link text or not. Suggest keeping it false, link text will show when you hover on the link.

  • linkTextKey: String. Key of link text/name. The default value is 'value', you need to set it to 'name' If your link object is like:

    {
      source: 'Napoleon',
      target: "Myriel", 
      name: 'friend'
    }
  • linkTypeKey: String. Key of link type. The default value is 'type'.

  • linkTextFrontSize: Number.

  • linkDistance: Number.

  • svgSize: Object which has

    • width: Number.
    • height: Number
  • svgTheme: String. 'light' or 'dark', 'light' is default.

  • bodyStrength: Number. A positive value causes nodes to attract each other, similar to gravity, while a negative value causes nodes to repel each other, similar to electrostatic charge.

  • highlightNodes: Array of node id. Stroke of nodes turn yellow.

Events

  • clickNode: emits (event, node-object)
  • clickLink: emits (event, link-object)
  • hoverNode: emits (event, node-object)
  • hoverLink: emits (event, link-object)

Classes

  • .element: all nodes and links
  • .node: all nodes
  • .link: all links
  • .[type]: nodes where node[nodeTypeKey] == type, links where link[linkTypeKey] == type
  • .selected: selected nodes (clicked node with its first layer nodes)

Reference

Repo

TODO

  • Docs: props and events
  • Learn Vue-CLI more
  • Fix: node's style when hover
  • CI
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].