mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Stat: Add Percent Change Option * Ensure div style only applied for percent change * Add metrics section to gdev * Apply new style and fix nan truthy * Handle no text case properly * Only display percent change with value * Improve styling * Remove VizOrientation dep and improve styling * Display percent change for text mode name * Add check for undefined percentChange * Don't show percent change option for all values * Make metric alignment more robust * Make percent change column case tighter Check undefined directly to avoid truthy issues * Simplify percentChange calculation * Add documentation for show percent change * Add tests for percent change * Refactor big value and pull out percent change * minor changes * initial approach at addressing setting % change colors to be conventional (not super happy with handling of contrast) * Clean up initial color change approach (no need to handle 0 case as is handled as NaN currently * Update shadow styling and include icon * Update docs/sources/panels-visualizations/visualizations/stat/index.md Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * Stat: Add Percent Change Option (refactor and color exploration) (#79504) Co-authored-by: nmarrs <nathanielmarrs@gmail.com> * some missed cleanup :D * update percent change to show to not be tied to text value; update docs accordingly * initial start for fixing scaling of % change for no text mode * Fix styling for case where textmode is none * Tweak styling a bit for icon and minimum padding * Apply flex wrap to container styles * Update gdev for stat panel tests * attempt at fixing horizontal percent change styling / placement --------- Co-authored-by: nmarrs <nathanielmarrs@gmail.com> Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
42 lines
1.2 KiB
CUE
42 lines
1.2 KiB
CUE
// Copyright 2021 Grafana Labs
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package grafanaplugin
|
|
|
|
import (
|
|
"github.com/grafana/grafana/packages/grafana-schema/src/common"
|
|
)
|
|
|
|
composableKinds: PanelCfg: {
|
|
maturity: "experimental"
|
|
|
|
lineage: {
|
|
schemas: [{
|
|
version: [0, 0]
|
|
schema: {
|
|
Options: {
|
|
common.SingleStatBaseOptions
|
|
graphMode: common.BigValueGraphMode & (*"area" | _)
|
|
colorMode: common.BigValueColorMode & (*"value" | _)
|
|
justifyMode: common.BigValueJustifyMode & (*"auto" | _)
|
|
textMode: common.BigValueTextMode & (*"auto" | _)
|
|
wideLayout: bool | *true
|
|
showPercentChange: bool | *false
|
|
} @cuetsy(kind="interface")
|
|
}
|
|
}]
|
|
lenses: []
|
|
}
|
|
}
|