aurea-eden 1.25.1 → 1.26.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 (93) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +300 -95
  3. package/dist/bpmn-diagram.es.js +37516 -25040
  4. package/dist/bpmn-diagram.umd.js +13 -5790
  5. package/package.json +17 -8
  6. package/.gitattributes +0 -2
  7. package/.github/workflows/static.yml +0 -43
  8. package/CHANGELOG.md +0 -60
  9. package/README_.md +0 -174
  10. package/assets/3diagram_logo.png +0 -0
  11. package/assets/aurea-eden-logo.jpeg +0 -0
  12. package/assets/favicon/about.txt +0 -6
  13. package/assets/favicon/android-chrome-192x192.png +0 -0
  14. package/assets/favicon/android-chrome-512x512.png +0 -0
  15. package/assets/favicon/apple-touch-icon.png +0 -0
  16. package/assets/favicon/favicon-16x16.png +0 -0
  17. package/assets/favicon/favicon-32x32.png +0 -0
  18. package/assets/favicon/favicon.ico +0 -0
  19. package/assets/favicon/site.webmanifest +0 -1
  20. package/assets/threejs_camera.jpg.webp +0 -0
  21. package/assets/threejs_camera3.jpg.webp +0 -0
  22. package/assets/threejs_cameras.webp +0 -0
  23. package/assets/threejs_cameras2.webp +0 -0
  24. package/assets/threejs_objects.webp +0 -0
  25. package/assets/threejs_scene.webp +0 -0
  26. package/assets/threejs_scene_graph.webp +0 -0
  27. package/favicon.ico +0 -0
  28. package/index.html +0 -34
  29. package/index.js +0 -153
  30. package/lib/connectors/Connector.js +0 -47
  31. package/lib/diagrams/Diagram.js +0 -710
  32. package/lib/diagrams/DiagramConstants.js +0 -22
  33. package/lib/elements/Element.js +0 -860
  34. package/lib/materials/BarMaterial.js +0 -17
  35. package/lib/materials/DiagramEditMaterial.js +0 -28
  36. package/lib/notations/BpmnDiagram.js +0 -861
  37. package/lib/shapes/Shape.js +0 -23
  38. package/lib/shapes/bar/ValueBarConstants.js +0 -34
  39. package/lib/shapes/bar/ValueBarShape.js +0 -52
  40. package/lib/shapes/basic/BasicShapeConstants.js +0 -23
  41. package/lib/shapes/basic/BoxShape.js +0 -12
  42. package/lib/shapes/basic/CircleShape.js +0 -55
  43. package/lib/shapes/basic/DiamondShape.js +0 -169
  44. package/lib/shapes/basic/RoundedRectangleShape.js +0 -180
  45. package/lib/shapes/connector/ConnectorConstants.js +0 -7
  46. package/lib/shapes/connector/RoundedCornerOrthogonalConnectorShape.js +0 -229
  47. package/lib/shapes/icon/IconConstants.js +0 -7
  48. package/lib/shapes/icon/IconShape.js +0 -92
  49. package/lib/shapes/icon/bpmn/activities/ad-hoc-marker.svg +0 -50
  50. package/lib/shapes/icon/bpmn/activities/business-rule.svg +0 -92
  51. package/lib/shapes/icon/bpmn/activities/compensation-marker.svg +0 -50
  52. package/lib/shapes/icon/bpmn/activities/loop-marker.svg +0 -50
  53. package/lib/shapes/icon/bpmn/activities/manual.svg +0 -51
  54. package/lib/shapes/icon/bpmn/activities/parallel-mi-marker.svg +0 -70
  55. package/lib/shapes/icon/bpmn/activities/receive.svg +0 -77
  56. package/lib/shapes/icon/bpmn/activities/script.svg +0 -54
  57. package/lib/shapes/icon/bpmn/activities/send.svg +0 -86
  58. package/lib/shapes/icon/bpmn/activities/sequential-mi-marker.svg +0 -70
  59. package/lib/shapes/icon/bpmn/activities/service.svg +0 -58
  60. package/lib/shapes/icon/bpmn/activities/sub-process-marker.svg +0 -51
  61. package/lib/shapes/icon/bpmn/activities/user.svg +0 -50
  62. package/lib/shapes/icon/bpmn/events/compensation.svg +0 -47
  63. package/lib/shapes/icon/bpmn/events/conditional.svg +0 -47
  64. package/lib/shapes/icon/bpmn/events/error.svg +0 -47
  65. package/lib/shapes/icon/bpmn/events/escalation.svg +0 -47
  66. package/lib/shapes/icon/bpmn/events/intermediate-compensation.svg +0 -53
  67. package/lib/shapes/icon/bpmn/events/intermediate-conditional.svg +0 -53
  68. package/lib/shapes/icon/bpmn/events/intermediate-escalation.svg +0 -53
  69. package/lib/shapes/icon/bpmn/events/intermediate-link-catch.svg +0 -53
  70. package/lib/shapes/icon/bpmn/events/intermediate-link-throw.svg +0 -53
  71. package/lib/shapes/icon/bpmn/events/intermediate-receive.svg +0 -53
  72. package/lib/shapes/icon/bpmn/events/intermediate-send.svg +0 -69
  73. package/lib/shapes/icon/bpmn/events/intermediate-signal-catch.svg +0 -53
  74. package/lib/shapes/icon/bpmn/events/intermediate-signal-throw.svg +0 -53
  75. package/lib/shapes/icon/bpmn/events/intermediate-timer.svg +0 -107
  76. package/lib/shapes/icon/bpmn/events/intermediate.svg +0 -49
  77. package/lib/shapes/icon/bpmn/events/message-end.svg +0 -54
  78. package/lib/shapes/icon/bpmn/events/message-start.svg +0 -41
  79. package/lib/shapes/icon/bpmn/events/signal-end.svg +0 -47
  80. package/lib/shapes/icon/bpmn/events/signal-start.svg +0 -47
  81. package/lib/shapes/icon/bpmn/events/terminate.svg +0 -49
  82. package/lib/shapes/icon/bpmn/events/timer.svg +0 -104
  83. package/lib/shapes/icon/bpmn/gateways/complex.svg +0 -61
  84. package/lib/shapes/icon/bpmn/gateways/event-based.svg +0 -68
  85. package/lib/shapes/icon/bpmn/gateways/exclusive.svg +0 -57
  86. package/lib/shapes/icon/bpmn/gateways/inclusive.svg +0 -57
  87. package/lib/shapes/icon/bpmn/gateways/parallel.svg +0 -56
  88. package/lib/shapes/icon/decorators.svg +0 -262
  89. package/lib/shapes/icon/hexagon.svg +0 -5
  90. package/lib/shapes/text/Roboto_Regular.json +0 -5610
  91. package/lib/shapes/text/TextShape.js +0 -29
  92. package/lib/shapes/text/fonts/Roboto.zip +0 -0
  93. package/vite.config.js +0 -15
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aurea-eden",
3
3
  "type": "module",
