apextree 1.2.0 → 1.4.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.
- package/.editorconfig +7 -0
- package/.eslintignore +2 -0
- package/.eslintrc +9 -0
- package/.prettierrc +5 -0
- package/.vscode/settings.json +5 -0
- package/LICENSE +80 -0
- package/README.md +2 -0
- package/apextree.es.min.js +15673 -1530
- package/apextree.min.js +1 -1
- package/demo/bottom_to_top_view.html +3 -3
- package/demo/custom_font_options.html +2 -2
- package/demo/dynamic_view_change.html +2 -2
- package/demo/expand_collapse_nodes.html +1 -1
- package/demo/group_leaf_nodes.html +118 -0
- package/demo/left_to_right_view.html +3 -3
- package/demo/per_node_options.html +7 -5
- package/demo/right_to_left_view.html +1 -2
- package/demo/top_to_bottom_view.html +1 -2
- package/globals.d.ts +4 -0
- package/lib/ApexTree.d.ts +4 -3
- package/lib/models/DagreGraph.d.ts +30 -0
- package/lib/models/Graph.d.ts +10 -24
- package/lib/models/GraphNode.d.ts +20 -0
- package/lib/models/GraphPoint.d.ts +4 -0
- package/lib/models/Paper.d.ts +22 -22
- package/lib/models/TreeNode.d.ts +15 -0
- package/lib/models/index.d.ts +3 -2
- package/lib/settings/DirectionConfig.d.ts +22 -30
- package/lib/settings/Options.d.ts +36 -26
- package/lib/utils/EdgeUtils.d.ts +3 -2
- package/lib/utils/GraphUtils.d.ts +4 -7
- package/package.json +14 -11
- package/tsconfig.json +28 -0
- package/webpack.common.ts +68 -0
- package/webpack.config.ts +7 -0
- package/webpack.dev.ts +12 -0
- package/webpack.prod.ts +9 -0
package/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apextree",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@svgdotjs/svg.js": "^3.2.0",
|
|
6
6
|
"@svgdotjs/svg.panzoom.js": "^2.1.2",
|
|
7
|
-
"
|
|
8
|
-
},
|
|
9
|
-
"peerDependencies": {
|
|
10
|
-
"@svgdotjs/svg.js": "*",
|
|
11
|
-
"@svgdotjs/svg.panzoom.js": "^2.1.2"
|
|
7
|
+
"@dagrejs/dagre": "^1.1.4"
|
|
12
8
|
},
|
|
13
9
|
"type": "module",
|
|
14
|
-
"
|
|
15
|
-
"main": "./apextree.js",
|
|
16
|
-
"module": "./apextree.es.js",
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"main": "./apextree.min.js",
|
|
12
|
+
"module": "./apextree.es.min.js",
|
|
13
|
+
"license": "See LICENSE in LICENSE",
|
|
17
14
|
"exports": {
|
|
18
15
|
".": {
|
|
19
|
-
"import":
|
|
20
|
-
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./index.d.ts",
|
|
18
|
+
"default": "./apextree.es.min.js"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"default": "./apextree.min.js"
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowSyntheticDefaultImports": true,
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"rootDir": ".",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"moduleResolution": "Node",
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"target": "es6",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"noImplicitAny": true,
|
|
12
|
+
"strictNullChecks": true,
|
|
13
|
+
"lib": [
|
|
14
|
+
"es2021",
|
|
15
|
+
"dom"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
"exclude": [
|
|
20
|
+
"node_modules",
|
|
21
|
+
"dist",
|
|
22
|
+
],
|
|
23
|
+
"ts-node": {
|
|
24
|
+
"esm": true,
|
|
25
|
+
"experimentalSpecifierResolution": "node"
|
|
26
|
+
},
|
|
27
|
+
"files": ["globals.d.ts"]
|
|
28
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import {Compiler, Configuration, WebpackPluginInstance} from 'webpack';
|
|
3
|
+
|
|
4
|
+
export const ROOT = path.resolve(__dirname, '.');
|
|
5
|
+
|
|
6
|
+
interface CommonConfig extends Configuration {
|
|
7
|
+
plugins: (((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance)[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const commonConfig: CommonConfig = {
|
|
11
|
+
entry: [path.resolve(__dirname, 'src/ApexTree.ts')],
|
|
12
|
+
output: {
|
|
13
|
+
clean: true,
|
|
14
|
+
filename: 'ApexTree.js',
|
|
15
|
+
path: path.resolve(__dirname, 'dist'),
|
|
16
|
+
library: 'ApexTree',
|
|
17
|
+
libraryTarget: 'umd',
|
|
18
|
+
libraryExport: 'ApexTree',
|
|
19
|
+
},
|
|
20
|
+
module: {
|
|
21
|
+
rules: [
|
|
22
|
+
{
|
|
23
|
+
// Include ts, tsx, js, and jsx files.
|
|
24
|
+
test: /\.(ts|js)?$/,
|
|
25
|
+
include: [ROOT],
|
|
26
|
+
exclude: [/node_modules/],
|
|
27
|
+
use: [
|
|
28
|
+
{
|
|
29
|
+
loader: 'babel-loader',
|
|
30
|
+
options: {
|
|
31
|
+
// Rely on babel loading it's `babel.config.js` file. If we need to edit it for
|
|
32
|
+
// Hot Module Reloading support so be it.
|
|
33
|
+
// https://gist.github.com/rmoorman/94eeed830942758e218d92f15ce58d88
|
|
34
|
+
presets: [['@babel/preset-env', {targets: 'defaults'}]],
|
|
35
|
+
plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-transform-runtime'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
test: /\.ts?$/,
|
|
42
|
+
include: [ROOT],
|
|
43
|
+
exclude: [/node_modules/],
|
|
44
|
+
use: [
|
|
45
|
+
'babel-loader',
|
|
46
|
+
{
|
|
47
|
+
loader: 'ts-loader',
|
|
48
|
+
options: {
|
|
49
|
+
configFile: 'tsconfig.json',
|
|
50
|
+
transpileOnly: true,
|
|
51
|
+
experimentalWatchApi: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{test: /\.(less)$/, loader: 'asset/resource'},
|
|
57
|
+
{
|
|
58
|
+
test: /\.svg$/,
|
|
59
|
+
loader: 'raw-loader',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
resolve: {
|
|
64
|
+
modules: [__dirname, 'src', 'node_modules'],
|
|
65
|
+
extensions: ['.ts', '.js'],
|
|
66
|
+
},
|
|
67
|
+
plugins: [],
|
|
68
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {Configuration} from 'webpack';
|
|
2
|
+
|
|
3
|
+
export default (argv: any, env: any = {mode: 'production'}): Configuration => {
|
|
4
|
+
const mode = argv?.mode || env.mode;
|
|
5
|
+
const config: Configuration = require(`./webpack.${mode === 'development' ? 'dev' : 'prod'}`).default;
|
|
6
|
+
return config;
|
|
7
|
+
};
|
package/webpack.dev.ts
ADDED