<template><div ref="miniView" class="c-mini-graph"><div :style="{width:(100 * zoom) + 'px',height:(graphSetting.canvasNVInfo.height * 100/graphSetting.canvasNVInfo.width * zoom)+'px'}" class="c-mini-canvas"><template v-for="thisNode in $parent.nodeViewList"><div v-if="isAllowShowNode(thisNode)" :key="thisNode.id" :style="{'margin-left':(thisNode.x * 100/graphSetting.canvasSize.width * zoom)+'px','margin-top':(thisNode.y * 100/graphSetting.canvasSize.width * zoom)+'px'}" class="c-mini-node" /></template></div><div :style="getPositionData()" class="c-mini-view"><i class="el-icon-view" /></div></div></template><script>import SeeksGraphMath from './core4vue/SeeksGraphMath'export default {name: 'GraphMiniView',props: {graphSetting: {mustUseProp: true,default: () => { return {} },type: Object}},data() {return {zoom: 1}},mounted() {},methods: {getPositionData() {var _c_width = 100var _r = _c_width / this.graphSetting.canvasNVInfo.widthvar _width = this.graphSetting.viewNVInfo.width * _rvar _height = this.graphSetting.viewNVInfo.height * _rvar _view_x = (this.graphSetting.viewNVInfo.x - this.graphSetting.canvasNVInfo.x) * _rvar _view_y = (this.graphSetting.viewNVInfo.y - this.graphSetting.canvasNVInfo.y) * _rif (_width > 100) {_height = _height * 100 / _width_view_x = _view_x * 100 / _width_view_y = _view_y * 100 / _widththis.zoom = 100 / _width_width = 100} else {this.zoom = 1}// console.log('Mini View style:', _view_center_x, _canvas_center_x)var style = {width: _width + 'px',height: _height + 'px','margin-left': _view_x + 'px','margin-top': _view_y + 'px'}return style},isAllowShowNode(nodeData) {return SeeksGraphMath.isAllowShowNode(nodeData)}}}</script><style scoped>.c-mini-graph{height:100px;width:100px;position: absolute;margin-left: 60px;margin-top:100px;z-index: 999;}.c-fixedLayout{position: fixed;top:100px;}.c-mini-canvas{background-color: #AACBFF;border: #7BA8FF solid 1px;opacity: 0.8;position: absolute;}.c-mini-view{background-color: #F5A565;border: #C03639 solid 1px;opacity: 0.5;color: #ffffff;font-size: 14px;text-align: center;display: flex;align-items: center;justify-content: center;position: absolute;}.c-mini-node{position: absolute;width:2px;height:2px;background-color: #000000;border-radius: 1px;}</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。