• Stars
    star
    248
  • Rank 163,560 (Top 4 %)
  • Language
    JavaScript
  • Created almost 12 years ago
  • Updated almost 6 years ago

Reviews

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

Repository Details

JQuery Organisation Chart Plugin

jquery-orgchart

The original JQuery Organisation Chart Plugin.

IMPORTANT! This project has been superceded by the react-org-chart project.

This is a small JQuery plugin that generates a hierarchical orginisational chart from a nested unordered list.

HTML/CSS purists likely would not be happy with this since it uses nested tables to achieve the layout. Nevertheless, it works pretty well and you can make nice looking interactive organisational charts with it quite easily.

This has been tested on Firefox and Chrome on Linux, and Firefox and Chrome on Windows. It also works on IE8, but due to the deficient CSS support in that broken browser the chart looks quite basic.

See jquery-orgchart-plugin for more information.

There are some live demos.

There are also some old live demos.

There is also an advanced live demo showing Bootstrap integration and one approach to navigating an interactive chart.

Some new tutorials are available.

NEW: 2015/02/20

Add an "adjunct" node inside your list item, an adjunct can be used for example for an "Assistant to..." relationship on the chart. Using an adjunct is simple, just add an "<adjunct>" element to your list item. The adjunct element can contain HTML.

If you have created some publically available beautiful or interesting charts, please send links or screen-shots to:

mark [dot] lee [at] capricasoftware [dot] co [dot] uk

Features

  • HTML markup, including clickable hyperlinks, inside the chart nodes;
  • All attributes from the source list get baked into the corresponding chart nodes (e.g. you can annotate the nodes with your own "data" attributes);
  • Optionally add an "adjunct" node to each chart node (e.g. for "Assistant to" type relationships);
  • Options to limit the chart to the desired number of levels, and show remaining levels in a single stack;
  • Options to copy CSS styles, classes, HTML data attributes and title attributes (useful for tooltips or external tooltip plugins) from the source list (all enabled by default);
  • Optional callback to handle clicked chart nodes;
  • Small size, only 3K minified (7K un-minified);
  • Easy to to change the appearance of the chart by overriding a small number of CSS style rules;
  • Does exactly what it says on the tin, no feature bloat!

Configuration Options

chartClass (string) is used to specify a CSS class to add to the created chart.

container (jQuery element) specifies the element that will contain the chart.

copyClasses (boolean) specifies whether or not CSS classes should be copied from the source list to the associated chart nodes.

copyData (boolean) specifies whether or not data attribute values should be copied from the source list to the associated chart nodes.

copyStyles (boolean) specifies whether or not the CSS "style" attribute values should be copied from the source list to the associated chart nodes.

copyTitle (boolean) specifies whether or not the "title" attribute values should be copied from the source list to the associated chart nodes.

depth (integer) is used in conjunction with stack to configure at what level the stacking takes effect.

fade (boolean) is used to enable a fading animation when showing/hiding chart nodes.

hoverClass (string) is used to specify the CSS class that gets dynamically added to chart nodes on mouse-over.

interactive (boolean) is used to enable interactive chart features, like clicking to show/hide child nodes.

levels (integer) specifies how many levels deep in the source list are used to create the chart.

nodeClicked (function) callback function invoked when a chart node is clicked: the first parameter is the underlying node element; the second parameter is the visual component that was clicked (a jQuery object).

nodeText (function) callback function used to extract node text context.

replace (boolean) true if the chart container should be emptied before generating the chart.

showLevels (integer) specifies how many chart levels to show initially.

speed (jQuery speed) specifies the animation speed if fade is enabled.

stack (boolean) is used to enable stacking.

Simple Example

Organisation Chart Demo

$("#organisation").orgChart({container: $("#main")});

In this example "#organisation" is the selector for the source list and the "container" option specifies the target container for the generated chart.

Live Demo

Source for Simple Demo

Simple Stacking Example

Organisation Chart Stacking Demo

$("#organisation").orgChart({container: $("#main"), stack: true, depth: 2});

Building on the previous example, the "stack" option is added with a corresponding chart "depth" of "2". This means that the chart will display two levels before stacking any remaining levels in a single list.

Live Demo

Source for Simple Stacking Demo

Styling Levels Example

Organisation Chart Styling Levels Demo

$("#organisation").orgChart({container: $("#main")});
div.orgChart div.node.level1 {
    background-color: #fbcece;
}
div.orgChart div.node.level1.special {
    background-color: white;
}
div.orgChart div.node.level2 {
    background-color: #cefbce;
}
div.orgChart div.node.level3 {
    background-color: #e0cefb;
}

Each node in the chart automatically gets assigned a class for its level, this can be used to style each level individually.

Any classes that are specified on items in the source list get applied to the corresponding chart node, this can also be used to customise the style for a particular node or collection of nodes. In this example the main protagonist has his own unique background colour applied, overriding the colour for his level in the chart. The root of the chart has level zero.

Live Demo

Source for Styling Levels Demo

Eating Your Own Dog Food Example

Organisation Chart Dog Food Demo

$("#organisation").orgChart({container: $("#main")});

Live Demo

Source for Dog Food Demo

Other Examples

Simple Interactive Live Demo

Links Live Demo

On-Click Live Demo

More Repositories

1

