Socket
Socket
Sign inDemoInstall

ng2-konva

Package Overview
Dependencies
6
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

.npmignore

75

package.json
{
"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"
}
}

@@ -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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc