Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* replace d3-voronoi with delaunator * tsc commpiler might complain cause of @types/delaunator @types/delaunator version 3.0 is coming soon and will fix it * examples/src folder cannot have subfolder as relative paths are buggy in parcel-bundler (parcel-bundler/parcel#2786) * add examples/README.md
- Loading branch information
1 parent
f5d3d04
commit 14cc986
Showing
10 changed files
with
99 additions
and
28 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/src/points-grid/points-grid.ts → examples/src/points-grid.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 8 additions & 5 deletions
13
...ples/src/triangles-web-with-d3/index.html → examples/src/triangles-web-with-d3.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
|
||
<title>svg-gen example: triangles-web-with-d3</title> | ||
|
||
<link rel="stylesheet" href="../example.css"> | ||
<link rel="stylesheet" href="./example.css"> | ||
|
||
<style> | ||
polygon { | ||
fill: purple; | ||
stroke: white; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="header"> | ||
<h1> | ||
<a href="../index.html">svg-gen Examples</a> / Triangles Web with d3 | ||
<a href="./index.html">svg-gen Examples</a> / Triangles Web with d3 | ||
</h1> | ||
<p class="code-link">See source code on  | ||
<a href="https://github.com/tobiaskraus/svg-gen/tree/master/examples/src/triangles-web-with-d3/"> | ||
github.com/tobiaskraus/svg-gen/.../examples/... | ||
</a> | ||
</p> | ||
</div> | ||
|
||
<div class="content"> | ||
<svg id="svg"></svg> | ||
</div> | ||
|
||
<script src="./triangles-web-with-d3.ts"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"target": "es2015", | ||
"module": "commonjs", | ||
"baseUrl": "./" | ||
"baseUrl": "./", | ||
"esModuleInterop": true | ||
} | ||
} |