Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #142 from thomasbanghart/AP-1610_sankey_gt10_dim
Browse files Browse the repository at this point in the history
BUG FIX: AP 1610 Sankey appends "1" to 11th dimension
  • Loading branch information
noahamac authored Apr 22, 2020
2 parents eed2eb1 + 18d8189 commit e10bcc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/sankey.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/subtotal.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/examples/sankey/sankey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ const vis: Sankey = {
}
path.forEach(function (p: any, i: number) {
if (i === path.length - 1) return
const source: any = path.slice(i, i + 1)[0] + i
const target: any = path.slice(i + 1, i + 2)[0] + (i + 1)
const source: any = path.slice(i, i + 1)[0] + i + `len:${path.slice(i, i + 1)[0].length}`
const target: any = path.slice(i + 1, i + 2)[0] + (i + 1) +`len:${path.slice(i + 1, i + 2)[0].length}`

nodes.add(source)
nodes.add(target)
// Setup drill links
Expand Down Expand Up @@ -152,7 +153,7 @@ const vis: Sankey = {

graph.nodes = nodes.values().map((d: any) => {
return {
name: d.slice(0, -1)
name: d.slice(0, d.split("len:")[1])
}
})

Expand Down Expand Up @@ -234,6 +235,7 @@ const vis: Sankey = {
.on('mouseleave', function (d: Cell) {
d3.selectAll('.link').style('opacity', 0.4)
})


node.append('rect')
.attr('x', function (d: Cell) { return d.x0 })
Expand Down

0 comments on commit e10bcc2

Please sign in to comment.