Skip to content

Commit

Permalink
Removed lens_multitable from x-pack/maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuznietsov committed May 6, 2022
1 parent 9b7fe19 commit a8d79a0
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 300 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type {
LegendConfig,
IconPosition,
DataLayerArgs,
LensMultiTable,
ValueLabelMode,
AxisExtentMode,
DataLayerConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
FittingFunctions,
IconPositions,
LayerTypes,
MULTITABLE,
LineStyles,
SeriesTypes,
ValueLabelModes,
Expand Down Expand Up @@ -296,15 +295,6 @@ export type XYExtendedLayerConfigResult =
| ExtendedReferenceLineLayerConfigResult
| ExtendedAnnotationLayerConfigResult;

export interface LensMultiTable {
type: typeof MULTITABLE;
tables: Record<string, Datatable>;
dateRange?: {
fromDate: Date;
toDate: Date;
};
}

export type ReferenceLineLayerConfigResult = ReferenceLineLayerArgs & {
type: typeof REFERENCE_LINE_LAYER;
layerType: typeof LayerTypes.REFERENCELINE;
Expand Down
264 changes: 127 additions & 137 deletions src/plugins/chart_expressions/expression_xy/public/__mocks__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import { Datatable } from '@kbn/expressions-plugin/common';
import { chartPluginMock } from '@kbn/charts-plugin/public/mocks';
import { LensMultiTable } from '../../common';
import { LayerTypes } from '../../common/constants';
import { DataLayerConfig, XYProps } from '../../common/types';
import { mockPaletteOutput, sampleArgs } from '../../common/__mocks__';
Expand All @@ -21,151 +20,142 @@ export const chartsActiveCursorService = chartStartContract.activeCursor;

export const paletteService = chartPluginMock.createPaletteRegistry();

export const dateHistogramData: LensMultiTable = {
type: 'lens_multitable',
tables: {
timeLayer: {
type: 'datatable',
rows: [
{
xAccessorId: 1585758120000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585758360000,
splitAccessorId: "Women's Accessories",
yAccessorId: 1,
},
{
xAccessorId: 1585758360000,
splitAccessorId: "Women's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585759380000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585759380000,
splitAccessorId: "Men's Shoes",
yAccessorId: 1,
},
{
xAccessorId: 1585759380000,
splitAccessorId: "Women's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585760700000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585760760000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585760760000,
splitAccessorId: "Men's Shoes",
yAccessorId: 1,
},
{
xAccessorId: 1585761120000,
splitAccessorId: "Men's Shoes",
yAccessorId: 1,
},
],
columns: [
{
id: 'xAccessorId',
name: 'order_date per minute',
meta: {
type: 'date',
export const dateHistogramData: Datatable = {
type: 'datatable',
rows: [
{
xAccessorId: 1585758120000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585758360000,
splitAccessorId: "Women's Accessories",
yAccessorId: 1,
},
{
xAccessorId: 1585758360000,
splitAccessorId: "Women's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585759380000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585759380000,
splitAccessorId: "Men's Shoes",
yAccessorId: 1,
},
{
xAccessorId: 1585759380000,
splitAccessorId: "Women's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585760700000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585760760000,
splitAccessorId: "Men's Clothing",
yAccessorId: 1,
},
{
xAccessorId: 1585760760000,
splitAccessorId: "Men's Shoes",
yAccessorId: 1,
},
{
xAccessorId: 1585761120000,
splitAccessorId: "Men's Shoes",
yAccessorId: 1,
},
],
columns: [
{
id: 'xAccessorId',
name: 'order_date per minute',
meta: {
type: 'date',
field: 'order_date',
source: 'esaggs',
index: 'indexPatternId',
sourceParams: {
indexPatternId: 'indexPatternId',
type: 'date_histogram',
appliedTimeRange: {
from: '2020-04-01T16:14:16.246Z',
to: '2020-04-01T17:15:41.263Z',
},
params: {
field: 'order_date',
source: 'esaggs',
index: 'indexPatternId',
sourceParams: {
indexPatternId: 'indexPatternId',
type: 'date_histogram',
appliedTimeRange: {
from: '2020-04-01T16:14:16.246Z',
to: '2020-04-01T17:15:41.263Z',
},
params: {
field: 'order_date',
timeRange: { from: '2020-04-01T16:14:16.246Z', to: '2020-04-01T17:15:41.263Z' },
useNormalizedEsInterval: true,
scaleMetricValues: false,
interval: '1m',
drop_partials: false,
min_doc_count: 0,
extended_bounds: {},
},
},
params: { id: 'date', params: { pattern: 'HH:mm' } },
timeRange: { from: '2020-04-01T16:14:16.246Z', to: '2020-04-01T17:15:41.263Z' },
useNormalizedEsInterval: true,
scaleMetricValues: false,
interval: '1m',
drop_partials: false,
min_doc_count: 0,
extended_bounds: {},
},
},
{
id: 'splitAccessorId',
name: 'Top values of category.keyword',
meta: {
type: 'string',
params: { id: 'date', params: { pattern: 'HH:mm' } },
},
},
{
id: 'splitAccessorId',
name: 'Top values of category.keyword',
meta: {
type: 'string',
field: 'category.keyword',
source: 'esaggs',
index: 'indexPatternId',
sourceParams: {
indexPatternId: 'indexPatternId',
type: 'terms',
params: {
field: 'category.keyword',
source: 'esaggs',
index: 'indexPatternId',
sourceParams: {
indexPatternId: 'indexPatternId',
type: 'terms',
params: {
field: 'category.keyword',
orderBy: 'yAccessorId',
order: 'desc',
size: 3,
otherBucket: false,
otherBucketLabel: 'Other',
missingBucket: false,
missingBucketLabel: 'Missing',
},
},
params: {
id: 'terms',
params: {
id: 'string',
otherBucketLabel: 'Other',
missingBucketLabel: 'Missing',
parsedUrl: {
origin: 'http://localhost:5601',
pathname: '/jiy/app/kibana',
basePath: '/jiy',
},
},
},
orderBy: 'yAccessorId',
order: 'desc',
size: 3,
otherBucket: false,
otherBucketLabel: 'Other',
missingBucket: false,
missingBucketLabel: 'Missing',
},
},
{
id: 'yAccessorId',
name: 'Count of records',
meta: {
type: 'number',
source: 'esaggs',
index: 'indexPatternId',
sourceParams: {
indexPatternId: 'indexPatternId',
params: {},
params: {
id: 'terms',
params: {
id: 'string',
otherBucketLabel: 'Other',
missingBucketLabel: 'Missing',
parsedUrl: {
origin: 'http://localhost:5601',
pathname: '/jiy/app/kibana',
basePath: '/jiy',
},
params: { id: 'number' },
},
},
],
},
},
{
id: 'yAccessorId',
name: 'Count of records',
meta: {
type: 'number',
source: 'esaggs',
index: 'indexPatternId',
sourceParams: {
indexPatternId: 'indexPatternId',
params: {},
},
params: { id: 'number' },
},
},
},
dateRange: {
fromDate: new Date('2020-04-01T16:14:16.246Z'),
toDate: new Date('2020-04-01T17:15:41.263Z'),
},
],
};

export const dateHistogramLayer: DataLayerConfig = {
Expand All @@ -181,7 +171,7 @@ export const dateHistogramLayer: DataLayerConfig = {
seriesType: 'bar_stacked',
accessors: ['yAccessorId'],
palette: mockPaletteOutput,
table: dateHistogramData.tables.timeLayer,
table: dateHistogramData,
};

export function sampleArgsWithReferenceLine(value: number = 150) {
Expand Down
Loading

0 comments on commit a8d79a0

Please sign in to comment.