ng2-konva
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "ng2-konva", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Angular binding to canvas element via Konva framework", | ||
"keywords": [ | ||
"angular", | ||
"angula2", | ||
"angular2", | ||
"ng", | ||
@@ -12,8 +12,71 @@ "konva", | ||
], | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build": "gulp build", | ||
"build:watch": "gulp", | ||
"docs": "npm run docs:build", | ||
"docs:build": "compodoc -p tsconfig.json -n ng2-konva -d docs --hideGenerator", | ||
"docs:serve": "npm run docs:build -- -s", | ||
"docs:watch": "npm run docs:build -- -s -w", | ||
"lint": "tslint --type-check --project tsconfig.json src/**/*.ts", | ||
"lite": "lite-server", | ||
"playground:build": "tsc -p playground -w", | ||
"playground": "concurrently \"npm run build:watch\" \"npm run playground:build\" \"npm run lite\"", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:ci": "jest --runInBand" | ||
}, | ||
"author": "", | ||
"license": "MIT" | ||
"jest": { | ||
"preset": "jest-preset-angular", | ||
"setupTestFrameworkScriptFile": "<rootDir>/src/jest.ts" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/rafaesc/ng2-konva.git" | ||
}, | ||
"author": { | ||
"name": "Rafael Escala", | ||
"email": "rafaesc92@gmail.com" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/rafaesc/ng2-konva.git/issues" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "^4.0.0", | ||
"@angular/compiler": "^4.0.0", | ||
"@angular/compiler-cli": "^4.0.0", | ||
"@angular/core": "^4.0.0", | ||
"@angular/platform-browser": "^4.0.0", | ||
"@angular/platform-browser-dynamic": "^4.0.0", | ||
"@compodoc/compodoc": "^1.0.0-beta.10", | ||
"@types/jest": "^19.2.3", | ||
"@types/node": "~6.0.60", | ||
"angular-in-memory-web-api": "^0.3.2", | ||
"codelyzer": "~2.0.0", | ||
"concurrently": "^3.4.0", | ||
"core-js": "^2.4.1", | ||
"del": "^2.2.2", | ||
"gulp": "^3.9.1", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-rollup": "^2.11.0", | ||
"jest": "^20.0.3", | ||
"jest-preset-angular": "^2.0.2", | ||
"konva": "^1.7.6", | ||
"lite-server": "^2.3.0", | ||
"node-sass": "^4.5.2", | ||
"node-sass-tilde-importer": "^1.0.0", | ||
"node-watch": "^0.5.2", | ||
"protractor": "~5.1.0", | ||
"rollup": "^0.41.6", | ||
"run-sequence": "^1.2.2", | ||
"rxjs": "^5.1.0", | ||
"systemjs": "^0.20.12", | ||
"ts-node": "~2.0.0", | ||
"tslint": "~4.5.0", | ||
"typescript": "~2.2.0", | ||
"zone.js": "^0.8.4" | ||
}, | ||
"engines": { | ||
"node": ">=6.0.0" | ||
} | ||
} |
103
README.md
@@ -1,6 +0,103 @@ | ||
# ng2-konva (0.0.0) | ||
# ng2-konva (WORK IN PROGRESS) | ||
This package is in development - check back later! | ||
ng2-konva is a JavaScript library for drawing complex canvas graphics using Angular. | ||
It provides declarative and reactive bindings to the [Konva Framework](http://konvajs.github.io/). | ||
All `ng2-konva` components correspond to `Konva` components of the same name with the prefix 'ko-'. All the parameters available for `Konva` objects can add as `config` in the prop as Observable for corresponding `ng2-konva` components. | ||
Core shapes are: ko-stage, ko-layer, ko-rect, ko-circle, ko-ellipse, ko-line, ko-image, ko-text, ko-text-path, ko-star, ko-label, SVG Path, ko-regular-polygon. | ||
Also you can create custom shape. | ||
To get more info about `Konva` you can read [Konva Overview](http://konvajs.github.io/docs/overview.html). | ||
## Installation | ||
To install this library, run: | ||
```bash | ||
$ npm install ng2-konva --save | ||
``` | ||
## Consuming your library | ||
Once you have published your library to npm, you can import your library in any Angular application by running: | ||
```bash | ||
$ npm install ng2-konva | ||
``` | ||
and then from your Angular `AppModule`: | ||
```typescript | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgModule } from '@angular/core'; | ||
import { AppComponent } from './app.component'; | ||
// Import your library | ||
import { KonvaModule } from 'ng2-konva'; | ||
@NgModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
KonvaModule | ||
], | ||
providers: [], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } | ||
``` | ||
Once your library is imported, you can use its components in your Angular application: | ||
```typescript | ||
@Component({ | ||
selector: 'app', | ||
template: ` | ||
<ko-stage [config]="configStage"> | ||
<ko-layer> | ||
<ko-circle [config]="configCircle" (click)="handleClick($event)"></ko-circle> | ||
</ko-layer> | ||
</ko-stage>` | ||
}) | ||
class AppComponent implements OnInit { | ||
public configStage = new BehaviorSubject({ | ||
width: 200, | ||
height: 200 | ||
}); | ||
public configCircle = Observable.of({ | ||
x: 100, | ||
y: 100, | ||
radius: 70, | ||
fill: 'red', | ||
stroke: 'black', | ||
strokeWidth: 4 | ||
}); | ||
public handleClick(component) { | ||
console.log('Hello Circle', component); | ||
} | ||
} | ||
``` | ||
## Development | ||
To generate all `*.js`, `*.d.ts` and `*.metadata.json` files: | ||
```bash | ||
$ npm run build | ||
``` | ||
To lint all `*.ts` files: | ||
```bash | ||
$ npm run lint | ||
``` | ||
## License | ||
[MIT](LICENSE) License | ||
MIT © [Rafael Escala](mailto:rafaesc92@gmail.com) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
274637
33
1576
1
1
104
33
2