Code Monkey home page Code Monkey logo

vue-orgchart's Introduction

Hi there 👋

vue-orgchart's People

Contributors

lfy55 avatar spiritree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-orgchart's Issues

Passing in options - docs & examples?

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?

Missing html2canvas

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:

  • VueJs [2.5.13]
  • VueOrgchart [1.1.0]

Many thanks,

Neil

CSS Settings

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

[Feature] add option for 'allowTaint'

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.

Questions about buttons

I have some questions:

  1. How can I create my own button which exports the image? I would like to place this button in other place.
  2. How can I create a button which centralizes the tree (moving to the center of the tree)?

component as content

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

Failed to create node (IE11)

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:[]
      }]
}

How can i handle a specific node in a tree?

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>

Capture onClick event

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.

Custom CSS edges

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);
}

Add image to chart

Greetings,

how i display image in chart, may be like this. Thank You.
image

How to change options after chart is rendered?

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); });

Export error

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)

How to handle children of nodes that should be at different depths?

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.

Screen Shot 2019-05-30 at 5 39 49 PM

是否支持移动端

问下,项目要在平板电脑上使用此类组织结构拖拽功能,此插件是否可以支持移动端拖拽事件

Error style in component include two chart

<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!

How to have title below the node name

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:

See the tilte under the name

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.

direction和toggleSiblingsResp选项无效

作者你好,我在使用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>

Does not update after dispatch

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.

img1

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?

Uncaught TypeError: Cannot set property 'value' of null

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.