Skip to content

Commit

Permalink
fix(sankey): use node color for link color (#1615)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze authored Jun 22, 2021
1 parent 232b613 commit 1002edb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/sankey/src/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const computeNodeAndLinks = ({
width,
height,
getColor,
getLinkColor,
getLabel,
}) => {
const sankey = d3Sankey()
Expand Down Expand Up @@ -61,7 +60,7 @@ export const computeNodeAndLinks = ({
})

data.links.forEach(link => {
link.color = getLinkColor(link)
link.color = link.source.color
link.pos0 = link.y0
link.pos1 = link.y1
link.thickness = link.width
Expand Down Expand Up @@ -111,7 +110,6 @@ export const useSankey = ({

const getColor = useOrdinalColorScale(colors, 'id')
const getNodeBorderColor = useInheritedColor(nodeBorderColor, theme)
const getLinkColor = useOrdinalColorScale(colors, 'source.id')

const getLabel = useMemo(() => getLabelGenerator(label, labelFormat), [label, labelFormat])
const getLabelTextColor = useInheritedColor(labelTextColor, theme)
Expand All @@ -130,7 +128,6 @@ export const useSankey = ({
width,
height,
getColor,
getLinkColor,
getLabel,
}),
[
Expand All @@ -145,7 +142,6 @@ export const useSankey = ({
width,
height,
getColor,
getLinkColor,
getLabel,
]
)
Expand Down

0 comments on commit 1002edb

Please sign in to comment.