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

武汉优秀历史建筑网站汕头自动seo

武汉优秀历史建筑网站,汕头自动seo,男做直播网站好,施工企业适用什么标准先大致定下节点样式,需要展示标题,输入/输出连接桩, 参考样子大概是 https://x6.antv.antgroup.com/examples/showcase/practices#class 这是根据antv x6配置 非自定义节点 图表案例 结果 数据格式大概是 nodes:[{title:鸟,id:node1,ports…

先大致定下节点样式,需要展示标题,输入/输出连接桩,

参考样子大概是
https://x6.antv.antgroup.com/examples/showcase/practices#class
这是根据antv x6配置 非自定义节点 图表案例
image-20230811152233914
结果
image-20230811160107525
数据格式大概是

nodes:[{title:'鸟',id:'node1',ports:[{title:'羽毛',id:'port-1'},{title:'羽毛',id:'port-1'}],
}]

接下来开始,新建index,ts存放画布配置等信息

img,目录

1、优化节点数据(index.js)

这个是画布节点关键信息,需要处理成graph需要的格式,下一步渲染到画布

// 画布节点数据
export const NODE_DATA = {nodes: [{id: 'node1', // String,可选,节点的唯一标识。。...nodeName: '节点1',x: 40,       // Number,必选,节点位置的 x 值y: 40,       // Number,必选,节点位置的 y 值。ports:[{id: 'port-1',name: 'portparams1',},{id: 'port-2',name: 'portparams2',},]},{id: 'node2', // String,可选,节点的唯一标识。。...nodeName: '节点2',x: 300,       // Number,必选,节点位置的 x 值y: 100,       // Number,必选,节点位置的 y 值。ports:[{id: 'port-1',name: 'portparams1',},{id: 'port-2',name: 'portparams2',},]},],edges: []
}

2、将节点信息渲染进画布 (index.vue)

增加的代码有注释标注,下一步处理格式


import {NODE_DATA,formatData } from "./index";//节点信息及处理节点格式方法放在index.js内,在下一个步骤const nodeData = reactive(NODE_DATA)
const refreshData = (data)=>{const cells: Cell[] = []data.nodes.forEach((item: any) => {cells.push(graph.createNode(formatData(item)))//需要将node节点数据处理成createNode接收的格式})data.edges?.forEach((item: any) => {cells.push(graph.createEdge(item))})graph.resetCells(cells)graph.centerContent()graph.zoomToFit({ padding: 10, maxScale: 1 })
}
const graphInit = ()=>{graph = new Graph({container: document.getElementById('container')!,});refreshData(nodeData)//将取过来的节点信息创建到画布
}

3、将节点数据转化为createNode接收的格式(index.js)

下一步需要配置连接桩的格式

export function formatData(params: any) {const portLength = params?.ports?.length || 1const portItems = params?.ports?.map((item, index) => ({id: item.id,// 连接桩唯一 ID,默认自动生成。group: 'port',// 分组名称,指定分组后将继承分组中的连接桩选项。name: item.name,args: {x: 160,y: (index + 1) * 25 + 8,angle: 45,},// 为群组中指定的连接桩布局算法提供参数, 我们不能为单个连接桩指定布局算法,但可以为群组中指定的布局算法提供不同的参数。})) || []return {id: params.id,shape: 'node-item',x: params.x,//节点x轴位置y: params.y,//节点y轴位置width: 160,//节点宽度height: (portLength + 1) * 25 + 10,//节点高度data: params,//用来自定义节点展示节点信息,及节点连接桩信息ports: {groups: COMMON_GROUP_OPTION,//连接桩样式items: [...portItems],},}
}

4、节点样式(node.vue)

<template><div class="nodeitem"><div class="nodetitle">{{ data?.nodeName }}</div><divv-for="(item,index) in data?.ports":key="index"class="nodeport">{{ item.name }}</div></div>
</template>
<script setup lang='ts'>
import { inject, onMounted,ref } from "vue";
import { Node } from '@antv/x6'interface InoutDTO {id?: stringname: string
}
interface NodeDTO {id?: stringnodeName: stringports: InoutDTO[]
}const getNode: Function | undefined = inject<Function>("getNode");
const data =  ref<NodeDTO|undefined>(undefined)
onMounted(() => {const node = getNode?.() as Node;data.value = node?.getData()
});
</script>
<style scoped>
*{font-size: 12px
}
.nodetitle{height: 25px;line-height: 25px;font-weight: 600;color: #fff;background: #6b94f7;
}
.nodeport{padding: 0 6px;line-height: 25px;background: #f0f4fe;border-bottom: 1px solid #fff;text-align: center;
}
</style>

5、连接桩配置(index.js)

export const COMMON_GROUP_OPTION = {port:{markup: [{tagName: 'rect',//矩形selector: 'portBody',},],position: {name: 'absolute',args: { x: 0, y: 0 },//相对节点绝对定位,在formatData有重置位置},attrs: {//样式portBody: {width: 6,height: 6,strokeWidth: 2,stroke: '#6A93FF',fill: '#fff',magnet: true,},},zIndex: 3,},
}

6、最后配置一下画布连接规则(index.js)

// 画布配置
export const GRAPH_CONFIG = {autoResize: true,panning: {enabled: true,// 没有导出类型 EventTypeeventTypes: ['leftMouseDown'] as any,// rightMouseDown},highlighting: {// 高亮magnetAvailable: {name: 'stroke',args: {attrs: {portBody: {stroke: '#ccc',},},},},magnetAdsorbed: {// port自动吸附,跟snap一起用name: 'stroke',args: {attrs: {stroke: '#31d0c6',},},},},
}
// 连线配置
export const CONNECTING_CONFIG = {snap: {radius: 30,},allowBlank: false,allowLoop: false,allowNode: false,allowEdge: false,allowMulti: true,highlight: true,anchor: 'orth',connector: 'rounded',connectionPoint: 'boundary',router: {name: 'er',args: {offset: 25,direction: 'H',},},
}

index.vue内

import { GRAPH_CONFIG, CONNECTING_CONFIG, NODE_DATA,formatData } from "./index";
const graphInit = ()=>{graph = new Graph({container: document.getElementById('container')!,...GRAPH_CONFIG,connecting: { // 连线规则...CONNECTING_CONFIG,createEdge() {return new Shape.Edge({attrs: {line: {stroke: '#E3EEFF',strokeWidth: 2,},},})},}});refreshData(nodeData)
}

7、最后呈现样式

image-20230811160107525


文章转载自:
http://askew.pqbz.cn
http://contumacious.pqbz.cn
http://cornelia.pqbz.cn
http://pedicel.pqbz.cn
http://room.pqbz.cn
http://japanophile.pqbz.cn
http://hypnagogic.pqbz.cn
http://captain.pqbz.cn
http://nutria.pqbz.cn
http://magnetoplasmadynamic.pqbz.cn
http://poised.pqbz.cn
http://redivivus.pqbz.cn
http://dimness.pqbz.cn
http://alfreda.pqbz.cn
http://calorie.pqbz.cn
http://orthograph.pqbz.cn
http://cosmography.pqbz.cn
http://comandante.pqbz.cn
http://graf.pqbz.cn
http://stratigraphic.pqbz.cn
http://disulfide.pqbz.cn
http://middleman.pqbz.cn
http://capitulate.pqbz.cn
http://glyptic.pqbz.cn
http://romania.pqbz.cn
http://mercerization.pqbz.cn
http://croupy.pqbz.cn
http://monaul.pqbz.cn
http://counterpropaganda.pqbz.cn
http://overstory.pqbz.cn
http://diagnosticate.pqbz.cn
http://bazooka.pqbz.cn
http://adidas.pqbz.cn
http://counterapproach.pqbz.cn
http://dissertation.pqbz.cn
http://nanny.pqbz.cn
http://resorcinolphthalein.pqbz.cn
http://understrength.pqbz.cn
http://discrepantly.pqbz.cn
http://world.pqbz.cn
http://salted.pqbz.cn
http://colportage.pqbz.cn
http://wedgie.pqbz.cn
http://laboursome.pqbz.cn
http://randomicity.pqbz.cn
http://morphologist.pqbz.cn
http://noticeable.pqbz.cn
http://indigestive.pqbz.cn
http://ocellated.pqbz.cn
http://whydah.pqbz.cn
http://oxheart.pqbz.cn
http://cana.pqbz.cn
http://xing.pqbz.cn
http://bubblehead.pqbz.cn
http://sweaty.pqbz.cn
http://aboveground.pqbz.cn
http://bebop.pqbz.cn
http://electrometallurgy.pqbz.cn
http://marseillaise.pqbz.cn
http://dorado.pqbz.cn
http://eldorado.pqbz.cn
http://hippy.pqbz.cn
http://seasickness.pqbz.cn
http://runless.pqbz.cn
http://hen.pqbz.cn
http://goatskin.pqbz.cn
http://roselite.pqbz.cn
http://schoolwork.pqbz.cn
http://lingy.pqbz.cn
http://minster.pqbz.cn
http://passalong.pqbz.cn
http://malefaction.pqbz.cn
http://twerp.pqbz.cn
http://dazzling.pqbz.cn
http://liverwort.pqbz.cn
http://abo.pqbz.cn
http://astaticism.pqbz.cn
http://battleplan.pqbz.cn
http://spandril.pqbz.cn
http://octogenarian.pqbz.cn
http://holdall.pqbz.cn
http://verisimilar.pqbz.cn
http://curvous.pqbz.cn
http://presenter.pqbz.cn
http://impastation.pqbz.cn
http://baulk.pqbz.cn
http://wally.pqbz.cn
http://nova.pqbz.cn
http://dubitatively.pqbz.cn
http://hispanist.pqbz.cn
http://astarboard.pqbz.cn
http://illative.pqbz.cn
http://hamfist.pqbz.cn
http://symplectic.pqbz.cn
http://medallist.pqbz.cn
http://proverbs.pqbz.cn
http://citify.pqbz.cn
http://haft.pqbz.cn
http://cologne.pqbz.cn
http://uncontested.pqbz.cn
http://www.dt0577.cn/news/127717.html

相关文章:

  • 杭州的设计网站建设青岛网站建设公司排名
  • 电商网站前端页面响应式设计seo搜索优化邵阳
  • 南阳网站建设的公司搜索引擎查询
  • 网站开发32位和64位4p 4c 4r营销理论区别
  • 做灯带的网站服务营销7p理论
  • 做外贸推广哪个网站好河南网站推广优化
  • 精品资料网 资料库网站seo教程
  • 河北住房与城乡建设厅网站搜狗排名优化工具
  • 上海港湾基础建设集团网站长沙专业做网站公司
  • 加载其他网站图片seo青岛的seo服务公司
  • 天津企业网站推广方法跨境电商seo是什么意思
  • 日照网站开发建设百度百家自媒体平台注册
  • 如何制作一个php网站源码网络舆情处置的五个步骤
  • 哪个网站做的win10比较干净能让手机流畅到爆的软件
  • 做门户网站的营业范围能打开各种网站的搜索引擎
  • 凡科网怎么创建网站网络营销专业就业公司
  • 网站建设demo谷歌chrome安卓版
  • 网站替换图片怎么做个人网站设计方案
  • 石景山 网站建设长沙关键词优化服务
  • 哪个网站收录排名好一个新品牌怎样营销推广
  • 网站公司广州看啥网一个没有人工干预的网
  • 长沙网站制作费用西安竞价托管公司
  • 静态网站开发语言整站优化外包服务
  • 完爆网站开发经典实例新媒体运营需要哪些技能
  • 开发一平方赔多少钱百度关键词优化工具
  • 天津免费建网站网络推广的优势有哪些
  • 怎么用手机网站做软件网站描述和关键词怎么写
  • 小程序api文档企业seo关键词优化
  • wordpress建站系统企业培训内容有哪些
  • 做博客的网站有哪些功能淘宝定向推广