Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17dc3de
commit f292480
Showing
37 changed files
with
4,364 additions
and
740 deletions.
There are no files selected for viewing
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,37 @@ | ||
# dependencies | ||
/node_modules | ||
|
||
# profiling files | ||
chrome-profiler-events.json | ||
speed-measure-plugin.json | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
|
||
# System Files | ||
.DS_Store | ||
Thumbs.db |
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,27 +1,265 @@ | ||
# NlsNg10SplineGenerator | ||
<h1 align="center"><strong>Spline Generator</strong></h1> | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.5. | ||
<div align="center"> | ||
<a href="https://npmjs.org/package/nls-spline-generator"> | ||
<img src="https://badgen.now.sh/npm/v/nls-spline-generator" alt="version" /> | ||
</a> | ||
</div> | ||
|
||
## Development server | ||
--- | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. | ||
# Getting started | ||
|
||
## Code scaffolding | ||
## 1) Add dependency to your project | ||
|
||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
```bash | ||
# npm | ||
npm install nls-spline-generator --save | ||
|
||
## Build | ||
# yarn | ||
yarn add nls-spline-generator | ||
``` | ||
|
||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. | ||
## 2) Import module to your Angular application | ||
|
||
## Running unit tests | ||
```ts | ||
// app.module.ts (default filename) | ||
|
||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
import { NlsSplineGeneratoreModule } from 'nls-spline-generator'; | ||
|
||
## Running end-to-end tests | ||
@NgModule({ | ||
declarations: [ | ||
// ... | ||
], | ||
imports: [ | ||
// ... | ||
NlsSplineGeneratoreModule | ||
], | ||
providers: [ | ||
// ... | ||
], | ||
bootstrap: [ | ||
// ... | ||
] | ||
}) | ||
export class AppModule { } | ||
``` | ||
|
||
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). | ||
## 4) Implement directive in your template | ||
|
||
## Further help | ||
Past in the configuration and set animation to `true` or `false` (default is `false`): | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). | ||
```html | ||
<nls-spline-generator [config]="config"></nls-spline-generator> | ||
``` | ||
|
||
## Usage only | ||
|
||
```ts | ||
// models/config.model.ts | ||
/** | ||
* The Configuration stands for incoming parameters from outside | ||
* to adjust the outcoming graphs. | ||
*/ | ||
|
||
export interface Config { | ||
/** | ||
* Amount of orientation points, excl. entry and vector points | ||
*/ | ||
points?: number; | ||
/** | ||
* Points distributation factor depending on canvas size | ||
*/ | ||
overshoot?: number; | ||
/** | ||
* Amount of graphs | ||
*/ | ||
graphs?: number; | ||
/** | ||
* Amount of splines each graph | ||
*/ | ||
splines?: number; | ||
/** | ||
* Directional vectors coming next after entry points. | ||
* Starting as well ending points of graph drawn on canvs. | ||
* Enters the canvas (in) | ||
* Leaves the canvas (off) | ||
*/ | ||
vector?: { | ||
in?: { | ||
/** | ||
* Vector direction set by part of tau. Examples: | ||
* 0 up, 0.25 right, 0.5 bottom, 0.75 left | ||
*/ | ||
direction: number; | ||
/** | ||
* Margin between canvas border and first graph curve (px) | ||
*/ | ||
margin: number; | ||
/** | ||
* Percentage of canvas height or width | ||
*/ | ||
tension: number; | ||
}, | ||
out?: { | ||
/** | ||
* Vector direction set by part of tau. Examples: | ||
* 0 up, 0.25 right, 0.5 bottom, 0.75 left | ||
*/ | ||
direction: number; | ||
/** | ||
* Margin between canvas border and first graph curve (px) | ||
*/ | ||
margin: number; | ||
/** | ||
* Percentage of canvas height or width | ||
*/ | ||
tension: number; | ||
} | ||
}; | ||
/** | ||
* Configuration for Margins for Entrie Points, Splines and the Canvas at all. | ||
*/ | ||
margin?: { | ||
/** | ||
* Margin between entry points of graphs | ||
*/ | ||
entry?: number; | ||
/** | ||
* Margin between splines of graphs | ||
*/ | ||
spline?: number; | ||
canvas?: { | ||
/** | ||
* Horizontal margin between entry points and canvas boundries (px) | ||
*/ | ||
x?: number; | ||
/** | ||
* Vertical margin between entry points and canvas boundries (px) | ||
*/ | ||
y?: number; | ||
} | ||
}; | ||
/** | ||
* Configuration of spline strokes | ||
*/ | ||
stroke?: { | ||
/** | ||
* Spline stroke width in pixel | ||
*/ | ||
width: number; | ||
/** | ||
* Spline stroke color in hexadecimal, rgb, etc. | ||
*/ | ||
colors: string[]; | ||
}; | ||
/** | ||
* Background color of canvas (default transprent) | ||
*/ | ||
background?: string; | ||
/** | ||
* Configuration for Animation | ||
*/ | ||
animation?: { | ||
enabled?: boolean; | ||
frequency?: number; | ||
/** | ||
* Amplitude of noise generated animation pathes | ||
*/ | ||
amplitude?: number; | ||
/** | ||
* Radius of circular noise generated pathes | ||
*/ | ||
radius?: number; | ||
/** | ||
* Ticks per one animation cycle | ||
*/ | ||
ticks?: number; | ||
}; | ||
/** | ||
* Enable debug mode to draw all helpers like | ||
* points etc. | ||
*/ | ||
debug?: boolean; | ||
} | ||
``` | ||
|
||
## Active Development (Advanced) | ||
|
||
### Rquirements | ||
|
||
- Node.js | ||
- Angular CLI | ||
|
||
### NPM Scripts | ||
|
||
| command | description | | ||
|------------------|--------------------------------------------------------------------| | ||
| `npm run start` | start development server on `http://localhost:4200/` | | ||
| `npm run build` | build production application and save to `./dist` | | ||
| `npm run build:library` | build node module and save to `./dist/nls-spline-generator` | | ||
| `npm run library:files` | copy `README.md` and `LICENSE` to library directory | | ||
|
||
### Version Release | ||
|
||
#### 1. Bumping new version of main application | ||
|
||
```bash | ||
npm version major|minor|patch -m "RELEASE MESSAGE" | ||
``` | ||
|
||
#### 2. Synchronizing versions | ||
|
||
Synchronize the version of `./projects/nls-spline-generator/package.json` with the main application `./package.json`. | ||
|
||
#### 3. Copying files | ||
|
||
Copy `README.md` and `LICENSE` from main application to library. | ||
|
||
```bash | ||
npm run library:files | ||
``` | ||
|
||
#### 4. Building library | ||
|
||
```bash | ||
npm run build:library | ||
``` | ||
|
||
#### 5. Publishing to npm | ||
|
||
```bash | ||
cd dist/nls-spline-generator | ||
npm publish | ||
cd ../.. | ||
``` | ||
|
||
#### 6. Push changes to repository | ||
|
||
```bash | ||
git push | ||
git push --tags | ||
``` | ||
|
||
### Semantic Versioning | ||
|
||
**Any release or tag must use [Semantic Versioning](//semver.org/).** | ||
|
||
Given a version number `MAJOR.MINOR.PATCH`, increment the: | ||
|
||
1. `MAJOR` version when you make incompatible API changes, | ||
1. `MINOR` version when you add functionality in a backwards-compatible manner, and | ||
1. `PATCH` version when you make backwards-compatible bug fixes. | ||
|
||
*Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.* | ||
|
||
|
||
## Contributors | ||
|
||
- Author and Realisation [Michael Czechowski](//github.com/nextlevelshit) | ||
- Consultant [Martin Maga](//github.com/qualiacode) | ||
- Idea and Concept [Bernhard Kinzler](//b612-design.de) | ||
|
||
## License | ||
|
||
> pending |
Oops, something went wrong.