• Stars
    star
    289
  • Rank 143,419 (Top 3 %)
  • Language Vue
  • License
    MIT License
  • Created about 6 years ago
  • Updated almost 2 years ago

Reviews

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

Repository Details

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.

OrgChart

jQuery Version

ES6 Version

Web Components Version

Angular Version -- the most space-saving solution

React Version

Foreword

  • First of all, thanks a lot for wesnolte's great work😊 -- jOrgChart. The thought that using nested tables to build out the tree-like orgonization chart is amazing. This idea is more simple and direct than its counterparts based on svg
  • Unfortunately, it's long time not to see the update of jOrgChart. on the other hand, I got some interesting ideas to add, so I choose to create a new repo.

Features

  • For now, just static organization chart

Installation

npm install vue-organization-chart -S

Demos

Usage

<template>
  <div>
    <organization-chart :datasource="ds"></organization-chart>
  </div>
</template>

<script>
  import Vue from 'vue'
  import OrganizationChart from 'vue-organization-chart'
  import 'vue-organization-chart/dist/orgchart.css'

  export default {
    components: {
      OrganizationChart
    },
    data () {
      return {
        ds: {
          'id': '1',
          'name': 'Lao Lao',
          'title': 'general manager',
          'children': [
            { 'id': '2', 'name': 'Bo Miao', 'title': 'department manager' },
            { 'id': '3', 'name': 'Su Miao', 'title': 'department manager',
              'children': [
                { 'id': '4', 'name': 'Tie Hua', 'title': 'senior engineer' },
                { 'id': '5', 'name': 'Hei Hei', 'title': 'senior engineer',
                  'children': [
                    { 'id': '6', 'name': 'Pang Pang', 'title': 'engineer' },
                    { 'id': '7', 'name': 'Xiang Xiang', 'title': 'UE engineer' }
                  ]
                 }
               ]
             },
            { 'id': '8', 'name': 'Hong Miao', 'title': 'department manager' },
            { 'id': '9', 'name': 'Chun Miao', 'title': 'department manager' }
          ]
        }
      }
    }
  }
</script>

Attributes

NameTypeRequiredDefaultDescription
datasourcejsonyesdatasource usded to build out structure of orgchart. It could be a json object.
panbooleannofalseUsers could pan the orgchart by mouse drag&drop if they enable this attribute.
zoombooleannofalseUsers could zoomin/zoomout the orgchart by mouse wheel if they enable this attribute.
zoomin-limitnumberno7Users are allowed to set a zoom-in limit.
zoomout-limitnumberno0.5Users are allowed to set a zoom-out limit.

Events

NameParametersDescription
node-clicknode datatriggers when user clicks the node.

Scoped Slots

<template slot-scope="{ nodeData }">
  <!-- feel free to customize the internal structure of node -->
</template>

More Repositories

1

OrgChart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
JavaScript
2,851
star
2

OrgChart.js

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
JavaScript
406
star
3

react-orgchart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
JavaScript
131
star
4

OrgChart-Webcomponents

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
JavaScript
117
star
5

ng-orgchart

The most space-saving layout of organization chart
TypeScript
37
star
6

JSON-Loop

JSON Loop is a super easy to use tool class helping you loop the deeply nested JSON object.
JavaScript
19
star
7

json-digger

JavaScript
7
star
8

js-basics

4
star
9

learn-angularjs-with-example

AngularJS is amiable js framework as well as powerful. Let's step to her inch by inch.
HTML
4
star
10

Simple-Popup

Hope this small jquery snippet to help you replace all primitive popup boxes of native javascript including alert box, confirm box, prompt box.
JavaScript
4
star
11

hr

human resource management demo based on react-orgchart component
JavaScript
3
star
12

bigfish

基于Vue.js & Firebase的钓鱼日志
JavaScript
2
star
13

tree-slide

It's a manufacture tool for 3D slides with the help of tree hierarchy.
JavaScript
2
star
14

xiezi

陪孩子写字,不是简单的事
1
star
15

overlooked

We just collect overlooked UI demands.
1
star
16

cohort

Cohort is a hotchpotch where you can share any media stuff with your dudes. In the other hand, I regard it as a undefended area where I play around and demonstrate the every aspect of MEAN.JS(MongoDB + Express + AngularJS + Node.js)
JavaScript
1
star