1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.monitoring.dashboard.v1; 18 19import "google/monitoring/dashboard/v1/widget.proto"; 20 21option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; 22option go_package = "cloud.google.com/go/monitoring/dashboard/apiv1/dashboardpb;dashboardpb"; 23option java_multiple_files = true; 24option java_outer_classname = "LayoutsProto"; 25option java_package = "com.google.monitoring.dashboard.v1"; 26option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; 27option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; 28 29// A basic layout divides the available space into vertical columns of equal 30// width and arranges a list of widgets using a row-first strategy. 31message GridLayout { 32 // The number of columns into which the view's width is divided. If omitted 33 // or set to zero, a system default will be used while rendering. 34 int64 columns = 1; 35 36 // The informational elements that are arranged into the columns row-first. 37 repeated Widget widgets = 2; 38} 39 40// A mosaic layout divides the available space into a grid of blocks, and 41// overlays the grid with tiles. Unlike `GridLayout`, tiles may span multiple 42// grid blocks and can be placed at arbitrary locations in the grid. 43message MosaicLayout { 44 // A single tile in the mosaic. The placement and size of the tile are 45 // configurable. 46 message Tile { 47 // The zero-indexed position of the tile in grid blocks relative to the 48 // left edge of the grid. Tiles must be contained within the specified 49 // number of columns. `x_pos` cannot be negative. 50 int32 x_pos = 1; 51 52 // The zero-indexed position of the tile in grid blocks relative to the 53 // top edge of the grid. `y_pos` cannot be negative. 54 int32 y_pos = 2; 55 56 // The width of the tile, measured in grid blocks. Tiles must have a 57 // minimum width of 1. 58 int32 width = 3; 59 60 // The height of the tile, measured in grid blocks. Tiles must have a 61 // minimum height of 1. 62 int32 height = 4; 63 64 // The informational widget contained in the tile. For example an `XyChart`. 65 Widget widget = 5; 66 } 67 68 // The number of columns in the mosaic grid. The number of columns must be 69 // between 1 and 12, inclusive. 70 int32 columns = 1; 71 72 // The tiles to display. 73 repeated Tile tiles = 3; 74} 75 76// A simplified layout that divides the available space into rows 77// and arranges a set of widgets horizontally in each row. 78message RowLayout { 79 // Defines the layout properties and content for a row. 80 message Row { 81 // The relative weight of this row. The row weight is used to adjust the 82 // height of rows on the screen (relative to peers). Greater the weight, 83 // greater the height of the row on the screen. If omitted, a value 84 // of 1 is used while rendering. 85 int64 weight = 1; 86 87 // The display widgets arranged horizontally in this row. 88 repeated Widget widgets = 2; 89 } 90 91 // The rows of content to display. 92 repeated Row rows = 1; 93} 94 95// A simplified layout that divides the available space into vertical columns 96// and arranges a set of widgets vertically in each column. 97message ColumnLayout { 98 // Defines the layout properties and content for a column. 99 message Column { 100 // The relative weight of this column. The column weight is used to adjust 101 // the width of columns on the screen (relative to peers). 102 // Greater the weight, greater the width of the column on the screen. 103 // If omitted, a value of 1 is used while rendering. 104 int64 weight = 1; 105 106 // The display widgets arranged vertically in this column. 107 repeated Widget widgets = 2; 108 } 109 110 // The columns of content to display. 111 repeated Column columns = 1; 112} 113