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

Fixes for test app crashes for 12 schema data #33542

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

srmukher
Copy link
Contributor

@srmukher srmukher commented Jan 2, 2025

Fixes for test app crashes for 12 schema data

Fixed schema data numbers 84, 85, 88, 91, 92, 93, 99, 100, 101, 102, 103, 107

@srmukher srmukher requested a review from a team as a code owner January 2, 2025 11:03
Copy link

github-actions bot commented Jan 2, 2025

📊 Bundle size report

✅ No changes found

Copy link

github-actions bot commented Jan 2, 2025

Pull request demo site: URL

@@ -65,6 +66,35 @@ export const updateXValues = (xValues: any[]): any[] => {
});
return xValues;
};

function parseDateFromString(dateString: string): Date | null {
Copy link
Contributor

Choose a reason for hiding this comment

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

parseDateFromString

does Date.parse not take care of these cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no this is for the cases if the dateString is of any format like "2021 Q1". If it contains date string, parseDateFromString will then parse it and return the date.

Copy link
Contributor

Choose a reason for hiding this comment

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

what is the output for 2021 Q1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

new Date(2021)

Copy link
Contributor

Choose a reason for hiding this comment

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

and for 2121 Q2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for data: "x": [
"2020 Q1",
"2020 Q2",
"2020 Q3",
"2020 Q4",
"2021 Q1",
"2021 Q2",
"2021 Q3",
"2021 Q4",
"2022 Q1",
"2022 Q2"
],
"y": [75, 78, 80, 82, 85, 88, 90, 92, 95, 97],

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not getting what is 2020 Q2 getting transformed into. What line of code is doing this conversion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Every year if present is getting extracted as it is without the Q2 and created as a Date. For "2020 Q2" it is new Date(2020) as well as for "2020 Q3".

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not correct. Q1, Q2, Q3, Q4 should have different x values. In such case we can fall back on vertical stacked bar chart and render x value as string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the string can be anything like "2021 Quater1" or something else, the entire string cannot be used to convert to a unique Date string. So, falling back would be best here.

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