基于vue的组织架构树组件

Vue.D3.tree (Vue.D3.tree)

Update documentationVue components to display graphics based on D3.js layout.

更新documentationVue组件以显示基于D3.js布局的图形。

树 (Tree)

用法 (Usage)

<tree :data="tree" :node-text="name" layoutType="circular">
</tree>
import {tree} from 'vued3tree'export default {components: {tree},data() {return {tree: {name: "father",children:[{name: "son1",children:[ {name: "grandson"}, {name: "grandson2"}]},{name: "son2",children:[ {name: "grandson3"}, {name: "grandson4"}]}]}}}
}//...

物产 (Properties)

Name Required Type/Value Default Description
data no Object null Data representing tree structure, children nodes are represented by children property
duration no Number 750 Animation duration in milliseconds
layoutType no 'circular' or 'euclidean' 'euclidean' Circular or euclidean layout
marginX no Number 20 margin for X axis in pixel
marginY no Number 20 margin for Y axis in pixel
nodeText yes String null name of the property of the node to be used as a display name
type no 'tree' or 'cluster' 'tree' kind of layout: tree or cluster
radius no Number 3 node circle radius in pixel
zoomable no Boolean true If true tree can be zoomed in using mouse wheel and drag-and-drop
名称 需要 类型/值 默认 描述
数据 没有 Object 空值 表示树结构的数据,子节点由children属性表示
持续时间 没有 Number 750 动画持续时间(以毫秒为单位)
layoutType 没有 “圆形”或“欧几里得” '欧几里得' 圆形或欧式布局
marginX 没有 Number 20 X轴的边距(以像素为单位)
边际 没有 Number 20 Y轴的边距(以像素为单位)
nodeText String 空值 用作显示名称的节点的属性名称
类型 没有 “树”或“集群” '树' 布局类型: 树或群集
半径 没有 Number 3 节点圆半径(以像素为单位)
可缩放 没有 Boolean 真正 如果可以使用鼠标滚轮和拖放操作放大真实的树

大事记 (Events)

  • clicked

    clicked

Sent when the node name is clicked

单击节点名称时发送

  • expand

    expand

Sent when the node is clicked and the node children are expanded

单击节点并展开子节点时发送

  • retract

    retract

Sent when the node is clicked and the node children are retracted

单击节点并且收回节点子节点时发送

For all these events, the argument passed is {element, data} where element represents the node build by D3.js and data is the node raw data.

对于所有这些事件,传递的参数为{element, data} ,其中element表示由D3.js构建的节点,而data是节点原始数据。

  • zoom

    zoom

Sent when the tree is zoomed. Argument: {transform} where transform is d3.zoom transform object

缩放树时发送。 参数: {transform}其中transform是d3.zoom变换对象

方法 (methods)

Name Argument return Description
expand D3.js node a promise which resolve when animation is over Expand the given node.
expandAll D3.js node a promise which resolve when animation is over Expand the given node and all its children.
collapse D3.js node a promise which resolve when animation is over Collapse the given node.
collapseAll D3.js node a promise which resolve when animation is over Collapse the given node and all its children.
resetZoom - a promise which resolve when animation is over Set zoom matrix to identity
show D3.js node a promise which resolve when animation is over Expand nodes if needed in order to show the given node.
showOnly D3.js node a promise which resolve when animation is over Retract all node that are not in the path of the given node.
名称 论据 返回 描述
扩大 D3.js node 当动画结束时解决的诺言 展开给定的节点。
展开全部 D3.js node 当动画结束时解决的诺言 展开给定的节点及其所有子节点。
坍方 D3.js node 当动画结束时解决的诺言 折叠给定的节点。
全部收缩 D3.js node 当动画结束时解决的诺言 折叠给定的节点及其所有子节点。
resetZoom -- 当动画结束时解决的诺言 将缩放矩阵设置为恒等
表演 D3.js node 当动画结束时解决的诺言 如果需要,请展开节点以显示给定的节点。
只显示 D3.js node 当动画结束时解决的诺言 撤回不在给定节点路径中的所有节点。

分层边缘捆绑 (Hierarchical Edge Bundling)

用法 (Usage)

