feat(plugin-chart-echarts): support non-timeseries x-axis (#17917)

* feat(plugin-chart-echarts): support non-timeseries x-axis

* fix tests

* change formula return type from Date to number

* add x_axis test coverage

* rename func and improve coverage

* add x-axis control to bar chart

* remove redundant console.log

* fix description

* make x-axis control mandatory

* 🙃

* fix x-axis formatter

* fix showValues

* fix implicit rDTTM_ALIAS references in postProcessing

* replace TIME_COLUMN with DTTM_ALIAS

* fix remaining implicit indexes

* fix: Disable filtering on wide result sets (#18021)

* fix: handle null values in time-series table (#18039)

* cleanup column_type_mappings (#17569)

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>

* important change to MakeFile (#18037)

* add missing is_timeseries to pivot op

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>
Co-authored-by: Grace Guo <grace.guo@airbnb.com>
Co-authored-by: Đặng Minh Dũng <dungdm93@live.com>
Co-authored-by: AAfghahi <48933336+AAfghahi@users.noreply.github.com>
This commit is contained in:
Ville Brofeldt
2022-01-21 21:23:23 +02:00
committed by GitHub
parent b083b3421f
commit e9651ea52f
42 changed files with 489 additions and 201 deletions

View File

@@ -17,14 +17,14 @@
* under the License.
*/
import {
AnnotationSourceType,
AnnotationStyle,
AnnotationType,
ChartProps,
EventAnnotationLayer,
FormulaAnnotationLayer,
IntervalAnnotationLayer,
TimeseriesAnnotationLayer,
AnnotationStyle,
AnnotationType,
AnnotationSourceType,
} from '@superset-ui/core';
import transformProps from '../../src/Timeseries/transformProps';
@@ -35,6 +35,7 @@ describe('EchartsTimeseries transformProps', () => {
granularity_sqla: 'ds',
metric: 'sum__num',
groupby: ['foo', 'bar'],
viz_type: 'my_viz',
};
const queriesData = [
{
@@ -64,15 +65,15 @@ describe('EchartsTimeseries transformProps', () => {
series: expect.arrayContaining([
expect.objectContaining({
data: [
[new Date(599616000000), 1],
[new Date(599916000000), 3],
[599616000000, 1],
[599916000000, 3],
],
name: 'San Francisco',
}),
expect.objectContaining({
data: [
[new Date(599616000000), 2],
[new Date(599916000000), 4],
[599616000000, 2],
[599916000000, 4],
],
name: 'New York',
}),
@@ -88,8 +89,8 @@ describe('EchartsTimeseries transformProps', () => {
annotationType: AnnotationType.Formula,
value: 'x+1',
style: AnnotationStyle.Solid,
showLabel: true,
show: true,
showLabel: true,
};
const chartProps = new ChartProps({
...chartPropsConfig,
@@ -109,22 +110,22 @@ describe('EchartsTimeseries transformProps', () => {
series: expect.arrayContaining([
expect.objectContaining({
data: [
[new Date(599616000000), 1],
[new Date(599916000000), 3],
[599616000000, 1],
[599916000000, 3],
],
name: 'San Francisco',
}),
expect.objectContaining({
data: [
[new Date(599616000000), 2],
[new Date(599916000000), 4],
[599616000000, 2],
[599916000000, 4],
],
name: 'New York',
}),
expect.objectContaining({
data: [
[new Date(599616000000), 599616000001],
[new Date(599916000000), 599916000001],
[599616000000, 599616000001],
[599916000000, 599916000001],
],
name: 'My Formula',
}),