feat: add legendHide for the tooltip (#21547)

pull/21555/head^2
Timmy Luong 2021-05-25 10:31:50 -07:00 committed by GitHub
parent 19b0470ed7
commit b0d62f0c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 57 additions and 0 deletions

View File

@ -12,6 +12,7 @@ This release adds an embedded SQLite database for storing metadata required by t
1. [21531](https://github.com/influxdata/influxdb/pull/21531): Remove feature flags for permanent UI features
1. [21543](https://github.com/influxdata/influxdb/pull/21543): Added `influxd` configuration flag `--sqlite-path` for specifying a user-defined path to the SQLite database file
1. [21543](https://github.com/influxdata/influxdb/pull/21543): Updated `influxd` configuration flag `--store` to work with string values `disk` or `memory`. Memory continues to store metadata in-memory for testing; `disk` will persist metadata to disk via bolt and SQLite
1. [21547](https://github.com/influxdata/influxdb/pull/21547): Allow hiding the tooltip independently of the static legend
### Bug Fixes

View File

@ -755,6 +755,7 @@ type LinePlusSingleStatProperties struct {
TimeFormat string `json:"timeFormat"`
HoverDimension string `json:"hoverDimension"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}
@ -784,6 +785,7 @@ type XYViewProperties struct {
TimeFormat string `json:"timeFormat"`
HoverDimension string `json:"hoverDimension"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}
@ -814,6 +816,7 @@ type BandViewProperties struct {
MainColumn string `json:"mainColumn"`
LowerColumn string `json:"lowerColumn"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}
@ -825,6 +828,7 @@ type CheckViewProperties struct {
Queries []DashboardQuery `json:"queries"`
ViewColors []string `json:"colors"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}
@ -857,6 +861,7 @@ type HistogramViewProperties struct {
Note string `json:"note"`
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}
@ -889,6 +894,7 @@ type HeatmapViewProperties struct {
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
TimeFormat string `json:"timeFormat"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}
@ -922,6 +928,7 @@ type ScatterViewProperties struct {
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
TimeFormat string `json:"timeFormat"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}
@ -953,6 +960,7 @@ type MosaicViewProperties struct {
TimeFormat string `json:"timeFormat"`
HoverDimension string `json:"hoverDimension"`
LegendColorizeRows bool `json:"legendColorizeRows"`
LegendHide bool `json:"legendHide"`
LegendOpacity float64 `json:"legendOpacity"`
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
}

View File

@ -64,6 +64,7 @@ func TestView_MarshalJSON(t *testing.T) {
"timeFormat": "",
"hoverDimension": "",
"legendColorizeRows": false,
"legendHide": false,
"legendOpacity": 0,
"legendOrientationThreshold": 0
}

View File

@ -507,6 +507,7 @@ func TestService_handleGetDashboard(t *testing.T) {
"yTickStart": 0,
"yTickStep": 0,
"legendColorizeRows": false,
"legendHide": false,
"legendOpacity": 0,
"legendOrientationThreshold": 0
},
@ -1034,6 +1035,7 @@ func TestService_handlePostDashboard(t *testing.T) {
"yTickStep": 0,
"type": "xy",
"legendColorizeRows": false,
"legendHide": false,
"legendOpacity": 0,
"legendOrientationThreshold": 0
},

View File

@ -790,6 +790,7 @@ func convertCellView(cell influxdb.Cell) chart {
ch.NoteOnEmpty = p.ShowNoteWhenEmpty
ch.BinSize = int(p.BinSize)
ch.LegendColorizeRows = p.LegendColorizeRows
ch.LegendHide = p.LegendHide
ch.LegendOpacity = float64(p.LegendOpacity)
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
case influxdb.HistogramViewProperties:
@ -804,6 +805,7 @@ func convertCellView(cell influxdb.Cell) chart {
ch.BinCount = p.BinCount
ch.Position = p.Position
ch.LegendColorizeRows = p.LegendColorizeRows
ch.LegendHide = p.LegendHide
ch.LegendOpacity = float64(p.LegendOpacity)
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
case influxdb.MarkdownViewProperties:
@ -829,6 +831,7 @@ func convertCellView(cell influxdb.Cell) chart {
ch.YTickStep = p.YTickStep
ch.Position = p.Position
ch.LegendColorizeRows = p.LegendColorizeRows
ch.LegendHide = p.LegendHide
ch.LegendOpacity = float64(p.LegendOpacity)
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
case influxdb.SingleStatViewProperties:
@ -856,6 +859,7 @@ func convertCellView(cell influxdb.Cell) chart {
ch.Note = p.Note
ch.NoteOnEmpty = p.ShowNoteWhenEmpty
ch.LegendColorizeRows = p.LegendColorizeRows
ch.LegendHide = p.LegendHide
ch.LegendOpacity = float64(p.LegendOpacity)
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
case influxdb.ScatterViewProperties:
@ -879,6 +883,7 @@ func convertCellView(cell influxdb.Cell) chart {
ch.Note = p.Note
ch.NoteOnEmpty = p.ShowNoteWhenEmpty
ch.LegendColorizeRows = p.LegendColorizeRows
ch.LegendHide = p.LegendHide
ch.LegendOpacity = float64(p.LegendOpacity)
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
case influxdb.TableViewProperties:
@ -920,6 +925,7 @@ func convertCellView(cell influxdb.Cell) chart {
ch.MainColumn = p.MainColumn
ch.LowerColumn = p.LowerColumn
ch.LegendColorizeRows = p.LegendColorizeRows
ch.LegendHide = p.LegendHide
ch.LegendOpacity = float64(p.LegendOpacity)
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
case influxdb.XYViewProperties:
@ -943,6 +949,7 @@ func convertCellView(cell influxdb.Cell) chart {
ch.YTickStep = p.YTickStep
ch.Position = p.Position
ch.LegendColorizeRows = p.LegendColorizeRows
ch.LegendHide = p.LegendHide
ch.LegendOpacity = float64(p.LegendOpacity)
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
}
@ -1081,6 +1088,7 @@ func convertChartToResource(ch chart) Resource {
fieldChartNoteOnEmpty: ch.NoteOnEmpty,
fieldChartShade: ch.Shade,
fieldChartLegendColorizeRows: ch.LegendColorizeRows,
fieldChartLegendHide: ch.LegendHide,
fieldChartStaticLegendColorizeRows: ch.StaticLegend.ColorizeRows,
fieldChartStaticLegendHide: ch.StaticLegend.Hide,
fieldChartGeoAllowPanAndZoom: ch.AllowPanAndZoom,

View File

@ -1504,6 +1504,7 @@ func (p *Template) parseChart(dashMetaName string, chartIdx int, r Resource) (*c
MainColumn: r.stringShort(fieldChartMainColumn),
LowerColumn: r.stringShort(fieldChartLowerColumn),
LegendColorizeRows: r.boolShort(fieldChartLegendColorizeRows),
LegendHide: r.boolShort(fieldChartLegendHide),
LegendOpacity: r.float64Short(fieldChartLegendOpacity),
LegendOrientationThreshold: r.intShort(fieldChartLegendOrientationThreshold),
Zoom: r.float64Short(fieldChartGeoZoom),

View File

@ -573,6 +573,7 @@ const (
fieldChartYTickStep = "yTickStep"
fieldChartYPos = "yPos"
fieldChartLegendColorizeRows = "legendColorizeRows"
fieldChartLegendHide = "legendHide"
fieldChartLegendOpacity = "legendOpacity"
fieldChartLegendOrientationThreshold = "legendOrientationThreshold"
fieldChartGeoCenterLon = "lon"
@ -624,6 +625,7 @@ type chart struct {
TableOptions tableOptions
TimeFormat string
LegendColorizeRows bool
LegendHide bool
LegendOpacity float64
LegendOrientationThreshold int
Zoom float64
@ -694,6 +696,7 @@ func (c *chart) properties() influxdb.ViewProperties {
ShowNoteWhenEmpty: c.NoteOnEmpty,
TimeFormat: c.TimeFormat,
LegendColorizeRows: c.LegendColorizeRows,
LegendHide: c.LegendHide,
LegendOpacity: float64(c.LegendOpacity),
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
}
@ -711,6 +714,7 @@ func (c *chart) properties() influxdb.ViewProperties {
Note: c.Note,
ShowNoteWhenEmpty: c.NoteOnEmpty,
LegendColorizeRows: c.LegendColorizeRows,
LegendHide: c.LegendHide,
LegendOpacity: float64(c.LegendOpacity),
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
}
@ -745,6 +749,7 @@ func (c *chart) properties() influxdb.ViewProperties {
ShowNoteWhenEmpty: c.NoteOnEmpty,
TimeFormat: c.TimeFormat,
LegendColorizeRows: c.LegendColorizeRows,
LegendHide: c.LegendHide,
LegendOpacity: float64(c.LegendOpacity),
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
}
@ -774,6 +779,7 @@ func (c *chart) properties() influxdb.ViewProperties {
ShowNoteWhenEmpty: c.NoteOnEmpty,
TimeFormat: c.TimeFormat,
LegendColorizeRows: c.LegendColorizeRows,
LegendHide: c.LegendHide,
LegendOpacity: float64(c.LegendOpacity),
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
}
@ -804,6 +810,7 @@ func (c *chart) properties() influxdb.ViewProperties {
ShowNoteWhenEmpty: c.NoteOnEmpty,
TimeFormat: c.TimeFormat,
LegendColorizeRows: c.LegendColorizeRows,
LegendHide: c.LegendHide,
LegendOpacity: float64(c.LegendOpacity),
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
}
@ -852,6 +859,7 @@ func (c *chart) properties() influxdb.ViewProperties {
Axes: c.Axes.influxAxes(),
Position: c.Position,
LegendColorizeRows: c.LegendColorizeRows,
LegendHide: c.LegendHide,
LegendOpacity: float64(c.LegendOpacity),
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
}
@ -911,6 +919,7 @@ func (c *chart) properties() influxdb.ViewProperties {
Position: c.Position,
TimeFormat: c.TimeFormat,
LegendColorizeRows: c.LegendColorizeRows,
LegendHide: c.LegendHide,
LegendOpacity: float64(c.LegendOpacity),
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
}

View File

@ -1069,6 +1069,7 @@ spec:
assert.Equal(t, 0.0, props.YTickStart)
assert.Equal(t, 100.0, props.YTickStep)
assert.Equal(t, true, props.LegendColorizeRows)
assert.Equal(t, false, props.LegendHide)
assert.Equal(t, 1.0, props.LegendOpacity)
assert.Equal(t, 5, props.LegendOrientationThreshold)
assert.True(t, props.ShowNoteWhenEmpty)
@ -1189,6 +1190,7 @@ spec:
assert.Equal(t, "histogram note", props.Note)
assert.Equal(t, 30, props.BinCount)
assert.Equal(t, true, props.LegendColorizeRows)
assert.Equal(t, false, props.LegendHide)
assert.Equal(t, 1.0, props.LegendOpacity)
assert.Equal(t, 5, props.LegendOrientationThreshold)
assert.True(t, props.ShowNoteWhenEmpty)
@ -1313,6 +1315,7 @@ spec:
assert.Equal(t, 0.0, props.XTickStart)
assert.Equal(t, 1000.0, props.XTickStep)
assert.Equal(t, true, props.LegendColorizeRows)
assert.Equal(t, false, props.LegendHide)
assert.Equal(t, 1.0, props.LegendOpacity)
assert.Equal(t, 5, props.LegendOrientationThreshold)
})
@ -1354,6 +1357,7 @@ spec:
assert.Equal(t, 0.0, props.YTickStart)
assert.Equal(t, 100.0, props.YTickStep)
assert.Equal(t, true, props.LegendColorizeRows)
assert.Equal(t, false, props.LegendHide)
assert.Equal(t, 1.0, props.LegendOpacity)
assert.Equal(t, 5, props.LegendOrientationThreshold)
assert.Equal(t, true, props.StaticLegend.ColorizeRows)
@ -1435,6 +1439,7 @@ spec:
assert.Equal(t, 0.0, props.YTickStart)
assert.Equal(t, 100.0, props.YTickStep)
assert.Equal(t, true, props.LegendColorizeRows)
assert.Equal(t, false, props.LegendHide)
assert.Equal(t, 1.0, props.LegendOpacity)
assert.Equal(t, 5, props.LegendOrientationThreshold)
})
@ -1882,6 +1887,7 @@ spec:
assert.Equal(t, 0.0, props.YTickStart)
assert.Equal(t, 100.0, props.YTickStep)
assert.Equal(t, true, props.LegendColorizeRows)
assert.Equal(t, false, props.LegendHide)
assert.Equal(t, 1.0, props.LegendOpacity)
assert.Equal(t, 5, props.LegendOrientationThreshold)
assert.Equal(t, true, props.StaticLegend.ColorizeRows)
@ -2356,6 +2362,7 @@ spec:
assert.Equal(t, 0.0, props.YTickStart)
assert.Equal(t, 100.0, props.YTickStep)
assert.Equal(t, true, props.LegendColorizeRows)
assert.Equal(t, false, props.LegendHide)
assert.Equal(t, 1.0, props.LegendOpacity)
assert.Equal(t, 5, props.LegendOrientationThreshold)
assert.Equal(t, true, props.StaticLegend.ColorizeRows)

View File

@ -2418,6 +2418,7 @@ func TestService(t *testing.T) {
BinSize: 10,
TimeFormat: "",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},
@ -2443,6 +2444,7 @@ func TestService(t *testing.T) {
BinCount: 30,
Position: "stacked",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},
@ -2481,6 +2483,7 @@ func TestService(t *testing.T) {
YSuffix: "y_suffix",
TimeFormat: "",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},
@ -2516,6 +2519,7 @@ func TestService(t *testing.T) {
YPrefix: "y_prefix",
YSuffix: "y_suffix",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},
@ -2594,6 +2598,7 @@ func TestService(t *testing.T) {
YTickStep: 100,
Position: "stacked",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},
@ -2630,6 +2635,7 @@ func TestService(t *testing.T) {
Position: "overlaid",
TimeFormat: "",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},
@ -2667,6 +2673,7 @@ func TestService(t *testing.T) {
LowerColumn: "lower",
TimeFormat: "",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},
@ -2968,6 +2975,7 @@ func TestService(t *testing.T) {
BinCount: 30,
Position: "stacked",
LegendColorizeRows: true,
LegendHide: false,
LegendOpacity: 1.0,
LegendOrientationThreshold: 5,
},

View File

@ -37,6 +37,7 @@ spec:
yTickStart: 0
yTickStep: 100
legendColorizeRows: true
legendHide: false
legendOpacity: 1.0
legendOrientationThreshold: 5
staticLegend:

View File

@ -29,6 +29,7 @@
"yTickStep": 100,
"binSize": 10,
"legendColorizeRows": true,
"legendHide": false,
"legendOpacity": 1.0,
"legendOrientationThreshold": 5,
"queries": [

View File

@ -15,6 +15,7 @@ spec:
height: 3
binSize: 10
legendColorizeRows: true
legendHide: false
legendOpacity: 1.0
legendOrientationThreshold: 5
generateXAxisTicks:

View File

@ -19,6 +19,7 @@
"position": "stacked",
"binCount": 30,
"legendColorizeRows": true,
"legendHide": false,
"legendOpacity": 1.0,
"legendOrientationThreshold": 5,
"fillColumns": [

View File

@ -15,6 +15,7 @@ spec:
binCount: 30
fillColumns: ["a", "b"]
legendColorizeRows: true
legendHide: false
legendOpacity: 1.0
legendOrientationThreshold: 5
queries:

View File

@ -32,6 +32,7 @@ spec:
- _value
- foo
legendColorizeRows: true
legendHide: false
legendOpacity: 1.0
legendOrientationThreshold: 5
queries:

View File

@ -28,6 +28,7 @@
"yTickStart": 0,
"yTickStep": 100,
"legendColorizeRows": true,
"legendHide": false,
"legendOpacity": 1.0,
"legendOrientationThreshold": 5,
"queries": [

View File

@ -32,6 +32,7 @@ spec:
width: 6
height: 3
legendColorizeRows: true
legendHide: false
legendOpacity: 1.0
legendOrientationThreshold: 5
queries:

View File

@ -34,6 +34,7 @@
"yTickStep": 100,
"position": "overlaid",
"legendColorizeRows": true,
"legendHide": false,
"legendOpacity": 1.0,
"legendOrientationThreshold": 5,
"staticLegend": {

View File

@ -34,6 +34,7 @@ spec:
yTickStart: 0
yTickStep: 100
legendColorizeRows: true
legendHide: false
legendOpacity: 1.0
legendOrientationThreshold: 5
staticLegend:

View File

@ -33,6 +33,7 @@
"yTickStart": 0,
"yTickStep": 100,
"legendColorizeRows": true,
"legendHide": false,
"legendOpacity": 1.0,
"legendOrientationThreshold": 5,
"staticLegend": {

View File

@ -32,6 +32,7 @@ spec:
yTickStart: 0
yTickStep: 100
legendColorizeRows: true
legendHide: false
legendOpacity: 1.0
legendOrientationThreshold: 5
staticLegend: