-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: vis is rendered with an invalid config #172
Conversation
{status === 'pending' ? ( | ||
<Loader /> | ||
) : !hasAtLeast2CatCols ? ( | ||
<InvalidCols headerMessage="Invalid settings" bodyMessage="To create a heatmap chart, select at least 2 categorical columns." /> | ||
) : ( | ||
{status === 'pending' && <Loader />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Invalid settings message is shown shortly while the state is idle
. This change fixes that. The other visualizations account for the idle
state already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this issue and the mention.
@@ -26,7 +26,7 @@ export function HeatmapText({ | |||
isImmediate: boolean; | |||
}) { | |||
const labelSpacing = useMemo(() => { | |||
const maxLabelLength = d3.max(yScale.domain().map((m) => m.length)); | |||
const maxLabelLength = d3.max(yScale.domain().map((m) => m?.length)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accounts for null categories. They are still shown in the visualization but at least the application does not crash.
I have created an issue to discuss possible better solutions
@oltionchampari regarding your last point of using useUncontrolled when we are using mantine7. develop is currently using mantine7, and mantine6 has the hook as well. So why don't we do it right away? 🤔 |
I thought it was in 7 and we would need the change soonish in v7.0.3. But since its in v6 already we can go ahead and change it already |
Ok, now I understand: this PR is intended to be released for a previous visyn_core version, right? But then the |
We will cherry pick this commit and merge it to v7.0.3 as far as i understand. |
Yeah, that makes sense. I would still like to see the |
@puehringer Please take another look when possible.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the suggestion and updating the example. It looks good to me.
@puehringer please take a final look. Thanks.
**Issue** - [ ] All acceptance criteria from the issue are met - [x] 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** - [x] Branch is up-to-date with the branch to be merged with, i.e., develop - [x] Code is cleaned up and formatted - [ ] Unit tests are written (frontend/backend if applicable) - [ ] Integration tests are written (if applicable) **PR** - [x] Descriptive title for this pull request is provided (will be used for release notes later) - [x] Reviewer and assignees are defined - [x] Add type label (e.g., *bug*, *feature*) to this pull request - [x] Add release label (e.g., `release: minor`) to this PR following [semver](https://semver.org/) - [x] The PR is connected to the corresponding issue (via `Closes #...`) - [x] [Summary of changes](#summary-of-changes) is written We have the issue that we are providing vis an externalConfig that does not include all possible defaults ```typescript const config = { type: 'Heatmap plot', catColumnsSelected: [ { id: 'Column 1', name: 'Column 1' }, { id: 'Column 2', name: 'Column 2' }, ], }; ``` This is the different values the vis was being rendered with (causes errors) when inputing the above config ``` MainApp.tsx: Parent {type: 'Heatmap plot', catColumnsSelected: Array(2)} MainApp.tsx:40 Parent null MainApp.tsx:40 Parent {type: 'Heatmap plot', catColumnsSelected: Array(2), color: {…}} MainApp.tsx:40 Parent {type: 'Heatmap plot', color: {…}, catColumnsSelected: Array(2), numColorScaleType: 'Sequential', xSortedBy: 'CAT_ASC', …} ``` And this with this fix ``` MainApp.tsx: Parent {type: 'Heatmap plot', catColumnsSelected: Array(2)} MainApp.tsx:40 Parent {type: 'Heatmap plot', color: {…}, catColumnsSelected: Array(2), numColorScaleType: 'Sequential', xSortedBy: 'CAT_ASC', …} ``` We could improve the logic and readabilty of this section of code when we switch completely to mantine 7 to use https://mantine.dev/hooks/use-uncontrolled/ before ![gr-original](https://github.com/datavisyn/visyn_core/assets/51322092/ea036357-6411-4592-aaf2-a1b469ce2d3e) after ![gr-new](https://github.com/datavisyn/visyn_core/assets/51322092/a9e2aac0-b55a-4395-a25b-7eb0e908fdd0) - Thanks for creating this pull request 🤗 (cherry picked from commit 30da502)
Developer Checklist (Definition of Done)
Issue
UI/UX/Vis
Code
PR
release: minor
) to this PR following semverCloses #...
)Summary of changes
We have the issue that we are providing vis an externalConfig that does not include all possible defaults
This is the different values the vis was being rendered with (causes errors) when inputing the above config
And this with this fix
We could improve the logic and readabilty of this section of code when we switch completely to mantine 7 to use https://mantine.dev/hooks/use-uncontrolled/
Screenshots
before
![gr-original](https://private-user-images.githubusercontent.com/51322092/303600378-ea036357-6411-4592-aaf2-a1b469ce2d3e.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNzI1MjIsIm5iZiI6MTcyMTI3MjIyMiwicGF0aCI6Ii81MTMyMjA5Mi8zMDM2MDAzNzgtZWEwMzYzNTctNjQxMS00NTkyLWFhZjItYTFiNDY5Y2UyZDNlLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE4VDAzMTAyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1NjgzMDljZjczZDU0YjcxMTkxOTdjMmI4YmMzYWQ1MzI3NDYyNjg3MTEzM2EwMDJkY2JhZWQ2NTcyNzEzY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.rqaAQG04Mt3tT0OpR25hIRyq66rBc2LxiWleXf39Pcc)
![gr-new](https://private-user-images.githubusercontent.com/51322092/303600476-a9e2aac0-b55a-4395-a25b-7eb0e908fdd0.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNzI1MjIsIm5iZiI6MTcyMTI3MjIyMiwicGF0aCI6Ii81MTMyMjA5Mi8zMDM2MDA0NzYtYTllMmFhYzAtYjU1YS00Mzk1LWEyNWItN2ViMGU5MDhmZGQwLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE4VDAzMTAyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMzN2QyZjJmMDljZGVmYTQyNmExMmQwMGJlNzI3ZDRlYTQ3ODYyYmY4YWMwMGQ1MjZkNmZlMTEzZjIzN2U5ZmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0vQM-AhTe8Osg3CMkoRMF2w5Tl4jU8k1IiQtZzsPazc)
after
Additional notes for the reviewer(s)
Thanks for creating this pull request 🤗