Skip to content

Commit cfb1d04

Browse files
committed
1 parent 0a49e75 commit cfb1d04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+17771
-0
lines changed

gojs-3d/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

gojs-3d/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
/.svelte-kit
7+
/build
8+
9+
# OS
10+
.DS_Store
11+
Thumbs.db
12+
13+
# Env
14+
.env
15+
.env.*
16+
!.env.example
17+
!.env.test
18+
19+
# Vite
20+
vite.config.js.timestamp-*
21+
vite.config.ts.timestamp-*

gojs-3d/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

gojs-3d/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock

gojs-3d/.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}

gojs-3d/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# gojs-3d
2+
3+
### By Northwoods Software for [GoJS](https://gojs.net)
4+
5+
This project provides a basic example of using GoJS alongside a 3D view (using ThreeJS) in a Svelte app.
6+
7+
## Installation
8+
9+
Start by running `npm install` to install all necessary dependencies.
10+
`npm run dev` runs the app in the development mode.
11+
12+
## GoJS with ThreeJS in Svelte
13+
14+
This sample demonstrates GoJS Diagrams alongside a 3D model made with ThreeJS.
15+
16+
Three separate GoJS Diagrams observe a single model, each showing two of three coordinate
17+
planes. When Nodes are moved or resized, two-way bindings on the Node Templates transmit
18+
those changes back to the model, automatically updating the other GoJS Diagrams. The ThreeJS
19+
view is updated with a Model change listener (<a target="\_blank" href="https://gojs.net/latest/api/symbols/Model.html#addChangedListener"> <code>model.addChangedListener</code></a> ).
20+
21+
This sample also demonstrates GoJS alongside Svelte, where one component creates a GoJS
22+
model and passes it to children components. Those components bind the model and a selection
23+
variable, to pass upwards to update the state of other diagrams and the UI. A simple node
24+
information component is included to show details about a selected object.
25+
26+
## [Project source code](https://github.com/NorthwoodsSoftware/GoJS/tree/master/projects)
27+
28+
## [See more GoJS Samples](https://gojs.net/latest/samples/)

gojs-3d/eslint.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import prettier from 'eslint-config-prettier';
2+
import js from '@eslint/js';
3+
import svelte from 'eslint-plugin-svelte';
4+
import globals from 'globals';
5+
import ts from 'typescript-eslint';
6+
7+
export default ts.config(
8+
js.configs.recommended,
9+
...ts.configs.recommended,
10+
...svelte.configs['flat/recommended'],
11+
prettier,
12+
...svelte.configs['flat/prettier'],
13+
{
14+
languageOptions: {
15+
globals: {
16+
...globals.browser,
17+
...globals.node
18+
}
19+
}
20+
},
21+
{
22+
files: ['**/*.svelte'],
23+
24+
languageOptions: {
25+
parserOptions: {
26+
parser: ts.parser
27+
}
28+
}
29+
},
30+
{
31+
ignores: ['build/', '.svelte-kit/', 'dist/']
32+
}
33+
);

0 commit comments

Comments
 (0)