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

Nice to have: customizable bar colors #59

Open
hilaryca opened this issue Oct 18, 2018 · 11 comments
Open

Nice to have: customizable bar colors #59

hilaryca opened this issue Oct 18, 2018 · 11 comments
Assignees

Comments

@hilaryca
Copy link

We'd like to color code our groups so that each one is identified by the same color across all reports, making it easy for them to spot their figures in charts.

Can the Sankey allow the colors of the bars to be set too? Ideally users would have an option to make the bars & ribbon colors match, but default would be black ribbons.

@paulbwagner
Copy link

As a generalization, it would be nice to use a table column to indicate the node color, as well as a table column as the link color. Other sankey diagrams such as those in D3 or Python libraries have these sorts of properties driven by the data and not by fixed format settings, which gives the user maximum flexibility.

@lrlucchini
Copy link

Yes please. This has me going through the code here trying to see if there's an easy way to replicate the process to color the links, but doing that for the nodes instead. In the configuration/capabilities JSON file it already specifies a "Node" section in the format pane, identically to the "Links" section which allows you to change the color of each link. I think the original intent was to allow us to change the nodes, but somewhere in the process that got removed/broken. I am trying to create my own custom visual to fix for this by copying their code, but I am not sure what I'm doing at this point.

@jeremyfirth
Copy link

Yes please. This has me going through the code here trying to see if there's an easy way to replicate the process to color the links, but doing that for the nodes instead. In the configuration/capabilities JSON file it already specifies a "Node" section in the format pane, identically to the "Links" section which allows you to change the color of each link. I think the original intent was to allow us to change the nodes, but somewhere in the process that got removed/broken. I am trying to create my own custom visual to fix for this by copying their code, but I am not sure what I'm doing at this point.

I'm in the same boat. I have a little coding background, and I was relieved to find the source code for this visualization on github. Have you made any progress with being able to color-code the nodes manually? I'm looking for that function specifically.

@helen508light
Copy link

Thank you for your feedback.
We'll consider your suggestions in the next versions of the visual.

@jeremyfirth
There are no implemented features you had mentioned here for now.
Please note that source code for the visual is public, feel free to fork and modify it for your needs.

@harry843
Copy link

harry843 commented Apr 8, 2020

I agree with the comments above. I would find it hugely beneficial for the colouring of node bars to be a feature included in the next release. I am also new to coding and unsure how to go about doing this manually using the source code on github.

@mneira10
Copy link

+1

@ncardona10
Copy link

It would be incredibly usefull !!

@joespiff
Copy link

I've made some changes to the code in my fork of this repo in an effort to enable this feature. It is still experimental, but I'd love to hear feedback from anyone who tries it. If I can get some validation that it is solid, I may make a pull request to get it incorporated into the official repo.

@zBritva
Copy link
Contributor

zBritva commented Aug 20, 2020

@joespiff It's good that community wants to help to improve the visual. Thanks!

But the problem is:

Power BI binds properties to data (data rows). In this case it's color.
For 1 row you can bind one instance of color. (for one object)
For 5 row you can bind 5 instances of color. (for one object)
e.t.c

Details:
We have data:

TARGET SOURCE VALUE
A B 1

There is one row. And we can bind only one color per row.
It means if you have only one object, you can store only one color (for source node or for target node).

There we have a bug:
sankey_nodes_color

It's limitation of categorical data view mapping. But it requires rework code of sankey to switch from categorical to matrix data view mapping

Probably it can be resolved by using matrix data view mapping, but I am not sure.

Another tricky options is: use two different objects: one for source nodes color another for target nodes color.
Disadvantage is, you can assign different colors in source and target for the same node. It can confuse the user.

I hope I explained the limitations. Ask if you have questions.

@Mike-Honey
Copy link

I've made some changes to the code in my fork of this repo in an effort to enable this feature. It is still experimental, but I'd love to hear feedback from anyone who tries it. If I can get some validation that it is solid, I may make a pull request to get it incorporated into the official repo.

@joespiff - I'm keen to try your fork, but I cant find it?

@Mike-Honey
Copy link

Mike-Honey commented Mar 24, 2021

Please implement this by adding input data columns for the source and destination node colors, and for the link color. That's 3 input data columns in all.

Trying to achieve consistent colors with this visual is currently a nightmare - it resets node colors seemingly at random.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests