-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grouping HPCC Graph nodes on left and right sides #4099
Comments
I have looked into this and there is a relatively easy way to add additional forces to influence which side they end up on.
|
|
yes this positioning function is something that may be useful for us! @GordonSmith would you mind sending us a very simple example code where you position a node to a desired location? Maybe push node B to all the way right and push node A to all the way left? If you could update the code snippet below that would be super helpful for us.
|
hi @GordonSmith would it be possible for you to provide us a simple example using positioning logic you mentioned in your previous comment? Thank you very much! |
My previous comments was referencing information needed to implement the feature - rather than it existing... The following code is where the current force is initialised: https://github.com/hpcc-systems/Visualization/blob/trunk/packages/graph/src/graph2/layouts/forceDirected.ts#L43-L68 I think we would need 3 simulations - center, left and right and then filter the |
yes that sounds correct! please let me know if there are any updates or any code snippets that I can use! Thank you very much! |
We need a graph visualization where similar nodes can be grouped on either sides of a root node.
For example: consider a scenario where we want to show a visualization for different transactions performed by a customer over a certain period of time. Let's say we have two types of transactions: debits and credits. Transactions will be grouped based on these transaction types resulting in two groups of transactions. Each resulting transaction group will then be grouped based on their merchant categories. This means that, in the group of debit transactions for example, we can have a group of transactions made on merchants who belong to the "Groceries" category, we can have another group of transactions made on merchants who fall into the "Bars and Nightclubs" category, e.t.c. At the end of the day we can have data in the following format:
If we take a look at the "debits" property of this object, we can see that it is an array containing a list of objects. Each object in the array is a result of grouping debit transactions by merchant categories. Each object in the array will be rendered as a node in the HPCC graph.
By using the HPCC Graph2 react component, we want to achieve the desired ouput as shown in the image below:
The goal is to have all nodes considered as debit transactions to be on one side of the root node and all other nodes considered as credit transactions to be on the other side of the root node. In this case, the root node represents the account from which these transactions were performed. From the picture above, the nodes representing debit transactions are on the right and all have a red color meanwhile the nodes representing credit transactions are on the left and have a green color.
The text was updated successfully, but these errors were encountered: