spiritree / vue-orgchart Goto Github PK
View Code? Open in Web Editor NEW:herb: Vue.js wrapper for OrgChart.js
Home Page: https://spiritree.github.io/vue-orgchart
License: MIT License
:herb: Vue.js wrapper for OrgChart.js
Home Page: https://spiritree.github.io/vue-orgchart
License: MIT License
It would be good to show in the docs how to pass in options, such as for the Ajax support or being able to set toggleSiblingsResp
property. Taking or two of the examples in the orgchart and showing an equivalent with your library could also be useful?
Hi there,
I'm using your component (which is working great, thanks) but can't get the export feature to work. Whenever I click the 'Export' button it throws the following error in the console:
Uncaught TypeError: window.html2canvas is not a function at e.value (vue-orgchart.min.js?f5c3:1)
I'm using:
Many thanks,
Neil
nodeTitle
option is not working as expected.
Please help with setting the css selector. I'm unable to set line sizes, node colors and convert solid to dashed connection lines.
Thank you
Hi there,
Are you planning on allowing for allowTaint
(Whether to allow cross-origin images to taint the canvas) to be set on the component? This will be helpful for people who may need to display profile photos (potentially served from another server) in their org charts.
Many thanks.
How to zoom from the event listener button?
I have some questions:
Greetings,
Can you use a component as the content of a node?
The component seems to render just fine, but vue won't react to it.
Thanks
Property direction
is not taking effect. Silently vue-orgchart sets default to t2b
... It seems that the only direction that works is the default one.
<vo-basic :data="chartData"
:direction="b2t"
:draggable=true>
</vo-basic>
Check here: https://jsfiddle.net/udnbt9fg/
Add child nodes multiple times
你好,我想问下,如何将节点换成图片,且每个节点有对应添加事件按钮
When rendering the org chart, the top level parent node or root node is not being created in IE11. It is responding with an error "failed to creat node." All other nodes below the top one are rendered correctly. Is there any way to fix this on IE11?
Example chart data:
chartData = {
id: '269',
name:
Role 1,
parentId: null,
children: [
{
id: '270',
name: Role 2,
parentId: 269,
children:[]
}, {
id: '271',
name: Role 3,
parentId: 269,
children:[]
}]
}
I would like to implement the following feature - everytime user clicks the node, it will pop a window with the details of the specific node.
I would like to implement something like this:
<vo-basic @click="showDetails(node)" :data="Tree" :pan="true" :zoom="true"></vo-basic>
I'm trying to capture v-on:click or onclick event on a node to execute a method, someone knows how to do this? (if it's possible, without JQuery)
I'm loading the orgchart nodes from an Ajax call, so they are not loaded on the initial DOM, and it's being a little difficult to control that event on my Vue (also I'm kindda new on Vue)
Thank you in advance.
I have added some style to draw edges instead of using font-awesome icons. Here an example and this is the style:
.edge {
border: solid black;
border-width: 0 3px 3px 0;
display: inline-block;
padding: 3px;
visibility: hidden;
}
.edge.verticalEdge, .edge.horizontalEdge {
height: auto !important;
width: auto !important;
}
.edge.verticalEdge{
left: 46% !important;
}
.edge.horizontalEdge{
top: 46% !important;
}
.edge.fa-chevron-right {
visibility: visible;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.edge.fa-chevron-left {
visibility: visible;
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}
.edge.fa-chevron-up {
visibility: visible;
transform: rotate(-135deg);
-webkit-transform: rotate(-135deg);
}
.edge.fa-chevron-down {
visibility: visible;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
这个有什么办法修改吗?
I want to check selected node is a Root. ? because I doesn't want to delete a Root
Thank you
We shouldn't assume we have buttons for VoEdit, to allow for the editor to be used when we don't want to have some of the buttons
When the root node of a chart is dragged, I get this error:
Uncaught TypeError: Cannot read property 'parentNode' of null at e.value (vue-orgchart.min.js?f5c3:formatted:1298)
Is there currently a way to get this error to not occur or can a fix be added to catch it?
Example: https://spiritree.github.io/vue-orgchart/#/edit
Using this link drag the Javascript node.
When you don't set node-content
, styling with direction="b2t"
gets broken:
https://jsfiddle.net/pwv2uyao/1/
Hi,
I am trying to create a chart with zoom and pan which is initially set to false.
<vo-edit :data="chartData" :pan="isPanAllowed" :zoom="isZoomAllowed"></vo-edit>
data() { return { isPanAllowed: false, isZoomAllowed: false }; },
I have a checkbox that toggles these values:
<input type="checkbox" v-model="isPanAllowed"> <input type="checkbox" v-model="isZoomAllowed">
But this is not updating chart options.
I even tried something like
watch: { isZoomAllowed: { handler(isZoomAllowed) { this.orgchart.setOptions('zoom', isZoomAllowed); } } }
But I get error TypeError: this.orgchart.setOptions is not a function
Is there any way to do something like this in vue (https://codepen.io/dabeng/pen/KMKaRY)
$('#toggleZoom').on('click', function() { oc.setOptions('zoom', this.checked); });
how add a new node when I click parent node?
should I add code :@click='addnode' in parent node ?
I tried building the project, but the build
definition references webpack.config.build.js
, while the build folder only contains webpack.config.js
.
Hello.
When I try to export the chart, I am getting this error.
vue-orgchart.min.js?f5c3:1 Uncaught TypeError: window.html2canvas is not a function
at e.value (vue-orgchart.min.js?f5c3:1)
Hi I would like to have parent child relationships where the parent can have children that are on different levels. As you can see in my screen shot below, I have a node with the name "undefined", but I would like to hide the node and instead have the three children be shown when the siblings of undefined are shown. Is this possible to do? If so, can you please provide some guidance. Thanks!
I have tried just using CSS to hide the node, but then when the org chart first loads with only a particular depth showing these "children" of "undefined" are not accessible.
问下,项目要在平板电脑上使用此类组织结构拖拽功能,此插件是否可以支持移动端拖拽事件
<div class="row">
<div class="col-lg-6">
<vo-basic :data="chart1" ></vo-basic>
</div>
<div class="col-lg-6">
<vo-basic :data="chart2" ></vo-basic>
</div>
</div>
My code isn't display in two column, it display in one column(I think it same chart-container ID).
Can you support me?
Tks!
Base on the document, it seems that no possible to display the title of the node name in the same way as in OrgChart.js:
Can we have this feature or I missed something for the properties?
I did try:
<vo-basic :data="chartData" :nodeContent="title"></vo-basic>
var Main = {
created() {
this.chartData = {
name: 'JavaScript',
title:'Mr. A',
children: [
{ name: 'Angular', title:'Mr. B' },
{
name: 'React', title:'Manager',
children: [{ name: 'Preact', title:'Mr. C' }]
},
{
name: 'Vue', title:'Manager',
children: [{ name: 'Moon', title:'Mr. D' }]
}
]
}
}
}
Thanks to advice.
作者你好,我在使用vue-orgchart的时候,给组件设置direction和toggleSiblingsResp均无效。
设置 direction时,赋值为l2r则显示空白,不设置direction或者设置为b2t或者t2b是有效的。
代码如下
<vo-edit v-if="list" v-loading.body="listLoading" direction="b2t" element-loading-text="Loading" :data="list" pan zoom toggleSiblingsResp export-filename="绩效考核组结构" exportButton draggable></vo-edit>
目前按钮文本为export,建议开放文本自定义
Hi, first I want to congratulate you on the package.
I am a beginner in Vuejs and I am not able to display information that is in the "treeArea" variable, which is brought after the dispatch.
AreasTree.vue
<template>
<div>
<vo-edit :data="treeArea"></vo-edit>
</div>
</template>
<script>
import { VoEdit } from 'vue-orgchart'
export default {
data () {
return {
treeArea: {
name: '',
children: []
}
}
},
created () {
this.$store.dispatch('getAreas', this.$route.params.id)
},
computed: {
areaList () {
return this.$store.state.area.areaList
}
},
watch: {
areaList (response) {
this.treeArea = response
}
},
components: {
VoEdit
}
}
</script>
Can you help me?
I get this error when I click on an element.
Uncaught TypeError: Cannot set property 'value' of null
at ft (vue-orgchart.min.js?f5c3:1)
at HTMLDivElement.eval (vue-orgchart.min.js?f5c3:1)
Seems the problem is that
document.getElementById("selected-node");
Always returns null
Hello,
How can I add a hyperlink to this demo? https://codepen.io/dabeng/pen/QppGZR
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.