vlcj

Java framework for the vlc media player
Java
1,130
star
2

vlcj-player

Feature-rich example vlcj media player
Java
178
star
3

vlcj-javafx-demo

Sample application showing vlcj rendering video in a JavaFX scene.
Java
113
star
4

picam

Unofficial Java API library for the Raspberry Pi camera.
Java
49
star
5

vlcj-javafx

JavaFX support classes for vlcj.
Java
40
star
6

vlcj-examples

Examples for the vlcj project
Java
27
star
7

choonio

An audio player implemented using vlcj, VLC, Spring Boot and React
TypeScript
23
star
8

vlcj-info

Small library to extract media information from local files.
Java
17
star
9

vlcj-natives

Native bindings to LibVLC used by the vlcj project
Java
14
star
10

vlcj-lwjgl-demo

Demo application embedding a vlcj media player in a LWJGL application
Java
14
star
11

ezcap-linux

Some notes on how to get an EZCap USB capture device working under Linux for VLC et al
14
star
12

bootlace

A complete AngularJS, Spring MVC, Spring Security and MongoDB reference web application
JavaScript
13
star
13

spa-javalin-react

Basic Javalin web application configured for a ReactJS single page client application
JavaScript
8
star
14

vlcsharp

Port of vlcj to platform-independent C#
C#
6
star
15

spa-vertx-vue

Basic Vert.x web application configured for a VueJS single page client application
Java
5
star
16

spa-vertx-angular

Basic Vert.x web application configured for an AngularJS single page client application
Java
5
star
17

react-org-chart

Simple hierarchical organisation chart component for ReactJS
JavaScript
5
star
18

picam-native

JNI native library for the picam project
C
4
star
19

spa-spring-vue

Basic SpringMVC web application configured for a VueJS single page client application
Java
4
star
20

youtube-comments

Download a YouTube comment thread as a spreadsheet
Java
3
star
21

lircj

Java wrapper for LIRC
Java
3
star
22

spa-vertx-react

Basic Vert.x web application configured for a ReactJS single page client application
JavaScript
3
star
23

media-scanner

Scan directories recursively for media, with pluggable title and meta-data parsing.
Java
3
star
24

micro-frontend

Complete example of a micro-frontend application built using ReactJS
JavaScript
2
star
25

spa-boot-react

Basic Spring Boot web application configured for a ReactJS single page client application
Java
2
star
26

react-template-app

Template application for React, with Typescript, Jest, ESLint, Prettier, Husky and maybe more
JavaScript
2
star
27

sfa

Fully working single page reference application with React, SpringBoot, Spring Security and MongoDB
Java
2
star
28

spa-spring-react

Basic SpringMVC web application configured for a ReactJS single page client application
Java
2
star
29

vlcj-subs

Optional vlcj library for integrating subtitle/sub-picture functionality
Java
2
star
30

generator-prospa

Create fully working Single Page Applications using various technology combinations with Yeoman
JavaScript
2
star
31

vlcj-hue-concept

Proof of concept application showing how vlcj could be used to provide ambient light cues
Java
2
star
32

vlcj-swt-swing

Example showing how to use vlcj and SWT embedded in a Swing application
Java
1
star
33

vlcj-radio-demo

A demo application that uses vlcj to play internet radio streams
Java
1
star
34

rotten-tomatoes-service

Simple service to access the Rotten Tomatoes public web services.
Java
1
star
35

inhibit

Small library to inhibit the desktop screensaver on Linux
C
1
star
36

image-utils

Simple image processing utilities.
Java
1
star
37

nodejs-typescript-example

Example project showing how to create a NodeJS application with Typescript in Visual Studio Code
TypeScript
1
star
38

bloodmatch

MeteorJS reference application, a real-time multiplayer matchmaking web application for Bloodborne
JavaScript
1
star
39

tmdb-service

Simple service to access themoviedatabase.org public web services.
Java
1
star
40

vlcj-osx-stubs

Various stubs for OSX-specific classes used to cross-compile vlcj on Linux or Windows
Java
1
star
41

next-starter

Starter project for NextJS with ESLint, Prettier and Husky
JavaScript
1
star
42

segment-amplitude-testing

TypeScript
1
star
43

vlcj-swt

Support library to use an EmbeddedMediaPlayer with an SWT video surface
Java
1
star
44

reactive-gridfs

Example showing how to use Spring Boot, Spring Web Flux and GridFS to create a reactive simple file upload/download service.
Java
1
star
45

font-face-test

TypeScript
1
star
46

vlcj-file-filters

User interface FileFilter implementations for file types supported by vlcj
Java
1
star
47

arty

Various components used to deal with art resources
Java
1
star
48

brue

Java framework for the Philips Hue bridge web-service API
Java
1
star
49

vlcj-legacy

Legacy components used by FFI version of vlcj.
Java
1
star
50

native-streams

A small library that enables the redirection of native process in/out/err streams to any file
Java
1
star
51

expo-starter

Starter project for React Native with Expo, Typescript, and modern tooling
TypeScript
1
star
52

brue-okhttp

OkHttp implementation for the Brue project
Java
1
star
53

image-service

Java
1
star
54

caprica

1
star
55

spa-boot-vue

Basic Spring Boot web application configured for a VueJS single page client application
Java
1
star