4
- "version": "1.25.1",
4
+ "version": "1.26.0",
5
5
  "description": "A Three.js-based framework for creating custom 3D diagramming notations.",
6
6
  "main": "dist/bpmn-diagram.es.js",
7
7
  "module": "dist/bpmn-diagram.es.js",
@@ -18,19 +18,28 @@
18
18
  "Three.js",
19
19
  "library"
20
20
  ],
21
+ "files": [
22
+ "dist/bpmn-diagram.es.js",
23
+ "dist/bpmn-diagram.umd.js"
24
+ ],
21
25
  "scripts": {
22
26
  "dev": "vite",
23
- "build": "vite build",
24
- "predeploy": "npm run build",
25
- "deploy1": "npm run build && mkdir -p temp-deploy && cp -r dist/* temp-deploy/ && cp index.html temp-deploy/ && cp index.js temp-deploy/ && cp favicon.ico temp-deploy/ && git branch -D gh-pages || true && git checkout --orphan gh-pages && git rm -rf . && git clean -fxd && mv temp-deploy/* . && rm -rf temp-deploy && git add . && git commit -m 'Deploy to GitHub Pages' && git push -f origin gh-pages && git checkout main",
26
- "deploy": "npm run build && git branch -D gh-pages || true",
27
+ "// --- BUILD TASKS ---": "",
28
+ "build:lib": "vite build",
29
+ "build:site": "vite build --mode site",
30
+ "// --- DEPLOY TASKS ---": "",
31
+ "deploy:pages": "gh-pages -d dist-site",
32
+ "deploy:npm": "npm publish",
33
+ "// --- RELEASE TASKS ---": "",
27
34
  "release": "standard-version",
28
- "release:patch": "standard-version --release-as patch",
29
- "release:minor": "standard-version --release-as minor",
30
- "release:major": "standard-version --release-as major"
35
+ "push:git": "git push --follow-tags origin main",
36
+ "// --- THE MASTER COMMAND ---": "",
37
+ "ship": "npm run release && npm run build:lib && npm run build:site && npm run deploy:npm && npm run deploy:pages && npm run push:git"
31
38
  },
32
39
  "devDependencies": {
40
+ "gh-pages": "^6.3.0",
33
41
  "standard-version": "^9.5.0",
42
+ "terser": "^5.39.0",
34
43
  "vite": "^6.2.0",
35
44
  "vite-plugin-css-injected-by-js": "^3.3.0"
36
45
  },
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
@@ -1,43 +0,0 @@
1
- # Simple workflow for deploying static content to GitHub Pages
2
- name: Deploy static content to Pages
3
-
4
- on:
5
- # Runs on pushes targeting the default branch
6
- push:
7
- branches: ["main"]
8
-
9
- # Allows you to run this workflow manually from the Actions tab
10
- workflow_dispatch:
11
-
12
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
- permissions:
14
- contents: read
15
- pages: write
16
- id-token: write
17
-
18
- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19
- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20
- concurrency:
21
- group: "pages"
22
- cancel-in-progress: false
23
-
24
- jobs:
25
- # Single deploy job since we're just deploying
26
- deploy:
27
- environment:
28
- name: github-pages
29
- url: ${{ steps.deployment.outputs.page_url }}
30
- runs-on: ubuntu-latest
31
- steps:
32
- - name: Checkout
33
- uses: actions/checkout@v4
34
- - name: Setup Pages
35
- uses: actions/configure-pages@v5
36
- - name: Upload artifact
37
- uses: actions/upload-pages-artifact@v3
38
- with:
39
- # Upload entire repository
40
- path: '.'
41
- - name: Deploy to GitHub Pages
42
- id: deployment
43
- uses: actions/deploy-pages@v4
package/CHANGELOG.md DELETED
@@ -1,60 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### [1.25.1](https://gitlab.tecna.pl/waszkowski_r/three-diagram/compare/v1.25.0...v1.25.1) (2025-04-30)
6
-
7
- ## [1.25.0](https://gitlab.tecna.pl/waszkowski_r/three-diagram/compare/v1.24.0...v1.25.0) (2025-04-30)
8
-
9
- ## [1.24.0] - 2025-04-30
10
- ### Added
11
- - Complete JSDoc documentation for main module and components
12
-
13
- ## [1.1.0] - 2025-04-26
14
- ### Added
15
- - New sample diagrams for demonstration
16
- - Spot light functionality for better 3D visualization
17
- ### Changed
18
- - Enhanced diagram display modes
19
-
20
- ## [1.0.0] - 2025-03-16
21
- ### Added
22
- - Complete BPMN notation support
23
- - BPMN elements and icons
24
- - Icon placeholders system
25
- - Text wrapping functionality
26
- ### Changed
27
- - Improved icon shape handling
28
-
29
- ## [0.3.0] - 2025-02-28
30
- ### Added
31
- - BPMN parser functionality
32
- - Connector system for diagram elements
33
- ### Changed
34
- - Major project reorganization
35
- - API improvements
36
-
37
- ## [0.2.0] - 2025-02-16
38
- ### Added
39
- - Bar visualization with random heights and colors
40
- - Text support for elements
41
- - Analysis mode with TWEEN animations
42
- ### Changed
43
- - Controls system with map and orbit controls
44
- - Project files organization refactor
45
-
46
- ## [0.1.0] - 2025-01-23
47
- ### Added
48
- - Basic BPMN shapes and elements
49
- - Diagram modes (EDIT, VIEW)
50
- - Camera controls and adjustments
51
- - Map controls for EDIT mode
52
- - Window resize handling
53
- - Favicon support
54
-
55
- ## [0.0.1] - 2025-01-13
56
- ### Added
57
- - Initial project setup
58
- - Basic Three.js integration
59
- - Project structure
60
- - License
package/README_.md DELETED
@@ -1,174 +0,0 @@
1
- # Aurea EDEN
2
-
3
- ![Three Diagram Logo](assets/3diagram_logo.png)
4
-
5
- ## Libraries used
6
-
7
- ```
8
- npm install --save three
9
- npm install @tweenjs/tween.js
10
- npm install --save-dev vite
11
-
12
- ```
13
-
14
- ## Run
15
- ### Vite
16
- ```
17
- npx vite
18
- ```
19
- and open the local site: [http://localhost:5173/](http://localhost:5173/)
20
-
21
-
22
- ### Build and run
23
- ```
24
- npm run build
25
- npx vite
26
- ```
27
- and open the local site [http://localhost:5173/use-lib.html](http://localhost:5173/use-lib.html)
28
-
29
- ## Getting started
30
-
31
- To make it easy for you to get started with GitLab, here's a list of recommended next steps.
32
-
33
- Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
34
-
35
- ## Add your files
36
-
37
- - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
38
- - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
39
-
40
- ```
41
- cd existing_repo
42
- git remote add origin https://gitlab.tecna.pl/waszkowski_r/three-diagram.git
43
- git branch -M master
44
- git push -uf origin master
45
- ```
46
-
47
- ## Git configuration
48
-
49
- You can view all of your settings and where they are coming from using:
50
-
51
- ```
52
- $ git config --list --show-origin
53
- ```
54
-
55
- Your Identity
56
- The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information, and it’s immutably baked into the commits you start creating:
57
-
58
- ```
59
- $ git config --global user.name "John Doe"
60
- $ git config --global user.email johndoe@example.com
61
- ```
62
-
63
- ### Avoid Repeated Credential Prompts
64
-
65
- If you want VS Code to stop asking for credentials every time you push your changes to GitLab, follow this step:
66
-
67
- ```
68
- git config credential.helper store
69
- ```
70
-
71
- ## Integrate with your tools
72
-
73
- - [ ] [Set up project integrations](https://gitlab.tecna.pl/waszkowski_r/three-diagram/-/settings/integrations)
74
-
75
- ## Collaborate with your team
76
-
77
- - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
78
- - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
79
- - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
80
- - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
81
- - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
82
-
83
- ## Test and Deploy
84
-
85
- Use the built-in continuous integration in GitLab.
86
-
87
- - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
88
- - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
89
- - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
90
- - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
91
- - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
92
-
93
- ***
94
-
95
- # Editing this README
96
-
97
- When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
98
-
99
- ## Suggestions for a good README
100
-
101
- Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
102
-
103
- ## Name
104
- Choose a self-explaining name for your project.
105
-
106
- ## Description
107
- Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
108
-
109
- ## Badges
110
- On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
111
-
112
- ## Visuals
113
- Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
114
-
115
- ## Installation
116
- Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
117
-
118
- ## Usage
119
- Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
120
-
121
- ## Support
122
- Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
123
-
124
- ## Roadmap
125
- If you have ideas for releases in the future, it is a good idea to list them in the README.
126
-
127
- ## Contributing
128
- State if you are open to contributions and what your requirements are for accepting them.
129
-
130
- For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
131
-
132
- You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
133
-
134
- ## Authors and acknowledgment
135
- Show your appreciation to those who have contributed to the project.
136
-
137
- ## License
138
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
139
-
140
- ## Project status
141
- If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
142
-
143
- # Acknowledgment
144
- The library structure and behavior are inspired by Sameer Kumar's sample JavaScript Vite library. For more details, visit the [GitHub repository](https://github.com/sameer1612/ninja-lib) and the [preparation guide](https://betterprogramming.pub/the-pragmatic-guide-to-your-first-javascript-library-516a7b08c677).
145
-
146
- Useful Three.js Tutorial [here](https://sbcode.net/threejs/)
147
- (i.e. [OrbitControls](https://sbcode.net/threejs/orbit-controls/)).
148
-
149
- Drawing technology flow chart [orthogonal connection algorithm](https://pubuzhixing.medium.com/drawing-technology-flow-chart-orthogonal-connection-algorithm-fe23215f5ada).
150
- Routing [Orthogonal Diagram Connectors in JavaScript](https://medium.com/swlh/routing-orthogonal-diagram-connectors-in-javascript-191dc2c5ff70).
151
- Orthogonal Connector Routing example [here](https://orthogonal.jose.page/).
152
-
153
-
154
-
155
- For testing
156
-
157
- $ npm install --save dat.gui
158
-
159
- https://github.com/dataarts/dat.gui
160
-
161
-
162
- **Adding automated versioning**
163
-
164
- https://muetsch.io/mastering-software-versioning-in-javascript-projects.html
165
-
166
- Install:
167
- ```terminal
168
- npm i --save-dev standard-version
169
- ```
170
-
171
- Set a new version:
172
- ```terminal
173
- npm run release
174
- ```
Binary file
Binary file
@@ -1,6 +0,0 @@
1
- This favicon was generated using the following graphics from Twitter Twemoji:
2
-
3
- - Graphics Title: 2197.svg
4
- - Graphics Author: Copyright 2020 Twitter, Inc and other contributors (https://github.com/twitter/twemoji)
5
- - Graphics Source: https://github.com/twitter/twemoji/blob/master/assets/svg/2197.svg
6
- - Graphics License: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/favicon.ico DELETED
Binary file
package/index.html DELETED
@@ -1,34 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Aurea EDEN demo</title>
6
- <!-- Favicon hack - Add '?' to favicon.ico to be visible in dev mode on vite -->
7
- <!-- https://stackoverflow.com/questions/7324456/favicon-not-showing-up -->
8
- <link rel="icon" href="favicon.ico?" type="image/x-icon">
9
- <style>
10
- body { margin: 0; }
11
-
12
- /* 2. set appropriate css for the camera vectors */
13
- #camera-vectors {
14
- position: absolute;
15
- top: 0;
16
- left: 0;
17
- background: grey; /* rgba(128, 128, 128, 0); */
18
- padding: 8px;
19
- color: white; /* rgba(255, 255, 255, 0); */
20
- }
21
- </style>
22
- </head>
23
- <body>
24
- <script type="module" src="index.js"></script>
25
-
26
- <!-- CAMERA HELPER 1. create spans for displaying camera position and lookAt vectors -->
27
- <div id="camera-vectors">
28
- <span>Free Camera Vectors:</span><br>
29
- <span id="position"></span><br>
30
- <span id="lookingAt"></span>
31
- </div>
32
-
33
- </body>
34
- </html>
package/index.js DELETED
@@ -1,153 +0,0 @@
1
- // Prepare a BPMN diagram
2
-
3
- import { BpmnDiagram } from "./lib/notations/BpmnDiagram.js";
4
- import * as dat from 'dat.gui';
5
-
6
- var diagram = new BpmnDiagram(document.body);
7
-
8
-
9
- // Set GUI
10
-
11
- const gui = new dat.GUI();
12
- const parameters =
13
- {
14
- mode: "VIEW",
15
- toggleHelpers: function() { toggleHelpers() },
16
- reset: function() { resetDiagram() },
17
- export: function() { exportDiagram() },
18
- import: function() { importDiagram() },
19
- clear: function() { clearDiagram() }
20
- };
21
-
22
- var diagramMode = gui.add( parameters, 'mode', [ "VIEW", "ANALYZE" ] ).name('Diagram mode').listen();
23
- diagramMode.onChange(function(value)
24
- { setDiagramMode(); });
25
-
26
-
27
- gui.add( parameters, 'toggleHelpers' ).name("Toggle Helpers");
28
- gui.add( parameters, 'reset' ).name("Reset Diagram");
29
- gui.add( parameters, 'export' ).name("Export Diagram");
30
- gui.add( parameters, 'import' ).name("Import Diagram");
31
- gui.add( parameters, 'clear' ).name("Clear Diagram");
32
- gui.open();
33
-
34
- function setDiagramMode() {
35
- var value = parameters.mode;
36
- diagram.setMode(value);
37
- console.log(diagram);
38
- }
39
-
40
- function toggleHelpers() {
41
- if (diagram.helpers) {
42
- diagram.hideHelpers();
43
- } else {
44
- diagram.showHelpers();
45
- }
46
- }
47
-
48
- function resetDiagram() {
49
- parameters.mode = "VIEW";
50
- diagram.reset();
51
- console.log(diagram);
52
- }
53
-
54
- function importDiagram() {
55
- console.log('Importing diagram');
56
- const input = document.createElement('input');
57
- input.type = 'file';
58
- input.accept = '.bpmn';
59
- input.onchange = (event) => {
60
- const file = event.target.files[0];
61
- if (file) {
62
- console.log(file);
63
- diagram.import(file);
64
- }
65
- };
66
- input.click();
67
- }
68
-
69
- function exportDiagram() {
70
- diagram.export();
71
- }
72
-
73
- function clearDiagram() {
74
- diagram.clear();
75
- }
76
-
77
-
78
-
79
- // Add diagram elements
80
-
81
- diagram.addStartEvent('e1');
82
-
83
- diagram.addTask('a1')
84
- .positionRightOf('e1')
85
- .addWrappedText('Handle Quotations')
86
- .connectFrom('e1', 'E', 'W')
87
- .addValueBar(20);
88
-
89
- diagram.addGateway('g1')
90
- .positionRightOf('a1')
91
- .connectFrom('a1', 'E', 'W');
92
-
93
- diagram.addTask('a2')
94
- .positionRightOf('g1')
95
- .addWrappedText('Fill Order')
96
- .addValueBar(35)
97
- .connectFrom('g1', 'E', 'W');
98
-
99
- diagram.addTask('a3')
100
- .positionUpRightOf('a2')
101
- .addWrappedText('Ship Order')
102
- .addValueBar(30)
103
- .connectFrom('a2', 'N', 'W');
104
-
105
- diagram.addTask('a4')
106
- .positionDownRightOf('a2')
107
- .addWrappedText('Send Invoice')
108
- .addValueBar(60)
109
- .connectFrom('a2', 'S', 'W');
110
-
111
- diagram.addTask('a5')
112
- .positionRightOf('a4')
113
- .addWrappedText('Make Payment')
114
- .addValueBar(50)
115
- .connectFrom('a4', 'E', 'W');
116
-
117
- diagram.addTask('a6')
118
- .positionRightOf('a5')
119
- .addWrappedText('Accept Payment')
120
- .addValueBar(30)
121
- .connectFrom('a5', 'E', 'W');
122
-
123
- diagram.addGateway('g2')
124
- .positionUpRightOf('a6')
125
- .connectFrom('a3', 'E', 'N')
126
- .connectFrom('a6', 'E', 'S');
127
-
128
- diagram.addUserTask('a7')
129
- .positionRightOf('g2')
130
- .addWrappedText('Close Order')
131
- .addValueBar(30)
132
- .connectFrom('g2', 'E', 'W');
133
-
134
- diagram.addEndEvent('e2')
135
- .positionRightOf('a7')
136
- .connectFrom('a7', 'E', 'W');
137
-
138
- // Non-standard connector
139
- const waypoints = [
140
- diagram.getElementById('g1').getNorthPoint(),
141
- { x: diagram.getElementById('g1').getNorthPoint().x,
142
- y: diagram.getElementById('a3').getNorthPoint().y + BpmnDiagram.Dimensions.DISTANCE_BETWEEN_ELEMENTS },
143
- { x: diagram.getElementById('a7').getNorthPoint().x,
144
- y: diagram.getElementById('a3').getNorthPoint().y + BpmnDiagram.Dimensions.DISTANCE_BETWEEN_ELEMENTS },
145
- diagram.getElementById('a7').getNorthPoint()
146
- ];
147
- diagram.addFlowConnector('f1', waypoints);
148
-
149
- // End of diagram preparation
150
-
151
- diagram.arrange();
152
- diagram.fitScreen();
153
-
@@ -1,47 +0,0 @@
1
- import * as THREE from 'three';
2
- import { RoundedCornerOrthogonalConnectorShape } from '../shapes/connector/RoundedCornerOrthogonalConnectorShape.js';
3
-
4
- class Connector extends THREE.Mesh {
5
- constructor(elementId,
6
- shape = new RoundedCornerOrthogonalConnectorShape(),
7
- sourceElement = null,
8
- targetElement = null,
9
- sourcePoint = { x: 0, y: 0 },
10
- targetPoint = { x: 2, y: 2 },
11
- waypoints = [{ x: 0, y: 1 }, { x: 2, y: 1 }],
12
- properties = {}) {
13
- super(shape.geometry, shape.material);
14
- this.elementId = elementId;
15
- this.sourceElement = sourceElement;
16
- this.targetElement = targetElement;
17
- this.shape = shape;
18
- this.points = [sourcePoint, ...waypoints, targetPoint];
19
- this.properties = properties;
20
- }
21
-
22
- setDiagram(diagram) {
23
- this.diagram = diagram;
24
- }
25
-
26
- static determinePoints(sourcePoint, targetPoint, sourcePosition, targetPosition) { //TODO: rozbudować o sourcePosition i targetPosition (np. trzyelementowe konektory)
27
- let waypoints = [];
28
-
29
- if (sourcePoint.x !== targetPoint.x && sourcePoint.y !== targetPoint.y) {
30
- // if source position starts with W or E then use the y coordinate of the source point
31
- // and the x coordinate of the target point
32
- if (sourcePosition.startsWith('W') || sourcePosition.startsWith('E')) {
33
- waypoints.push({ x: targetPoint.x, y: sourcePoint.y });
34
- }
35
- // if source position starts with N or S then use the x coordinate of the source point
36
- // and the y coordinate of the target point
37
- if (sourcePosition.startsWith('N') || sourcePosition.startsWith('S')) {
38
- waypoints.push({ x: sourcePoint.x, y: targetPoint.y });
39
- }
40
- }
41
-
42
- return [sourcePoint, ...waypoints, targetPoint];
43
- }
44
-
45
- }
46
-
47
- export { Connector };