All Projects → konvajs → Ng2 Konva

konvajs / Ng2 Konva

Angular & Canvas - JavaScript library for drawing complex canvas graphics using Angular.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ng2 Konva

Cc
一个基于angular5.0.0+ng-bootstrap1.0.0-beta.8+bootstrap4.0.0-beta.2+scss的后台管理系统界面(没基础的同学请先自学基础,谢谢!)
Stars: ✭ 416 (+433.33%)
Mutual labels:  ng2, angular2
Ngx Echarts
An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
Stars: ✭ 820 (+951.28%)
Mutual labels:  ng2, angular2
Ngx Admin
Customizable admin dashboard template based on Angular 10+
Stars: ✭ 23,286 (+29753.85%)
Mutual labels:  ng2, angular2
pikaso
Seamless and headless HTML5 Canvas library
Stars: ✭ 23 (-70.51%)
Mutual labels:  canvas, shape
Ng2 Ace
A basic ace editor directive for angular 2.
Stars: ✭ 33 (-57.69%)
Mutual labels:  ng2, angular2
ngx-magicsearch
Magic Search/Faceted Search Library for Angular 2
Stars: ✭ 19 (-75.64%)
Mutual labels:  angular2, ng2
Konva
Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
Stars: ✭ 6,985 (+8855.13%)
Mutual labels:  shape, canvas
ng-elm
Write Angular components in Elm.
Stars: ✭ 41 (-47.44%)
Mutual labels:  angular2, ng2
Ngvas
An Angular2/Angular4 library for HTML Canvas.
Stars: ✭ 31 (-60.26%)
Mutual labels:  canvas, angular2
Mylittlecanvas
🎨Need to create a custom view ? You don't know how to use Canvas, use MyLittleCanvas instead !
Stars: ✭ 870 (+1015.38%)
Mutual labels:  shape, canvas
angular2-cookie-law
Angular2+ component that provides a banner to inform users about cookie law
Stars: ✭ 38 (-51.28%)
Mutual labels:  angular2, ng2
Ngautocomplete
Light-weight autocomplete component for Angular.
Stars: ✭ 52 (-33.33%)
Mutual labels:  ng2, angular2
ng2-fused
FuseBox plugins and utilities for building Angular2 applications.
Stars: ✭ 13 (-83.33%)
Mutual labels:  angular2, ng2
Angular
UI-Router for Angular: State-based routing for Angular (v2+)
Stars: ✭ 287 (+267.95%)
Mutual labels:  ng2, angular2
ng2-gravatar
Angular2 gravatar directive
Stars: ✭ 21 (-73.08%)
Mutual labels:  angular2, ng2
Vue Konva
Vue & Canvas - JavaScript library for drawing complex canvas graphics using Vue.
Stars: ✭ 682 (+774.36%)
Mutual labels:  shape, canvas
ng2-STOMP-Over-WebSocket
STOMP Over WebSocket service for angular2
Stars: ✭ 35 (-55.13%)
Mutual labels:  angular2, ng2
ng-seed
Simple Angular seed project with commonly used features.
Stars: ✭ 12 (-84.62%)
Mutual labels:  angular2, ng2
Angular2 Carousel
An lightweight , touchable and responsive library to create a carousel for angular 2 / 4 / 5
Stars: ✭ 26 (-66.67%)
Mutual labels:  ng2, angular2
Ng2 Sweetalert2
A sweetalert2 service for angular2.
Stars: ✭ 49 (-37.18%)
Mutual labels:  ng2, angular2

ng2-konva

Version License

Ng2Konva Logo

ng2-konva is a JavaScript library for drawing complex canvas graphics using Angular.

It provides declarative and reactive bindings to the Konva Framework.

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.

Documentation

http://rafaelescala.com/ng2-konva/

Installation

To install this library, run:

$ npm install konva ng2-konva --save

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import KonvaModule
import { KonvaModule } from 'ng2-konva';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    KonvaModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once KonvaModule is imported, you can use its components in your Angular application:

import { of } from 'rxjs/Observable';

@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: Observable<any> = of({
    width: 200,
    height: 200
  });
  public configCircle: Observable<any> = of({
    x: 100,
    y: 100,
    radius: 70,
    fill: 'red',
    stroke: 'black',
    strokeWidth: 4
  });

  public handleClick(component) {
    console.log('Hello Circle', component);
  }
}

Related repositories

License

MIT © Rafael Escala

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].