From 2304ce30f9aa633a87b722f1664c923b7c1972bc Mon Sep 17 00:00:00 2001 From: dubsky Date: Mon, 26 Oct 2020 12:03:03 +0100 Subject: [PATCH] fix: formatting & swagger go compatibility check --- dashboard.go | 65 ++++++++++++++++++++++++------------------------ http/swagger.yml | 7 ++---- 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/dashboard.go b/dashboard.go index 5b6967dbab..8158132f67 100644 --- a/dashboard.go +++ b/dashboard.go @@ -562,7 +562,7 @@ func MarshalViewPropertiesJSON(v ViewProperties) ([]byte, error) { Shape string `json:"shape"` GeoViewProperties }{ - Shape: "chronograf-v2", + Shape: "chronograf-v2", GeoViewProperties: vis, } case XYViewProperties: @@ -968,44 +968,45 @@ type GaugeViewProperties struct { // Geographical coordinates type Datum struct { - Lat float64 `json:"lat"` - Lon float64 `json:"lon"` + Lat float64 `json:"lat"` + Lon float64 `json:"lon"` } + // Single visualization layer properties of a chronograf map widget type GeoLayer struct { - Type string `json:"type"` - RadiusField string `json:"radiusField"` - ColorField string `json:"colorField"` - IntensityField string `json:"intensityField"` - // circle layer properties - ViewColors []ViewColor `json:"colors"` - Radius int32 `json:"radius"` - Blur int32 `json:"blur"` - RadiusDimension Axis `json:"radiusDimension"` - ColorDimension Axis `json:"colorDimension"` - IntensityDimension Axis `json:"intensityDimension"` - InterpolateColors bool `json:"interpolateColors"` - // track layer properties - TrackWidth int32 `json:"trackWidth"` - Speed int32 `json:"speed"` - RandomColors bool `json:"randomColors"` - // point layer properties - IsClustered bool `json:"isClustered"` + Type string `json:"type"` + RadiusField string `json:"radiusField"` + ColorField string `json:"colorField"` + IntensityField string `json:"intensityField"` + // circle layer properties + ViewColors []ViewColor `json:"colors"` + Radius int32 `json:"radius"` + Blur int32 `json:"blur"` + RadiusDimension Axis `json:"radiusDimension"` + ColorDimension Axis `json:"colorDimension"` + IntensityDimension Axis `json:"intensityDimension"` + InterpolateColors bool `json:"interpolateColors"` + // track layer properties + TrackWidth int32 `json:"trackWidth"` + Speed int32 `json:"speed"` + RandomColors bool `json:"randomColors"` + // point layer properties + IsClustered bool `json:"isClustered"` } // GeoViewProperties represents options for map view in Chronograf type GeoViewProperties struct { - Type string `json:"type"` - Queries []DashboardQuery `json:"queries"` - Center Datum `json:"center"` - Zoom float64 `json:"zoom"` - MapStyle string `json:"mapStyle"` - AllowPanAndZoom bool `json:"allowPanAndZoom"` - DetectCoordinateFields bool `json:"detectCoordinateFields"` - ViewColor []ViewColor `json:"colors"` - GeoLayers []GeoLayer `json:"layers"` - Note string `json:"note"` - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + Type string `json:"type"` + Queries []DashboardQuery `json:"queries"` + Center Datum `json:"center"` + Zoom float64 `json:"zoom"` + MapStyle string `json:"mapStyle"` + AllowPanAndZoom bool `json:"allowPanAndZoom"` + DetectCoordinateFields bool `json:"detectCoordinateFields"` + ViewColor []ViewColor `json:"colors"` + GeoLayers []GeoLayer `json:"layers"` + Note string `json:"note"` + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` } // TableViewProperties represents options for table view in Chronograf diff --git a/http/swagger.yml b/http/swagger.yml index 6a7387fcfc..749625d3de 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -9781,10 +9781,6 @@ components: type: type: string enum: [ heatmap, circleMap, pointMap, trackMap] - FieldLegendProperties: - type: object - properties: - label: string GeoCircleViewLayer: allOf: - $ref: "#/components/schemas/GeoViewLayerProperties" @@ -9902,7 +9898,8 @@ components: format: double zoom: description: Zoom level used for initial display of the map - type: float64 + type: number + format: double minimum: 1 maximum: 28 allowPanAndZoom: