Open 100pah opened 3 years ago
Would be great to have this feature 💯
@100pah Seems like a pretty useful feature
This feature seems really helpful. 👍
Yes, this feature is very helpful. Would be great to have this feature.
It is a very great feature. It would be very helpful to have this feature.
Any update on merging this?
This feature that i really want it. cannot wait
At present the there is only a simplest aggregate transformer in echarts-simple-transform/aggregate. We should better implement a built-in aggregate transformer in echarts.
About the API
Think of whether the API of echarts-simple-transform/aggregate appropriate.
About group by
In echarts-simple-transform/aggregate only on dimension can be set in group by. Do we need to support multiple dimension group by?
About Methods
Some
methods
of aggregate already roughly implemented in echarts-simple-transform/aggregate:sum
count
first
average
Q1
Q2
/median
Q3
min
max
We need to make sure they are implemented correctly.
Other methods we may implement:
distinct
: The count of distinct dimension values.variance
: The sample variance of dimension values.variancep
: The population variance of dimension values.stdev
: The sample standard deviation of dimension values.stdevp
: The population standard deviation of dimension values.stderr
: The standard error of dimension values.product
: The product of dimension values.valid
: The count of dimension values that are notnull
,undefined
,''
,NaN
,'-'
, or determined by user defined validation function.Some references: vega aggregate.
About math calculation precision
We all known that the floating precision issue (like
0.1 + 0.2
). It might bring trouble in some scenarios like:Some cases:
We should also take care the
toFixed bug
like:Solution:
multipleSafe
in appropriate place.See: IEEE 754, http://0.30000000000000004.com/, https://github.com/camsong/blog/issues/9, https://javascript.info/number#imprecise-calculations, ... (lots of related references)
Some library:
About big number
Do not support.
Test
Could find some test cases in some other math libraries.