dabeng / react-orgchart Goto Github PK
View Code? Open in Web Editor NEWIt's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
License: MIT License
It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
License: MIT License
Hi @dabeng dabeng
Thanks for creating a wonderful module.
I would like to know if it is possible to config a certain level of expansion on start? If it is not available, please consider it as a feature suggestion.
Thanks,
Hi @dabeng
I want to achieve this kind of functionally. Can you please help me out. I'm new to react & unable to find any solution.
// parent class
const ParentClass = () => {
const showForm = (event) => {
console.log('showForm');
};
return(
<OrganizationChart
ref={orgchart}
datasource={ds
NodeTemplate={MyNode}
</>
);
}
// NodeTemplate class
const MyNode = () => {
MyNode.propTypes = propTypes;
export default MyNode;
Thanks in advance.
请问有对ts编写react的环境进行支持吗?ts环境下会报项目缺少类型检查,需要自己写描述文件
we have problems with ssh because we are behind a proxy.
Can you change the package so that dependencies are not downloaded via ssh?
Any answer for on demand data, click the node, get the data based on api result, update to the state?
Hi, is there a way to export the datasource upon adding/deleting/updating the chart?
I saw on the jQuery version that there is a method called getHierarchy(), which is what I am looking for. But there is no such method in this react version. Does anyone have any suggestion?
Thanks.
I wona change node width .oc-heding to 30px;
how to props that?
Is there a way to do direction like the way you have for other versions of this library ?
for example from here
// sample of core source code let orgchart = new OrgChart({ 'data' : datascource, 'nodeContent': 'title', 'direction': 'r2l' }); document.querySelector('#chart-container').appendChild(orgchart);
Hello.
Im using the ES6 version on a react project with succeess but the full react would be better.
Any code ready in this implementation or need help on it?
直接启动,在3000端口访问页面会显示异常
重新用create-react-app创建工程再把代码拷进去是可用的
估计现有的create-react-app版本不匹配
The className values in the datasource are not applied to the elements.
is there a filter feature for the react version ? the only way i found is to filter the data source but its just replacing org chart with another
Can i create custom action when i click expand node? If can, how i do that?
Thanks
我看到jquery版本的有一个 'collapsed': true,可以控制是否展示子节点,但是在react版本中,此配置不生效
Is there a way to have multiple siblings be the parent for children nodes?
i.e. Three founders having the rest of the company listed under them
Hi @dabeng
I'm getting this error -
SyntaxError: Failed to execute 'querySelector' on 'Document': '#562bebec-9002-4228-b3da-1a3a589323d1' is not a valid selector.
Can you please look into this. Thanks in advance.
I am trying to implement color-coded chart but className values in the datasource are not applied to the elements.
like provided example as follow https://dabeng.github.io/OrgChart/color-coded.html
Sorry to post this here, Xuebin Dong! Couldn't find an email to reach out to you.
Could you image to do a paid conversation of this widget for Mendix?
Mendix is a low code platform based on react/typescript.
And the datasource connection would be 'specific' to hook it into the drag and drop environment of Mendix. For an expert like you, it should be a matter of a couple of hours.
Let me know if you are interested - I really could use org charts for one of my Mendix projects.
[email protected]
My data is returned from the database.
How do I create the datasource with my data?
Is there any way to drag and drop the parent nodes without children nodes?
Collapsing nodes by default using collapsed: true & className: 'slide-up' as done in https://dabeng.github.io/OrgChart/default-collapsed.html, doesn't work in react version.
codeSandboxFork: https://codesandbox.io/s/react-orgchart-demo-forked-8k6dd?file=/src/default-chart/default-chart.js
Any workaround to get this working? Please help.
why it is warning?
Warning: Each child in a list should have a unique "key" prop.
in ChartNode (created by ChartNode)
in ChartNode (created by ForwardRef)
in ul (created by ForwardRef)
in div (created by ForwardRef)
in div (created by ForwardRef)
Check the render method of ChartNode
. See https://fb.me/react-warning-keys for more information.
Is it possible to have On click event (to click on node and then get the node information).
Thanks
in jquery version of this package, APIs are there to hide child or siblings of a node based on id value of node.Can we have same type apis in react version also?
When using the +/- buttons of edit-chart under New Nodes clicking minus removes two nodes instead of one. Please advise
Description
Error importing CSS files within node_modules and compatibility with Nextjs app.
Reproduce
//
import OrganizationChart from "@dabeng/react-orgchart"
import React from "react"
const DnDChart = () => {
const ds = {
id: "n1",
name: "Lao Lao",
title: "general manager",
children: [
{id: "n2", name: "Bo Miao", title: "department manager"},
{
id: "n3",
name: "Su Miao",
title: "department manager",
children: [
{id: "n4", name: "Tie Hua", title: "senior engineer"},
{
id: "n5",
name: "Hei Hei",
title: "senior engineer",
children: [
{id: "n6", name: "Dan Dan", title: "engineer"},
{id: "n7", name: "Xiang Xiang", title: "engineer"}
]
},
{id: "n8", name: "Pang Pang", title: "senior engineer"}
]
},
{id: "n9", name: "Hong Miao", title: "department manager"},
{
id: "n10",
name: "Chun Miao",
title: "department manager",
children: [{id: "n11", name: "Yue Yue", title: "senior engineer"}]
}
]
}
return <OrganizationChart datasource={ds} draggable={true} />
}
export default DnDChart
Cause
With Next.js importing CSS files within node_modules cannot be supported because we cannot know the correct behavior:
More details: https://nextjs.org/docs/messages/css-npm
Are you planning to implement l2r and r2l also in this version ?
If not, have you got some advice on how to performe this operation in react component ?
Thank you
This error happened at once in the browser console after the command npm run start
This error happened in the browser console at once after npm run start
This is less of an issue and more of a question. How can I change the size of the canvas in the browser? It takes 100% of the width but only 744 of the height. Can I get some direction on where these settings would be for the height?
Thanks
Hayy, thanks to created react version.
I have problem, how to set level or depth my org chart? I have 10 level, but i just want to show 3 level then i can expand manual.
Sorry for my bad english.
Thanks.
While dragging the graph very first sometimes I'm getting this error Uncaught TypeError: Cannot read property 'parentNode' of null
I'll be thankful for Any suggestions or help.
Hi @dabeng
In React Orgchart When I'm moving the graph haphazardly or doing hover on that somehow return parent node getting undefined or null. So I have added an if condition in ChartNode.js file after that the functionality is working smoothly.
I have found a solution but for that, I have to change in the node module's ChartNode.js file. So, if you can update your package & release a new version then it will be very helpful for me
Filename: node_modules@dabeng\react-orgchart\dist\ChartNode.js
in var addArrows = function.
line number 140 add the line if (!node) return false;
Thanks in advance
Hi @dabeng ,
Thanks for creating a wonderful library with multiple customization options.
I would like to request and suggest if you could add a feature for supporting hybrid layouts for more space saving Organization charts, it would be really helpful.
Thanks in advance
Hoping for your reply soon :-)
I installed React orgchart npm install @dabeng/react-orgchart vs 1.0.0;
verticalLevel or verticalDepth feature is not working.
but later I've tried npm i orgchart vs 3.1.1;
but i think there is no 3.1.1 react version...
now i must use jquery version ? or is there any other solution ?
Hi there,
I want to do a report path (like here) but can't find any attribute to tell to hide or collapse a node. Am I missing anything ?
Cheers
Hello, I have a very basic project based off the Pan and zoom example in the codesandbox.
https://codesandbox.io/s/react-orgchart-demo-o3nf6
The page won't even load, react catches the error before the page loads.
Uncaught ReferenceError: regeneratorRuntime is not defined
at react-dom.development.js:25012
at react-dom.development.js:25012
at renderWithHooks (react-dom.development.js:18331)
at updateForwardRef (react-dom.development.js:20338)
at beginWork (react-dom.development.js:22103)
at HTMLUnknownElement.callCallback (react-dom.development.js:3596)
at Object.invokeGuardedCallbackDev (radial-gradient.ts:22)
at invokeGuardedCallback (-prefix-radial-gradient.ts:70)
at beginWork$1 (react-dom.development.js:25012)
at performUnitOfWork (react-dom.development.js:25012)
react-dom.development.js:22984 The above error occurred in the <ForwardRef> component:
in ForwardRef
in Unknown
in Route
in Routes
in Router (created by BrowserRouter)
in BrowserRouter
in Unknown
Here is a minimal reproduced project:
https://github.com/zacharytyhacz/react-orgchart-bug
I'm trying to do a simple unit test with Jest + react-testing-library but I'm getting errors when trying to render your component.
To reproduce: Write any simple test case for initializing your component using Jest + react-testing-library
Do I need to set up any mocks in order to use this component in a jest environment?
I have added some images in org but it shows empty and some of the org cards disappear if it has large data
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.