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

Fetch whole dataset only when autoScale is off (and slices otherwise) #877

Merged
merged 6 commits into from
Nov 30, 2021

Conversation

loichuder
Copy link
Member

@loichuder loichuder commented Nov 26, 2021

Improvement for #616

Also:

  • Enforce numeric types for complex fields
  • Remove persistence of autoScale

Drafting it for discussion as I feel we can do better here:

  • There is a lot of common behaviour in the various LineVis containers that we could refactor
  • I liked that fact that useLineConfig was always used in Mapped components but now, I need it outside...

Copy link
Contributor

@axelboc axelboc left a comment

Choose a reason for hiding this comment

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

Apart from the loading message logic, which can be moved inside VisBoundary, I don't see a lot of duplication between the line and spectrum containers. Where there's more duplication now is between the line and heatmap containers. However, I don't see it as a problem, as all the business logic is nicely encapsulated in shared hooks and components.

Comparing the containers, I've actually just noticed that we have duplicate NeXus type guards: assertNumericNxData and assertNumericSignal, and assertComplexNxData and assertComplexSignal.

The fact that we use useLineConfig in the containers can indeed feel like we're breaking one of our design decisions, but perhaps this wasn't a great decision in the first place. It makes sense that the user's preferences would eventually affect the fetching of the data somehow. Perhaps relaxing this decision will open the door to some refactoring to reduce duplication/complexity in the mapped vis components?

packages/app/src/vis-packs/core/hooks.ts Outdated Show resolved Hide resolved
packages/app/src/vis-packs/core/line/MappedLineVis.tsx Outdated Show resolved Hide resolved
@loichuder loichuder force-pushed the fetch-slice-line-ii branch 2 times, most recently from 5dfb0d1 to d0e35c3 Compare November 29, 2021 12:06
@loichuder loichuder marked this pull request as ready for review November 29, 2021 12:07
Copy link
Contributor

@axelboc axelboc left a comment

Choose a reason for hiding this comment

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

nice!

packages/app/src/__tests__/CorePack.test.tsx Outdated Show resolved Hide resolved
@loichuder
Copy link
Member Author

/approve

@loichuder loichuder merged commit a6480f8 into main Nov 30, 2021
@loichuder loichuder deleted the fetch-slice-line-ii branch November 30, 2021 15:13
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