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

Relates to #3735, adds itemsymbol: 'constant' legend option, which uses a circle symbol for all legend entries. #5475

Closed

Conversation

brian428
Copy link

@brian428 brian428 commented Feb 5, 2021

As the title says, this is similar to the itemsizing legend option, but uses a constant legend symbol (circle) instead of using the symbol of the first point in the trace.

@archmoj archmoj added community community contribution feature something new labels Feb 5, 2021
@brian428
Copy link
Author

brian428 commented Feb 5, 2021

Hmm I'm open to advice on the unit test failure, since it seems related to trace ordering, which as far as I can tell has nothing to do with the changes in this PR?

@@ -77,6 +77,16 @@ module.exports = {
'or remain *constant* independent of the symbol size on the graph.'
].join(' ')
},
itemsymbol: {
valType: 'enumerated',
values: ['trace', 'constant'],
Copy link
Contributor

Choose a reason for hiding this comment

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

I can imagine people may want to have square or other symbols in future.
So it might be better to use circle instead of constant here.

Copy link
Author

Choose a reason for hiding this comment

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

Sure. I just figured I would err on the side of making it work similar to how itemsizing works. But obviously switching the option to "circle" would be simple.

Copy link
Author

@brian428 brian428 Feb 5, 2021

Choose a reason for hiding this comment

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

Also maybe worth noting that if #3735 is ever implemented to expose basically all marker options for the legend, I imagine folks would use that for more extensive customization of the legend symbol.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like circle :)

Copy link
Author

Choose a reason for hiding this comment

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

I switched atributes.js to list the 'circle' option. But in the style.js file, I believe I have set it up to use any valid symbol the user enters for itemsymbol. Meaning the docs could be expanded to list all valid symbol names as possible values. I'm just not sure where such a list would come from. For now, attributes.js just mentions 'circle'.

Copy link
Author

Choose a reason for hiding this comment

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

I updated it to pull in the list of symbols the same way it is done for the scatter trace attributes. I believe that should supply the full list of symbol options.

Copy link
Author

Choose a reason for hiding this comment

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

Just thought I'd bump this. I believe I have it set up so it will now accept any symbol name (not just circle) to use as the legend symbol. Anything else left to do before this could be merged in?

Copy link
Contributor

Choose a reason for hiding this comment

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

The tests are failing at the moment.
Could you please sync the master branch of your fork with upstream/master and then merge master into your branch?

Copy link
Author

Choose a reason for hiding this comment

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

hmm I pulled from the plotly master to my master, then rebased my feature branch the updated master. Something went wonky though, the PR says there are 462 changes. I'll try to figure out what I did wrong.

Copy link
Author

Choose a reason for hiding this comment

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

I think I fixed the wonky merge. Back to just the 3 changed files.

@archmoj
Copy link
Contributor

archmoj commented Feb 5, 2021

Hmm I'm open to advice on the unit test failure, since it seems related to trace ordering, which as far as I can tell has nothing to do with the changes in this PR?

That test is flaky at the moment. It should pass when I re-run.

@brian428 brian428 force-pushed the feature/legend_constant_symbol branch from 374ffd8 to 8ba0712 Compare February 22, 2021 19:26
@archmoj
Copy link
Contributor

archmoj commented Feb 22, 2021

pull-syntax
Could you please fix this syntax issue?

@nicolaskruchten
Copy link
Contributor

A small update on timing: our team is working hard on releasing v2.0 of Plotly.js, which we anticipate will happen in early April. This PR would be a good candidate to land in the library in v2.1 or later, so with apologies for the delay, we will likely not be able to give much feedback on this PR for the next few weeks :)

@archmoj
Copy link
Contributor

archmoj commented Jun 25, 2021

@brian428 in order for the tests to pass, you need to fetch upstream/master on your repo and then merge it into your feature branch.

@nicolaskruchten
Copy link
Contributor

Upon further thought, I think I much prefer the trace by trace approach laid out in #3735 rather than such an absolute legend-level attribute.

@gvwilson
Copy link
Contributor

This pull request has been sitting for a while, so I would like to close it as part of our effort to tidy up our public repositories. I've assigned it to myself to keep track of it; I'll wait until 2024-06-17 for someone to say it's still relevant and they'll to take it on, and otherwise I will close it then. Thanks - @gvwilson

@archmoj
Copy link
Contributor

archmoj commented Jul 13, 2024

Upon further thought, I think I much prefer the trace by trace approach laid out in #3735 rather than such an absolute legend-level attribute.

Closing in regards to a trace by trace approach.

@archmoj archmoj closed this Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants