Skip to content

Menupanel does not trigger section visibility by default #99

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

Conversation

bpostlethwaite
Copy link
Member

closes #58
@alexcjohnson this PR addressed earlier conversations linked in #58 we had about <Section> visibility. Now neither <Info> or <MenuPanel> trigger automatic <Section> visibility but will be hidden along with the <Section> if no attr components are defined.

@bpostlethwaite bpostlethwaite changed the base branch from master to develop November 23, 2017 01:26
} else {
plotProps = {isVisible: true};
// custom UI currently forces section visibility.
newProps = {key: i, 'data-section-child-visible': true};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have a use case in mind for this right now? I'm trying to figure out whether it seems more like <Info> or more like an attr.

Copy link
Member Author

Choose a reason for hiding this comment

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

For example if you want to add a business logic component that isn't tied to the editor. A data importer component or a component that adds buttons and range sliders but doesn't have an attr

Copy link
Member Author

Choose a reason for hiding this comment

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

If you add your own stuff to a Section the section will be visible. At that point it's up to the developer to add their own visibility handling.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense, I guess the last resort clause should be to make it visible. So I guess in the most generic case you'd add plotProps with isVisible for your own custom handling?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep that is exactly what CanvasSize and AxesRange and friends use by defining a modifyPlotProps function that overrides plotProps.isVisible

@alexcjohnson
Copy link
Collaborator

💃 I like it.

@bpostlethwaite bpostlethwaite merged commit ccd373a into develop Nov 23, 2017
@bpostlethwaite bpostlethwaite deleted the menupanelDoesNotTriggerSectionVisibilityByDefault branch November 23, 2017 03:19
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.

2 participants