Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ const datatableStateSharedOptionsSchema = {
* Sorting configuration
*/
sort_by: schema.maybe(sortingSchema),
/**
* Whether to show row numbers
*/
show_row_numbers: schema.maybe(
schema.boolean({ meta: { description: 'Whether to show row numbers' } })
),
};

const datatableStateCommonOptionsSchema = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,27 @@ const gaugeStateMetricOptionsSchema = {
),
};

const gaugeStateExtraOptionsSchema = {
/**
* Whether to respect the palette ranges for min/max
*/
respect_ranges: schema.maybe(
schema.boolean({ meta: { description: 'Whether to respect palette ranges for min/max' } })
),
/**
* Common label outside the chart
*/
common_label: schema.maybe(
schema.string({ meta: { description: 'Common label outside the chart' } })
),
/**
* Accessibility label for the chart
*/
aria_label: schema.maybe(
schema.string({ meta: { description: 'Accessibility label for the chart' } })
),
};

export const gaugeStateSchemaNoESQL = schema.object(
{
type: schema.literal('gauge'),
Expand All @@ -121,6 +142,7 @@ export const gaugeStateSchemaNoESQL = schema.object(
...layerSettingsSchema,
...datasetSchema,
...gaugeStateSharedOptionsSchema,
...gaugeStateExtraOptionsSchema,
/**
* Primary value configuration, must define operation.
*/
Expand All @@ -139,6 +161,7 @@ export const gaugeStateSchemaESQL = schema.object(
...layerSettingsSchema,
...datasetEsqlTableSchema,
...gaugeStateSharedOptionsSchema,
...gaugeStateExtraOptionsSchema,
/**
* Primary value configuration, must define operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const legendSchemaProps = {
visible: schema.maybe(schema.boolean({ meta: { description: 'Whether to show the legend' } })),
size: legendSizeSchema,
position: schema.maybe(positionSchema({ meta: { description: 'Legend position' } })),
should_truncate: schema.maybe(
schema.boolean({ meta: { description: 'Whether to truncate legend items' } })
),
};

const labelsSchemaProps = {
Expand Down Expand Up @@ -94,10 +97,23 @@ const heatmapSharedStateSchema = {
),
})
),
stroke_width: schema.maybe(
schema.number({ meta: { description: 'Grid cell border width in pixels' } })
),
stroke_color: schema.maybe(
schema.string({ meta: { description: 'Grid cell border color' } })
),
},
{ meta: { id: 'heatmapCells', description: 'Cells configuration' } }
)
),
percentage_mode: schema.maybe(
schema.boolean({ meta: { description: 'Whether to show values as percentages' } })
),
show_tooltip: schema.maybe(schema.boolean({ meta: { description: 'Whether to show tooltips' } })),
highlight_in_hover: schema.maybe(
schema.boolean({ meta: { description: 'Whether to highlight cells on legend hover' } })
),
};

const heatmapAxesStateSchemaProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
} from './shared';
import {
horizontalAlignmentSchema,
verticalAlignmentSchema,
leftRightAlignmentSchema,
beforeAfterAlignmentSchema,
} from '../alignments';
Expand Down Expand Up @@ -173,6 +174,26 @@ const metricStatePrimaryMetricOptionsSchema = {
* Where to apply the color (background or value)
*/
apply_color_to: schema.maybe(applyColorToSchema),
/**
* Position of the primary metric value. Possible values:
* - 'top': Value appears above the labels
* - 'bottom': Value appears below the labels
*/
position: schema.maybe(
verticalAlignmentSchema({
meta: { description: 'Position of the primary metric value (top or bottom)' },
})
),
/**
* Font weight for title and subtitle. Possible values:
* - 'bold': Bold font weight
* - 'normal': Normal font weight
*/
title_weight: schema.maybe(
schema.oneOf([schema.literal('bold'), schema.literal('normal')], {
meta: { description: 'Font weight for title and subtitle' },
})
),
};

const metricStateSecondaryMetricOptionsSchema = {
Expand Down Expand Up @@ -213,6 +234,26 @@ const metricStateSecondaryMetricOptionsSchema = {
),
])
),
/**
* Alignments for the secondary metric value.
*/
alignments: schema.maybe(
schema.object(
{
/**
* Alignment for secondary value. Possible values:
* - 'left': Align value to the left
* - 'center': Align value to the center
* - 'right': Align value to the right
*/
value: horizontalAlignmentSchema({
meta: { description: 'Alignment for secondary value' },
defaultValue: LENS_METRIC_STATE_DEFAULTS.secondaryAlign,
}),
},
{ meta: { id: 'metricSecondaryMetricAlignments' } }
)
),
/**
* Color configuration
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
sharedPanelInfoSchema,
} from '../shared';
import { legendNestedSchema, legendVisibleSchema, valueDisplaySchema } from './partition_shared';
import { positionSchema } from '../alignments';
import {
legendSizeSchema,
mergeAllBucketsWithChartDimensionSchema,
Expand All @@ -35,6 +36,15 @@ const mosaicStateSharedSchema = {
truncate_after_lines: legendTruncateAfterLinesSchema,
visible: legendVisibleSchema,
size: legendSizeSchema,
position: schema.maybe(positionSchema({ meta: { description: 'Legend position' } })),
values: schema.maybe(
schema.arrayOf(
schema.oneOf([schema.literal('value'), schema.literal('percent')], {
meta: { description: 'Legend value display mode' },
}),
{ maxSize: 2 }
)
),
},
{
meta: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
validateColoringAssignments,
valueDisplaySchema,
} from './partition_shared';
import { positionSchema } from '../alignments';
import { groupIsNotCollapsed } from '../../utils';

/**
Expand All @@ -44,6 +45,15 @@ const pieStateSharedSchema = {
truncate_after_lines: legendTruncateAfterLinesSchema,
visible: legendVisibleSchema,
size: legendSizeSchema,
position: schema.maybe(positionSchema({ meta: { description: 'Legend position' } })),
values: schema.maybe(
schema.arrayOf(
schema.oneOf([schema.literal('value'), schema.literal('percent')], {
meta: { description: 'Legend value display mode' },
}),
{ maxSize: 2 }
)
),
},
{ meta: { id: 'pieLegend', description: 'Legend configuration for pie/donut chart' } }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
validateColoringAssignments,
valueDisplaySchema,
} from './partition_shared';
import { positionSchema } from '../alignments';
import {
legendSizeSchema,
mergeAllBucketsWithChartDimensionSchema,
Expand All @@ -42,6 +43,15 @@ const treemapSharedStateSchema = {
truncate_after_lines: legendTruncateAfterLinesSchema,
visible: legendVisibleSchema,
size: legendSizeSchema,
position: schema.maybe(positionSchema({ meta: { description: 'Legend position' } })),
values: schema.maybe(
schema.arrayOf(
schema.oneOf([schema.literal('value'), schema.literal('percent')], {
meta: { description: 'Legend value display mode' },
}),
{ maxSize: 2 }
)
),
},
{
meta: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
validateMultipleMetricsCriteria,
valueDisplaySchema,
} from './partition_shared';
import { positionSchema } from '../alignments';
import {
legendSizeSchema,
mergeAllBucketsWithChartDimensionSchema,
Expand Down Expand Up @@ -51,6 +52,7 @@ export const waffleStateSharedSchema = {
truncate_after_lines: legendTruncateAfterLinesSchema,
visible: legendVisibleSchema,
size: legendSizeSchema,
position: schema.maybe(positionSchema({ meta: { description: 'Legend position' } })),
},
{ meta: { id: 'waffleLegend', description: 'Legend configuration for waffle chart' } }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ const referenceLineLayerShared = {
})
),
color: schema.maybe(staticColorSchema),
decoration_position: schema.maybe(
schema.oneOf([schema.literal('auto'), schema.literal('left'), schema.literal('right')], {
meta: { description: 'Position of the icon and label relative to the reference line' },
})
),
axis: schema.maybe(
schema.oneOf([schema.literal('bottom'), schema.literal('left'), schema.literal('right')], {
defaultValue: 'left',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ import { serializedValueSchema } from './serializedValue';

const colorByValueBase = schema.object({
type: schema.literal('dynamic'), // Specifies that the color assignment is dynamic (by value). Possible value: 'dynamic'
/**
* Controls the open/closed nature of the first and last color ranges.
* Possible values:
* - 'above': Last range extends to infinity
* - 'below': First range extends to negative infinity
* - 'all': Both first and last ranges are open-ended
* - 'none': All ranges are closed
*/
continuity: schema.maybe(
schema.oneOf(
[
schema.literal('above'),
schema.literal('below'),
schema.literal('all'),
schema.literal('none'),
],
{ meta: { description: 'Controls the open/closed nature of the color ranges' } }
)
),

/**
* Array of color steps defining the mapping from values to colors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export const fullConfigDatatableWithAdhocDataView: DatatableState = {
},
},
paging: 10,
show_row_numbers: true,
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ export const fullConfigDatatableAttributes: LensAttributes = {
headerRowHeight: 'auto',
headerRowHeightLines: 'auto',
rowHeightLines: 3,
showRowNumbers: true,
paging: {
size: 10,
enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export const comprehensiveGaugeWithAdHocDataView: GaugeState = {
index: 'comprehensive-index',
time_field: '@timestamp',
},
respect_ranges: true,
common_label: 'Bytes',
aria_label: 'Gauge chart',
metric: {
operation: 'average',
field: 'bytes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export const gaugeAttributes: LensAttributes = {
ticksPosition: 'bands',
labelMajorMode: 'auto',
labelMinor: 'Bytes Subtitle',
respectRanges: true,
commonLabel: 'Bytes',
ariaLabel: 'Gauge chart',
metricAccessor: '2ba2f501-1bca-4423-95b8-a5b92b05f5f5',
colorMode: 'palette',
minAccessor: 'a2ed356d-14fe-4066-9428-cec4a453cb7b',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ export const simple: LensAttributes = {
shape: 'heatmap',
layerId: '1df843f3-7796-4cef-a87d-babfbb85cd37',
layerType: 'data',
percentageMode: true,
showTooltip: true,
highlightInHover: false,
legend: {
isVisible: true,
position: 'right',
type: 'heatmap_legend',
shouldTruncate: true,
},
gridConfig: {
type: 'heatmap_grid',
Expand All @@ -31,6 +35,8 @@ export const simple: LensAttributes = {
isXAxisLabelVisible: true,
isYAxisTitleVisible: true,
isXAxisTitleVisible: true,
strokeWidth: 2,
strokeColor: '#000',
},
valueAccessor: 'e43d2fd3-5fdc-43c6-94db-d4ed285ebaff',
xAccessor: '290700e9-5d95-43f4-a22f-00f688499b9d',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const complexMetricAPIAttributes = {
percentile: 95,
},
},
position: 'top',
title_weight: 'normal',
},
{
type: 'secondary',
Expand All @@ -72,6 +74,9 @@ export const complexMetricAPIAttributes = {
palette: 'status',
value: false,
},
alignments: {
value: 'left',
},
},
],
breakdown_by: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ export const complexMetricAttributes: LensAttributes = {
maxAccessor: 'f041d9d0-db1d-4648-8320-a58449159841',
color: '#FFf',
showBar: true,
primaryPosition: 'top',
titleWeight: 'normal',
secondaryAlign: 'left',
secondaryTrend: {
type: 'none',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export const esqlCharts = [
legend: {
visible: 'auto',
nested: false,
position: 'left',
values: ['value'],
},
value_display: {
mode: 'percentage',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export const treemapLegacyBasicState = {
numberDisplay: 'percent',
legendDisplay: 'default',
nestedLegend: true,
legendPosition: 'left',
collapseFns: {},
categoryDisplay: 'default',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export const referenceLineXY: LensAttributes = {
{
axisMode: 'left',
color: '#e5281e',
iconPosition: 'left',
forAccessor: 'd661ac91-a1bc-45cc-bd62-b01cdf81199f',
},
],
Expand Down
Loading
Loading