Closed naveganth closed 9 months ago
Please read the doc pages. They are short and very useful. Please also give us a link to a Code example so the post can be easy readable.
- What do you mean by "camera is free"? Here you can see if the layout doc page can help: https://balkan.app/OrgChartJS/Docs/Layout
- You can have dynamic width, if this is what you mean: https://code.balkan.app/org-chart-js/dynamic-width#JS
- Predefine the field and don't add the ellipsis https://balkan.app/OrgChartJS/Docs/PredefinedTemplates - here are the filed definitions https://balkan.app/OrgChartJS/Docs/TextOverflow - here is how the ellipsis are added
- Not everything in the screenshot is possible, Again layout doc page is what you need: https://balkan.app/OrgChartJS/Docs/Layout
- Read and try min: true;: https://balkan.app/OrgChartJS/Docs/MinMax
- Need to predefine the links of the children template: https://balkan.app/OrgChartJS/Docs/Link#curve
Please read the doc pages. They are short and very useful. Please also give us a link to a Code example so the post can be easy readable.
Thanks for the help, but I couldn't get the dynamic width to work on a group minimized and maximized node.
- Predefine the field and don't add the ellipsis
Also I didn't understand how to make it show only the first two fields and not add elipsis.
The rest of the questions I managed to do what i wanted.
Again, thanks for the help, I'm still a newbie when it comes to this library. Code example, as requested.
Created a code demo for you: https://code.balkan.app/org-chart-js/issue-822#JS
Created a code demo for you: https://code.balkan.app/org-chart-js/issue-822#JS
Thanks for the response
A maximized node still doesn't have dynamic width, and how to only show the first two names of a person?
Also these are too big:
Problem:
How its supossed to be: (They should skip a line if its too big)
Also text outside the node
For my institution organogram idea, I want all the nodes be collapsed and the person seeing the website clicks on them to open and check for peoples information, ids and etc... So it must be dynamic because on the future i will add even more nodes and people as the organogram gets more complex>
Please check the code demo i did here.
The width of the maximized group node depends on the nodes in the group. If you'd like to have 2 lines for the name and dynamic width of the minimized node, you should split the name of two data fields before loading the chart. For example for node 7: data1: "SECRETARIA DE PLANEJAMENTO" data2: "GESTÃO ESTRATÉGICA E GOVERNANÇA (SEPLAN)"
You are very helpful, thanks again, but will that solve the text going outside of the maximized node? and will the width in both lines be dynamically aligned (in the middle) as:
For the maximized node you should use the text overflow functionality.
So I've been trying to get the the text inside the maximized node to be the same size as the text but couldn't.
- Expected Result (something like this):
I even tried changing the CSS with:
[data-n-id='0'] rect {
width: 600px;
}
For:
But for some reason the position is fixed and I didn't manage to make the width centered. Can you help me out? Code demo with example.
For the maximized node you should use the text overflow
functionality.
I tried that too but the text would just be behind the node and not centered too.
Also for some reason when loading into the page some group nodes text overflows a little, until you click them 2 times then it gets right.
- Text overflow:
- How it's supposed to be:
Nevermind managed to fix it:
Text-overflow:
OrgChart.templates.group.field_0 = '<text data-width="230" data-text-overflow="ellipsis" style="font-size: 18px;font-weight:bold;" fill="black" x="10" y="90" text-anchor="start">{val}</text>';
Text-overflow:
OrgChart.templates.group.field_0 = '<text data-width="230" data-text-overflow="ellipsis" style="font-size: 18px;font-weight:bold;" fill="black" x="10" y="90" text-anchor="start">{val}</text>';
Group.field_0 node is supposed to adequate accordingly to the size of the text, and not have ellipsis at the end of the text.
You are right. My mistake
It is by default with ellipsis:
`
OrgChart.templates.group.field_0 = '
Thanks for the help @ZornitsaPesheva I will be coming with new questions, again. 😁😁😁
My work so far
How to make it so the camera is free and doesn't center on nodes?
How to make the text increase the size of the node according to text?
How to make a field_0 show only the first two names of a person and not show elipsis?
How to make a complex layout like in the image bellow? (In the node SGP In the first image)
How to make all the "groups" minimized by default like this:
How to make the lines coming from "secretaria" round?
The code:
I appreciate any suggestions and corrections.