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

bugfix/19524-treegraph-set-data-links #19625

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions samples/unit-tests/series-treegraph/treegraph/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,29 @@ QUnit.test('Treegraph series',
'The SVG element of the second point should be an image (#19173)'
);

series.setData([{
id: 'A'
}, {
parent: 'A',
id: 'CCC'
}, {
parent: 'A',
id: 'DDD'
}]);

assert.strictEqual(
document.querySelectorAll('.highcharts-treegraph-series>.highcharts-point').length,
2,
'Correct amount of links after setData (#19524)'
);

assert.notOk(
series.links.find(
link => link.options.parent === 'A' && link.options.id === 'BBB'
),
'Removed the link from A to BBB (#19524)'
);

series.update({
marker: {
radius: 20
Expand Down
5 changes: 5 additions & 0 deletions ts/Series/Treegraph/TreegraphPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ class TreegraphPoint extends TreemapPoint {
this.collapseButton = void 0;
}

if (this.linkToParent) {
this.linkToParent.destroy();
delete this.linkToParent;
}

super.destroy.apply(this, arguments);
}

Expand Down