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 possibility to specify which vis types to show in the sidebar #129

Merged

Conversation

dvdanielamoitzi
Copy link
Contributor

We have the requirement to hide the heatmap in the general purpose vis. This PR introduces a property "visTypes" for the component which enables the developer to specify which vis types to show as options in the sidebar. If not specified, all vis types will be used.

Developer Checklist (Definition of Done)

Issue

  • All acceptance criteria from the issue are met
  • Tested in latest Chrome/Firefox

UI/UX/Vis

  • Requires UI/UX/Vis review
    • Reviewer(s) are notified (tag assignees)
    • Review has occurred (link to notes)
    • Feedback is included in this PR
    • Reviewer(s) approve of concept and design

Code

  • Branch is up-to-date with the branch to be merged with, i.e., develop
  • Code is cleaned up and formatted
  • Unit tests are written (frontend/backend if applicable)
  • Integration tests are written (if applicable)

PR

  • Descriptive title for this pull request is provided (will be used for release notes later)
  • Reviewer and assignees are defined
  • Add type label (e.g., bug, feature) to this pull request
  • Add release label (e.g., release: minor) to this PR following semver
  • The PR is connected to the corresponding issue (via Closes #...)
  • Summary of changes is written

Summary of changes

  • added visTypes prop to Vis component
  • filtering by visTypes when registering the vis types

Screenshots

In this example I have only passed visTypes={[ESupportedPlotlyVis.HEATMAP]} to the Vis component, and as you can see there are no more options in the sidebar:
image

Additional notes for the reviewer(s)

  • I'm not entirely sure if this is the way we want to do it, there would be the possibility to exclude certain vis types which might be better as newly introduced vis types would then show up by default whereas in my current approach the developer would need to add the new vistype to the visTypes props manually.

Thanks for creating this pull request 🤗

registerVisType(...registerAllVis());
}, [registerVisType]);
registerVisType(...registerAllVis(visTypes));
}, [registerVisType, visTypes]);
}
Copy link
Contributor

@dvmoritzschoefl dvmoritzschoefl Dec 7, 2023

Choose a reason for hiding this comment

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

this will kill performance of the app if visTypes is not memoized, since its wrapped in a context
should we do a shallow compare here? or alternatively we could call it initialVisTypes to make it clear that it will only affect the vis types at the first render, similiar to mantine-react-table (initialState) and other libraries

EDIT: the visprovider can handle this already by checking which vis are already in the provider

@dvdanielamoitzi dvdanielamoitzi merged commit 86db953 into develop Dec 7, 2023
4 checks passed
@dvdanielamoitzi dvdanielamoitzi deleted the dmoitzi/add_possibility_to_define_shown_vistypes branch December 7, 2023 10:17
@dvvanessastoiber dvvanessastoiber mentioned this pull request Dec 14, 2023
puehringer added a commit that referenced this pull request Dec 14, 2023
## What's changed

* fix: switch to storybook config from visyn_scripts
(#127)
* test: add data-testid to proxy view iframe
(#128)
* Add possibility to specify which vis types to show in the sidebar
(#129)
* Use correct workflow branches
(#133)
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