跳到主要内容

Line shape

用于显示和管理连接线的复杂控件

Line shape control

信息

Line shape 控件仅在 Diagram 编辑器的 default 模式下对 line 元素可用。

用法

{
type: "lineShape",

hidden?: boolean, // 默认为 false
disabled?: boolean, // 默认为 false

css?: string,
width?: string | number | "content", // 默认为 "content"
height?: string | number | "content", // 默认为 "content"
padding?: string | number, // 默认为 "0 16px"

label?: string,
labelAlignment?: "left" | "right" | "center", // 默认为 "left"
align?: "start" | "center" | "end" | "between" | "around" | "evenly", // 默认为 "between"
compact?: boolean, // 默认为 false

// 服务属性
$properties?: object
}

描述

基本属性

  • type - (必需)控件的类型,设置为 "lineShape"
  • hidden - (可选)定义控件是否隐藏,默认为 false
  • disabled - (可选)定义控件是启用(false)还是禁用(true),默认为 false
  • css - (可选)为控件添加样式类
  • width - (可选)控件的宽度,默认为 "content"
  • height - (可选)控件的高度,默认为 "content"
  • padding - (可选)设置控件组内内容的内边距,默认为 "0 16px"
  • label - (可选)指定控件的标签
  • labelAlignment - (可选)定义标签的位置,默认为 "left"
  • align - (可选)设置控件组内控件的对齐方式,默认为 "between"
  • compact - (可选)指定紧凑模式,移除缩进和边框,默认为 false

服务属性

  • $properties - (可选)允许您在复杂控件中覆盖基本控件的值。您可以配置基于基本控件的 Line shape 控件的以下元素:
    • connectType - (toggleGroup)设置连接线的类型

示例

const editor= new dhx.DiagramEditor("editor_container", {
type: "default",
view: {
editbar: {
properties: {
$line: [
{
type: "lineShape",
label: "Line connection type"
}
]
}
}
}
});