plebeiangraphlibrary 1.0.6 → 2.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.
- package/Build/pgl.d.ts +84 -32
- package/Build/pgl.d.ts.map +1 -1
- package/Build/pgl.js +540 -105
- package/Build/pgl.js.map +1 -1
- package/Build/pgl_module.js +9876 -6807
- package/Build/pgl_module.js.map +1 -1
- package/CODE_OF_CONDUCT.md +39 -39
- package/CONTRIBUTING.md +52 -52
- package/Examples/1_ZKC_simple.html +81 -75
- package/Examples/2_ZKC_edge_bundling.html +87 -81
- package/Examples/3_LargePointCloud.html +88 -81
- package/Examples/4_ToggleActivation.html +111 -105
- package/Examples/5_Hierarchy_simple.html +54 -0
- package/Examples/6_Flowmap_style.html +86 -0
- package/Examples/7_Graph_algorithms.html +63 -0
- package/Examples/8_ThreeWrapper_variants.html +51 -0
- package/Examples/MasterStyle.css +161 -53
- package/Examples/index.html +61 -34
- package/LICENSE +21 -21
- package/README.md +144 -139
- package/package.json +69 -67
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
# Code of Conduct for Plebeian Graph Library (PGL)
|
|
2
|
-
|
|
3
|
-
## My Pledge
|
|
4
|
-
In the interest of fostering an open and welcoming environment, I, as the maintainer and primary contributor of the Plebeian Graph Library (PGL), pledge to make participation in this project a harassment-free experience for everyone, regardless of individual differences.
|
|
5
|
-
|
|
6
|
-
## Standards
|
|
7
|
-
|
|
8
|
-
Behavior that contributes to a positive environment includes:
|
|
9
|
-
|
|
10
|
-
- Using welcoming and inclusive language
|
|
11
|
-
- Showing respect for differing viewpoints and experiences
|
|
12
|
-
- Gracefully accepting constructive criticism
|
|
13
|
-
- Focusing on what is best for the community
|
|
14
|
-
- Demonstrating empathy towards other community members
|
|
15
|
-
|
|
16
|
-
Unacceptable behavior includes:
|
|
17
|
-
|
|
18
|
-
- Use of sexualized language or imagery, unwelcome sexual attention or advances
|
|
19
|
-
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
20
|
-
- Public or private harassment
|
|
21
|
-
- Publishing others' private information without explicit permission
|
|
22
|
-
- Other conduct deemed inappropriate in a professional setting
|
|
23
|
-
|
|
24
|
-
## Responsibilities
|
|
25
|
-
|
|
26
|
-
As the project maintainer, I am responsible for clarifying the standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
27
|
-
|
|
28
|
-
I have the right to remove, edit, or reject comments, commits, code, and other contributions that do not align with this Code of Conduct.
|
|
29
|
-
|
|
30
|
-
## Scope
|
|
31
|
-
|
|
32
|
-
This Code of Conduct applies within all project spaces, as well as in public spaces when an individual is representing the project or its community. Representation of the project may include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at online or offline events.
|
|
33
|
-
|
|
34
|
-
## Enforcement
|
|
35
|
-
|
|
36
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting me [at](indrajeet.haldar08@gmail.com). All complaints will be reviewed and investigated and will result in a response that is necessary and appropriate to the circumstances. Confidentiality will be maintained for the reporter of an incident.
|
|
37
|
-
|
|
38
|
-
## Attribution
|
|
39
|
-
|
|
1
|
+
# Code of Conduct for Plebeian Graph Library (PGL)
|
|
2
|
+
|
|
3
|
+
## My Pledge
|
|
4
|
+
In the interest of fostering an open and welcoming environment, I, as the maintainer and primary contributor of the Plebeian Graph Library (PGL), pledge to make participation in this project a harassment-free experience for everyone, regardless of individual differences.
|
|
5
|
+
|
|
6
|
+
## Standards
|
|
7
|
+
|
|
8
|
+
Behavior that contributes to a positive environment includes:
|
|
9
|
+
|
|
10
|
+
- Using welcoming and inclusive language
|
|
11
|
+
- Showing respect for differing viewpoints and experiences
|
|
12
|
+
- Gracefully accepting constructive criticism
|
|
13
|
+
- Focusing on what is best for the community
|
|
14
|
+
- Demonstrating empathy towards other community members
|
|
15
|
+
|
|
16
|
+
Unacceptable behavior includes:
|
|
17
|
+
|
|
18
|
+
- Use of sexualized language or imagery, unwelcome sexual attention or advances
|
|
19
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
20
|
+
- Public or private harassment
|
|
21
|
+
- Publishing others' private information without explicit permission
|
|
22
|
+
- Other conduct deemed inappropriate in a professional setting
|
|
23
|
+
|
|
24
|
+
## Responsibilities
|
|
25
|
+
|
|
26
|
+
As the project maintainer, I am responsible for clarifying the standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
27
|
+
|
|
28
|
+
I have the right to remove, edit, or reject comments, commits, code, and other contributions that do not align with this Code of Conduct.
|
|
29
|
+
|
|
30
|
+
## Scope
|
|
31
|
+
|
|
32
|
+
This Code of Conduct applies within all project spaces, as well as in public spaces when an individual is representing the project or its community. Representation of the project may include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at online or offline events.
|
|
33
|
+
|
|
34
|
+
## Enforcement
|
|
35
|
+
|
|
36
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting me [at](indrajeet.haldar08@gmail.com). All complaints will be reviewed and investigated and will result in a response that is necessary and appropriate to the circumstances. Confidentiality will be maintained for the reporter of an incident.
|
|
37
|
+
|
|
38
|
+
## Attribution
|
|
39
|
+
|
|
40
40
|
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# Contributing to Plebeian Graph Library (PGL)
|
|
2
|
-
|
|
3
|
-
First off, thank you for considering contributing to PGL! It's people like you that make the open source community such a great place. Here are some guidelines to help you get started.
|
|
4
|
-
|
|
5
|
-
## How to Contribute
|
|
6
|
-
### Reporting Issues
|
|
7
|
-
|
|
8
|
-
If you find a bug or have a suggestion for a new feature or enhancement, I would love to hear about it! Before you submit an issue, please check to make sure it hasn't already been reported. Here's how you can report an issue:
|
|
9
|
-
|
|
10
|
-
- Go to the Issues section of our GitHub repository.
|
|
11
|
-
- Click on 'New Issue'.
|
|
12
|
-
- Write a clear title and a detailed description. For bugs, it's helpful to include:
|
|
13
|
-
* Steps to reproduce
|
|
14
|
-
* Expected and actual behavior
|
|
15
|
-
* Screenshots or error messages
|
|
16
|
-
* Your environment (browser, OS, etc.)
|
|
17
|
-
|
|
18
|
-
### Submitting Changes
|
|
19
|
-
|
|
20
|
-
Changes are accepted via Pull Requests (PRs) on GitHub. Here’s how you make a PR:
|
|
21
|
-
|
|
22
|
-
1. Fork the PGL repository.
|
|
23
|
-
1. Clone your fork to your local machine.
|
|
24
|
-
1. Create a new branch.
|
|
25
|
-
1. Make your changes. Please keep your code as clean and well-organized as possible.
|
|
26
|
-
1. Test your changes.
|
|
27
|
-
1. Commit your changes. Write a clear, descriptive commit message.
|
|
28
|
-
1. Push your changes to your fork on GitHub.
|
|
29
|
-
1. From your fork, make a Pull Request to the PGL main branch.
|
|
30
|
-
1. In your pull request, describe what your changes do and mention any relevant issue numbers.
|
|
31
|
-
|
|
32
|
-
Please adhere to the coding conventions used throughout the project (indentation, accurate comments, etc.).
|
|
33
|
-
|
|
34
|
-
### Seeking Support
|
|
35
|
-
|
|
36
|
-
If you need help or have any questions about contributing, please open an issue in the GitHub Issues. I'd be happy to help!
|
|
37
|
-
|
|
38
|
-
### Improving Documentation
|
|
39
|
-
|
|
40
|
-
Good documentation is as important as the code itself. If you find errors, typos, or areas that need enhancement, feel free to create a pull request.
|
|
41
|
-
|
|
42
|
-
## Code of Conduct
|
|
43
|
-
|
|
44
|
-
Please follow Code of Conduct in all your interactions with the project.
|
|
45
|
-
|
|
46
|
-
## Pull Request Process
|
|
47
|
-
|
|
48
|
-
1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
|
|
49
|
-
1. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations, and container parameters.
|
|
50
|
-
1. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme used is SemVer.
|
|
51
|
-
1. The Pull Request will be merged once it is approved and passes CI checks.
|
|
52
|
-
|
|
1
|
+
# Contributing to Plebeian Graph Library (PGL)
|
|
2
|
+
|
|
3
|
+
First off, thank you for considering contributing to PGL! It's people like you that make the open source community such a great place. Here are some guidelines to help you get started.
|
|
4
|
+
|
|
5
|
+
## How to Contribute
|
|
6
|
+
### Reporting Issues
|
|
7
|
+
|
|
8
|
+
If you find a bug or have a suggestion for a new feature or enhancement, I would love to hear about it! Before you submit an issue, please check to make sure it hasn't already been reported. Here's how you can report an issue:
|
|
9
|
+
|
|
10
|
+
- Go to the Issues section of our GitHub repository.
|
|
11
|
+
- Click on 'New Issue'.
|
|
12
|
+
- Write a clear title and a detailed description. For bugs, it's helpful to include:
|
|
13
|
+
* Steps to reproduce
|
|
14
|
+
* Expected and actual behavior
|
|
15
|
+
* Screenshots or error messages
|
|
16
|
+
* Your environment (browser, OS, etc.)
|
|
17
|
+
|
|
18
|
+
### Submitting Changes
|
|
19
|
+
|
|
20
|
+
Changes are accepted via Pull Requests (PRs) on GitHub. Here’s how you make a PR:
|
|
21
|
+
|
|
22
|
+
1. Fork the PGL repository.
|
|
23
|
+
1. Clone your fork to your local machine.
|
|
24
|
+
1. Create a new branch.
|
|
25
|
+
1. Make your changes. Please keep your code as clean and well-organized as possible.
|
|
26
|
+
1. Test your changes.
|
|
27
|
+
1. Commit your changes. Write a clear, descriptive commit message.
|
|
28
|
+
1. Push your changes to your fork on GitHub.
|
|
29
|
+
1. From your fork, make a Pull Request to the PGL main branch.
|
|
30
|
+
1. In your pull request, describe what your changes do and mention any relevant issue numbers.
|
|
31
|
+
|
|
32
|
+
Please adhere to the coding conventions used throughout the project (indentation, accurate comments, etc.).
|
|
33
|
+
|
|
34
|
+
### Seeking Support
|
|
35
|
+
|
|
36
|
+
If you need help or have any questions about contributing, please open an issue in the GitHub Issues. I'd be happy to help!
|
|
37
|
+
|
|
38
|
+
### Improving Documentation
|
|
39
|
+
|
|
40
|
+
Good documentation is as important as the code itself. If you find errors, typos, or areas that need enhancement, feel free to create a pull request.
|
|
41
|
+
|
|
42
|
+
## Code of Conduct
|
|
43
|
+
|
|
44
|
+
Please follow Code of Conduct in all your interactions with the project.
|
|
45
|
+
|
|
46
|
+
## Pull Request Process
|
|
47
|
+
|
|
48
|
+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
|
|
49
|
+
1. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations, and container parameters.
|
|
50
|
+
1. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme used is SemVer.
|
|
51
|
+
1. The Pull Request will be merged once it is approved and passes CI checks.
|
|
52
|
+
|
|
@@ -1,76 +1,82 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8" />
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<link rel="stylesheet" href="MasterStyle.css">
|
|
9
|
-
<title>
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
const
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<link rel="stylesheet" href="MasterStyle.css">
|
|
9
|
+
<title>Example 1 – Simple ZKC</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body class="example-page">
|
|
13
|
+
<header class="example-header">
|
|
14
|
+
<a href="index.html" class="back-link">← All examples</a>
|
|
15
|
+
<h1>Example 1 – Simple ZKC</h1>
|
|
16
|
+
<p class="example-desc">Basic 3D graph: ZKC dataset with box nodes and thick edges.</p>
|
|
17
|
+
<a href="https://github.com/range-et/PGL/blob/main/Examples/1_ZKC_simple.html" class="code-link" target="_blank" rel="noopener">View code</a>
|
|
18
|
+
</header>
|
|
19
|
+
<div class="canvas-wrap">
|
|
20
|
+
<canvas id="displayCanvas" class="displayCanvas"></canvas>
|
|
21
|
+
<script type="module">
|
|
22
|
+
// import the library
|
|
23
|
+
import * as PGL from "../Build/pgl_module.js";
|
|
24
|
+
|
|
25
|
+
// construct a simple ZKC graph
|
|
26
|
+
// this graph is pre initialized (Since it is simulated in this case)
|
|
27
|
+
const zkcSimulated = await PGL.SampleData.LoadZKCSimulated();
|
|
28
|
+
// console log this to see how this data is stored
|
|
29
|
+
console.log(zkcSimulated);
|
|
30
|
+
// also as a reference just see how this data is stored
|
|
31
|
+
zkcSimulated.printData();
|
|
32
|
+
|
|
33
|
+
// set the width and height
|
|
34
|
+
const width = 800;
|
|
35
|
+
const heigth = 700;
|
|
36
|
+
|
|
37
|
+
// pass in the graph and the canvas into the drawing object to draw it
|
|
38
|
+
// first get the canvas element
|
|
39
|
+
const canvas = document.getElementById("displayCanvas");
|
|
40
|
+
// then create a graph drawer object
|
|
41
|
+
// to do that first make a options object
|
|
42
|
+
const graphDrawerOptions = {
|
|
43
|
+
graph: zkcSimulated,
|
|
44
|
+
width: width,
|
|
45
|
+
height: heigth,
|
|
46
|
+
canvas: canvas
|
|
47
|
+
};
|
|
48
|
+
// then create the visualization window
|
|
49
|
+
// with those settings
|
|
50
|
+
const graph3d = new PGL.GraphDrawer.GraphDrawer3d(graphDrawerOptions);
|
|
51
|
+
// initialize this object before adding things to it
|
|
52
|
+
await graph3d.init();
|
|
53
|
+
|
|
54
|
+
// Create the 3d elements for the graph
|
|
55
|
+
// first describe a global scaling factor
|
|
56
|
+
const bounds = 1
|
|
57
|
+
// first create all the node elements
|
|
58
|
+
const nodeVisualElements = PGL.ThreeWrapper.DrawTHREEBoxBasedVertices(zkcSimulated, bounds, 0xffffff, 5);
|
|
59
|
+
// add the node elements to the scene
|
|
60
|
+
graph3d.addVisElement(nodeVisualElements);
|
|
61
|
+
// then create the edge elements
|
|
62
|
+
const edgeVisualElements = PGL.ThreeWrapper.DrawTHREEGraphEdgesThick(zkcSimulated, bounds, 0xffafcc, 10);
|
|
63
|
+
graph3d.addVisElement(edgeVisualElements);
|
|
64
|
+
|
|
65
|
+
// then there are two last steps for a 3d graph
|
|
66
|
+
// this is done so that other 3d objects can be added in later
|
|
67
|
+
// since the base library is three.js all standard three js things are possible
|
|
68
|
+
// now moving on to the two steps :
|
|
69
|
+
// make an animation function
|
|
70
|
+
function animate() {
|
|
71
|
+
requestAnimationFrame(animate);
|
|
72
|
+
graph3d.rendercall();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// append the graph renderer to the container
|
|
76
|
+
// and then drawing render calls
|
|
77
|
+
animate();
|
|
78
|
+
</script>
|
|
79
|
+
</div>
|
|
80
|
+
</body>
|
|
81
|
+
|
|
76
82
|
</html>
|
|
@@ -1,82 +1,88 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8" />
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
const
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<link rel="stylesheet" href="MasterStyle.css">
|
|
9
|
+
<title>Example 2 – Edge bundling</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body class="example-page">
|
|
13
|
+
<header class="example-header">
|
|
14
|
+
<a href="index.html" class="back-link">← All examples</a>
|
|
15
|
+
<h1>Example 2 – Edge bundling</h1>
|
|
16
|
+
<p class="example-desc">ZKC with curved, bundled edges and vertical displacement (arc-style).</p>
|
|
17
|
+
<a href="https://github.com/range-et/PGL/blob/main/Examples/2_ZKC_edge_bundling.html" class="code-link" target="_blank" rel="noopener">View code</a>
|
|
18
|
+
</header>
|
|
19
|
+
<div class="canvas-wrap">
|
|
20
|
+
<canvas id="displayCanvas" class="displayCanvas"></canvas>
|
|
21
|
+
<script type="module">
|
|
22
|
+
// import the library
|
|
23
|
+
import * as PGL from "../Build/pgl_module.js";
|
|
24
|
+
|
|
25
|
+
// construct a simple ZKC graph
|
|
26
|
+
// this graph is pre initialized (Since it is simulated in this case)
|
|
27
|
+
const zkcSimulated = await PGL.SampleData.LoadZKCSimulated();
|
|
28
|
+
// console log this to see how this data is stored
|
|
29
|
+
zkcSimulated.printData();
|
|
30
|
+
|
|
31
|
+
// set the width and height
|
|
32
|
+
const width = 800;
|
|
33
|
+
const heigth = 700;
|
|
34
|
+
|
|
35
|
+
// pass in the graph and the canvas into the drawing object to draw it
|
|
36
|
+
// first get the canvas element
|
|
37
|
+
const canvas = document.getElementById("displayCanvas");
|
|
38
|
+
// then create a graph drawer object
|
|
39
|
+
// to do that first make a options object
|
|
40
|
+
const graphDrawerOptions = {
|
|
41
|
+
graph: zkcSimulated,
|
|
42
|
+
width: width,
|
|
43
|
+
height: heigth,
|
|
44
|
+
canvas: canvas
|
|
45
|
+
};
|
|
46
|
+
// then create the visualization window
|
|
47
|
+
// with those settings
|
|
48
|
+
const graph3d = new PGL.GraphDrawer.GraphDrawer3d(graphDrawerOptions);
|
|
49
|
+
// initialize this object before adding things to it
|
|
50
|
+
await graph3d.init();
|
|
51
|
+
|
|
52
|
+
// Create the 3d elements for the graph
|
|
53
|
+
// first describe a global scaling factor
|
|
54
|
+
const bounds = 1
|
|
55
|
+
// first create all the node elements
|
|
56
|
+
const nodeVisualElements = PGL.ThreeWrapper.DrawTHREEBoxBasedVertices(zkcSimulated, bounds, 0xffffff, 3);
|
|
57
|
+
// add the node elements to the scene
|
|
58
|
+
graph3d.addVisElement(nodeVisualElements);
|
|
59
|
+
|
|
60
|
+
const EdgeMap = zkcSimulated.get_edge_map();
|
|
61
|
+
const EdgeMap_copy = PGL.Drawing.DisplaceEdgeInY(EdgeMap, 20);
|
|
62
|
+
const newEdgeMap = await PGL.Drawing.DrawEdgeBundling(EdgeMap_copy, 50, 10);
|
|
63
|
+
// then create the edge elements
|
|
64
|
+
// these are the reuglar edges
|
|
65
|
+
const edgeVisualElements = PGL.ThreeWrapper.DrawThinEdgesFromEdgeMap(EdgeMap, bounds, 0x62b6cb, 0.1);
|
|
66
|
+
graph3d.addVisElement(edgeVisualElements);
|
|
67
|
+
// these are the bundled edges
|
|
68
|
+
const edgeVisualElements_Bundled = PGL.ThreeWrapper.DrawThickEdgesFromEdgeMap(newEdgeMap, bounds, 0x5fa8d3, 5);
|
|
69
|
+
graph3d.addVisElement(edgeVisualElements_Bundled);
|
|
70
|
+
|
|
71
|
+
// then there are two last steps for a 3d graph
|
|
72
|
+
// this is done so that other 3d objects can be added in later
|
|
73
|
+
// since the base library is three.js all standard three js things are possible
|
|
74
|
+
// now moving on to the two steps :
|
|
75
|
+
// make an animation function
|
|
76
|
+
function animate() {
|
|
77
|
+
requestAnimationFrame(animate);
|
|
78
|
+
graph3d.rendercall();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// append the graph renderer to the container
|
|
82
|
+
// and then drawing render calls
|
|
83
|
+
animate();
|
|
84
|
+
</script>
|
|
85
|
+
</div>
|
|
86
|
+
</body>
|
|
87
|
+
|
|
82
88
|
</html>
|