• Stars
    star
    416
  • Rank 103,785 (Top 3 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Web application to illustrate the relationships between objects in a process using d3.js.

d3 process map

This is a PHP web application that displays a directed acyclic graph in a modern web browser using d3.js. It is designed for illustrating the relationships between objects in a process.

Examples

Data manipulation and reporting process:

Default dataset
https://nylen.io/d3-process-map/

Co-occurrences of Les Miserables characters:

Les Mis dataset
https://nylen.io/d3-process-map/?dataset=les-mis

Features

  • Hover over a node to see that object's relationships. (Unrelated objects and links will be made partially transparent.)
  • Click on a node to show the documentation for that object.
  • Click the "View list" button to view the documentation for all objects (good for printing).

Data format

The application can display one or more datasets located in the data/ folder. Each dataset gets its own folder. There are two datasets bundled with the application (one for each of the examples above). Switch between datasets by appending ?dataset=folder-name to the URL. If no dataset name is given, the dataset in the default folder will be displayed.

Each dataset should contain the following files:

  • objects.json
  • config.json
  • *.mkdn (one per object)

objects.json

An array of data objects to be displayed as graph nodes, each with the following properties:

  • name: The name of this object
  • type: The type of this object (e.g. view, table, etc.)
  • depends: An array of object names that this object depends on.
  • group (optional): This could be thought of as a "subtype".

config.json

A JSON object which contains the following fields:

  • title: The page title.
  • graph: The parameters for the graph and the d3.js force layout.
    • linkDistance: The link distance for the d3.js force layout.
    • charge: The charge for the d3.js force layout.
    • height: The height of the graph, in pixels. (The width of the graph is determined by the width of the browser window when the page is loaded.)
    • numColors: The number of colors to display (between 3 and 12).
    • labelPadding: The padding inside the node rectangles, in pixels.
    • labelMargin: The margin outside the node rectangles, in pixels.
  • types: Descriptions of the object types displayed in this graph, each with a long and a short field that describe the object type for documentation and for the graph legend, respectively.
  • constraints: An array of objects that describe how to position the nodes. Each constraint should have a type field whose value should be either 'position' or 'linkStrength', and a has field that specifies the conditions an object must meet for the constraints to be applied.
    • Position constraints: These constraints should have the properties weight, x (optional) and y (optional). On each iteration of the force layout, node positions will be "nudged" towards the x and/or y values given, with a force proportional to the weight given.
    • Link strength constraints: These constraints should have the property strength, which is a multiplier on the link strength of the links to and from the objects that the constraint applies to. This can be used to relax the position of certain nodes.

*.mkdn

Each object can have a Markdown file associated with it for additional documentation. The syntax is standard Markdown with one addition: object names can be enclosed in {{brackets}} to insert a link to that object.

If an object's name contains a slash (/), replace it with an underscore (_) in the documentation filename.

Other details

The code uses a d3.js force layout to compute object positions, with collision detection to prevent nodes from overlapping each other.

Nodes are colored by the ColorBrewer Set3 scheme, with colors assigned by the combination of the object's type and group.

To ensure that the arrows on the ends of the links remain visible, the links only extend to the outer edge of the target object's node.

Browser support

Works in recent versions of Chrome and Firefox. Other browsers have not been tested, but Internet Explorer doesn't stand a chance until at least version 9.

More Repositories

1

gnucash-django

Simple Web frontend for GnuCash, using Django
JavaScript
98
star
2

vba-common-library

Common VBA Library: Contains functions that are missing in the VBA language. Mainly for use with Excel.
Visual Basic
59
star
3

cyg-apt

Command-line Cygwin package manager that actually works (* or at least used to, YMMV)
Python
47
star
4

shiftcheckbox

jQuery plugin to handle selecting ranges of checkboxes via Shift+Click (and more)
PHP
37
star
5

d3-spirograph

d3.js spirograph - https://nylen.io/d3-spirograph/
JavaScript
21
star
6

auto-f1-presser

USB "keyboard" that automatically presses F1 every 5 seconds, using an Arduino Uno
Shell
21
star
7

node-json-align

Library and script to pretty-print JSON with values aligned together.
JavaScript
17
star
8

node-web-media-player

Super simple media player controller designed for Raspberry Pi.
CSS
15
star
9

gutenberg-examples

Moved to https://github.com/WordPress/gutenberg-examples
14
star
10

wait-until

Simple Node.js library to wait until a condition has been satisfied.
JavaScript
13
star
11

easy-tree

Simple Node.js library to manipulate tree data structures.
JavaScript
12
star
12

home-config

Simple Node.js library for managing a config file in a user's home dir.
JavaScript
10
star
13

openwesabe-installer

Installer for the open-source version of Wesabe.
Shell
10
star
14

rtgui

rtGui with my enhancements
PHP
9
star
15

wp-rest-notepad

Simple "secret notepad" powered by the WordPress REST API.
PHP
6
star
16

win-copy-paths-ext

Finally, a Windows copy path(s) shell extension that behaves just how I want.
C++
5
star
17

scrabble-words

PHP application to store a list of memorable words with definitions.
PHP
3
star
18

taper

tap test runner for Node.js that shows an appropriate level of detail with colorized output.
JavaScript
3
star
19

node-miner-rpc

CGMiner and BFGMiner RPC client for Node.js
JavaScript
3
star
20

xmonad-config

My xmonad configuration
Haskell
3
star
21

node-wp-hooks

WordPress actions and filters in JS
JavaScript
3
star
22

node-regexp-escape

RegExp.escape function for quoting text for a regular expression.
JavaScript
3
star
23

phoenix-config

My jasonm23/phoenix config
JavaScript
2
star
24

discourse-api-proxy

PHP script to simulate more fine-grained authentication capabilities for the Discourse REST API.
PHP
2
star
25

wesabe-balances

Simple web application to show balances of Wesabe accounts.
PHP
2
star
26

cage

Nicolas Cage
2
star
27

the-closer

Bot to automatically close new GitHub issues.
JavaScript
2
star
28

coinmon

Start and monitor BitCoin mining
Shell
2
star
29

babel-plugin-transform-jsx-flexible

Turn JSX into arbitrary function calls
JavaScript
2
star
30

scripts-tmux-screen

Scripts for working with tmux and screen.
JavaScript
2
star
31

teradata-utils

Useful Teradata queries including one that helps compare 2 similar tables.
2
star
32

hashtag

Node.js interleaved #text and #hashtags parser
JavaScript
1
star
33

Enriched-Editor

JavaScript
1
star
34

infrastructure-template

Template for creating and managing Devuan servers on DigitalOcean using Terraform + Ansible.
Shell
1
star
35

PHP-Error-Log-Viewer

A plugin to bring the PHP error log into the ClassicPress dashboard with color coding, sorting, and filitering.
PHP
1
star
36

connectbot

ConnectBot is a powerful open-source Secure Shell (SSH) client. It can manage simultaneous SSH sessions, create secure tunnels, and copy/paste between other applications.
Java
1
star
37

ooml-case-factory

3D printed case generator
C++
1
star
38

Ambiance-theme-mod

Modifications to Ubuntu 10.10's Ambiance theme
Shell
1
star
39

vimfiles

My vim config
Python
1
star
40

node-mediawiki

Functions and scripts for manipulating a MediaWiki instance.
JavaScript
1
star
41

slack-archiver

Set of tools to archive a Slack workspace.
JavaScript
1
star
42

exchangeIt

byarger's exchangeIt with my modifications to try and get it to work on Exchange 2007.
Java
1
star
43

i8042-debounce

Kernel module to debounce keypresses on my buggy Dell XPS keyboard
C
1
star
44

chronolog

Simple Node.js library to write logging messages prefixed with the current date.
JavaScript
1
star
45

burning-man-2016-leds

WS2812 LED strips + Arduino for Burning Man
C
1
star
46

lockd

A network lock service and client library. Port of apokalyptik/glockd to Node.js.
JavaScript
1
star
47

selectfocus

jQuery plugin to select all text in a textbox when it is focused
JavaScript
1
star