-
Notifications
You must be signed in to change notification settings - Fork 2
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 support for big number in the card and chart components #85
base: main
Are you sure you want to change the base?
Conversation
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 the improvements! In addition to the requested changes, did you test this change in GeneXus using the Angular Generator with some queries? It would be good to check the new behavior in a e2e case.
package.json
Outdated
@@ -67,6 +67,7 @@ | |||
"dependencies": { | |||
"@genexus/reporting-api": "~3.1.0", | |||
"@genexus/web-controls-library": "2.3.0", | |||
"@genexus/web-standard-functions": "file:///C:/PROJECTS/genexus/web-standard-functions/dist/lib-esm", |
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.
This should be a peer dependency to not force the version in this repo. Also, this should point to @genexus/web-standard-functions
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.
Great! I did this because I understood that could be necesary to modify some web-standard-function code before start working, but actually it wasn't so I will remove that. Thanks!
@@ -302,13 +306,15 @@ const showDataAsMapping: { | |||
// @todo Complete the implementation of this function by comparing it to the Web implementation | |||
export function valueOrPercentage( |
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.
[valueOrPercentage]
It would be nice to add some tests using this utility with different values to validates the new behavior.
@@ -1524,7 +1524,7 @@ function groupPoints( | |||
dateStr: null, | |||
name: null | |||
}; | |||
let pointAdd: { x: string; y: number; name: string }; | |||
let pointAdd: { x: string; y: GxBigNumber; name: string }; |
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.
[groupPoints]
It would be nice to add some tests using this utility with different values to validates the new behavior.
@@ -512,7 +513,7 @@ function aggregatePoints(chartSerie: QueryViewerChartSerie) { | |||
}); | |||
const value = aggregate( | |||
chartSerie.Aggregation, | |||
currentYValues, | |||
currentYValues.map(val => new GxBigNumber(val)), |
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.
[aggregatePoints]
It would be nice to add some tests using this utility with different values to validates the new behavior.
src/utils/general.ts
Outdated
@@ -122,76 +125,94 @@ function evaluate( | |||
|
|||
const aggregateMap: { |
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.
[aggregateMap]
It would be nice to add some tests using this utility with different values to validates the new behavior.
) => { | ||
return aggregateMap[aggregation || QueryViewerAggregationType.Sum]( | ||
values, | ||
quantities | ||
); | ||
}; |
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.
) => { | |
return aggregateMap[aggregation || QueryViewerAggregationType.Sum]( | |
values, | |
quantities | |
); | |
}; | |
) => | |
aggregateMap[aggregation || QueryViewerAggregationType.Sum]( | |
values, | |
quantities | |
); |
src/utils/general.ts
Outdated
) => { | ||
return new GxBigNumber(quantities.reduce((a, b) => a + b, 0)); | ||
}, |
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.
) => { | |
return new GxBigNumber(quantities.reduce((a, b) => a + b, 0)); | |
}, | |
) => new GxBigNumber(quantities.reduce((a, b) => a + b, 0)); |
src/utils/general.ts
Outdated
values, | ||
quantities | ||
); | ||
}; | ||
|
||
function aggregateDatum( |
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.
[aggregateDatum]
It would be nice to add some tests using this utility with different values to validates the new behavior.
src/utils/general.ts
Outdated
) => { | ||
return new GxBigNumber(quantities.reduce((a, b) => a + b, 0)); | ||
}, |
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.
) => { | |
return new GxBigNumber(quantities.reduce((a, b) => a + b, 0)); | |
}, | |
) => | |
new GxBigNumber(quantities.reduce((a, b) => a + b, 0)); |
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.
Hi Nico, thanks for the review!, I was actually tryng to upload a created branch, so this way to be able to collaborate in the feature, but I couldn't do it. Maybe I need some permissions?
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.
I've sent you an invitation.
…alueOrPercentage function tests
Labels and tooltips of the charts now show data as string wihout parsing, showing more precision
labels/tooltips
…eporting-controls-library into feature/gxBigNumber
- aggregateMap - aggregateDatum - groupPoints - aggregatePoints - valueOrPercentage
…@genexus/web-standard-functions
- Update calculate function, to handle operator precedence with custom BigNumber operations - Add Test for calculate function - Add aggregateDatum tests when isFormula and Sum - Add aggregateDatum tests when isFormula and Count
Use gxBigNumber for charts and card data manipulation