<hierarchical-edge-bundling identifier="id" :data="tree" :links="links" node-text="name"/>
import {hierarchicalEdgeBundling} from 'vued3tree'export default {components: {hierarchicalEdgeBundling},data() {return {tree: {name: "father",children:[{name: "son1",children:[ {name: "grandson", id: 1}, {name: "grandson2", id: 2}]},{name: "son2",children:[ {name: "grandson3", id: 3}, {name: "grandson4", id: 4}]}]},links: [{source: 3, target: 1, type: 1},{source: 3, target: 4, type: 2}],linkTypes: [{id: 1, name: 'depends', symmetric: true},{id: 2, name: 'implement', inName: 'implements', outName: 'is implemented by'},{id: 3, name: 'uses', inName: 'uses', outName: 'is used by'},]}}
}//...

物产 (Properties)

Name Required Type/Value Default Description
data no Object null Data representing tree structure, children nodes are represented by children property
links no Array null Data representing links between the nodes, having source and target properties referencing node identifiers
identifier yes String or Function - name of the property of the node to be used as a identifier or function taking a node and returning its identifier
nodeText yes String - name of the property of the node to be used as a display name
duration no Number 750 Animation duration in milliseconds
marginX no Number 20 margin for X axis in pixel
marginY no Number 20 margin for Y axis in pixel
maxTextWidth no Number -1 Max node text width (in pixel) to be displayed, if -1 text is not truncated.
nodeClass no String 'graph' class to be applied to the root div. Useful when custom CSS rules have to be applied.
名称 需要 类型/值 默认 描述
数据 没有 Object 空值 表示树结构的数据,子节点由children属性表示
链接 没有 Array 空值 表示节点之间链接的数据,具有引用节点标识符的source属性和target属性
识别码 StringFunction -- 要用作标识符或接受节点并返回其标识符的函数的节点属性的名称
nodeText String -- 用作显示名称的节点的属性名称
持续时间 没有 Number 750 动画持续时间(以毫秒为单位)
marginX 没有 Number 20 X轴的边距(以像素为单位)
边际 没有 Number 20 Y轴的边距(以像素为单位)
maxTextWidth 没有 Number -1 如果未截断-1文本,则要显示的最大节点文本宽度(以像素为单位)。
nodeClass 没有 String '图形' 应用于根div的类。 当必须应用自定义CSS规则时很有用。

大事记 (Events)

  • mouseNodeOver

    mouseNodeOver

Sent when the node name is hovered by mouse

鼠标悬停节点名称时发送

  • mouseNodeOut

    mouseNodeOut

Sent when mouse leaves the node name

鼠标离开节点名称时发送

For these events, the argument passed is {element, data} where element represents the node build by D3.js and data is the node raw data.

对于这些事件,传递的参数为{element, data} ,其中element表示由D3.js构建的节点,而data是节点原始数据。

  • clickOutsideGraph

    clickOutsideGraph

Sent when mouse is clicked outside any geometry or text of the hierarchical edge bundling

在层次边缘绑定的任何几何图形或文本之外单击鼠标时发送

  • nodesComputed

    nodesComputed

Sent when D3.js nodes are computed using data props. Called with D3.js hierarchy node

使用data道具计算D3.js节点时发送。 用D3.js层次结构节点调用

  • highlightedNodeChanged

    highlightedNodeChanged

Sent when highlighted node has changed.

当突出显示的节点已更改时发送。

数据 (data)

  • highlightedNode

    highlightedNode

Highlighted node: when set to a node data, the corresponding node and its related links will be highlighted. If null standard display is showing.

高亮显示的节点:当设置为节点数据时,相应的节点及其相关链接将被高亮显示。 如果为空,则显示标准显示。

安装 (Installation)

  • Available through:

    可通过以下方式获得:

npm install vued3tree

构建设置 (Build Setup)

# install dependencies
npm install# serve with hot reload at localhost:8080
npm run dev# build for production with minification
npm run build

翻译自: https://vuejsexamples.com/vue-component-to-display-tree-based-on-d3-js-layout/

基于vue的组织架构树组件

