Skip to content
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

Treemap not drilling down as expected with dynamic child updates #1610

Closed
ArunPragadeeswar007 opened this issue Jul 11, 2024 · 2 comments
Closed

Comments

@ArunPragadeeswar007
Copy link

ArunPragadeeswar007 commented Jul 11, 2024

Question

First of all, thank you for this amazing addon! It's been incredibly useful for our project. However, I've encountered an issue with the treemap that I need some help with.

The tree map is not functioning as expected when dynamically updating child nodes upon drilling down. The initial level works fine, but when clicking on a specific node (e.g., the fourth node), it drills down and expands all its child nodes. However, after this drill down with dynamic child updates, the view resets to the root level, and the nodes are added into the parent node but not expanded.

Please check out this : demo

Steps to Reproduce:

  1. Click on a node at the first level (e.g., the fourth node).
  2. Observe that it drills down and expands all its child nodes.
  3. Notice that the view resets to the root level and the nodes are added into the parent node but not expanded.

What I Have Tried:

  • Disabled the following properties:
dataItem.set("value", undefined);
dataItem.set("valueWorking", undefined);

This improved the situation, but the parent node is still shown. Additionally, when clicking on breadcrumbs, the node values are undefined, which causes issues in bread crumbs.

  • Updated the selectedDataItem when a node is clicked:
series.set("selectedDataItem", dataItem);

This resulted in nodes being added but introduced glitches.

  • Tried setting selectedDataItem to the node's children:
series.set("selectedDataItem", dataItem.get("children"));

This threw an error.

Expected Behavior:

When a node is clicked, data should be fetched, its child nodes should be updated and expanded, and navigation should work seamlessly, including with breadcrumbs.

Environment

  • amCharts version : "^5.4.5",
  • Browser and its version : Chrome (126.0.6478.127)
  • Framework : Ember 5.9
@martynasma
Copy link
Collaborator

Your example adds a new child to the clicked node.

The same click also acts as a drill-down, but it kicks in before your custom click handler which adds new child, hence no drill-down.

Also, when end-point node (no children) gains a child, it's value changes to the sum of its children, hence layout changing.

I suggest disabling the built-in drill-down altogether, and just relying on your custom click handler.

Copy link

This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added.

@github-actions github-actions bot added the stale label Aug 16, 2024
@zeroin zeroin closed this as completed Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants