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

sankey.states.hover.color is never used #8532

xuv opened this issue Jun 26, 2018 · 4 comments

sankey.states.hover.color is never used #8532

xuv opened this issue Jun 26, 2018 · 4 comments


Copy link

@xuv xuv commented Jun 26, 2018

Expected behaviour

Setting a hover color should display elements in that color when hovered.

Actual behaviour

The hover color is never taken into account

Live demo with steps to reproduce

Product version


Affected browser(s)

Tested in Firefox and Chrome

Copy link

@sebastianbochan sebastianbochan commented Jun 27, 2018

Hi @xuv,
Thank you for the reporting. The color is ignored in the pointAttibs function, but I prepared you a wrap which fixes the issue.

  H.wrap(H.seriesTypes.sankey.prototype, 'pointAttribs', function(proceed, point, state) {

    var opacity = this.options.linkOpacity,
    		color = point.color;

    if (state) {
      opacity = this.options.states[state].linkOpacity || opacity;
      color = this.options.states[state].color || point.color;
    return {
      fill: point.isNode ?
        color : H.color(color).setOpacity(opacity).get()

Internal note
@TorsteinHonsi does it make sense? If yes I will create a PR.

Copy link

@xuv xuv commented Jun 27, 2018

@sebastianbochan Thx for the quick response and for the fix.

Copy link

@TorsteinHonsi TorsteinHonsi commented Jun 28, 2018

@sebastianbochan Yes, makes sense! Thanks!

Copy link

@mjkstudios mjkstudios commented Sep 13, 2018

I had been using the select state to change the opacity on selection. That's great that the color is now taken into consideration, but for anyone wanting the previous behavior, color must be explicitly set to a falsy value:

    states: {
      select: {
      	color: null, // defaults to #cccccc
        linkOpacity: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants