-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix unique values hierarchy #832
Conversation
Some hierarchies have values that are present at multiple branches of a hierarchy
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When mapping Tariff or Basket ID
as color field, selecting the Zolltarifs
and List of Zolltarifs
values doesn't do anything (no data is filtered + no color appears in the option row). I guess it's related to a value being shared across multiple parents, but is this an expected behavior?
/** | ||
* Can be used for debugging, pass a hierarchy, and copy the output | ||
* to graphviz. | ||
* | ||
* @see https://dreampuf.github.io/GraphvizOnline/ | ||
*/ | ||
export const hierarchyToGraphviz = ( | ||
hierarchy: DimensionHierarchyQueryHierarchy | ||
) => { | ||
const lines = [] as string[]; | ||
dfs(hierarchy, (node, { depth, parents }) => { | ||
lines.push(`"${node.value}"[label="${node.label.replace(/"/g, "")}"]`); | ||
if (parents.length > 0) { | ||
const parent = parents[parents.length - 1]; | ||
lines.push(`"${parent.value}" -> "${node.value}"`); | ||
} | ||
}); | ||
return ` | ||
digraph G { | ||
rankdir=LR | ||
|
||
${lines.join("\n")} | ||
} | ||
`; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can give an input here, and this might be an "special" situation in my data: most of the nodes are related to values in the Data, except the "list of Zolltarif" node itself -> this is kind of a "fake" node, just to regroup and display the list of Zolltarifs that are included in a basket (whithout having to look at all tarifs in the children, and also given that a tarif could be directly at that level and not coming from a child).
As discussed with Patrick, there could be a better way to show this, we can talk about it. This was just a "possible" way that I used for that POC.
Thus, for me it makes sense if the node "list of Zolltarfis" can not be selected. It is a nice handling of the situation by Visualize.
And it is the same for the node "Zolltarifs" itself: there is no value in the data for it, but its children do have a value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Fix #822 (comment)