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

保定网站优化公司php初学者网站

保定网站优化公司,php初学者网站,做网站公司 陕西渭南,广西建筑工程网vue中图谱关系插件relation-graph 一、效果图二、安装下载#xff08;vue2.0版本的#xff09;三、直接上代码 一、效果图 二、安装下载#xff08;vue2.0版本的#xff09; npm install --save relation-graph var foo bar;三、直接上代码 templatediv cla… vue中图谱关系插件relation-graph 一、效果图二、安装下载vue2.0版本的三、直接上代码 一、效果图 二、安装下载vue2.0版本的 npm install --save relation-graph var foo bar;三、直接上代码 templatediv classgraphClass refmyPageRelationGraphrefseeksRelationGraph:optionsgraphOptions:on-node-clickonNodeClick:on-line-clickonLineClickdivclassnodestyleheight: 100%slotnodeslot-scope{ node }mouseovershowNodeTips(node, $event)mouseouthideNodeTips(node, $event)pstyleposition: absolute;top: 8px;left: 38px;min-width: 350px;font-size: 10px;color: #8c9094;text-align: left;{{ node.text }}/p/div/RelationGraph!-- 点击提示 --divv-showisShowNodeTipsPanel:style{left: nodeMenuPanelPosition.x px,top: nodeMenuPanelPosition.y px,}styleposition: absolute;padding: 5px 10px;width: 250px;background: rgba(230, 217, 202, 0.8);z-index: 999;div styleline-height: 15px; color: #888888; font-size: 10px{{ currentNode.text }};[{{ currentNode.id }}]/div/div/div /template script import RelationGraph from relation-graph; import { knowledgeGraphList } from ../../api; export default {components: { RelationGraph },props: {id: {type: [Number, String],default: ,},},data() {return {activeKey: ,isShowNodeTipsPanel: false,nodeMenuPanelPosition: { x: 0, y: 0 },currentNode: {},graphOptions: {allowShowMiniToolBar: false, //是否显示工具栏allowSwitchLineShape: true,allowSwitchJunctionPoint: true,defaultNodeShape: 0, //默认的节点形状0:圆形1:矩形// defaultExpandHolderPosition: bottom, //节点展开关闭的按钮位置defaultLineShape: 1, //默认的线条样式1:直线/2:样式2/3:样式3/4:折线/5:样式5/6:样式6defaultJunctionPoint: border, //默认的连线与节点接触的方式border:边缘/ltrb:上下左右/tb:上下/lr:左右当布局为树状布局时应使用tb或者lr这样才会好看// defaultNodeBorderWidth: 0, //节点边框粗细defaultcolor: #8c9094, //默认的线条颜色defaultNodeColor: #FACD91, //默认的节点背景颜色defaultNodeWidth: 30, //节点宽度defaultNodeHeight: 30, //节点高度defaultFocusRootNode: true, //默认为根节点添加一个被选中的样式moveToCenterWhenResize: true, //当图谱的大小发生变化时是否重新让图谱的内容看起来居中debug: true,layouts: [{label: 中心,layoutName: center, //布局方式tree树状布局/center中心布局/force自动布局// layoutClassName: seeks-layout-center, //当使用这个布局时会将此样式添加到图谱上defaultJunctionPoint: border, //默认的连线与节点接触的方式defaultNodeShape: 0, //默认的节点形状0:圆形1:矩形defaultLineShape: 1, //默认的线条样式1:直线/2:样式2/3:样式3/4:折线/5:样式5/6:样式6},],},};},mounted() {this.showSeeksGraph();},methods: {showNodeTips(nodeObject, $event) {this.currentNode nodeObject;const _base_position this.$refs.myPage.getBoundingClientRect();this.isShowNodeTipsPanel true;this.nodeMenuPanelPosition.x $event.clientX - _base_position.x 10;this.nodeMenuPanelPosition.y $event.clientY - _base_position.y 10;},hideNodeTips(nodeObject, $event) {this.isShowNodeTipsPanel false;},callback(val) {this.activeKey val;this.showSeeksGraph();},//渲染节点和连接线showSeeksGraph() {knowledgeGraphList({ id: this.id }).then(({ data }) {// 线let lines data.edges.map(item ({from: item.from.toString(),to: item.to.toString(),text: item.label,color: item.label 依据 ? #FACD91 : item.label 历史 ? #67C23A : #82D2F8,styleClass: my-line-highlightxxxxxxxxxxxxxxx,lineShape: 6,fromJunctionPoint: border,toJunctionPoint: bottom,}));// 节点let nodes [];data.nodes.forEach((item, index) {let color lines.filter(c c.to item.id).length 0? lines.filter(c c.to item.id)[0].color: #FACD91;if (index 0) {nodes.push({id: item.id.toString(),text: item.label,color: #3e7afa,});} else {nodes.push({id: item.id.toString(),text: item.label,color: color,});}});var __graph_json_data {rootId: a,nodes: nodes,lines: lines,};// 以上数据中的node和link可以参考Node节点和Link关系中的参数进行配置this.$refs.seeksRelationGraph.setJsonData(__graph_json_data, graphInstance {setTimeout(() {graphInstance.stopAutoLayout();}, 1000);});});},//点击节点触发的函数onNodeClick(nodeObject, $event) {const allLinks this.$refs.seeksRelationGraph.getLinks();allLinks.forEach(link {// 还原所有样式link.relations.forEach(line {if (line.data.orignColor) {line.color line.data.orignColor;}if (line.data.orignFontColor) {line.fontColor line.data.orignColor;}if (line.data.orignLineWidth) {line.lineWidth line.data.orignLineWidth;}});});// 让与{nodeObject}相关的所有连线高亮allLinks.filter(link link.fromNode nodeObject || link.toNode nodeObject).forEach(link {link.relations.forEach(line {line.data.orignColor line.color;line.data.orignFontColor line.fontColor || line.color;line.data.orignLineWidth line.lineWidth || 1;line.color #3e7afa;line.fontColor #3e7afa;line.lineWidth 1;});});// 有时候更改一些属性后并不能马上同步到视图这需要以下方法让视图强制根据数据同步到最新this.$refs.seeksRelationGraph.getInstance().dataUpdated();},//店家连接线触发的函数onLineClick(lineObject, $event) {console.log(onLineClick:, lineObject);},}, }; /script style langscss .graphClass {height: 700px;position: relative;border: 1px solid #f2f3f3;.rel-map-canvas {margin-left: calc(50% - 10px) !important;} } /style style langscss scoped ::v-deep .relation-graph {.my-line-highlightxxxxxxxxxxxxxxx {animation: my-line-easy-anm1 2s linear infinite;}.rg-line-anm-1 {animation: my-line-easy-anm1 2s linear infinite;}//取消点击线条后节点的闪烁效果rel-node-flashing {animation: none;} }keyframes my-line-easy-anm1 {0% {stroke-dashoffset: 100px;stroke-dasharray: 5, 5, 5;}100% {stroke-dasharray: 5, 5, 5;stroke-dashoffset: 3px;} } /style 链接: https://relation-graph.com/#/docs/start 链接: https://cloud.tencent.com/developer/article/2325304
http://www.zqtcl.cn/news/926485/

