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

add unselected.line.color and unselected.line.opacity options to parcoords trace #6216

Merged
merged 7 commits into from
Jun 14, 2022

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Jun 9, 2022

Helps control the opacity and color of the parcoords deselected lines in the background.

Resolves #6213 and resolves #3939.

@plotly/plotly_js

@archmoj archmoj changed the title add unselected.line.color option to parcoords trace add unselected.line.color and unselected.line.opacity options to parcoords trace Jun 10, 2022
@mikesinc mikesinc mentioned this pull request Jun 13, 2022
23 tasks
@archmoj archmoj requested a review from alexcjohnson June 13, 2022 14:48
@@ -149,7 +149,10 @@ function model(layout, d, i) {
var trace = cd0.trace;
var lineColor = helpers.convertTypedArray(cd0.lineColor);
var line = trace.line;
var deselectedLines = {color: rgba(c.deselectedLineColor)};
var deselectedLines = {
color: rgba(trace.unselected.line.color || '#777'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can '#777' be the attribute default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Using #777 (explicitly or any other color) should set the color of lines to exactly that color.
But I am open to using auto instead of blank string as the dflt of unselected.line.color, if you prefer that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have lots of examples where a color and an opacity are specified side-by-side... and it doesn't mean it's NOT that color, just that there's opacity applied later that dilutes it.

Actually thinking about this a bit more, I might even suggest removing the "set opacity to 1 if a color is explicitly specified" and keep 'auto' as the consistent default, because if you did want to change this color most likely you still want it diluted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Addressed in 47bef38.

max: 1,
dflt: 'auto',
editType: 'plot',
description: 'Sets the opacity of unselected lines.'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we describe 'auto'? Not the full formula, just qualitatively something like "The default 'auto' decreases the opacity smoothly as the number of lines increases."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Addressed in 47bef38.

@archmoj
Copy link
Contributor Author

archmoj commented Jun 14, 2022

@alexcjohnson this PR is ready for another round of review. Thank you 🙏

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 great!

@archmoj archmoj merged commit e79f045 into master Jun 14, 2022
@archmoj archmoj deleted the parcoords-unselected-line-color branch June 14, 2022 16:28
@MahanyaKochhar
Copy link

Hi ! Is there any attribute available now that solves this issue in Python . I want to change the unselected line colour from the default grey to another colour. Please let me know .
Thanks.

kMutagene added a commit to plotly/Plotly.NET that referenced this pull request Feb 5, 2023
….color and unselected.line.opacity options to parcoords trace (plotly/plotly.js#6216)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
3 participants