Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
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.
To install this library, run:
$ npm install 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:
@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.of({
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);
}
}
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
MIT © Rafael Escala
FAQs
Angular binding to canvas element via Konva framework
The npm package ng2-konva receives a total of 1,757 weekly downloads. As such, ng2-konva popularity was classified as popular.
We found that ng2-konva demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.