Skip to content

Commit

Permalink
Sprint3 alpha (#64) (#931)
Browse files Browse the repository at this point in the history
* Sprint3 alpha (#64)

Signed-off-by: abasatwar <[email protected]>

* issues resolved and snapshots updated

Signed-off-by: Shankha Das <[email protected]>

* 2 snapshots updated

Signed-off-by: Shankha Das <[email protected]>

Signed-off-by: abasatwar <[email protected]>
Signed-off-by: Shankha Das <[email protected]>
Co-authored-by: Shankha Das <[email protected]>
  • Loading branch information
abasatwar and shankha-das authored Aug 10, 2022
1 parent 5a18297 commit 29a73c9
Show file tree
Hide file tree
Showing 45 changed files with 1,851 additions and 495 deletions.
16 changes: 16 additions & 0 deletions dashboards-observability/common/constants/data_table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export const GRID_HEADER_COLUMN_MAX_WIDTH = '150px';
export const GRID_PAGE_RANGE_DISPLAY = 5;
export const COLUMN_DEFAULT_MIN_WIDTH = 100;
export const GRID_PAGE_SIZES = [10, 50, 100];
export const ROW_DENSITIES = [
{ icon: 'tableDensityExpanded', height: 55, selected: false },
{ icon: 'tableDensityNormal', height: 45, selected: false },
{ icon: 'tableDensityCompact', height: 35, selected: true },
];

export const HEADER_HEIGHT = 35;
1 change: 1 addition & 0 deletions dashboards-observability/common/constants/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const VIZ_CONTAIN_XY_AXIS = [
visChartTypes.Histogram,
visChartTypes.Line,
visChartTypes.Pie,
visChartTypes.Scatter,
];

// default ppl aggregation method options
Expand Down
74 changes: 44 additions & 30 deletions dashboards-observability/common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const pageStyles: CSS.Properties = {
maxWidth: '1130px',
};


export enum visChartTypes {
Bar = 'bar',
HorizontalBar = 'horizontal_bar',
Expand All @@ -82,13 +81,15 @@ export enum visChartTypes {
Text = 'text',
Gauge = 'gauge',
Histogram = 'histogram',
TreeMap = 'tree_map'
TreeMap = 'tree_map',
Scatter = 'scatter',
LogsView = 'logs_view',
}

export interface ValueOptionsAxes {
xaxis ?: IField[];
yaxis ?: IField[];
zaxis ?: IField[];
xaxis?: IField[];
yaxis?: IField[];
zaxis?: IField[];
childField?: IField[];
valueField?: IField[];
series?: IField[];
Expand All @@ -97,72 +98,85 @@ export interface ValueOptionsAxes {

export const NUMERICAL_FIELDS = ['short', 'integer', 'long', 'float', 'double'];

export const ENABLED_VIS_TYPES = [visChartTypes.Bar, visChartTypes.HorizontalBar, visChartTypes.Line, visChartTypes.Pie, visChartTypes.HeatMap, visChartTypes.Text, visChartTypes.TreeMap, visChartTypes.Gauge, visChartTypes.Histogram];
export const ENABLED_VIS_TYPES = [
visChartTypes.Bar,
visChartTypes.HorizontalBar,
visChartTypes.Line,
visChartTypes.Pie,
visChartTypes.HeatMap,
visChartTypes.Text,
visChartTypes.TreeMap,
visChartTypes.Gauge,
visChartTypes.Histogram,
visChartTypes.Scatter,
visChartTypes.LogsView,
];

//Live tail constants
export const LIVE_OPTIONS = [
{
label:'5s',
label: '5s',
startTime: 'now-5s',
delayTime: 5000,
},
{
label:'10s',
label: '10s',
startTime: 'now-10s',
delayTime: 10000,
},
{
label:'30s',
label: '30s',
startTime: 'now-30s',
delayTime: 30000,
},
{
label:'1m',
label: '1m',
startTime: 'now-1m',
delayTime: 60000,
},
{
label:'5m',
label: '5m',
startTime: 'now-5m',
delayTime: 60000 * 5,
},
{
label:'15m',
label: '15m',
startTime: 'now-15m',
delayTime: 60000 * 15,
},
{
label:'30m',
label: '30m',
startTime: 'now-30m',
delayTime: 60000 * 30,
},
{
label:'1h',
label: '1h',
startTime: 'now-1h',
delayTime: 60000 * 60,
},
{
label:'2h',
label: '2h',
startTime: 'now-2h',
delayTime: 60000 * 120,
},
];

export const LIVE_END_TIME ='now';
export const LIVE_END_TIME = 'now';
export interface DefaultChartStylesProps {
DefaultMode: string,
Interpolation: string,
LineWidth: number,
FillOpacity: number,
MarkerSize: number,
ShowLegend: string,
LegendPosition: string,
LabelAngle: number,
DefaultSortSectors: string,
};
DefaultModeLine: string;
Interpolation: string;
LineWidth: number;
FillOpacity: number;
MarkerSize: number;
ShowLegend: string;
LegendPosition: string;
LabelAngle: number;
DefaultSortSectors: string;
DefaultModeScatter: string;
}

export const DefaultChartStyles: DefaultChartStylesProps = {
DefaultMode: 'lines',
DefaultModeLine: 'lines',
Interpolation: 'spline',
LineWidth: 2,
FillOpacity: 40,
Expand All @@ -171,7 +185,7 @@ export const DefaultChartStyles: DefaultChartStylesProps = {
LegendPosition: 'v',
LabelAngle: 0,
DefaultSortSectors: 'largest_to_smallest',
}

export const FILLOPACITY_DIV_FACTOR = 200;
DefaultModeScatter: 'markers',
};

export const FILLOPACITY_DIV_FACTOR = 200;
30 changes: 28 additions & 2 deletions dashboards-observability/common/types/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
SELECTED_TIMESTAMP,
SELECTED_DATE_RANGE,
} from '../constants/explorer';
import { CoreStart, HttpStart, NotificationsStart } from '../../../../src/core/public';
import { CoreStart, HttpSetup, HttpStart, NotificationsStart } from '../../../../src/core/public';
import SavedObjects from '../../public/services/saved_objects/event_analytics/saved_objects';
import TimestampUtils from '../../public/services/timestamp/timestamp';
import PPLService from '../../public/services/requests/ppl';
Expand Down Expand Up @@ -151,6 +151,31 @@ export interface SavedVizRes {
tenant: string;
}

export interface ExplorerDataType {
jsonData: object[];
jsonDataAll: object[];
}

export interface Query {
finalQuery: string;
index: string;
isLoaded: boolean;
objectType: string;
rawQuery: string;
savedObjectId: string;
selectedDateRange: string[];
selectedTimestamp: string;
tabCreatedType: string;
}

export interface ExplorerData {
explorerData?: ExplorerDataType;
explorerFields?: IExplorerFields;
query?: Query;
http?: HttpSetup;
pplService?: PPLService;
}

export interface IVisualizationContainerPropsData {
appData?: { fromApp: boolean };
rawVizData?: any;
Expand All @@ -161,6 +186,7 @@ export interface IVisualizationContainerPropsData {
xaxis: IField[];
yaxis: IField[];
};
explorer?: ExplorerData;
}

export interface IVisualizationContainerPropsVis {
Expand Down Expand Up @@ -190,7 +216,7 @@ export interface IConfigPanelOptionSection {
mapTo: string;
props?: any;
isSingleSelection?: boolean;
defaultState?: number;
defaultState?: boolean | string;
eleType?: string;
}

Expand Down
Loading

0 comments on commit 29a73c9

Please sign in to comment.