Comments (4)
Hi
I don't know if this is the same need, but mine is: provide a method to center the chart on a specific node.
I did something on my side but it would be useful to have it as a standard function. For example, I give the possibility to a user to search for a person and I center the chart on the found node.
from tree-chart.
@adevicq Can I ask how you accomplished centering the node to the screenspace?
from tree-chart.
Hi,
If you inspect the DOM, you will find two elements under a DIV which class is "tree-container"
These two elements (SVG and DIV) have a style which defines the position of the diagram:
style="transform: scale(1) translate(1024px, -15px); transform-origin: center center;"
You have to play with the "translate" parameter to move the view up/down and right/left.
Store the initial values of the two values in the translate property and move the view according to the desired coordinates.
Hope this helps.
from tree-chart.
@adevicq How can we calculate this transformation? Suppose a node has properties such as width, height, top, and left. How can we manipulate these properties to determine the transformation translation values for X and Y?
from tree-chart.
Related Issues (20)
- vue2无法折叠 HOT 1
- Open / close a node
- Vue 2 version missing enableCollapse param on init() method HOT 1
- onClickNode不生效? HOT 1
- How to start with nodes collapsed?
- linkStyle prop not used HOT 4
- Error on transition-group HOT 1
- 能否实现添加旁系节点,即配偶节点,附效果图
- Allow scrolling instead of zoom/pan
- vue3-tree-chart中direction为horizontal时,连接线绘制错误
- when i use demo (render tree with multiple parents) in vue3 it;s can not show the multiple parents HOT 4
- 同层级间节点间距调整
- 如何设置初始化的缩放大小和位置
- Could you help me, I need to remove this style but I can't (node-slot) How to customize this? HOT 1
- Hide node
- the line between nodes in not stable in Vue 2 HOT 1
- restore scale
- Search in tree - How this can be work.
- Wide charts are cut off and nodes start to duplicate
- 节点位置 HOT 1
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 tree-chart.