GithubHelp home page GithubHelp logo

d3-adjacency-matrix-layout's Introduction

d3-adjacency-matrix-layout

a d3 version 4 port of the adjacencyMatrix d3-plugin from @Elijah_Meeks

see the layout in use at http://bl.ocks.org/micahstubbs/7f360cc66abfa28b400b96bc75b8984e

develop with es2015 then bundle and transpile to todays-browsers-friendly es5 Javascript with the command
npm run prepublish

Download

build/d3-adjacency-matrix-layout.js

API Reference

matrix.size An array of [width, height] that is used to calculate grid x, y, height and width.

matrix.nodes An array of the nodes of your network.

matrix.links An array of the edges of your network. As with other D3 network layouts, if the source and target properties are numbers, they are assumed to be array position within the nodes array, otherwise objects are assumed.

matrix.edgeWeight The function to return the weight of the edges of your links, if any. Defaults to returning 1.

matrix.nodeID The function to return the id value of a node, defaults to returning #node.id. The id is used to build the matrix and drive the axes.

matrix.xAxis Cannot be set. Call this from the same place where you've put your matrix cells and it will build a simple horizontal axis with labels from your node id.

matrix.yAxis Cannot be set. Call this from the same place where you've put your matrix cells and it will build a simple vertical axis with labels from your node id.

matrix.directed Set to false if you want to mirror undirected networks.

d3-adjacency-matrix example

d3-adjacency-matrix-layout's People

Contributors

micahstubbs avatar

Stargazers

ekis avatar  avatar  avatar LYF avatar  avatar  avatar  avatar  avatar Saan Kim avatar Cameron Yick avatar Mason Chinkin avatar Jules Blom avatar Josh Teneycke avatar  avatar Vasco Asturiano avatar Travis Arnold avatar Roman Lishtaba avatar Brock Tibert avatar timelyportfolio avatar Dean Farrell avatar

Watchers

timelyportfolio avatar James Cloos avatar Roman Lishtaba 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.