当前位置: 首页 > news >正文

wordpress安装包下载荥阳seo

wordpress安装包下载,荥阳seo,网页设计免费模板素材,做牛仔裤的视频网站antv/x6 自定义html节点 效果图定义一个连接桩公共方法注册图形节点创建html节点动态更新节点内容 效果图 定义一个连接桩公共方法 const ports {groups: {top: {position: top,attrs: {circle: {r: 4,magnet: true,stroke: #cf1322,strokeWidth: 1,fill: #fff,style: {visib…

antv/x6 自定义html节点

    • 效果图
    • 定义一个连接桩公共方法
    • 注册图形节点
    • 创建html节点
    • 动态更新节点内容

效果图

在这里插入图片描述

定义一个连接桩公共方法

const ports = {groups: {top: {position: 'top',attrs: {circle: {r: 4,magnet: true,stroke: '#cf1322',strokeWidth: 1,fill: '#fff',style: {visibility: 'visible',},},},},right: {position: 'right',attrs: {circle: {r: 4,magnet: true,stroke: '#389e0d',strokeWidth: 1,fill: '#fff',style: {visibility: 'visible',},},},},bottom: {position: 'bottom',attrs: {circle: {r: 4,magnet: true,stroke: '#389e0d',strokeWidth: 1,fill: '#fff',style: {visibility: 'visible',},},},},left: {position: 'left',attrs: {circle: {r: 4,magnet: true,stroke: '#cf1322',strokeWidth: 1,fill: '#fff',style: {visibility: 'visible',},},},},},items: [{group: 'top',},{group: 'right',},{group: 'bottom',},{group: 'left',},],
}

注册图形节点

Shape.HTML.register({shape: 'html',width: 70,height: 36,effect: ['data'],html(cell) {const { label, props } = cell.getData()const div = document.createElement('div')div.style.width = 70const titleDiv = document.createElement('div')titleDiv.style.width = '70px'titleDiv.style.height = '36px'titleDiv.style.background = '#eb2f96'titleDiv.style.color = 'white'titleDiv.style.fontSize = '14px'titleDiv.style.textAlign = 'center'titleDiv.style.lineHeight = '36px'titleDiv.style.boxSizing = 'border-box'titleDiv.style.fontSize = '12px'titleDiv.style.borderRadius = '6px'titleDiv.style.whiteSpace = 'nowrap'titleDiv.style.overflow = 'hidden'titleDiv.style.textOverflow = 'ellipsis'titleDiv.setAttribute('title', label)titleDiv.textContent = labeldiv.append(titleDiv)return div},ports: { ...ports,items: [{group: 'left'},{group: 'right'}]},})
  1. effect 是当前节点的 prop 数组,当 effect 包含的 prop 有变动时,会重新执行 html 方法,返回新的 dom,更新节点内容;
  2. ports 是此节点的连接桩;此节点只用到了左右两个连接桩;

创建html节点

const r2 = this.graph.createNode({shape: 'html',data: {props:{desc: ''},label: '自定义html',},
})
  1. shape 要和注册节点里的名称一致;

动态更新节点内容

let cell = this.graph.getCellById(id)
cell.prop('data/label', '文字')
cell.prop('data/props/voice', 'desc')
  • id 是要更改内容的cell的id;
http://www.dinnco.com/news/40647.html

相关文章:

  • 可以设计什么网站广西壮族自治区人民医院
  • 哪个网站做的游戏好玩四川网络推广推广机构
  • 上哪儿找做网站百度推广怎么做的
  • 做网站项目时 需求分析的内容百度快照官网
  • 做视频特效的网站如何发布自己的网站
  • 做平面找那些网站找活网络营销与直播电商专升本
  • 红十字会三合一网站建设方案河南做网站的
  • 企业网站建设背景网络营销的现状及问题
  • wordpress播放视频该插件不支持济南优化seo公司
  • 做网站开发学什么建立网站一般要多少钱
  • 防城港装修公司口碑排行关键词优化公司哪家推广
  • 整合营销传播案例做网站关键词优化的公司
  • 分类网站上怎么做锚文本媒体发布公司
  • 昌平网站建设浩森宇特陕西seo推广
  • 香港MB网站西安网站建设公司排名
  • 北京短视频制作公司长沙seo网站排名优化公司
  • 介绍自己做的网站网站优化排名查询
  • 任何做网站seo有哪些作用
  • 深圳住房建设厅网站首页广州seo顾问
  • 做网站可以提些什么意见seo赚钱方法大揭秘
  • .中国域名的网站搜索引擎营销分析
  • 网站建设方案设计竞价账户托管公司
  • 做电力项目信息的网站广州网站优化外包
  • 蚌埠网站开发外包东莞疫情最新通告
  • 大兴网站开发网站建设重庆seo标准
  • 没有域名可以做网站seo推广效果怎么样
  • 东莞网站建设-南城石佳网页制作步骤
  • 昆明医院网站建设前端seo搜索引擎优化
  • 做网站九州科技网站如何做seo排名
  • 天津网站建设网络公司重庆seo整站优化效果