Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 Version of org chart #70

Merged
merged 65 commits into from
Aug 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
86d9b87
Added initial files, new structure
bumbeishvili Jul 2, 2021
76b54f9
implemented normal d3-plugin workflow
bumbeishvili Jul 3, 2021
a2c7546
Add build files to gitignore
bumbeishvili Jul 3, 2021
ac59e84
Simplify default content
bumbeishvili Jul 5, 2021
797c9cc
Use flextree instead of d3.tree
bumbeishvili Jul 9, 2021
b8fcdd0
Added right,top,left,bottom layout options
bumbeishvili Jul 13, 2021
5ef8015
New arrow functionality
bumbeishvili Jul 13, 2021
c5db0e4
position improvements, id & parentId specification
bumbeishvili Jul 15, 2021
c8ba290
Fixed all previous actions
bumbeishvili Jul 15, 2021
4143c02
Implemented chart fitting and node centering
bumbeishvili Jul 16, 2021
ebd5568
Uniform centering and expansion functionality
bumbeishvili Jul 16, 2021
b64f9ef
Implemented highlighting
bumbeishvili Jul 17, 2021
8fa58b6
Added neighbour margin option
bumbeishvili Jul 18, 2021
0794590
Fix for one element data array
bumbeishvili Jul 18, 2021
857c41d
fix expansions and multi node tree
bumbeishvili Jul 18, 2021
4589414
Implemented full screen functionality
bumbeishvili Jul 18, 2021
021a2ea
Implemented procedural zoom in and zoom out
bumbeishvili Jul 18, 2021
317f70d
Implemented exporting
bumbeishvili Jul 19, 2021
a106cd1
Implemented expand all
bumbeishvili Jul 24, 2021
377199e
fonts:#641 - fix size for planting tool
bumbeishvili Jul 28, 2021
ee33e5e
Added connections functionality
bumbeishvili Jul 29, 2021
70aeb20
completed vertical compact layout
bumbeishvili Aug 8, 2021
1405470
Completed compact layout work
bumbeishvili Aug 9, 2021
57cc906
Create docs.md
bumbeishvili Aug 9, 2021
2bef09f
Merge branch 'development' of https://github.com/bumbeishvili/d3-orga…
bumbeishvili Aug 9, 2021
92adfb6
Added examples
bumbeishvili Aug 9, 2021
6f6550f
PDF Export
bumbeishvili Aug 10, 2021
9337b4f
Circles example
bumbeishvili Aug 11, 2021
110c9c7
Change examples height
bumbeishvili Aug 11, 2021
623fb12
Format
bumbeishvili Aug 11, 2021
8ed9fbc
Added oval example version
bumbeishvili Aug 11, 2021
e96a9ca
Fix docs table layout
bumbeishvili Aug 11, 2021
79e7e62
Increase docs image height
bumbeishvili Aug 11, 2021
b54b0f0
Increase examples height, add oval version
bumbeishvili Aug 11, 2021
4a101d5
Added clean design version
bumbeishvili Aug 11, 2021
84f1e16
Add futuristic design version
bumbeishvili Aug 12, 2021
b301ab5
Update readme docs
bumbeishvili Aug 13, 2021
add10ac
Full sized gif in readme
bumbeishvili Aug 13, 2021
f78c588
Reduce example image dimensions
bumbeishvili Aug 13, 2021
e7d0597
Update readme, remove logs
bumbeishvili Aug 13, 2021
b7f3be3
Update main title
bumbeishvili Aug 13, 2021
2f9809c
remove unnecessary file
bumbeishvili Aug 13, 2021
8ef0229
Reorganize files
bumbeishvili Aug 13, 2021
23e7b1c
Move conduct and license to misc folder
bumbeishvili Aug 13, 2021
ac4e7b0
Typo
bumbeishvili Aug 13, 2021
5715fa3
Link Edit
bumbeishvili Aug 13, 2021
0bd5f43
Added prev version sample
bumbeishvili Aug 13, 2021
6961d78
Update npm version
bumbeishvili Aug 14, 2021
46be5a0
2.0.1-rc.0
bumbeishvili Aug 14, 2021
e45ad22
2.0.1-rc.1
bumbeishvili Aug 14, 2021
8121ae9
2.0.1-rc.2
bumbeishvili Aug 14, 2021
2b1d643
Changed Main Point
bumbeishvili Aug 14, 2021
7fabfc6
2.0.1-rc.3
bumbeishvili Aug 14, 2021
3ff98a8
Updated
bumbeishvili Aug 14, 2021
6649d0e
2.0.1-rc.3
bumbeishvili Aug 14, 2021
7b2e0b6
2.0.1-rc.4
bumbeishvili Aug 14, 2021
d951667
Added npm ignore
bumbeishvili Aug 14, 2021
fb78be1
2.0.1-rc.5
bumbeishvili Aug 14, 2021
f3f0311
Reorganize imports
bumbeishvili Aug 14, 2021
93d42f3
2.0.1-rc.6
bumbeishvili Aug 14, 2021
f0d30cb
Fix importing error
bumbeishvili Aug 14, 2021
c295d08
2.0.1-rc.7
bumbeishvili Aug 14, 2021
885243e
Improve node click handling
bumbeishvili Aug 14, 2021
c62fedd
2.0.1-rc.8
bumbeishvili Aug 14, 2021
40680d2
Update integration samples
bumbeishvili Aug 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
build/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