相关文章:

  • 用wordpress编写网站完整网站开发视频教程
  • 电商型网站建设价格ppt制作网站
  • 东莞做个网站查询工商营业执照
  • 从网址怎么看网站的域名租用云服务器多少钱
  • 网站开发技术有个人网页首页设计图片
  • 一站式网站建设平台做电商网站需要做什么准备
  • 网站开发小程序快站模板
  • 江苏集团网站建设智慧养老网站开发
  • 外网网址可以做英语阅读的网站怎么原创视频网站
  • 宁波网站建设流程图自己做网站可以揽业务吗
  • 赤峰市建设网站东胜做网站
  • 有口碑的坪山网站建设微信扫一扫登录网站如何做
  • 自己建网站要花多少钱蓟县网站建设
  • 兖州中材建设有限公司网站wordpress免签约接口
  • 湖北网站seo设计成都疾控最新通告
  • 商丘网站建设推广公司配资网站建设多少钱
  • 手机网站怎么做SEO优化gzip压缩 wordpress
  • 上下框架 网站app营销的核心是什么
  • 网站开发哪里有培训wordpress 主题 网址导航
  • 深圳市宝安区怎么样百度禁止seo推广
  • 手机电商网站 模板常熟做网站优化
  • 免费的logo设计网站网页设计与制作dw
  • 线上调研问卷在哪个网站上做网页设计学生作业
  • 云南高端网站建设网页设计工作室选址依据
  • 免费的编程自学网站互联网公司网站建设ppt
  • 免费发帖的网站网站空间服务器费用
  • 商城类的网站一般怎么做做ps从哪个网站上下载图片大小
  • 怎么做网站链接支付免费推广网站搭建
  • 威海 网站建设刚刚北京传来重大消息
  • 深圳返利网站开发做网站版权怎么写