[Visualizations] Adds dimensionName in datatable meta info (#107265)
* [Visualizations] Adds dimensionName in datatable meta info * Delete unused file * fix i18n * Another fix of i18n * Fix translations * Remove double types * Fix types * Another type fix Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
402702d55b
commit
4d3aed52a1
|
@ -1,5 +1,25 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`interpreter/functions#metric logs correct datatable to inspector 1`] = `
|
||||
Object {
|
||||
"columns": Array [
|
||||
Object {
|
||||
"id": "col-0-1",
|
||||
"meta": Object {
|
||||
"dimensionName": undefined,
|
||||
},
|
||||
"name": "Count",
|
||||
},
|
||||
],
|
||||
"rows": Array [
|
||||
Object {
|
||||
"col-0-1": 0,
|
||||
},
|
||||
],
|
||||
"type": "datatable",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`interpreter/functions#metric returns an object with the correct structure 1`] = `
|
||||
Object {
|
||||
"as": "metric_vis",
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import { createMetricVisFn } from './metric_vis_fn';
|
||||
import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils';
|
||||
import { Datatable } from '../../expressions/common/expression_types/specs';
|
||||
|
||||
describe('interpreter/functions#metric', () => {
|
||||
const fn = functionWrapper(createMetricVisFn());
|
||||
|
@ -56,4 +57,20 @@ describe('interpreter/functions#metric', () => {
|
|||
|
||||
expect(actual).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('logs correct datatable to inspector', async () => {
|
||||
let loggedTable: Datatable;
|
||||
const handlers = {
|
||||
inspectorAdapters: {
|
||||
tables: {
|
||||
logDatatable: (name: string, datatable: Datatable) => {
|
||||
loggedTable = datatable;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
await fn(context, args, handlers as any);
|
||||
|
||||
expect(loggedTable!).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
Style,
|
||||
} from '../../expressions/public';
|
||||
import { visType, DimensionsVisParam, VisParams } from './types';
|
||||
import { prepareLogTable, Dimension } from '../../visualizations/public';
|
||||
import { ColorSchemas, vislibColorMaps, ColorMode } from '../../charts/public';
|
||||
|
||||
export type Input = Datatable;
|
||||
|
@ -164,7 +165,24 @@ export const createMetricVisFn = (): MetricVisExpressionFunctionDefinition => ({
|
|||
const fontSize = Number.parseInt(args.font.spec.fontSize || '', 10);
|
||||
|
||||
if (handlers?.inspectorAdapters?.tables) {
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', input);
|
||||
const argsTable: Dimension[] = [
|
||||
[
|
||||
args.metric,
|
||||
i18n.translate('visTypeMetric.function.dimension.metric', {
|
||||
defaultMessage: 'Metric',
|
||||
}),
|
||||
],
|
||||
];
|
||||
if (args.bucket) {
|
||||
argsTable.push([
|
||||
[args.bucket],
|
||||
i18n.translate('visTypeMetric.function.adimension.splitGroup', {
|
||||
defaultMessage: 'Split group',
|
||||
}),
|
||||
]);
|
||||
}
|
||||
const logTable = prepareLogTable(input, argsTable);
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', logTable);
|
||||
}
|
||||
return {
|
||||
type: 'render',
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`interpreter/functions#table logs correct datatable to inspector 1`] = `
|
||||
Object {
|
||||
"columns": Array [
|
||||
Object {
|
||||
"id": "col-0-1",
|
||||
"meta": Object {
|
||||
"dimensionName": "Metrics",
|
||||
},
|
||||
"name": "Count",
|
||||
},
|
||||
],
|
||||
"rows": Array [
|
||||
Object {
|
||||
"col-0-1": 0,
|
||||
},
|
||||
],
|
||||
"type": "datatable",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`interpreter/functions#table returns an object with the correct structure 1`] = `
|
||||
Object {
|
||||
"as": "table_vis",
|
||||
|
|
|
@ -10,6 +10,7 @@ import { createTableVisFn } from './table_vis_fn';
|
|||
import { tableVisResponseHandler } from './utils';
|
||||
|
||||
import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils';
|
||||
import { Datatable } from '../../expressions/common/expression_types/specs';
|
||||
|
||||
jest.mock('./utils', () => ({
|
||||
tableVisResponseHandler: jest.fn().mockReturnValue({
|
||||
|
@ -67,4 +68,20 @@ describe('interpreter/functions#table', () => {
|
|||
expect(tableVisResponseHandler).toHaveBeenCalledTimes(1);
|
||||
expect(tableVisResponseHandler).toHaveBeenCalledWith(context, visConfig);
|
||||
});
|
||||
|
||||
it('logs correct datatable to inspector', async () => {
|
||||
let loggedTable: Datatable;
|
||||
const handlers = {
|
||||
inspectorAdapters: {
|
||||
tables: {
|
||||
logDatatable: (name: string, datatable: Datatable) => {
|
||||
loggedTable = datatable;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
await fn(context, visConfig, handlers as any);
|
||||
|
||||
expect(loggedTable!).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { ExpressionFunctionDefinition, Datatable, Render } from '../../expressions/public';
|
||||
import { prepareLogTable, Dimension } from '../../visualizations/public';
|
||||
import { TableVisData, TableVisConfig } from './types';
|
||||
import { VIS_TYPE_TABLE } from '../common';
|
||||
import { tableVisResponseHandler } from './utils';
|
||||
|
@ -122,7 +123,38 @@ export const createTableVisFn = (): TableExpressionFunctionDefinition => ({
|
|||
const convertedData = tableVisResponseHandler(input, args);
|
||||
|
||||
if (handlers?.inspectorAdapters?.tables) {
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', input);
|
||||
const argsTable: Dimension[] = [
|
||||
[
|
||||
args.metrics,
|
||||
i18n.translate('visTypeTable.function.dimension.metrics', {
|
||||
defaultMessage: 'Metrics',
|
||||
}),
|
||||
],
|
||||
[
|
||||
args.buckets,
|
||||
i18n.translate('visTypeTable.function.adimension.buckets', {
|
||||
defaultMessage: 'Buckets',
|
||||
}),
|
||||
],
|
||||
];
|
||||
if (args.splitColumn) {
|
||||
argsTable.push([
|
||||
[args.splitColumn],
|
||||
i18n.translate('visTypeTable.function.dimension.splitColumn', {
|
||||
defaultMessage: 'Split by column',
|
||||
}),
|
||||
]);
|
||||
}
|
||||
if (args.splitRow) {
|
||||
argsTable.push([
|
||||
[args.splitRow],
|
||||
i18n.translate('visTypeTable.function.dimension.splitRow', {
|
||||
defaultMessage: 'Split by row',
|
||||
}),
|
||||
]);
|
||||
}
|
||||
const logTable = prepareLogTable(input, argsTable);
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', logTable);
|
||||
}
|
||||
return {
|
||||
type: 'render',
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`interpreter/functions#tagcloud logs correct datatable to inspector 1`] = `
|
||||
Object {
|
||||
"columns": Array [
|
||||
Object {
|
||||
"id": "col-0-1",
|
||||
"meta": Object {
|
||||
"dimensionName": "Tag size",
|
||||
},
|
||||
"name": "Count",
|
||||
},
|
||||
],
|
||||
"rows": Array [
|
||||
Object {
|
||||
"col-0-1": 0,
|
||||
},
|
||||
],
|
||||
"type": "datatable",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`interpreter/functions#tagcloud returns an object with the correct structure 1`] = `
|
||||
Object {
|
||||
"as": "tagloud_vis",
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
import { createTagCloudFn } from './tag_cloud_fn';
|
||||
|
||||
import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils';
|
||||
import { Datatable } from '../../expressions/common/expression_types/specs';
|
||||
|
||||
describe('interpreter/functions#tagcloud', () => {
|
||||
const fn = functionWrapper(createTagCloudFn());
|
||||
|
@ -31,4 +32,20 @@ describe('interpreter/functions#tagcloud', () => {
|
|||
const actual = fn(context, visConfig, undefined);
|
||||
expect(actual).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('logs correct datatable to inspector', async () => {
|
||||
let loggedTable: Datatable;
|
||||
const handlers = {
|
||||
inspectorAdapters: {
|
||||
tables: {
|
||||
logDatatable: (name: string, datatable: Datatable) => {
|
||||
loggedTable = datatable;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
await fn(context, visConfig, handlers as any);
|
||||
|
||||
expect(loggedTable!).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { ExpressionFunctionDefinition, Datatable, Render } from '../../expressions/public';
|
||||
import { prepareLogTable, Dimension } from '../../visualizations/public';
|
||||
import { TagCloudVisParams, TagCloudVisConfig } from './types';
|
||||
|
||||
const name = 'tagcloud';
|
||||
|
@ -109,7 +110,24 @@ export const createTagCloudFn = (): TagcloudExpressionFunctionDefinition => ({
|
|||
} as TagCloudVisParams;
|
||||
|
||||
if (handlers?.inspectorAdapters?.tables) {
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', input);
|
||||
const argsTable: Dimension[] = [
|
||||
[
|
||||
[args.metric],
|
||||
i18n.translate('visTypeTagCloud.function.dimension.tagSize', {
|
||||
defaultMessage: 'Tag size',
|
||||
}),
|
||||
],
|
||||
];
|
||||
if (args.bucket) {
|
||||
argsTable.push([
|
||||
[args.bucket],
|
||||
i18n.translate('visTypeTagCloud.function.adimension.tags', {
|
||||
defaultMessage: 'Tags',
|
||||
}),
|
||||
]);
|
||||
}
|
||||
const logTable = prepareLogTable(input, argsTable);
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', logTable);
|
||||
}
|
||||
return {
|
||||
type: 'render',
|
||||
|
|
|
@ -15,7 +15,9 @@ import {
|
|||
VisParams,
|
||||
} from '../../visualizations/public';
|
||||
import { buildExpression, buildExpressionFunction } from '../../expressions/public';
|
||||
import type { Dimensions, DateHistogramParams, HistogramParams } from '../../vis_type_xy/public';
|
||||
import type { Dimensions } from '../../vis_type_xy/public';
|
||||
import type { DateHistogramParams, HistogramParams } from '../../visualizations/public';
|
||||
|
||||
import { BUCKET_TYPES } from '../../data/public';
|
||||
|
||||
import { vislibVisName, VisTypeVislibExpressionFunctionDefinition } from './vis_type_vislib_vis_fn';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import moment from 'moment';
|
||||
|
||||
import type { DateHistogramParams, HistogramParams } from '../../../../../vis_type_xy/public';
|
||||
import type { DateHistogramParams, HistogramParams } from '../../../../../visualizations/public';
|
||||
|
||||
import { initXAxis } from './_init_x_axis';
|
||||
import { makeFakeXAspect } from './_fake_x_aspect';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import moment from 'moment';
|
||||
import _ from 'lodash';
|
||||
|
||||
import type { DateHistogramParams } from '../../../../../vis_type_xy/public/types';
|
||||
import type { DateHistogramParams } from '../../../../../visualizations/public';
|
||||
|
||||
import { orderedDateAxis } from './_ordered_date_axis';
|
||||
import { OrderedChart } from './point_series';
|
||||
|
|
|
@ -8,12 +8,8 @@
|
|||
|
||||
import { Duration } from 'moment';
|
||||
|
||||
import type {
|
||||
Dimension,
|
||||
Dimensions,
|
||||
DateHistogramParams,
|
||||
HistogramParams,
|
||||
} from '../../../../../vis_type_xy/public';
|
||||
import type { Dimension, Dimensions } from '../../../../../vis_type_xy/public';
|
||||
import type { DateHistogramParams, HistogramParams } from '../../../../../visualizations/public';
|
||||
|
||||
import { getSeries } from './_get_series';
|
||||
import { getAspects } from './_get_aspects';
|
||||
|
|
|
@ -10,11 +10,11 @@ import { ScaleContinuousType } from '@elastic/charts';
|
|||
|
||||
import { Datatable } from '../../../expressions/public';
|
||||
import { BUCKET_TYPES } from '../../../data/public';
|
||||
import { DateHistogramParams } from '../../../visualizations/public';
|
||||
|
||||
import {
|
||||
Aspect,
|
||||
AxisConfig,
|
||||
DateHistogramParams,
|
||||
SeriesParam,
|
||||
VisConfig,
|
||||
VisParams,
|
||||
|
|
|
@ -15,4 +15,3 @@ export { seriesParam, ExpressionValueSeriesParam } from './series_param';
|
|||
export { thresholdLine, ExpressionValueThresholdLine } from './threshold_line';
|
||||
export { label, ExpressionValueLabel } from './label';
|
||||
export { visScale, ExpressionValueScale } from './vis_scale';
|
||||
export { xyDimension, ExpressionValueXYDimension } from './xy_dimension';
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import type { ExpressionFunctionDefinition, Datatable, Render } from '../../../expressions/public';
|
||||
import type { ExpressionFunctionDefinition, Datatable, Render } from '../../../expressions/common';
|
||||
import { prepareLogTable, Dimension } from '../../../visualizations/public';
|
||||
import type { ChartType } from '../../common';
|
||||
import type { VisParams, XYVisConfig } from '../types';
|
||||
|
||||
|
@ -262,7 +263,44 @@ export const visTypeXyVisFn = (): VisTypeXyExpressionFunctionDefinition => ({
|
|||
} as VisParams;
|
||||
|
||||
if (handlers?.inspectorAdapters?.tables) {
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', context);
|
||||
const argsTable: Dimension[] = [
|
||||
[
|
||||
args.yDimension,
|
||||
i18n.translate('visTypeXy.function.dimension.metric', {
|
||||
defaultMessage: 'Metric',
|
||||
}),
|
||||
],
|
||||
[
|
||||
args.zDimension,
|
||||
i18n.translate('visTypeXy.function.adimension.dotSize', {
|
||||
defaultMessage: 'Dot size',
|
||||
}),
|
||||
],
|
||||
[
|
||||
args.splitColumnDimension,
|
||||
i18n.translate('visTypeXy.function.dimension.splitcolumn', {
|
||||
defaultMessage: 'Column split',
|
||||
}),
|
||||
],
|
||||
[
|
||||
args.splitRowDimension,
|
||||
i18n.translate('visTypeXy.function.dimension.splitrow', {
|
||||
defaultMessage: 'Row split',
|
||||
}),
|
||||
],
|
||||
];
|
||||
|
||||
if (args.xDimension) {
|
||||
argsTable.push([
|
||||
[args.xDimension],
|
||||
i18n.translate('visTypeXy.function.adimension.bucket', {
|
||||
defaultMessage: 'Bucket',
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
const logTable = prepareLogTable(context, argsTable);
|
||||
handlers.inspectorAdapters.tables.logDatatable('default', logTable);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -22,8 +22,6 @@ export {
|
|||
Dimensions,
|
||||
ScaleType,
|
||||
AxisType,
|
||||
HistogramParams,
|
||||
DateHistogramParams,
|
||||
} from './types';
|
||||
export type { ValidationVisOptionsProps } from './editor/components/common/validation_wrapper';
|
||||
export { TruncateLabelsOption } from './editor/components/common/truncate_labels';
|
||||
|
|
|
@ -77,7 +77,6 @@ export class VisTypeXyPlugin
|
|||
expressions.registerFunction(expressionFunctions.thresholdLine);
|
||||
expressions.registerFunction(expressionFunctions.label);
|
||||
expressions.registerFunction(expressionFunctions.visScale);
|
||||
expressions.registerFunction(expressionFunctions.xyDimension);
|
||||
|
||||
visTypesDefinitions.forEach(visualizations.createBaseVisualization);
|
||||
}
|
||||
|
|
|
@ -8,16 +8,19 @@
|
|||
|
||||
import moment from 'moment';
|
||||
|
||||
import { VisToExpressionAst, getVisSchemas } from '../../visualizations/public';
|
||||
import {
|
||||
VisToExpressionAst,
|
||||
getVisSchemas,
|
||||
DateHistogramParams,
|
||||
HistogramParams,
|
||||
} from '../../visualizations/public';
|
||||
import { buildExpression, buildExpressionFunction } from '../../expressions/public';
|
||||
import { BUCKET_TYPES } from '../../data/public';
|
||||
import { Labels } from '../../charts/public';
|
||||
|
||||
import {
|
||||
DateHistogramParams,
|
||||
Dimensions,
|
||||
Dimension,
|
||||
HistogramParams,
|
||||
VisParams,
|
||||
CategoryAxis,
|
||||
SeriesParam,
|
||||
|
|
|
@ -8,7 +8,13 @@
|
|||
|
||||
import type { Fit, Position } from '@elastic/charts';
|
||||
import type { Style, Labels, PaletteOutput } from '../../../charts/public';
|
||||
import type { SchemaConfig } from '../../../visualizations/public';
|
||||
import type {
|
||||
SchemaConfig,
|
||||
ExpressionValueXYDimension,
|
||||
FakeParams,
|
||||
HistogramParams,
|
||||
DateHistogramParams,
|
||||
} from '../../../visualizations/public';
|
||||
import type { ChartType, XyVisType } from '../../common';
|
||||
import type {
|
||||
ExpressionValueCategoryAxis,
|
||||
|
@ -17,7 +23,6 @@ import type {
|
|||
ExpressionValueLabel,
|
||||
ExpressionValueThresholdLine,
|
||||
ExpressionValueTimeMarker,
|
||||
ExpressionValueXYDimension,
|
||||
} from '../expression_functions';
|
||||
|
||||
import type {
|
||||
|
@ -96,26 +101,6 @@ export interface TimeMarker {
|
|||
width?: number;
|
||||
}
|
||||
|
||||
export interface DateHistogramParams {
|
||||
date: boolean;
|
||||
interval: number;
|
||||
intervalESValue: number;
|
||||
intervalESUnit: string;
|
||||
format: string;
|
||||
bounds?: {
|
||||
min: string | number;
|
||||
max: string | number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface HistogramParams {
|
||||
interval: number;
|
||||
}
|
||||
|
||||
export interface FakeParams {
|
||||
defaultValue: string;
|
||||
}
|
||||
|
||||
export type Dimension = Omit<SchemaConfig, 'params'> & {
|
||||
params: DateHistogramParams | HistogramParams | FakeParams | {};
|
||||
};
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
|
||||
import { AccessorFn, Accessor } from '@elastic/charts';
|
||||
import { BUCKET_TYPES } from '../../../data/public';
|
||||
import { FakeParams, Aspect } from '../types';
|
||||
import { FakeParams } from '../../../visualizations/public';
|
||||
import { Aspect } from '../types';
|
||||
|
||||
export const COMPLEX_X_ACCESSOR = '__customXAccessor__';
|
||||
export const COMPLEX_SPLIT_ACCESSOR = '__complexSplitAccessor__';
|
||||
|
|
|
@ -13,8 +13,9 @@ import { DomainRange } from '@elastic/charts';
|
|||
|
||||
import { getAdjustedInterval } from '../../../charts/public';
|
||||
import { Datatable } from '../../../expressions/public';
|
||||
import { DateHistogramParams, HistogramParams } from '../../../visualizations/public';
|
||||
|
||||
import { Aspect, DateHistogramParams, HistogramParams } from '../types';
|
||||
import { Aspect } from '../types';
|
||||
|
||||
export const getXDomain = (params: Aspect['params']): DomainRange => {
|
||||
const minInterval = (params as DateHistogramParams | HistogramParams)?.interval ?? undefined;
|
||||
|
|
|
@ -7,13 +7,35 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { ExpressionValueVisDimension } from '../../../visualizations/public';
|
||||
import type { ExpressionValueVisDimension } from './vis_dimension';
|
||||
|
||||
import type {
|
||||
ExpressionFunctionDefinition,
|
||||
Datatable,
|
||||
ExpressionValueBoxed,
|
||||
} from '../../../expressions/public';
|
||||
import type { Dimension } from '../types';
|
||||
Datatable,
|
||||
DatatableColumn,
|
||||
SerializedFieldFormat,
|
||||
} from '../../../expressions/common';
|
||||
|
||||
export interface DateHistogramParams {
|
||||
date: boolean;
|
||||
interval: number;
|
||||
intervalESValue: number;
|
||||
intervalESUnit: string;
|
||||
format: string;
|
||||
bounds?: {
|
||||
min: string | number;
|
||||
max: string | number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface HistogramParams {
|
||||
interval: number;
|
||||
}
|
||||
|
||||
export interface FakeParams {
|
||||
defaultValue: string;
|
||||
}
|
||||
|
||||
interface Arguments {
|
||||
visDimension: ExpressionValueVisDimension;
|
||||
|
@ -27,9 +49,9 @@ export type ExpressionValueXYDimension = ExpressionValueBoxed<
|
|||
{
|
||||
label: string;
|
||||
aggType: string;
|
||||
params: Dimension['params'];
|
||||
accessor: number;
|
||||
format: Dimension['format'];
|
||||
params: DateHistogramParams | HistogramParams | FakeParams | {};
|
||||
accessor: number | DatatableColumn;
|
||||
format: SerializedFieldFormat;
|
||||
}
|
||||
>;
|
||||
|
||||
|
@ -40,34 +62,34 @@ export const xyDimension = (): ExpressionFunctionDefinition<
|
|||
ExpressionValueXYDimension
|
||||
> => ({
|
||||
name: 'xydimension',
|
||||
help: i18n.translate('visTypeXy.function.xydimension.help', {
|
||||
help: i18n.translate('visualizations.function.xydimension.help', {
|
||||
defaultMessage: 'Generates xy dimension object',
|
||||
}),
|
||||
type: 'xy_dimension',
|
||||
args: {
|
||||
visDimension: {
|
||||
types: ['vis_dimension'],
|
||||
help: i18n.translate('visTypeXy.function.xyDimension.visDimension.help', {
|
||||
help: i18n.translate('visualizations.function.xyDimension.visDimension.help', {
|
||||
defaultMessage: 'Dimension object config',
|
||||
}),
|
||||
required: true,
|
||||
},
|
||||
label: {
|
||||
types: ['string'],
|
||||
help: i18n.translate('visTypeXy.function.xyDimension.label.help', {
|
||||
help: i18n.translate('visualizations.function.xyDimension.label.help', {
|
||||
defaultMessage: 'Label',
|
||||
}),
|
||||
},
|
||||
aggType: {
|
||||
types: ['string'],
|
||||
help: i18n.translate('visTypeXy.function.xyDimension.aggType.help', {
|
||||
help: i18n.translate('visualizations.function.xyDimension.aggType.help', {
|
||||
defaultMessage: 'Aggregation type',
|
||||
}),
|
||||
},
|
||||
params: {
|
||||
types: ['string'],
|
||||
default: '"{}"',
|
||||
help: i18n.translate('visTypeXy.function.xyDimension.params.help', {
|
||||
help: i18n.translate('visualizations.function.xyDimension.params.help', {
|
||||
defaultMessage: 'Params',
|
||||
}),
|
||||
},
|
|
@ -7,9 +7,13 @@
|
|||
*/
|
||||
|
||||
import { ExpressionValueVisDimension } from './expression_functions/vis_dimension';
|
||||
import { ExpressionValueXYDimension } from './expression_functions/xy_dimension';
|
||||
import { Datatable } from '../../expressions/common/expression_types/specs';
|
||||
|
||||
export type Dimension = [ExpressionValueVisDimension[] | undefined, string];
|
||||
export type Dimension = [
|
||||
Array<ExpressionValueVisDimension | ExpressionValueXYDimension> | undefined,
|
||||
string
|
||||
];
|
||||
|
||||
const getDimensionName = (columnIndex: number, dimensions: Dimension[]) => {
|
||||
for (const dimension of dimensions) {
|
||||
|
|
|
@ -41,5 +41,11 @@ export {
|
|||
} from './types';
|
||||
export { VisualizationListItem, VisualizationStage } from './vis_types/vis_type_alias_registry';
|
||||
export { VISUALIZE_ENABLE_LABS_SETTING } from '../common/constants';
|
||||
export { SavedVisState, VisParams, prepareLogTable } from '../common';
|
||||
export { SavedVisState, VisParams, prepareLogTable, Dimension } from '../common';
|
||||
export { ExpressionValueVisDimension } from '../common/expression_functions/vis_dimension';
|
||||
export {
|
||||
ExpressionValueXYDimension,
|
||||
DateHistogramParams,
|
||||
FakeParams,
|
||||
HistogramParams,
|
||||
} from '../common/expression_functions/xy_dimension';
|
||||
|
|
|
@ -33,6 +33,7 @@ import {
|
|||
import { TypesService } from './vis_types/types_service';
|
||||
import { range as rangeExpressionFunction } from '../common/expression_functions/range';
|
||||
import { visDimension as visDimensionExpressionFunction } from '../common/expression_functions/vis_dimension';
|
||||
import { xyDimension as xyDimensionExpressionFunction } from '../common/expression_functions/xy_dimension';
|
||||
|
||||
import { createStartServicesGetter, StartServicesGetter } from '../../kibana_utils/public';
|
||||
import { createSavedVisLoader, SavedVisualizationsLoader } from './saved_visualizations';
|
||||
|
@ -138,6 +139,7 @@ export class VisualizationsPlugin
|
|||
|
||||
expressions.registerFunction(rangeExpressionFunction);
|
||||
expressions.registerFunction(visDimensionExpressionFunction);
|
||||
expressions.registerFunction(xyDimensionExpressionFunction);
|
||||
const embeddableFactory = new VisualizeEmbeddableFactory({ start });
|
||||
embeddable.registerEmbeddableFactory(VISUALIZE_EMBEDDABLE_TYPE, embeddableFactory);
|
||||
|
||||
|
|
|
@ -5198,11 +5198,11 @@
|
|||
"visTypeXy.function.valueAxis.axisParams.help": "値軸パラメーター",
|
||||
"visTypeXy.function.valueaxis.help": "値軸オブジェクトを生成します",
|
||||
"visTypeXy.function.valueAxis.name.help": "値軸の名前",
|
||||
"visTypeXy.function.xyDimension.aggType.help": "集約タイプ",
|
||||
"visTypeXy.function.xydimension.help": "XYディメンションオブジェクトを生成します",
|
||||
"visTypeXy.function.xyDimension.label.help": "ラベル",
|
||||
"visTypeXy.function.xyDimension.params.help": "パラメーター",
|
||||
"visTypeXy.function.xyDimension.visDimension.help": "ディメンションオブジェクト構成",
|
||||
"visualizations.function.xyDimension.aggType.help": "集約タイプ",
|
||||
"visualizations.function.xydimension.help": "XYディメンションオブジェクトを生成します",
|
||||
"visualizations.function.xyDimension.label.help": "ラベル",
|
||||
"visualizations.function.xyDimension.params.help": "パラメーター",
|
||||
"visualizations.function.xyDimension.visDimension.help": "ディメンションオブジェクト構成",
|
||||
"visTypeXy.functions.help": "XYビジュアライゼーション",
|
||||
"visTypeXy.histogram.groupTitle": "系列を分割",
|
||||
"visTypeXy.histogram.histogramDescription": "軸の縦棒にデータを表示します。",
|
||||
|
|
|
@ -5225,11 +5225,11 @@
|
|||
"visTypeXy.function.valueAxis.axisParams.help": "值轴参数",
|
||||
"visTypeXy.function.valueaxis.help": "生成值轴对象",
|
||||
"visTypeXy.function.valueAxis.name.help": "值轴的名称",
|
||||
"visTypeXy.function.xyDimension.aggType.help": "聚合类型",
|
||||
"visTypeXy.function.xydimension.help": "生成 xy 维度对象",
|
||||
"visTypeXy.function.xyDimension.label.help": "标签",
|
||||
"visTypeXy.function.xyDimension.params.help": "参数",
|
||||
"visTypeXy.function.xyDimension.visDimension.help": "维度对象配置",
|
||||
"visualizations.function.xyDimension.aggType.help": "聚合类型",
|
||||
"visualizations.function.xydimension.help": "生成 xy 维度对象",
|
||||
"visualizations.function.xyDimension.label.help": "标签",
|
||||
"visualizations.function.xyDimension.params.help": "参数",
|
||||
"visualizations.function.xyDimension.visDimension.help": "维度对象配置",
|
||||
"visTypeXy.functions.help": "XY 可视化",
|
||||
"visTypeXy.histogram.groupTitle": "拆分序列",
|
||||
"visTypeXy.histogram.histogramDescription": "在轴上以垂直条形图的形式呈现数据。",
|
||||
|
|
Loading…
Reference in a new issue