package-lock.json
121 changes: 121 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


package-lock.json
67 changes: 39 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
# D3 v5 organization chart
# Highly customizable d3 based organization chart
[![NPM Version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=js&type=6&v=1.1.1&x2=0)](https://npmjs.org/package/d3-org-chart)
[![](https://img.shields.io/npm/dm/d3-org-chart)](https://npmjs.org/package/d3-org-chart)

<p align="center">
<!-- Thanks Vasturiano for this trick - https://github.com/vasturiano -->
<a href="https://observablehq.com/@bumbeishvili/d3-v5-organization-chart"><img width="80%" src="https://user-images.githubusercontent.com/6873202/74429052-a7b3b780-4e73-11ea-82c2-b65b5bd0c27d.gif"></a>
<a href="#"><img width="100%" src="https://user-images.githubusercontent.com/6873202/129306455-09f47e5e-0dc8-41b5-8fe2-da3fa4e0f7ed.gif"></a>
</p>






Highly customizable org chart built with d3 v5.
Highly customizable org chart built with d3 v7.

Have you impressivelly customized an organizational chart and want to be featured on this page? Just email me at me@davidb.dev and include screenshot of your org chart and it will be featured on this page (dimensions of image should be 500 X 500).


Featured customizations:

| | | | |
|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|
|<img alt="screen shot 2017-08-07 at 12 18 15 pm" src="https://user-images.githubusercontent.com/6873202/120426599-753c0f80-c381-11eb-9695-c63808c98951.png"> <div style="100%">Light gradient version with horizontal layout</div> | <img alt="screen shot 2017-08-07 at 12 18 15 pm" src="https://user-images.githubusercontent.com/6873202/120426591-6f462e80-c381-11eb-9f77-2cf85b216a41.png"> <div style="100%">Compact layout</div> |

## Jump To Examples



| | |
|:-------------------------:|:-------------------------:|
|<a href="https://stackblitz.com/edit/web-platform-sgsxzp"><img height="400px" src="https://user-images.githubusercontent.com/6873202/128979415-1b7fb969-6fc6-4a25-9ae2-87da7a9b031c.png"></a> <div style="100%">Default</div> | <a href="https://stackblitz.com/edit/web-platform-jyncb9"><img height="400px" src="https://user-images.githubusercontent.com/6873202/128979000-e5111571-8021-4c56-93d3-8d40dfe57536.png"></a> <div style="100%">Sky </div>
| <a href="https://stackblitz.com/edit/web-platform-lwyild"><img height="400px" src="https://user-images.githubusercontent.com/6873202/128978399-32f890c6-86f7-46e2-b41e-58202e61f03b.png"></a> <div style="100%">Circles</div>| <a href="https://stackblitz.com/edit/web-platform-uhd3q7"><img height="400px" src="https://user-images.githubusercontent.com/6873202/129042576-0a8b27da-7a9d-4dee-b5b6-68080772cc9f.png"></a> <div style="100%">Oval</div>|
| <a href="https://stackblitz.com/edit/web-platform-3gwnsg"><img height="400px" src="https://user-images.githubusercontent.com/6873202/129054271-21ba5182-38c5-4856-bb21-727bba49243a.png"></a> <div style="100%">Clean (Design by [Anton](https://dribbble.com/shots/15480691-Org-chart))</div>| <a href="https://stackblitz.com/edit/web-platform-o5t1ha"><img height="400px" src="https://user-images.githubusercontent.com/6873202/129182014-610b6761-6dd4-4847-92cb-66407a900d03.png"></a> <div style="100%">Futuristic - Full Functionality</div>|
| <a href="https://stackblitz.com/edit/web-platform-thplyq"><img height="400px" src="https://user-images.githubusercontent.com/6873202/129419379-a9d055c8-723c-468f-bd87-4762ba721d87.png"></a> <div style="100%">Prev version design</div>|

Check out examples

* [Observable example](https://observablehq.com/@bumbeishvili/d3-v5-organization-chart) (latest stable)
* [Jsfiddle example](https://jsfiddle.net/k2ucqayn/)
* [Codepen example](https://codepen.io/bumbeishvili/full/arpJrv)
* [Observable Dev version](https://observablehq.com/d/e106c59dbd9f6151) (Unstable - latest)

#### Featured customizations:

| | | | |
|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|
|<img alt="screen shot 2017-08-07 at 12 18 15 pm" height="300px" src="https://user-images.githubusercontent.com/6873202/120426599-753c0f80-c381-11eb-9695-c63808c98951.png"> <div style="100%">Light gradient version with horizontal layout</div> | <img alt="screen shot 2017-08-07 at 12 18 15 pm" height="300px" src="https://user-images.githubusercontent.com/6873202/120426591-6f462e80-c381-11eb-9f77-2cf85b216a41.png"> <div style="100%">Compact layout</div> |


Check out several libraries and frameworks integrations

* [Vue.js Integration](https://stackblitz.com/edit/d3-org-chart-vue-integration)
* [Vue.js Integration](https://stackblitz.com/edit/d3-org-chart-vue-integration-su3d6r)
* [React integration](https://stackblitz.com/edit/d3-org-chart-react-integration-hooks)
* [Angular integration](https://stackblitz.com/edit/d3-org-chart-angular-integration)
* [Angular integration](https://stackblitz.com/edit/d3-org-chart-angular-integration-halhxr)

Custom components & algorithms I used

* [Curved edges](https://observablehq.com/@bumbeishvili/curved-edges?collection=@bumbeishvili/work-components) - observablehq playground
* [Curved edges - vertical](https://observablehq.com/@bumbeishvili/curved-edges-compacty-vertical)
* [Curved edges - horizontal](https://observablehq.com/@bumbeishvili/curved-edges-compact-horizontal)
* [Flextree Algorithm](https://github.com/Klortho/d3-flextree)


### Installing
Expand All @@ -54,24 +55,34 @@ Custom components & algorithms I used
npm i d3-org-chart
```

### Docs
[Weak Wiki](https://github.com/bumbeishvili/d3-organization-chart/wiki)

### Usage
```
```javascript
const TreeChart = require ('https://bundle.run/d3-org-chart@1.0.4');


new TreeChart()
.container(<myDOMElement>)
.data(<myData>)
.svgWidth(700)
.initialZoom(0.4)
.onNodeClick(d=> console.log(d+' node clicked'))
.container(<myDOMElement>) // Dom element or css selector

// Sample Data - https://github.com/bumbeishvili/sample-data/blob/main/org.csv
.data(<myData>) // Tabular data, where hierarchy is defined using id and parentNodeId columns
.nodeId(d=>d.id) // By default id and nodeId is looked for
.parentNodeid(d=>d.parentId) // By default parentId and parentNodeId is looked for
.render()

```

### Quick Docs

Check the sample data here - https://github.com/bumbeishvili/sample-data/blob/main/org.csv

For the full functionality of exposed methods check [Futuristic Example](https://stackblitz.com/edit/web-platform-o5t1ha) and button bound functions

For the high level overview of margins and content setting check the image bellow

![](https://user-images.githubusercontent.com/6873202/129315269-a2ef1c25-1078-486f-bf0a-0a05d273f354.png)




## Notes & appreciations
I created this org-chart when I was hired by [TeamApps](https://github.com/teamapps-org).
Expand All @@ -80,7 +91,7 @@ Although this Org chart was specifically created for [teamapps java web applicat

Big thanks to [Matthias](https://github.com/Matthias-Bernstein) and [Yann](https://github.com/yamass), who assembled requirements for org-chart and had valuable pieces of advice afterwads.

Also, thanks for all people who made generous [donations](https://ko-fi.com/bumbeishvili), it gives me motivation to further improve this org chart component.
Also, thanks all people who made generous [donations](https://ko-fi.com/bumbeishvili), it gives me motivation to further improve this org chart component.

Thanks [contractzen](https://www.contractzen.com/) for the significant contribution, which made implementation of some of the most important features (optimal layout, exporting ) possible.

Expand Down
Loading