Skip to content

Changing Histogram parameter descriptions #623

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

Merged
merged 5 commits into from
Jun 10, 2016

Conversation

yankev
Copy link
Contributor

@yankev yankev commented Jun 9, 2016

Resolves #614

},
nbinsx: {
valType: 'integer',
min: 0,
dflt: 0,
role: 'style',
description: 'Sets the number of x axis bins.'
description: [
'Specifies the maximum number of desired bins. This value will be used',
Copy link
Contributor

Choose a reason for hiding this comment

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

we use 4 space indentation.

Run npm run lint to check that your patch passes our linting rules.

@mdtusz
Copy link
Contributor

mdtusz commented Jun 10, 2016

Looks good to me 💃

@@ -82,15 +82,21 @@ module.exports = {
role: 'style',
description: [
'Determines whether or not the x axis bin attributes are picked',
'by an algorithm.'
'by an algorithm. Note that this should be set to false if you',
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to my comment in #607, autobinx does not need to be set to false as it is defaulted to false in if xbins.start and xbins.end are valid inputs (see logic).

But we don't really have a way to communicate smart default logic in our descriptions yet.

So, I think this patch is fine for now. But we should starting thinking about a better approach cc @cldougl

Copy link
Member

Choose a reason for hiding this comment

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

@etpinard yep agreed -- I'll try to think of wording to express the logic ( plotly/documentation#428 ). I really want to change that because I think that having 1 less variable to worry about to get a result makes these 'trickier' attributes w/ dependents more approachable for new users.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great. I was thinking about adding another meta filed to our attribute descriptions.

Something like dfltDependsOn:

autobinx: {
  valType: 'boolean',
  dflt: false,
  dfltDependsOn: ['xbins.end', 'xbins.start']
};

Copy link
Member

Choose a reason for hiding this comment

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

I like that a lot -- that's a lot easier for me to read than trying to pull the default info from the description

Copy link
Member

Choose a reason for hiding this comment

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

but we should still have some note that expresses you don't have to set this attribute, we'll logically set it for you with the defaultDepends

Copy link
Contributor

@mdtusz mdtusz Jun 10, 2016

Choose a reason for hiding this comment

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

What would be really helpful is if we use some delimiter to mark things as linkable attributes so that in the docs, users can click on them and go to their definition. E.g.

description: 'This sets some thing, provided that [context.attribute](toplevel.midlevel.bottomlevel) is true.' would output:

"This sets some thing, provided that context.attribute is true."

I'm not sure what the process of attributes.js files -> docs is, but I'd think we could make it happen.

@etpinard etpinard merged commit 32293e3 into plotly:master Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants