From 82b5e5c886ea4e6614feed9de2e9958a68b2d833 Mon Sep 17 00:00:00 2001 From: dej611 Date: Fri, 17 Jul 2020 13:06:17 +0200 Subject: [PATCH] :white_check_mark: Fix testing issues --- .../vislib/lib/types/point_series.test.js | 16 +- .../types/testdata_linechart_percentile.json | 608 ++++++------ ...data_linechart_percentile_float_value.json | 864 +++++++++--------- ...nechart_percentile_float_value_result.json | 331 ++++++- .../testdata_linechart_percentile_result.json | 333 ++++++- 5 files changed, 1401 insertions(+), 751 deletions(-) diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js b/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js index 594dd1ee1b5ca..b46054f3cd983 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js @@ -217,30 +217,26 @@ describe('Point Series Config Type Class Test Suite', function () { }); describe('line chart', function () { - function prepareData(percentileTestdata) { + function prepareData({ cfg, data }) { const percentileDataObj = { get: (prop) => { return maxBucketData[prop] || maxBucketData.data[prop] || null; }, getLabels: () => [], - data: percentileTestdata.data, + data: data, }; - return (parsedConfig = vislibPointSeriesTypes.line( - percentileTestdata.cfg, - percentileDataObj - )); + const parsedConfig = vislibPointSeriesTypes.line(cfg, percentileDataObj); + return parsedConfig; } it('should render a percentile line chart', function () { const parsedConfig = prepareData(percentileTestdata); - expect(JSON.stringify(parsedConfig)).toEqual(JSON.stringify(percentileTestdataResult)); + expect(parsedConfig).toMatchObject(percentileTestdataResult); }); it('should render a percentile line chart when value is float', function () { const parsedConfig = prepareData(percentileTestdataFloatValue); - expect(JSON.stringify(parsedConfig)).toEqual( - JSON.stringify(percentileTestdataFloatValueResult) - ); + expect(parsedConfig).toMatchObject(percentileTestdataFloatValueResult); }); }); }); diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json index 818d9133938fa..d52cb18727c05 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json @@ -140,320 +140,320 @@ } }, "yAxisLabel": "", - "series": [ - { - "id": "1.1", - "rawId": "col-1-1.1", - "label": "1st percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 116.33676605224609, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 + "hits": 2 + }, + "series": [ + { + "id": "1.1", + "rawId": "col-1-1.1", + "label": "1st percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 0, - "value": 116.33676605224609 + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" + "column": 1, + "row": 0, + "value": 116.33676605224609 }, - { - "x": 1557547200000, - "y": 223, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + }, + { + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 1, - "value": 223 + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" - } - ] - }, - { - "id": "1.50", - "rawId": "col-2-1.50", - "label": "50th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 658.8453063964844, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + } + ] + }, + { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 0, - "value": 658 + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" + "column": 2, + "row": 0, + "value": 658 }, - { - "x": 1557547200000, - "y": 756, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 1, - "value": 756.2283554077148 + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - } - ] - } - ], - "hits": 2 - }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + } + ], "type": "series", "labels": [ "1st percentile of AvgTicketPrice", diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json index b8a659faf781e..6e1a707229974 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json @@ -1,465 +1,463 @@ { - "cfg": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, + "cfg": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "dimensions": { - "x": { - "accessor": 0, - "format": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } - }, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "dimensions": { + "x": { + "accessor": 0, + "format": { + "id": "date", "params": { - "date": true, - "interval": "P1D", - "format": "YYYY-MM-DD", - "bounds": { - "min": "2019-05-10T04:00:00.000Z", - "max": "2019-05-12T10:18:57.342Z" - } - }, - "aggType": "date_histogram" + "pattern": "YYYY-MM-DD" + } }, - "y": [ - { - "accessor": 1, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - }, - { - "accessor": 2, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" + "params": { + "date": true, + "interval": "P1D", + "format": "YYYY-MM-DD", + "bounds": { + "min": "2019-05-10T04:00:00.000Z", + "max": "2019-05-12T10:18:57.342Z" } - ] - }, - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } + }, + "aggType": "date_histogram" }, - "legendPosition": "right", - "seriesParams": [ + "y": [ { - "data": { - "id": "1", - "label": "Percentiles of AvgTicketPrice" + "accessor": 1, + "format": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "area", - "valueAxes": [ + "params": {}, + "aggType": "percentiles" + }, { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Percentiles of AvgTicketPrice" + "accessor": 2, + "format": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } }, - "type": "value" + "params": {}, + "aggType": "percentiles" } ] }, - "data": { - "uiState": {}, - "data": { - "xAxisOrderedValues": [ - 1557460800000, - 1557547200000 - ], - "xAxisFormat": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Percentiles of AvgTicketPrice" }, - "xAxisLabel": "timestamp per day", - "ordered": { - "interval": "P1D", - "date": true, - "min": 1557460800000, - "max": 1557656337342 + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "area", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 }, - "yAxisFormat": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Percentiles of AvgTicketPrice" }, - "yAxisLabel": "", - "series": [ + "type": "value" + } + ] + }, + "data": { + "uiState": {}, + "data": { + "xAxisOrderedValues": [ + 1557460800000, + 1557547200000 + ], + "xAxisFormat": { + "id": "date", + "params": { + "pattern": "YYYY-MM-DD" + } + }, + "xAxisLabel": "timestamp per day", + "ordered": { + "interval": "P1D", + "date": true, + "min": 1557460800000, + "max": 1557656337342 + }, + "yAxisFormat": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } + }, + "yAxisLabel": "", + "hits": 2 + }, + "series": [ + { + "id": "1.['1.1']", + "rawId": "col-1-1.['1.1']", + "label": "1.1th percentile of AvgTicketPrice", + "values": [ { - "id": "1.['1.1']", - "rawId": "col-1-1.['1.1']", - "label": "1.1th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 116.33676605224609, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 }, - "column": 1, - "row": 0, - "value": 116.33676605224609 - }, - "parent": null, - "series": "1.1th percentile of AvgTicketPrice", - "seriesId": "col-1-1.['1.1']" + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] }, - { - "x": 1557547200000, - "y": 223, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 }, - "column": 1, - "row": 1, - "value": 223 - }, - "parent": null, - "series": "1.1th percentile of AvgTicketPrice", - "seriesId": "col-1-1.['1.1']" - } - ] + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 0, + "value": 116.33676605224609 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" }, { - "id": "1.50", - "rawId": "col-2-1.50", - "label": "50th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 658.8453063964844, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 }, - "column": 2, - "row": 0, - "value": 658 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] }, - { - "x": 1557547200000, - "y": 756, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" }, - "column": 2, - "row": 1, - "value": 756.2283554077148 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - } - ] + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" } - ], - "hits": 2 + ] }, - "type": "series", - "labels": [ - "1.1th percentile of AvgTicketPrice", - "50th percentile of AvgTicketPrice" - ] - } - + { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 0, + "value": 658 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + } + ], + "type": "series", + "labels": [ + "1.1th percentile of AvgTicketPrice", + "50th percentile of AvgTicketPrice" + ] } - \ No newline at end of file +} \ No newline at end of file diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json index d50d20a70608b..f7dd18f5eb712 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json @@ -122,8 +122,335 @@ { "type": "point_series", "addTimeMarker": false, - "series": [] + "series": [ + { + "show": true, + "type": "area", + "mode": "normal", + "drawLinesBetweenPoints": true, + "showCircles": true, + "data": { + "id": "1.['1.1']", + "rawId": "col-1-1.['1.1']", + "label": "1.1th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 0, + "value": 116.33676605224609 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" + }, + { + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" + } + ] + } + }, + { + "data": { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 0, + "value": 658 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ] } ], "enableHover": true -} +} \ No newline at end of file diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json index d50d20a70608b..02062c987564e 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json @@ -122,8 +122,337 @@ { "type": "point_series", "addTimeMarker": false, - "series": [] + "series": [ + { + "data": { + "id": "1.1", + "rawId": "col-1-1.1", + "label": "1st percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 0, + "value": 116.33676605224609 + }, + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + }, + { + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + } + ] + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 0, + "value": 658 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ] } ], "enableHover": true -} +} \ No newline at end of file