基于vue的组织架构树组件_Vue组件基于D3.js布局显示树相关推荐

  1. 移动端vue实现部门结构功能_基于Vue制作组织架构树组件

    编程之家收集整理的这篇文章主要介绍了基于Vue制作组织架构树组件,编程之家小编觉得挺不错的,现在分享给大家,也给大家做个参考. 由于公司业务需求,需要开发一个展示组织架构的树组件(公司的项目是基于Vu ...

  2. 移动端vue实现部门结构功能_基于Vue的组织架构树组件

    由于公司业务需求,需要开发一个展示组织架构的树组件(公司的项目是基于Vue).在GitHub上找了半天,这类组件不多,也没有符合业务需求的组件,所以决定自己造轮子! 分析 既然是树,那么每个节点都应该 ...

  3. bootstrap树节点如何设置默认不展开_我开源了一个基于Vue的组织架构树组件

    开门见山 Demo 演示地址:http://www.longstudy.club/vue... github 地址:https://github.com/qq44924588... 项目背景 因为最近 ...

  4. 好用的基于vue的组织架构图组件

    都是基于vue的组织架构图,有支持vue2.x和vue3.x,可自行选择使用 一.vue-okr-tree(支持vue2) 文档地址:vue2-okr-tree 这个文档里面只有使用方法,不像vue3 ...

  5. 一个基于vue和element-ui的树形穿梭框组件

    el-tree-transfer 简介 因为公司业务使用vue框架,ui库使用的element-ui.在市面上找到一个好用的vue树形穿梭框组件都很难,又不想仅仅因为一个穿梭框在element-ui之 ...

  6. ztree 标准得json数据格式_Django+zTree构建组织架构树

    树,因其清晰明了的展现形式而被广泛的使用 日常的开发过程中我们需要经常与"树"打交道,例如公司的组织架构树.服务器的项目归属树,管理后台侧边树等等,本篇文章介绍关于树的两个内容 多 ...

  7. vue——实现组织架构图(vue-org-tree)——技能提升

    关于组织架构图,效果图如下: 之前我是用jq写过一个组织架构图,文章链接如下:当时是用的jOrgChart jq版本的组织架构图:https://blog.csdn.net/yehaocheng520 ...

  8. 基于vue和elementUI封装框选表格组件

    前言:主要是 table 表格框选功能 实现功能如下: 表格框选功能 右键操作功能(删除.查看.编辑) 分页功能 表头分类筛选功能 回显功能(显示默认选中数据) 排序功能 行禁用不可选功能 不说废话, ...

  9. vue可视化拖拽组件模板_基于 Vue 丝滑般拖拽排序组件VueSlicksort

    今天给大家分享一个功能超强的自由拖拽排序组件VueSlicksort. vue-slicksort 一款功能强大的可拖拽的vue.js组件.拥有丝滑般拖拽动画效果,支持水平/垂直/网格拖拽排序.还可以 ...

最新文章

  1. 不就是发个短信吗?这你都会?
  2. Linux下记录所有用户操作的脚本
  3. Intel 64/x86_64/IA-32/x86处理器 - 通用指令(3) - 逻辑指令/移位指令
  4. XDebug的配置和使用(审计方法)
  5. 嵌入式Linux开发板移植SSH
  6. IDEA 后退/前进 快捷键
  7. protal认证的稳定性测试脚本
  8. iOS打包错误The operation couldn’t be completed. (AppThinning.StubError error 1.)
  9. Learn OpenGL 笔记7.1 PBR Theory(physically based rendering基于物理的渲染 理论)
  10. 供参考的the-gan-zoo,列出的GAN相关模型和论文
  11. eclipse配置环境变量 win10
  12. 《写给大家看的设计书》《写给大家看的色彩书》《点石成金》《形式感》学习笔记
  13. 电磁兼容性(EMC)测试方法与整改指南
  14. scrapy学习之爬取顶点小说数据(转)
  15. IntelliJ IDEA 2018.3.2的颜色代码JRA
  16. git repack多包使用及相关性能测试
  17. 最棒的Visual Studio扩展
  18. react-native自定义头部
  19. 一款好用的小游戏制作软件:construct2
  20. STM32F1xx_DFP.2.3.0获取

热门文章

  1. 未来教育计算机二级wps office,2019年全国计算机一级WPS Office应用考试大纲
  2. FATE —— 二.3.1 Hetero-NN自定义数据集
  3. matlab自动写word报告,matlab自动写入word
  4. python数据分析-pandas学习
  5. 腾讯推页游平台’”页游乐园”YY.QQ.com
  6. 一语中的丨高对抗重实战攻防视角下,企业安全运营到底该怎么做?
  7. 我的世界java版红石电梯_《我的世界》红石电梯建造教程
  8. 实现1V1音视频实时互动直播系统 十二、第三节 直播系统中的信令及其逻辑关系
  9. Flash中传统补间,补间动画,补间形状的区别
  10. 详细设计说明书(GB8567——88)