kurkle / chartjs-chart-sankey

Chart.js module for creating sankey diagrams
MIT License
148 stars 29 forks source link

alpha value upgradation #95

Closed RishikeshB closed 3 weeks ago

RishikeshB commented 1 year ago

Hi, Thank you @kurkle for this great library! As in issue #93 I'd like to increase chart color intensity for better visualization. For this added 'alpha' value where set alpha value to 1 (alpha:1) the intensity of the chart flow color increases or else by default the color value will be 0.5. This will be helpful when given only two color for large dataset.

Eg: I'm not given alpha value and not given any color for flow, chart takes its default color values has red and green : code:

data: {
datasets: [{
label: 'My sankey',
data,
}]
},

chart looks like:

alpha=0

Eg: I'm given alpha value as 1 and not given any color for flow, chart takes its default color values has red and green: code:

data: {
datasets: [{
label: 'My sankey',
data,
alpha:1
}]
},

chart looks like

alpha=1

I'm submitting a PR that proposes a new option.

stockiNail commented 1 year ago

@RishikeshB @kurkle if I may jump in the thread, maybe the best thing is to remove any default alpha color value and delegate the user to decide the colors to apply. Just thinking loud.

kurkle commented 1 year ago

I agree with @stockiNail, it would be best to remove the .alpha call and use whatever already is in the color provided.

RishikeshB commented 1 year ago

but when we remove .alpha call, any of us may required a lite colors to view flow. alpha value will serve better usage switching from dark and light.

kurkle commented 1 year ago

please remove the added files in dist too

kurkle commented 1 year ago

Also this should be documented, can you do that too?

sonarcloud[bot] commented 9 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud