diff --git a/LICENCE b/LICENSE
similarity index 100%
rename from LICENCE
rename to LICENSE
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..4307ae4
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,31 @@
+# svg-gen Examples
+
+Some code examples, to see how this library works.
+
+## TypeScript & parcel-bundler
+
+All examples are written in TypeScript.
+In order to use the svg-gen library directly (realive path: ..) instead of npm installing and to avoid much configuration, we use parcel.
+Parcel is bundler like Webpack, but with less configuration.
+
+## Current issue: Folder structure
+
+I tried to have all examples in subfolders (html + css files).
+And to have one index.html in examples root.
+But parcel resolves the relative paths wrong, when html files are in subfolders [Parcel issue 2786](https://github.com/parcel-bundler/parcel/issues/2786)
+
+## Build and Test examples
+
+```sh
+npm run build
+```
+
+the built files will be in in examples/dist/
+
+## Develop
+
+```sh
+npm start
+```
+
+The browser will open autommatically the local webserver and refreshes when changes are made.
\ No newline at end of file
diff --git a/examples/package-lock.json b/examples/package-lock.json
index 59d892f..6fab447 100644
--- a/examples/package-lock.json
+++ b/examples/package-lock.json
@@ -1354,6 +1354,12 @@
"@types/d3-selection": "*"
}
},
+ "@types/delaunator": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@types/delaunator/-/delaunator-2.0.0.tgz",
+ "integrity": "sha512-5MwdeoRF5Q3zfGljBt4uOVt2Xppf+kAoZk2fRQV4TOUa7HsZ9R6J4Bu2pfNx9RoIJrbtQwMGHPSdGiQsmJ9jEQ==",
+ "dev": true
+ },
"@types/geojson": {
"version": "7946.0.7",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz",
@@ -3067,6 +3073,11 @@
}
}
},
+ "delaunator": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-3.0.2.tgz",
+ "integrity": "sha512-GNSex8jhF1mcqtNAMYvdZ6Ng7YieYNlbOq2xshyZhLc98P8y5O7Vm6buw4A60wGOd9qvK9RcIMm5qoe4PncAPw=="
+ },
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
diff --git a/examples/package.json b/examples/package.json
index 012b143..e63af31 100644
--- a/examples/package.json
+++ b/examples/package.json
@@ -4,18 +4,18 @@
"description": "",
"main": "index.html",
"scripts": {
- "start": "rm ./dist/ -rf && parcel serve ./src/**/*",
- "build": "rm ./dist/ -rf && parcel build ./src/**/* --public-url ../ && parcel build ./src/index.html --public-url ."
+ "start": "rm ./dist/ -rf && parcel serve ./src/**/* --public-url ./",
+ "build": "rm ./dist/ -rf && parcel build ./src/index.html --public-url ./ --no-minify"
},
"author": "Tobias Kraus svg-gen Examples
See source code on diff --git a/examples/src/points-grid/points-grid.ts b/examples/src/points-grid.ts similarity index 97% rename from examples/src/points-grid/points-grid.ts rename to examples/src/points-grid.ts index 7d7b4ca..d874909 100644 --- a/examples/src/points-grid/points-grid.ts +++ b/examples/src/points-grid.ts @@ -1,4 +1,4 @@ -import { PointsGrid, SvgRenderer } from '../../../src/index'; +import { PointsGrid, SvgRenderer } from '../../src/index'; function example1() { let pointsGrid = new PointsGrid({ diff --git a/examples/src/triangles-web-with-d3/index.html b/examples/src/triangles-web-with-d3.html similarity index 84% rename from examples/src/triangles-web-with-d3/index.html rename to examples/src/triangles-web-with-d3.html index c517c0c..59ded73 100644 --- a/examples/src/triangles-web-with-d3/index.html +++ b/examples/src/triangles-web-with-d3.html @@ -1,14 +1,15 @@ +
- +See source code on
@@ -27,11 +29,12 @@