orgchart 4.0.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.github/workflows/publish.yml +32 -0
  2. package/README.md +205 -89
  3. package/README.zh-cn.md +221 -68
  4. package/README.zh-tw.md +221 -68
  5. package/bower.json +6 -9
  6. package/demo/10000-nodes.html +139 -0
  7. package/demo/ajax-datasource.html +46 -45
  8. package/demo/bottom2top.html +12 -9
  9. package/demo/center-on-selected-node.html +21 -17
  10. package/demo/color-coded.html +12 -9
  11. package/demo/css/style.css +28 -0
  12. package/demo/custom-icons.html +12 -9
  13. package/demo/custom-template.html +12 -9
  14. package/demo/data-prop-compact.html +11 -8
  15. package/demo/data-prop-hybrid.html +79 -50
  16. package/demo/default-collapsed.html +12 -9
  17. package/demo/drag-drop-hybrid-chart.html +17 -14
  18. package/demo/drag-drop.html +21 -16
  19. package/demo/edit-chart.html +148 -94
  20. package/demo/edit-hybrid-chart.html +178 -135
  21. package/demo/expand-to-given-depth.html +30 -22
  22. package/demo/export-chart-pdf.html +12 -9
  23. package/demo/export-chart-with-pictures.html +19 -12
  24. package/demo/export-chart.html +12 -9
  25. package/demo/family-tree.html +100 -0
  26. package/demo/familytree-custom-properties.html +108 -0
  27. package/demo/filter-node.html +104 -57
  28. package/demo/get-hierarchy.html +17 -12
  29. package/demo/get-related-nodes.html +27 -17
  30. package/demo/index.html +7 -4
  31. package/demo/integrate-map.html +32 -27
  32. package/demo/left2right.html +12 -9
  33. package/demo/level-offset.html +16 -15
  34. package/demo/link-node.html +12 -9
  35. package/demo/local-datasource.html +11 -8
  36. package/demo/minimap.html +224 -0
  37. package/demo/nodes-of-different-widths.html +11 -8
  38. package/demo/ondemand-loading-data.html +88 -91
  39. package/demo/option-createNode.html +31 -20
  40. package/demo/pan-zoom.html +20 -11
  41. package/demo/reload-data.html +17 -14
  42. package/demo/report-path.html +59 -29
  43. package/demo/responsive-design.html +14 -11
  44. package/demo/right2left.html +12 -9
  45. package/demo/toggle-sibs-resp.html +12 -9
  46. package/demo/ul-datasource.html +11 -8
  47. package/demo/vertical-level.html +12 -9
  48. package/dist/css/{jquery.orgchart.css → orgchart.css} +210 -78
  49. package/dist/css/orgchart.min.css +1 -0
  50. package/dist/js/orgchart.js +4101 -0
  51. package/dist/js/orgchart.min.js +2 -0
  52. package/dist/js/orgchart.min.js.map +1 -0
  53. package/gulpfile.js +37 -26
  54. package/package.json +32 -32
  55. package/src/css/{jquery.orgchart.css → orgchart.css} +210 -78
  56. package/src/js/orgchart.js +4101 -0
  57. package/test/cypress/e2e/demo-interactions.cy.js +91 -0
  58. package/test/cypress/e2e/demo-rendering.cy.js +100 -0
  59. package/test/cypress/e2e/drag-drop-hybrid-chart.cy.js +22 -0
  60. package/test/cypress/e2e/edit-chart.cy.js +20 -0
  61. package/test/cypress/e2e/level-offset.cy.js +21 -0
  62. package/test/cypress/e2e/minimap.cy.js +66 -0
  63. package/test/cypress/e2e/pan-zoom.cy.js +165 -0
  64. package/test/cypress/e2e/report-path.cy.js +20 -0
  65. package/test/cypress/e2e/vertical-vevel.cy.js +5 -3
  66. package/test/e2e/local-datasource/test.js +1 -1
  67. package/test/integration/init-tests.js +168 -62
  68. package/test/integration/tests.js +1034 -56
  69. package/test/unit/lifecycle-builders-export.tests.js +1426 -0
  70. package/test/unit/minimap.tests.js +210 -0
  71. package/test/unit/tests.js +2372 -252
  72. package/demo/multiple-layers.html +0 -128
  73. package/dist/css/jquery.orgchart.min.css +0 -1
  74. package/dist/js/jquery.orgchart.js +0 -1686
  75. package/dist/js/jquery.orgchart.min.js +0 -5
  76. package/dist/js/jquery.orgchart.min.js.map +0 -1
  77. package/src/js/jquery.orgchart.js +0 -1686
package/gulpfile.js CHANGED
@@ -1,17 +1,32 @@
1
- var gulp = require('gulp');
2
- var browserSync = require('browser-sync').create();
3
- var mocha = require('gulp-mocha');
4
- var uglify = require('gulp-uglify');
5
- var rename = require("gulp-rename");
6
- var del = require('del');
7
- var eslint = require('gulp-eslint');
8
- var merge = require('merge-stream');
9
- var csslint = require('gulp-csslint');
10
- var cleanCSS = require('gulp-clean-css');
11
- var sourcemaps = require('gulp-sourcemaps');
12
- var cypress = require('cypress');
13
- var jest = require('gulp-jest').default;
14
- var paths = {
1
+ const gulp = require('gulp');
2
+ const { spawn } = require('node:child_process');
3
+ const browserSync = require('browser-sync').create();
4
+ const uglify = require('gulp-uglify');
5
+ const rename = require("gulp-rename");
6
+ const eslint = require('gulp-eslint');
7
+ const merge = require('ordered-read-streams');
8
+ const csslint = require('gulp-csslint');
9
+ const cleanCSS = require('gulp-clean-css');
10
+ const sourcemaps = require('gulp-sourcemaps');
11
+ const cypress = require('cypress');
12
+ const jest = require('gulp-jest').default;
13
+ const deletePaths = (patterns) => import('del').then(({ deleteAsync }) => deleteAsync(patterns));
14
+ const runMocha = (files) => new Promise(function (resolve, reject) {
15
+ const mochaProcess = spawn(process.execPath, [
16
+ require.resolve('mocha/bin/mocha.js'),
17
+ '--reporter', 'spec'
18
+ ].concat(files), { stdio: 'inherit' });
19
+
20
+ mochaProcess.once('error', reject);
21
+ mochaProcess.once('exit', function (exitCode) {
22
+ if (exitCode === 0) {
23
+ resolve();
24
+ } else {
25
+ reject(new Error('Tests failed with exit code ' + exitCode));
26
+ }
27
+ });
28
+ });
29
+ const paths = {
15
30
  src: 'src',
16
31
  srcFiles: 'src/**/*',
17
32
  srcHTML: 'src/**/*.html',
@@ -33,27 +48,23 @@ var paths = {
33
48
  };
34
49
 
35
50
  gulp.task('unit-tests', function () {
36
- return gulp.src(['test/unit/*.js'], {read: false})
37
- .pipe(mocha({reporter: 'spec'}));
51
+ return runMocha(['test/unit/*.js']);
38
52
  });
39
53
 
40
54
  gulp.task('integration-tests', gulp.series('unit-tests', function () {
41
- return gulp.src(['test/integration/*.js'], {read: false})
42
- .pipe(mocha({reporter: 'spec'}));
55
+ return runMocha(['test/integration/*.js']);
43
56
  }));
44
57
 
45
58
  gulp.task('addAssets', gulp.series('integration-tests', function () {
46
- var jsFiles = gulp.src([
59
+ const jsFiles = gulp.src([
47
60
  paths.srcJS,
48
- 'node_modules/jquery/dist/jquery.min.js',
49
- 'node_modules/jquery-mockjax/dist/jquery.mockjax.min.js',
50
61
  'node_modules/html2canvas/dist/html2canvas.min.js',
51
62
  'node_modules/jspdf/dist/jspdf.umd.min.js',
52
63
  'node_modules/json-digger/dist/json-digger.js'
53
64
  ])
54
65
  .pipe(gulp.dest(paths.demoJSFolder));
55
66
 
56
- var cssFiles = gulp.src(paths.srcCSS)
67
+ const cssFiles = gulp.src(paths.srcCSS)
57
68
  .pipe(gulp.dest(paths.demoCSSFolder));
58
69
 
59
70
  return merge(jsFiles, cssFiles);
@@ -74,7 +85,7 @@ gulp.task('e2e-tests', gulp.series('addAssets', function () {
74
85
  gulp.task('test', gulp.series('e2e-tests'));
75
86
 
76
87
  gulp.task('cleanupJS', function() {
77
- return del([paths.distJSFolder + '/**']);
88
+ return deletePaths([paths.distJSFolder + '/**']);
78
89
  });
79
90
 
80
91
  gulp.task('eslint', function () {
@@ -88,13 +99,13 @@ gulp.task('js', gulp.series('cleanupJS', 'eslint', 'test', function () {
88
99
  .pipe(gulp.dest(paths.distJSFolder))
89
100
  .pipe(sourcemaps.init())
90
101
  .pipe(uglify())
91
- .pipe(rename('jquery.orgchart.min.js'))
102
+ .pipe(rename('orgchart.min.js'))
92
103
  .pipe(sourcemaps.write('./'))
93
104
  .pipe(gulp.dest(paths.distJSFolder));
94
105
  }));
95
106
 
96
107
  gulp.task('cleanupCSS', function() {
97
- return del([paths.distCSSFolder + '/**']);
108
+ return deletePaths([paths.distCSSFolder + '/**']);
98
109
  });
99
110
 
100
111
  gulp.task('csslint', function() {
@@ -113,7 +124,7 @@ gulp.task('css', gulp.series('cleanupCSS', 'csslint', function () {
113
124
  return gulp.src(paths.srcCSS)
114
125
  .pipe(gulp.dest(paths.distCSSFolder))
115
126
  .pipe(cleanCSS())
116
- .pipe(rename('jquery.orgchart.min.css'))
127
+ .pipe(rename('orgchart.min.css'))
117
128
  .pipe(gulp.dest(paths.distCSSFolder));
118
129
  }));
119
130
 
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "orgchart",
3
- "version": "4.0.1",
4
- "description": "Simple and direct organization chart(tree-like hierarchy) plugin based on pure DOM and jQuery.",
5
- "main": "./dist/js/jquery.orgchart.min.js",
3
+ "version": "6.0.0",
4
+ "description": "Simple and direct organization chart(tree-like hierarchy) library based on pure DOM.",
5
+ "main": "./dist/js/orgchart.min.js",
6
6
  "style": [
7
- "./dist/css/jquery.orgchart.min.css"
7
+ "./dist/css/orgchart.min.css"
8
8
  ],
9
9
  "scripts": {
10
10
  "test": "gulp test",
11
11
  "unit-tests": "gulp unit-tests",
12
+ "integration-tests": "gulp integration-tests",
13
+ "e2e-tests": "gulp e2e-tests",
14
+ "addAssets": "gulp addAssets",
12
15
  "build": "gulp build",
13
16
  "start": "gulp serve",
14
17
  "cypress:open": "cypress open"
@@ -18,11 +21,10 @@
18
21
  },
19
22
  "repository": {
20
23
  "type": "git",
21
- "url": "https://github.com/dabeng/OrgChart.git"
24
+ "url": "git+https://github.com/dabeng/OrgChart.git"
22
25
  },
23
26
  "keywords": [
24
- "jquery",
25
- "plugin",
27
+ "dom",
26
28
  "organization",
27
29
  "chart",
28
30
  "orgchart",
@@ -38,36 +40,34 @@
38
40
  "homepage": "https://github.com/dabeng/OrgChart#readme",
39
41
  "dependencies": {
40
42
  "html2canvas": "^1.4.1",
41
- "jquery": "^3.6.2",
42
- "jquery-mockjax": "^2.6.0",
43
43
  "json-digger": "^2.0.2",
44
- "jspdf": "^2.5.1"
44
+ "jspdf": "^4.2.1"
45
45
  },
46
46
  "devDependencies": {
47
- "browser-sync": "^2.26.7",
48
- "chai": "^4.2.0",
49
- "cypress": "^13.2.0",
50
- "del": "^3.0.0",
51
- "gulp": "^4.0.2",
52
- "gulp-clean-css": "^3.10.0",
47
+ "browser-sync": "^3.0.4",
48
+ "chai": "^6.2.2",
49
+ "cypress": "^15.20.0",
50
+ "del": "^8.0.1",
51
+ "gulp": "^5.0.1",
52
+ "gulp-clean-css": "^4.3.0",
53
53
  "gulp-csslint": "^1.0.1",
54
- "gulp-eslint": "^4.0.2",
55
- "gulp-inject": "^4.3.2",
56
- "gulp-jest": "^4.0.3",
57
- "gulp-mocha": "^8.0.0",
58
- "gulp-rename": "^1.4.0",
59
- "gulp-sourcemaps": "^2.6.5",
54
+ "gulp-eslint": "^6.0.0",
55
+ "gulp-inject": "^5.0.5",
56
+ "gulp-jest": "^4.0.4",
57
+ "gulp-mocha": "^10.0.1",
58
+ "gulp-rename": "^2.1.0",
59
+ "gulp-sourcemaps": "^3.0.0",
60
60
  "gulp-uglify": "^3.0.2",
61
- "jest": "^29.3.1",
62
- "jest-cli": "^29.3.1",
63
- "jest-image-snapshot": "^6.1.0",
64
- "jest-puppeteer": "^4.3.0",
65
- "jsdom": "^16.5.0",
61
+ "jest": "^30.4.2",
62
+ "jest-cli": "^30.4.2",
63
+ "jest-image-snapshot": "^6.5.2",
64
+ "jest-puppeteer": "^11.0.0",
65
+ "jsdom": "^30.0.1",
66
66
  "jsdom-global": "^3.0.2",
67
- "merge-stream": "^1.0.1",
68
- "mocha": "^10.2.0",
69
- "puppeteer": "^1.20.0",
70
- "sinon": "^4.5.0",
71
- "sinon-chai": "^2.14.0"
67
+ "mocha": "^11.8.0",
68
+ "ordered-read-streams": "^2.0.0",
69
+ "puppeteer": "^25.5.0",
70
+ "sinon": "^22.1.0",
71
+ "sinon-chai": "^4.0.1"
72
72
  }
73
73
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * jQuery OrgChart Plugin
2
+ * JavaScript OrgChart Component
3
3
  * https://github.com/dabeng/OrgChart
4
4
  *
5
5
  * Copyright 2016, dabeng
@@ -51,7 +51,9 @@
51
51
  }
52
52
 
53
53
  .orgchart ~ .mask {
54
- position: absolute;
54
+ position: sticky;
55
+ width: 100%;
56
+ height: 100%;
55
57
  top: 0;
56
58
  right: 0;
57
59
  bottom: 0;
@@ -83,6 +85,75 @@
83
85
  list-style: none;
84
86
  padding-left: 0;
85
87
  margin: 0;
88
+ justify-content: center;
89
+ }
90
+
91
+ .orgchart-minimap {
92
+ position: absolute;
93
+ right: 12px;
94
+ bottom: 12px;
95
+ z-index: 25;
96
+ width: 180px;
97
+ height: 120px;
98
+ padding: 8px;
99
+ border: 1px solid rgba(68, 68, 68, 0.18);
100
+ border-radius: 8px;
101
+ background-color: rgba(255, 255, 255, 0.96);
102
+ box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
103
+ box-sizing: border-box;
104
+ }
105
+
106
+ .orgchart-minimap-stage {
107
+ position: relative;
108
+ width: 100%;
109
+ height: 100%;
110
+ overflow: hidden;
111
+ border-radius: 5px;
112
+ background-image: linear-gradient(rgba(68, 68, 68, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(68, 68, 68, 0.05) 1px, transparent 1px);
113
+ background-size: 10px 10px;
114
+ background-color: #f9fbfc;
115
+ }
116
+
117
+ .orgchart-minimap-content {
118
+ position: absolute;
119
+ top: 0;
120
+ left: 0;
121
+ pointer-events: none;
122
+ }
123
+
124
+ .orgchart-minimap-node {
125
+ position: absolute;
126
+ min-width: 6px;
127
+ height: 18px;
128
+ border-radius: 0;
129
+ opacity: 1;
130
+ box-shadow: none;
131
+ }
132
+
133
+ .orgchart-minimap .orgchart,
134
+ .orgchart-minimap .orgchart ul,
135
+ .orgchart-minimap .orgchart li,
136
+ .orgchart-minimap .orgchart .node,
137
+ .orgchart-minimap .orgchart .edge,
138
+ .orgchart-minimap .orgchart .verticalNodes,
139
+ .orgchart-minimap .orgchart .verticalNode,
140
+ .orgchart-minimap .orgchart .nodes,
141
+ .orgchart-minimap-node {
142
+ pointer-events: none;
143
+ }
144
+
145
+ .orgchart-minimap-viewport {
146
+ position: absolute;
147
+ top: 0;
148
+ left: 0;
149
+ min-width: 12px;
150
+ min-height: 12px;
151
+ border: 2px solid rgba(28, 111, 197, 0.9);
152
+ border-radius: 4px;
153
+ background-color: rgba(28, 111, 197, 0.12);
154
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 0 999px rgba(255, 255, 255, 0.12);
155
+ box-sizing: border-box;
156
+ cursor: move;
86
157
  }
87
158
 
88
159
  .orgchart .hierarchy {
@@ -91,13 +162,71 @@
91
162
 
92
163
  /* styles of link lines */
93
164
  .orgchart .hierarchy::before {
165
+ box-sizing: border-box;
94
166
  content: "";
95
167
  position: absolute;
96
168
  top: -11px; /* -(background square size + half width of line) */
97
169
  left: 0;
98
170
  width: 100%;
171
+ border-color: rgba(217, 83, 79, 0.8);
172
+ border-style: solid;
173
+ border-width: 2px 0 0 0;
174
+ }
175
+
176
+ /* 本姓人与上一层父母的连线,借助伪元素::before实现 */
177
+ /* 处理同一层中特殊的首节点 */
178
+ .orgchart .couple:first-child:not(:only-child)::before {
179
+ width: calc(100% - 69px); /* half width of hierarchy - half width of node - node's padding - node's border width */
180
+ left: 69px;
181
+ }
182
+
183
+ /* 处理同一层中特殊的末节点 */
184
+ .orgchart .couple:last-child:not(:only-child)::before {
185
+ width: calc(50% + 71px);
186
+ left: 0;
187
+ }
188
+
189
+ .orgchart .hierarchy.couple:only-child::before {
190
+ width: 142px; /* half of node's width + link's width */
191
+ left: calc(50% - 71px); /* half width of node - half of link width */
192
+ }
193
+
194
+ /* 在family tree中,一个夫妻组合里,本姓人只有一个,外姓人可能有多个 */
195
+ /* 我们通过水平的连线来表示他们存在婚姻关系,借助伪元素::after实现 */
196
+ .orgchart .hierarchy.spouse:not(.couple)::after {
197
+ content: "";
198
+ position: absolute;
199
+ border-top: 2px solid rgba(217, 83, 79, 0.8);
200
+ box-sizing: border-box;
201
+ z-index: 0;
202
+ top: 24px;
203
+ width: var(--ft-width);
204
+ left: var(--ft-left-offset);
205
+ }
206
+
207
+ /* 一夫一妻情况下的连线 */
208
+ .orgchart .couple {
209
+ white-space: nowrap;
210
+ }
211
+
212
+ .orgchart .couple:has(> .nodes) > .node:first-child::after {
213
+ content: "";
214
+ position: absolute;
215
+ top: 24px;
216
+ left: calc(100% + 1px);
217
+ width: 2px;
218
+ height: 33px;
219
+ background-color: rgba(217, 83, 79, 0.8);
220
+ }
221
+ .orgchart .couple::after {
222
+ content: "";
223
+ position: absolute;
99
224
  border-top: 2px solid rgba(217, 83, 79, 0.8);
100
225
  box-sizing: border-box;
226
+ z-index: 0;
227
+ top: 24px;
228
+ width: 20px;
229
+ left: calc(50% - 10px); /* half of hierarchy - node's padding width - node's border with */
101
230
  }
102
231
 
103
232
  .orgchart .hierarchy:first-child::before,
@@ -111,7 +240,7 @@
111
240
  width: calc(50% + 1px);
112
241
  }
113
242
 
114
- .orgchart .hierarchy:not(.hidden):only-child::before {
243
+ .orgchart .hierarchy:not(.hidden):not(.spouse):only-child::before {
115
244
  width: 2px;
116
245
  }
117
246
 
@@ -122,17 +251,17 @@
122
251
  .orgchart .isSiblingsCollapsed.left-sibs:last-child:before,
123
252
  .orgchart .isCollapsedSibling::before,
124
253
  .orgchart .isCollapsedSibling .hierarchy::before,
125
- .orgchart .isChildrenCollapsed > .node:not(:only-child)::after,
254
+ .orgchart .hierarchy.isChildrenCollapsed:not(.couple) > .node:has(+ .nodes)::after,
126
255
  .orgchart .isCollapsedDescendant::before,
127
256
  .orgchart .isCollapsedDescendant > .node::before,
128
257
  .orgchart .isCollapsedDescendant > .node::after,
129
258
  .orgchart .isAncestorsCollapsed:only-child::before,
130
- .orgchart .isAncestorsCollapsed > .node::before {
259
+ .orgchart .isAncestorsCollapsed > .node:not(.outsider)::before {
131
260
  content: none;
132
261
  }
133
262
 
134
263
  /* excluding leaf node */
135
- .orgchart .node:not(:only-child)::after {
264
+ .orgchart .hierarchy:not(.couple) > .node:has(+ .nodes)::after {
136
265
  content: "";
137
266
  position: absolute;
138
267
  bottom: -12px; /* -(background square size + node's border width) */
@@ -158,14 +287,24 @@
158
287
  .orgchart > ul > li > ul li > .node::before {
159
288
  content: "";
160
289
  position: absolute;
161
- top: var(--top, -12px); /* -(fallback value = background square size + border width of node) */
162
290
  left: calc(50% - 1px);
163
291
  width: 2px;
164
- height: var(--height, 10px); /* fallback value = background square size */
165
292
  background-color: rgba(217, 83, 79, 0.8);
293
+ top: var(--top, -12px); /* -(fallback value = background square size + border width of node) */
294
+ height: var(--height, 10px); /* fallback value = background square size */
166
295
  }
167
296
 
168
- .orgchart > ul > li > ul li.isSiblingsCollapsed > .node::before {
297
+ .orgchart > ul > li > ul li > .node.outsider::before {
298
+ background-color: unset;
299
+ background-image: repeating-linear-gradient(
300
+ to bottom,
301
+ rgba(217, 83, 79, 0.8) 0 2px,
302
+ transparent 2px 4px
303
+ );
304
+ background-repeat: repeat-y;
305
+ }
306
+
307
+ .orgchart > ul > li > ul .isSiblingsCollapsed > .node::before {
169
308
  top: var(--top-cross-point, -12px);
170
309
  height: var(--height-cross-point, 10px);
171
310
  }
@@ -179,6 +318,8 @@
179
318
  padding: 3px;
180
319
  border: 2px dashed transparent;
181
320
  text-align: center;
321
+ transition: transform 0.3s, opacity 0.3s;
322
+ z-index: 1;
182
323
  }
183
324
 
184
325
  .orgchart.l2r .node, .orgchart.r2l .node {
@@ -190,7 +331,7 @@
190
331
  background-color: rgba(238, 217, 54, 0.5);
191
332
  transition: .5s;
192
333
  cursor: default;
193
- z-index: 20;
334
+ z-index: 2;
194
335
  }
195
336
 
196
337
  .orgchart .node.focused {
@@ -402,28 +543,61 @@
402
543
  bottom: -2px;
403
544
  width: 16px;
404
545
  height: 16px;
546
+ visibility: hidden;
547
+ background-color: rgba(68, 157, 68, 0.6);
548
+ }
549
+
550
+ .orgchart .node:hover .toggleBtn {
551
+ visibility: visible;
405
552
  }
406
553
 
407
554
  .orgchart .node .toggleBtn::before {
408
- background-color: rgba(68, 157, 68, 0.6);
555
+ content: "";
409
556
  position: absolute;
410
- left: 0;
411
- bottom: 0;
557
+ left: 3px;
558
+ top: 7px;
559
+ box-sizing: border-box;
560
+ width: 10px;
561
+ height: 2px;
562
+ border-radius: 1px;
563
+ background-color: #fff;
564
+ display: none;
412
565
  }
413
566
 
414
- .orgchart .node .toggleBtn:hover::before {
567
+ .orgchart .node .toggleBtn:hover {
415
568
  background-color: #449d44;
416
569
  }
417
570
 
571
+ .orgchart .node .toggleBtn::after {
572
+ content: "";
573
+ position: absolute;
574
+ left: 7px;
575
+ top: 3px;
576
+ width: 2px;
577
+ height: 10px;
578
+ border-radius: 1px;
579
+ background-color: #fff;
580
+ display: none;
581
+ }
582
+
583
+ .orgchart .node .toggleBtn.oci-plus-square::before,
584
+ .orgchart .node .toggleBtn.oci-plus-square::after {
585
+ display: block;
586
+ }
587
+
588
+ .orgchart .node .toggleBtn.oci-minus-square::before {
589
+ display: block;
590
+ }
591
+
592
+ .orgchart .node .toggleBtn.oci-minus-square::after {
593
+ display: none;
594
+ }
595
+
418
596
  .oc-export-btn {
419
597
  margin-left: 0.5rem;
420
598
  padding: 0.5rem 1rem;
421
599
  }
422
600
 
423
- .orgchart .node {
424
- transition: transform 0.3s, opacity 0.3s;
425
- }
426
-
427
601
  .orgchart .slide-down {
428
602
  opacity: 0;
429
603
  transform: translateY(40px);
@@ -479,8 +653,8 @@
479
653
  margin-bottom: 0;
480
654
  }
481
655
 
482
- .orgchart .nodes.vertical .node::before,
483
- .orgchart .nodes.vertical .node::after {
656
+ .orgchart .nodes.vertical .hierarchy .node::before,
657
+ .orgchart .nodes.vertical .hierarchy .node::after {
484
658
  content: none;
485
659
  }
486
660
 
@@ -495,20 +669,21 @@
495
669
  content: '';
496
670
  position: absolute;
497
671
  left: -6px; /* -(background square size + half width of line */
672
+ width: 11px; /* background square size + half width of line */
498
673
  border-color: rgba(217, 83, 79, 0.8);
499
674
  border-style: solid;
500
- border-width: 0 0 2px 2px;
501
675
  }
502
676
 
503
677
  .orgchart .nodes.vertical .hierarchy::before {
504
- top: 0px;
505
- height: 26px; /* node top half's height(25px) + half width of line */
506
- width: 11px; /* background square size + half width of line */
678
+ height: 26px;
679
+ top: 0;
680
+ border-width: 0 0 2px 2px;
507
681
  }
508
682
 
509
683
  .orgchart .nodes.vertical .hierarchy::after {
684
+ height: calc(100% - 24px); /* node top half's height(25px) + half width of line */
510
685
  bottom: 0;
511
- height: calc(100% - 24px); /* height of hierarchy - (node top half's height(25px) - half width of line) */
686
+ border-width: 0 0 0 2px;
512
687
  }
513
688
 
514
689
  .orgchart .nodes.vertical .hierarchy:last-child::after {
@@ -516,7 +691,6 @@
516
691
  }
517
692
 
518
693
  .orgchart .nodes.vertical > .hierarchy:first-child::before {
519
- box-sizing: border-box;
520
694
  top: -11px; /* -(background square size + half width of line) */
521
695
  height: 35px; /* node top half's height + node padding + node border width + background square size */
522
696
  width: calc(50% + 2px);
@@ -524,19 +698,16 @@
524
698
  }
525
699
 
526
700
  .orgchart .nodes.vertical > .hierarchy:first-child::after {
527
- box-sizing: border-box;
528
701
  top: 24px; /* node bottom half's height(25px) - half border width of line */
529
- width: 11px; /* backgroud square size + half border width of line */
530
702
  border-width: 2px 0 0 2px;
531
703
  }
532
704
 
533
- .orgchart .nodes.vertical > .hierarchy:first-child:last-child::after {
705
+ .orgchart .nodes.vertical > .hierarchy:only-child::after {
534
706
  border-width: 2px 0 0 0;
535
707
  }
536
708
 
537
709
  /* styles for compact nodes */
538
710
  .orgchart .node.compact {
539
- position: static;
540
711
  display: grid;
541
712
  width: 140px;
542
713
  height: 50px;
@@ -544,7 +715,6 @@
544
715
  }
545
716
 
546
717
  .orgchart .node.compact.looseMode {
547
- display: grid;
548
718
  width: unset;
549
719
  height: unset;
550
720
  }
@@ -587,14 +757,14 @@
587
757
  background-color: #eee;
588
758
  }
589
759
 
590
- .orgchart .node.compact::before {
760
+ /* .orgchart .node.compact::before {
591
761
  top: var(--top-cross-point, -10px);
592
- }
762
+ } */
593
763
 
594
764
  .orgchart .node.compact > .content {
595
765
  position: absolute;
596
- top: 25px;
597
- left: 5px;
766
+ top: 23px;
767
+ left: 3px;
598
768
  }
599
769
 
600
770
  .orgchart .node.compact.looseMode > .title {
@@ -603,8 +773,8 @@
603
773
  }
604
774
 
605
775
  .orgchart .node.compact.looseMode > .content {
606
- top: 30px;
607
- left: 10px;
776
+ top: 28px;
777
+ left: 8px;
608
778
  }
609
779
 
610
780
  .orgchart .node.compact > .node.compact.looseMode > .title {
@@ -627,7 +797,7 @@
627
797
  margin-bottom: 0;
628
798
  }
629
799
 
630
- .orgchart .node.compact .node:not(:only-child)::after {
800
+ .orgchart .node.compact .node:has(+ .nodes)::after {
631
801
  content: unset;
632
802
  }
633
803
 
@@ -637,33 +807,11 @@
637
807
 
638
808
  .orgchart .node.compact > .backToCompactSymbol {
639
809
  position: absolute;
640
- top: 5px;
641
- left: 5px;
642
- }
643
-
644
- .orgchart .node.compact.looseMode > .backToCompactSymbol {
645
- top: 10px;
646
- left: 10px;
647
- }
648
-
649
- .orgchart .node.compact > .node.compact.looseMode > .backToCompactSymbol {
650
810
  top: 8px;
651
811
  left: 8px;
652
812
  }
653
813
 
654
- .orgchart .node.compact > .node.compact > .backToCompactSymbol {
655
- position: absolute;
656
- top: 3px;
657
- left: 3px;
658
- }
659
-
660
814
  .orgchart .node.compact > .backToLooseSymbol {
661
- position: absolute;
662
- top: 25px;
663
- right: 5px;
664
- }
665
-
666
- .orgchart .node.compact > .node.compact > .backToLooseSymbol {
667
815
  position: absolute;
668
816
  top: 23px;
669
817
  right: 3px;
@@ -790,27 +938,11 @@
790
938
  }
791
939
 
792
940
  .oci-plus-square::before {
793
- content: "﹢";
794
- display: inline-block;
795
- width: 16px;
796
- height: 16px;
797
- text-align: center;
798
- line-height: 16px;
799
- background-color: #000;
800
- color: #fff;
801
- font-weight: bold;
941
+ content: "";
802
942
  }
803
943
 
804
944
  .oci-minus-square::before {
805
- content: "﹣";
806
- display: inline-block;
807
- width: 16px;
808
- height: 16px;
809
- text-align: center;
810
- line-height: 16px;
811
- background-color: #000;
812
- color: #fff;
813
- font-weight: bold;
945
+ content: "";
814
946
  }
815
947
 
816
948
  .oci-arrow-square-up::before {