Comments (3)
Hi, it relies on an svg marker functionality to draw arrows and texts
If there is a bug, it can be fixed by overriding current defs
generation function
chart.defs(function (state, visibleConnections) {
return `<defs>
${visibleConnections.map(conn => {
const labelWidth = this.getTextWidth(conn.label, { ctx: state.ctx, fontSize: 2, defaultFont: state.defaultFont });
return `
<marker id="${conn.from + "_" + conn.to}" refX="${conn._source.x < conn._target.x ? -7 : 7}" refY="5" markerWidth="500" markerHeight="500" orient="${conn._source.x < conn._target.x ? "auto" : "auto-start-reverse"}" >
<rect rx=0.5 width=${conn.label ? labelWidth + 3 : 0} height=3 y=1 fill="#E27396"></rect>
<text font-size="2px" x=1 fill="white" y=3>${conn.label || ''}</text>
</marker>
<marker id="arrow-${conn.from + "_" + conn.to}" markerWidth="500" markerHeight="500" refY="2" refX="1" orient="${conn._source.x < conn._target.x ? "auto" : "auto-start-reverse"}" >
<path transform="translate(0)" d='M0,0 V4 L2,2 Z' fill='#E27396' />
</marker>
`}).join("")}
</defs>
`})
from org-chart.
Thanks for the input @bumbeishvili , i'll try this solution and update here.
from org-chart.
I'll have to modify the orientation for the text in the defs, thanks @bumbeishvili it's working now.
from org-chart.
Related Issues (20)
- The folding/folding function causes the image within the node to flash HOT 7
- Vite (using ESBuild) fails with 'Cannot use import statement outside a module' HOT 1
- nodeButtonWidth is not a function, same for Height, nodeButtonX and Y. HOT 2
- implement d3.interpolateZoom on node click
- onNodeClick Safari - Activates on clicking expand nodes HOT 1
- Disable expand if number of nodes are higher than a specific value HOT 3
- Facing the issue "TypeError: linkUpdate.transition is not a function at OrgChart.update (d3-org-chart.js:703:14)"
- How can I keep font family when export image or pdf file? HOT 1
- SVG height not updating on resize? HOT 1
- Adjust specific nodes to a certain level HOT 4
- Node Coloring persisting when chart rerenders HOT 4
- Bidirectional Org Chart ( Two Layouts at a time ) HOT 8
- ERROR ReferenceError: document is not defined when using Angular v18.x HOT 1
- Error and not visualise the chart HOT 7
- Exporting with bootstrap style HOT 1
- Is it possible to add a node to the chart as a parent (ex: add supervisor) HOT 1
- fit() function doesn't distinguish between expanded and unexpanded nodes
- how to integrate with asp mvc core/blazor and show brackets for leagues and sports (custom teams, golf, pickelball, soccer) HOT 1
- Hide a node based on a condition HOT 6
- is there a way to update the svg width without calling render()? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-chart.