Skip to content

Commit 065751e

Browse files
committed
Use updated sunburst-chart API
1 parent 702d999 commit 065751e

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

client/src/components/Sunburst.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import Sunburst from "@arclamp/sunburst-chart";
2+
import Sunburst from "sunburst-chart";
33
import debounce from "lodash.debounce";
44
55
function treeifyTable8(tab) {
@@ -114,13 +114,17 @@ export default {
114114
this.chart = Sunburst()
115115
.width(this.$el.offsetWidth)
116116
.height(this.$el.offsetHeight)
117-
.tooltipShow(d => d.name !== "")
118-
.tooltipTitle(d => {
119-
const text = this.chart._tooltipTitle(d);
120-
return text
121-
.split(" > ")
122-
.slice(1)
123-
.join(" > ");
117+
.showTooltip(d => d.name !== "")
118+
.tooltipTitle((data, d) => {
119+
let stack = [];
120+
let curNode = d;
121+
while (curNode) {
122+
stack.unshift(curNode);
123+
curNode = curNode.parent;
124+
}
125+
stack = stack.slice(1);
126+
127+
return stack.map(d => d.data.name).join(' > ');
124128
})
125129
.tooltipContent(d => (d.value !== undefined ? `value: ${d.value}` : ""))
126130
.color(d => this.cmap(d.name))

0 commit comments

Comments
 (0)