Options
All
  • Public
  • Public/Protected
  • All
Menu

Template definition

OrgChart.templates.myTemplate = Object.assign({}, OrgChart.templates.ana);

Hierarchy

  • template

Indexable

[name: string]: any

A custom field definition

 OrgChart.templates.myTemplate.number =
`<text width="230" style="font-size: 11px;" fill="#64696b" x="150" y="53" text-anchor="start">{val}</text>`;

Index

Properties

defs?: string

SVG <defs?> of the template

OrgChart.templates.myTemplate.defs = 
`<filter id="{randId}" x="0" y="0" width="200%" height="200%">
<feOffset result="offOut" in="SourceAlpha" dx="5" dy="5"></feOffset>
<feGaussianBlur result="blurOut" in="offOut" stdDeviation="5"></feGaussianBlur>
<feBlend in="SourceGraphic" in2="blurOut" mode="normal"></feBlend>
</filter>`;
editFormHeaderColor?: string

Edit form header color

 OrgChart.templates.myTemplate.editFormHeaderColor = '#039BE5'
expandCollapseSize?: number

Size of the expandCollapse button

OrgChart.templates.myTemplate.expandCollapseSize = 30;
img_0?: string | ((node: node, data: nodeData, template: template, config: options) => string)

Node image

 OrgChart.templates.myTemplate.img_0 =  
`<clipPath id="{randId}"><circle cx="50" cy="30" r="40"></circle></clipPath>
<image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="-10" width="80" height="80">
</image>`;
link?: string

Link Defines the link color, width and curve

OrgChart.templates.myTemplate.link = 
`<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />`;
linkAdjuster?: { fromX?: number; fromY?: number; toX?: number; toY?: number }

Adjust link positions

OrgChart.templates.myTemplate.linkAdjuster = {
fromX: 0,
fromY: -10,
toX: 0,
toY: 0
}

Type declaration

  • Optional fromX?: number
  • Optional fromY?: number
  • Optional toX?: number
  • Optional toY?: number
link_field_0?: string

Link label

 OrgChart.templates.myTemplate.link_field_0 =  
`<text text-anchor="middle" fill="#aeaeae" data-width="290" x="0" y="0" style="font-size:10px;">{val}</text>`;
menuButton?: string

Menu button

 OrgChart.templates.myTemplate.menuButton = 
`<div style="position:absolute;right:{p}px;top:{p}px; width:40px;height:50px;cursor:pointer;" data-ctrl-menu="">
<hr style="background-color: #7A7A7A; height: 3px; border: none;">
<hr style="background-color: #7A7A7A; height: 3px; border: none;">
<hr style="background-color: #7A7A7A; height: 3px; border: none;">
</div>`;
min?: template

Minimized template

OrgChart.templates.myTemplate.min = Object.assign({}, OrgChart.templates.ana);
OrgChart.templates.myTemplate.min.size = [250, 60];
OrgChart.templates.myTemplate.min.img_0 = "";
OrgChart.templates.myTemplate.min.field_0 =
`<text data-width="230" style="font-size: 18px;" fill="#ffffff" x="125" y="40" text-anchor="middle">{val}</text>`;
OrgChart.templates.myTemplate.min.field_1 = "";
minus?: string | ((node: node, data: nodeData, template: template, config: options) => string)

Minus/collapse button

 OrgChart.templates.myTemplate.minus =
`<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle>
<line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>`;
node?: string | ((node: node, data: nodeData, template: template, config: options) => string)

Node definition - A string that should contains SVG markup.

OrgChart.templates.myTemplate.node =
`<rect x="0" y="0" height="{h}" width="{w}" fill="#039BE5" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>`;
nodeCircleMenuButton?: object

EMode circle menu button

 OrgChart.templates.myTemplate.nodeCircleMenuButton = {
radius: 18,
x: 250,
y: 60,
color: '#fff',
stroke: '#aeaeae'
}
nodeMenuButton?: string | ((node: node, data: nodeData, template: template, config: options) => string)

Node menu button

 OrgChart.templates.myTemplate.nodeMenuButton = 
`<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" data-ctrl-n-menu-id="{id}">
<rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect>
<circle cx="0" cy="0" r="2" fill="#ffffff"></circle>
<circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle>
</g>`;
padding?: [number, number, number, number]

Inner spacing around the node content area.

Order of values: [top, right, bottom, left]

Example: OrgChart.templates.myTemplate.padding = [10, 15, 10, 15];

Meaning:

  • top: 10px
  • right: 15px
  • bottom: 10px
  • left: 15px

Use this to prevent content from touching the edges of the node and to control internal layout spacing.

plus?: string | ((node: node, data: nodeData, template: template, config: options) => string)

Plus/expand button

OrgChart.templates.myTemplate.plus =
`<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle>
<line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>
<line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#aeaeae"></line>`;
pointer?: string

Pointer

OrgChart.templates.myTemplate.pointer =
`<g data-pointer="pointer" transform="matrix(0,0,0,0,100,100)">
<radialGradient id="pointerGradient">
<stop stop-color="#ffffff" offset="0" />
<stop stop-color="#C1C1C1" offset="1" />
</radialGradient>
<circle cx="16" cy="16" r="16" stroke-width="1" stroke="#acacac" fill="url(#pointerGradient)"></circle>
</g>`;
ripple?: { color?: string; radius?: number; rect?: { height: number; width: number; x: number; y: number } }

Ripple

OrgChart.templates.myTemplate.ripple = 
radius: 100,
color: "#e6e6e6",
rect: null
}

Type declaration

  • Optional color?: string
  • Optional radius?: number
  • Optional rect?: { height: number; width: number; x: number; y: number }
    • height: number
    • width: number
    • x: number
    • y: number
size?: number[]

Size of the template

OrgChart.templates.myTemplate.size = [200, 100];
svg?: string

Template main svg definition

OrgChart.templates.myTemplate.svg =
`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}
</svg>`;
treeListMaxHeight?: number

Sets the maximum height of the Tree List. When the content exceeds this height, vertical scrolling is enabled. If set to Number.MAX_SAFE_INTEGER no scrolling is enabled.

OrgChart.templates.myTemplate.treeListMaxHeight = 450;

Legend

  • Constructor
  • Property
  • Method
  • Static property
  • Static method
  • Property

Settings

Theme

Generated using TypeDoc