Skip to content
导览

Interface: NodeState

节点的状态

Details

主要包括节点的颜色、透明度、是否展示。

Properties

color

Optional color: string

Details

设置节点颜色,支持 16 进制和 rgb 类型的颜色。

Examples

ts
const nodeState = {
  // color: "rgb(192, 192, 192)",
  color: "#ff0000",
  //... 其他属性
}
const nodeState = {
  // color: "rgb(192, 192, 192)",
  color: "#ff0000",
  //... 其他属性
}

opacity

Optional opacity: number

Details

设置节点透明值。

透明值范围是 0-255。0表示全透,255表示不透明。

Examples

ts
const nodeState = {
  // opacity: 255,
  opacity: 0,
  //... 其他属性
}
const nodeState = {
  // opacity: 255,
  opacity: 0,
  //... 其他属性
}

show

Optional show: boolean

Details

设置节点隐藏, 只能传递 false

false 表示隐藏节点。

Examples

ts
const nodeState = {
  show: false,
}
const nodeState = {
  show: false,
}