Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147342 | Sep 6,2019 11:31 AM UTC | Sep 12,2019 08:53 AM UTC | Angular - EJ 2 | 7 |
![]() |
Tags: Diagram |
App.component.html
<ejs-diagram #diagram id="diagram" width="100%" height="700px" [nodes]="nodes">
</ejs-diagram>
App.component.ts
//define nodes collection
public nodes: NodeModel[] = [
//create SVG node
{
id: 'SVGNode',
width: 100,
height: 100,
offsetX: 200,
offsetY: 200,
shape: {
//set type as native
type: 'Native',
// define SVG content as a tring
content: '<svg height="150" width="400"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" /><stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" /></linearGradient></defs><ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)" /></svg>'
},
}
] |
<ejs-symbolpalette id="symbolpalette" [palettes]='palettes' width="100%" height="200px" [getSymbolInfo]="getSymbolInfo" [symbolHeight]=80 [symbolWidth]=120>
</ejs-symbolpalette>
public getSymbolInfo(symbol: NodeModel): SymbolInfo {
// display text for palette item
return { description: { text: symbol.id }, fit: true };
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.