grafana/public/app/plugins/panel/graph/module.ts

410 lines
12 KiB
TypeScript
Raw Normal View History

import './graph';
import './series_overrides_ctrl';
import './thresholds_form';
2018-06-21 07:41:47 -05:00
import './time_regions_form';
import template from './template';
import _ from 'lodash';
import { MetricsPanelCtrl } from 'app/plugins/sdk';
import { DataProcessor } from './data_processor';
import { axesEditorComponent } from './axes_editor';
import config from 'app/core/config';
import TimeSeries from 'app/core/time_series2';
import { getProcessedDataFrames } from 'app/features/query/state/runRequest';
import { DataFrame, FieldConfigProperty, getColorForTheme, PanelEvents, PanelPlugin } from '@grafana/data';
Graph: Add data links feature (click on graph) (#17267) * WIP: initial panel links editor * WIP: Added dashboard migration to new panel drilldown link schema * Make link_srv interpolate new variables * Fix failing tests * Drilldown: Add context menu to graph viz (#17284) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Move graph context menu controller to separate file * Drilldown: datapoint variables interpolation (#17328) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Add util for absolute time range transformation * Add series name and datapoint timestamp interpolation * Rename drilldown link variables tot snake case, use const values instead of strings in tests * Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning * Rename seriesLabel to seriesName * Drilldown: use separate editors for panel and series links (#17355) * Use correct target ini context menu links * Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui * Expose DrilldownLinksEditor as an angular directive * Enable visualization specifix drilldown links * Props interfaces rename * Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391) * Add variables suggestion in drilldown link editor * Enable prism * Fix backspace not working * Move slate value helpers to grafana/ui * Add syntax higlighting for links input * Rename drilldown link components to data links * Add template variabe suggestions * Bugfix * Fix regexp not working in Firefox * Display correct links in panel header corner * bugfix * bugfix * Bugfix * Context menu UI tweaks * Use data link terminology instead of drilldown * DataLinks: changed autocomplete syntax * Use singular form for data link * Use the same syntax higlighting for built-in and template variables in data links editor * UI improvements to context menu * UI review tweaks * Tweak layout of data link editor * Fix vertical spacing * Remove data link header in context menu * Remove pointer cursor from series label in context menu * Fix variable selection on click * DataLinks: migrations for old links * Update docs about data links * Use value time instead of time range when interpolating datapoint timestamp * Remove not used util * Update docs * Moved icon a bit more down * Interpolate value ts only when using __value_time variable * Bring href property back to LinkModel * Add any type annotations * Fix TS error on slate's Value type * minor changes
2019-06-25 04:38:51 -05:00
import { GraphContextMenuCtrl } from './GraphContextMenuCtrl';
Graph Panel: use FieldConfig for displayName and DataLinks (#25917) * graph with new controls * graph with new controls * Fix categories * fix test imports * Chore: Fix spelling (#25905) * grafana-ui: Make output chunks correct (#25922) * Explore/Loki: Show results of instant queries only in table and time series only in graph (#25845) * Show results of instant queries only in table and rest in graph * Add type to QueryResultMeta * Update log row hover background only if context is not open * Revert "Update log row hover background only if context is not open" This reverts commit 144197c9540565273515a6d7dd38d3e12a436f05. * Explore/Loki: Fix field type in table for instant queries (#25907) * Update field type for instant queries to number * Remove fieldtype as in prometheus * Revert "Remove fieldtype as in prometheus" This reverts commit f887ad1125deb1053e33f7ef385d5f518ac27892. * Chore: Disable scopelint for tests (#25923) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * grafana/ui: Fix storybook dev (#25928) * Minimize css and js only for storybook build * Update CodeEditor story, make it internal * Update storybook webpack config * TimeZonePicker: added possibility to toggle if internal time zones should be included or not. (#25934) * made some small adjustments after feedback. * made the flag optional. * Docker: Upgrade to base on Alpine 3.12 (#25936) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * DataLinks: Add internal links in table and allow custom query (#25613) * Add internal links in table and with custom query * Add specific types for internal and external link * Change the datalink types to be more backward compatible * Refactor the link utils for explore * Add internal linking to table panels * Fix derived field condition * Prettify * Add and fix tests * Prettify * Fix imports and tests * Remove unused type * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * CircleCI: Upgrade grabpl (#25939) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Provisioning: Use folders structure from the file system to create desired folders in dashboard provisioning. (#23117) Fixes #12016 * Added options to customize chart data listening (#25918) * Explore: Remove legend formatting when switching from panel to Explore (#25848) * Remove legend formatting when switching from panel to explore * Add test coverage * Query history: Add search for query history and starred queries (#25747) * Add searching functionality to Queries tab * Implement search for starred queries * Update tests and add test coverage for searching * Changes based on provided feedback * Remove redundant storing of results * Update naming of onSearchFilterChange function in tests * Update filterQueriesBySearchFilter function * Update filterQueriesBySearchFilter function * Debounce search * Remove console.log() * Use useDebouncedCallback * Update tests, remove redundant props * When in starred, search only in starred * Add timefilter as dependency * Remove redundant dependency, refactor * Grafana-UI: Add FileUpload (#25835) * Grafana UI: Setup component * Grafana UI: DashboardFileUpload => FileUpload * Grafana UI: Expand docs * Grafana UI: Add className * Grafana UI: Update import * Grafana UI: Clarify props * Update packages/grafana-ui/src/components/FileUpload/FileUpload.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Grafana UI: Style icon * Grafana UI: Show uploaded file name * Grafana UI: Add tests * Grafana UI: Add useStyles + useCallback * Grafana UI: Remove stylesFactory * Grafana UI: Revert to useTheme Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Fix: Value mappings match against string values (#25929) * Use standard input for value mappings value * add test and case for matching string values * re add number on rangemap * remove FieldTypeNumber required * Docs: Changelog update 7.05 & latest.json update (#25941) * Docs: Changelog update for 7.0.5 * Update latest.json * Fixed alignment * Stackdriver: Rename Stackdriver to Google Cloud Monitoring (#25807) * Update backend * Update frontend * Keep old plugin id * Update docs * Place doc images to a new directory * Legacy support for stackdriver-auto alignment * Consistent plugin name * Apply suggestions from code review Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Update docs * Update public/app/plugins/datasource/cloud-monitoring/README.md Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> * Add reference to the data source formerly being named Stackdriver * Update pkg/models/datasource.go Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix gofmt Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix strict null errors that resulted from search (#25950) * Arrow: when exporting arrow use the calculated names (#25871) * PanelHeader: Fixed loading icon position (#25949) * PanelHeader: Fixed loading icon position * revert back to text weak color * Azure/Log Analytics: return more error information (#25937) When there is an error message in the HTTP response, this copies that error so it is relayed to the user by being shown in the frontend. This also makes it so when there is an error the interpolated query string (ExecutedQueryString) is returned so users can see it in the query inspector. * Azure: Multiple dimension support for Azure Monitor Service (#25947) Azure Monitor (metrics) support multiple dimensions instead of just one. Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Docs: Update alert-list-panel.md (#25779) Fixed minor typo and format updates * Docs: Update add-a-panel.md (#25780) * Linting fixes for the provisioning package (#25690) * Chore: whatwg-fetch version bump (#25952) * Use latest fetch polyfill/shim * Updated lockfile * Monaco: option to hide line numbers (#25920) * Docs: Reorganize reference topics (#25915) * moved annotations.md * Update annotations.md * moved dashboard_folders.md * moved dashboard_history.md * moved playlist.md * moved search.md * migrations test * docs: spelling (#24383) * Docs: spelling * Docs: spelling (contribute/ directory) * Drop whats-new-in changes * migrations test Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Richard Hartmann <RichiH@users.noreply.github.com> Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com> Co-authored-by: Maksim Nabokikh <32434187+nabokihms@users.noreply.github.com> Co-authored-by: Steven Vachon <contact@svachon.com> Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com> Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Carl Bergquist <carl@grafana.com> Co-authored-by: Kyle Brandt <kyle@grafana.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2020-07-01 02:39:06 -05:00
import { graphPanelMigrationHandler } from './GraphMigrations';
import { DataWarning, GraphFieldConfig, GraphPanelOptions } from './types';
import { auto } from 'angular';
import { AnnotationsSrv } from 'app/features/annotations/all';
import { CoreEvents } from 'app/types';
import { getLocationSrv } from '@grafana/runtime';
import { getDataTimeRange } from './utils';
import { changePanelPlugin } from 'app/features/dashboard/state/actions';
import { dispatch } from 'app/store/store';
import { ThresholdMapper } from 'app/features/alerting/state/ThresholdMapper';
import { getAnnotationsFromData } from 'app/features/annotations/standardAnnotationSupport';
Graph Panel: use FieldConfig for displayName and DataLinks (#25917) * graph with new controls * graph with new controls * Fix categories * fix test imports * Chore: Fix spelling (#25905) * grafana-ui: Make output chunks correct (#25922) * Explore/Loki: Show results of instant queries only in table and time series only in graph (#25845) * Show results of instant queries only in table and rest in graph * Add type to QueryResultMeta * Update log row hover background only if context is not open * Revert "Update log row hover background only if context is not open" This reverts commit 144197c9540565273515a6d7dd38d3e12a436f05. * Explore/Loki: Fix field type in table for instant queries (#25907) * Update field type for instant queries to number * Remove fieldtype as in prometheus * Revert "Remove fieldtype as in prometheus" This reverts commit f887ad1125deb1053e33f7ef385d5f518ac27892. * Chore: Disable scopelint for tests (#25923) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * grafana/ui: Fix storybook dev (#25928) * Minimize css and js only for storybook build * Update CodeEditor story, make it internal * Update storybook webpack config * TimeZonePicker: added possibility to toggle if internal time zones should be included or not. (#25934) * made some small adjustments after feedback. * made the flag optional. * Docker: Upgrade to base on Alpine 3.12 (#25936) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * DataLinks: Add internal links in table and allow custom query (#25613) * Add internal links in table and with custom query * Add specific types for internal and external link * Change the datalink types to be more backward compatible * Refactor the link utils for explore * Add internal linking to table panels * Fix derived field condition * Prettify * Add and fix tests * Prettify * Fix imports and tests * Remove unused type * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * CircleCI: Upgrade grabpl (#25939) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Provisioning: Use folders structure from the file system to create desired folders in dashboard provisioning. (#23117) Fixes #12016 * Added options to customize chart data listening (#25918) * Explore: Remove legend formatting when switching from panel to Explore (#25848) * Remove legend formatting when switching from panel to explore * Add test coverage * Query history: Add search for query history and starred queries (#25747) * Add searching functionality to Queries tab * Implement search for starred queries * Update tests and add test coverage for searching * Changes based on provided feedback * Remove redundant storing of results * Update naming of onSearchFilterChange function in tests * Update filterQueriesBySearchFilter function * Update filterQueriesBySearchFilter function * Debounce search * Remove console.log() * Use useDebouncedCallback * Update tests, remove redundant props * When in starred, search only in starred * Add timefilter as dependency * Remove redundant dependency, refactor * Grafana-UI: Add FileUpload (#25835) * Grafana UI: Setup component * Grafana UI: DashboardFileUpload => FileUpload * Grafana UI: Expand docs * Grafana UI: Add className * Grafana UI: Update import * Grafana UI: Clarify props * Update packages/grafana-ui/src/components/FileUpload/FileUpload.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Grafana UI: Style icon * Grafana UI: Show uploaded file name * Grafana UI: Add tests * Grafana UI: Add useStyles + useCallback * Grafana UI: Remove stylesFactory * Grafana UI: Revert to useTheme Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Fix: Value mappings match against string values (#25929) * Use standard input for value mappings value * add test and case for matching string values * re add number on rangemap * remove FieldTypeNumber required * Docs: Changelog update 7.05 & latest.json update (#25941) * Docs: Changelog update for 7.0.5 * Update latest.json * Fixed alignment * Stackdriver: Rename Stackdriver to Google Cloud Monitoring (#25807) * Update backend * Update frontend * Keep old plugin id * Update docs * Place doc images to a new directory * Legacy support for stackdriver-auto alignment * Consistent plugin name * Apply suggestions from code review Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Update docs * Update public/app/plugins/datasource/cloud-monitoring/README.md Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> * Add reference to the data source formerly being named Stackdriver * Update pkg/models/datasource.go Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix gofmt Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix strict null errors that resulted from search (#25950) * Arrow: when exporting arrow use the calculated names (#25871) * PanelHeader: Fixed loading icon position (#25949) * PanelHeader: Fixed loading icon position * revert back to text weak color * Azure/Log Analytics: return more error information (#25937) When there is an error message in the HTTP response, this copies that error so it is relayed to the user by being shown in the frontend. This also makes it so when there is an error the interpolated query string (ExecutedQueryString) is returned so users can see it in the query inspector. * Azure: Multiple dimension support for Azure Monitor Service (#25947) Azure Monitor (metrics) support multiple dimensions instead of just one. Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Docs: Update alert-list-panel.md (#25779) Fixed minor typo and format updates * Docs: Update add-a-panel.md (#25780) * Linting fixes for the provisioning package (#25690) * Chore: whatwg-fetch version bump (#25952) * Use latest fetch polyfill/shim * Updated lockfile * Monaco: option to hide line numbers (#25920) * Docs: Reorganize reference topics (#25915) * moved annotations.md * Update annotations.md * moved dashboard_folders.md * moved dashboard_history.md * moved playlist.md * moved search.md * migrations test * docs: spelling (#24383) * Docs: spelling * Docs: spelling (contribute/ directory) * Drop whats-new-in changes * migrations test Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Richard Hartmann <RichiH@users.noreply.github.com> Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com> Co-authored-by: Maksim Nabokikh <32434187+nabokihms@users.noreply.github.com> Co-authored-by: Steven Vachon <contact@svachon.com> Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com> Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Carl Bergquist <carl@grafana.com> Co-authored-by: Kyle Brandt <kyle@grafana.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2020-07-01 02:39:06 -05:00
export class GraphCtrl extends MetricsPanelCtrl {
static template = template;
renderError: boolean;
hiddenSeries: any = {};
hiddenSeriesTainted = false;
seriesList: TimeSeries[] = [];
dataList: DataFrame[] = [];
annotations: any = [];
alertState: any;
annotationsPromise: any;
dataWarning?: DataWarning;
colors: any = [];
subTabIndex: number;
processor: DataProcessor;
Graph: Add data links feature (click on graph) (#17267) * WIP: initial panel links editor * WIP: Added dashboard migration to new panel drilldown link schema * Make link_srv interpolate new variables * Fix failing tests * Drilldown: Add context menu to graph viz (#17284) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Move graph context menu controller to separate file * Drilldown: datapoint variables interpolation (#17328) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Add util for absolute time range transformation * Add series name and datapoint timestamp interpolation * Rename drilldown link variables tot snake case, use const values instead of strings in tests * Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning * Rename seriesLabel to seriesName * Drilldown: use separate editors for panel and series links (#17355) * Use correct target ini context menu links * Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui * Expose DrilldownLinksEditor as an angular directive * Enable visualization specifix drilldown links * Props interfaces rename * Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391) * Add variables suggestion in drilldown link editor * Enable prism * Fix backspace not working * Move slate value helpers to grafana/ui * Add syntax higlighting for links input * Rename drilldown link components to data links * Add template variabe suggestions * Bugfix * Fix regexp not working in Firefox * Display correct links in panel header corner * bugfix * bugfix * Bugfix * Context menu UI tweaks * Use data link terminology instead of drilldown * DataLinks: changed autocomplete syntax * Use singular form for data link * Use the same syntax higlighting for built-in and template variables in data links editor * UI improvements to context menu * UI review tweaks * Tweak layout of data link editor * Fix vertical spacing * Remove data link header in context menu * Remove pointer cursor from series label in context menu * Fix variable selection on click * DataLinks: migrations for old links * Update docs about data links * Use value time instead of time range when interpolating datapoint timestamp * Remove not used util * Update docs * Moved icon a bit more down * Interpolate value ts only when using __value_time variable * Bring href property back to LinkModel * Add any type annotations * Fix TS error on slate's Value type * minor changes
2019-06-25 04:38:51 -05:00
contextMenuCtrl: GraphContextMenuCtrl;
panelDefaults: any = {
// datasource name, null = default datasource
datasource: null,
// sets client side (flot) or native graphite png renderer (png)
renderer: 'flot',
yaxes: [
{
label: null,
show: true,
logBase: 1,
min: null,
max: null,
format: 'short',
},
{
label: null,
show: true,
logBase: 1,
min: null,
max: null,
format: 'short',
},
],
xaxis: {
show: true,
mode: 'time',
2016-09-05 04:07:41 -05:00
name: null,
values: [],
buckets: null,
},
yaxis: {
align: false,
alignLevel: null,
},
// show/hide lines
lines: true,
// fill factor
fill: 1,
// fill gradient
fillGradient: 0,
// line width in pixels
linewidth: 1,
// show/hide dashed line
dashes: false,
// show/hide line
hiddenSeries: false,
// length of a dash
dashLength: 10,
// length of space between two dashes
spaceLength: 10,
// show hide points
points: false,
// point radius in pixels
pointradius: 2,
// show hide bars
bars: false,
// enable/disable stacking
stack: false,
// stack percentage mode
percentage: false,
// legend options
legend: {
show: true, // disable/enable legend
values: false, // disable/enable legend values
min: false,
max: false,
current: false,
total: false,
avg: false,
},
// how null points should be handled
nullPointMode: 'null',
// staircase line mode
steppedLine: false,
// tooltip options
tooltip: {
value_type: 'individual',
shared: true,
sort: 0,
},
// time overrides
timeFrom: null,
timeShift: null,
// metric queries
targets: [{}],
// series color overrides
aliasColors: {},
// other style overrides
seriesOverrides: [],
thresholds: [],
2018-06-21 07:41:47 -05:00
timeRegions: [],
options: {
// show/hide alert threshold lines and fill
alertThreshold: true,
},
};
/** @ngInject */
constructor($scope: any, $injector: auto.IInjectorService, private annotationsSrv: AnnotationsSrv) {
super($scope, $injector);
_.defaults(this.panel, this.panelDefaults);
_.defaults(this.panel.tooltip, this.panelDefaults.tooltip);
_.defaults(this.panel.legend, this.panelDefaults.legend);
_.defaults(this.panel.xaxis, this.panelDefaults.xaxis);
Graph: Add data links feature (click on graph) (#17267) * WIP: initial panel links editor * WIP: Added dashboard migration to new panel drilldown link schema * Make link_srv interpolate new variables * Fix failing tests * Drilldown: Add context menu to graph viz (#17284) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Move graph context menu controller to separate file * Drilldown: datapoint variables interpolation (#17328) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Add util for absolute time range transformation * Add series name and datapoint timestamp interpolation * Rename drilldown link variables tot snake case, use const values instead of strings in tests * Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning * Rename seriesLabel to seriesName * Drilldown: use separate editors for panel and series links (#17355) * Use correct target ini context menu links * Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui * Expose DrilldownLinksEditor as an angular directive * Enable visualization specifix drilldown links * Props interfaces rename * Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391) * Add variables suggestion in drilldown link editor * Enable prism * Fix backspace not working * Move slate value helpers to grafana/ui * Add syntax higlighting for links input * Rename drilldown link components to data links * Add template variabe suggestions * Bugfix * Fix regexp not working in Firefox * Display correct links in panel header corner * bugfix * bugfix * Bugfix * Context menu UI tweaks * Use data link terminology instead of drilldown * DataLinks: changed autocomplete syntax * Use singular form for data link * Use the same syntax higlighting for built-in and template variables in data links editor * UI improvements to context menu * UI review tweaks * Tweak layout of data link editor * Fix vertical spacing * Remove data link header in context menu * Remove pointer cursor from series label in context menu * Fix variable selection on click * DataLinks: migrations for old links * Update docs about data links * Use value time instead of time range when interpolating datapoint timestamp * Remove not used util * Update docs * Moved icon a bit more down * Interpolate value ts only when using __value_time variable * Bring href property back to LinkModel * Add any type annotations * Fix TS error on slate's Value type * minor changes
2019-06-25 04:38:51 -05:00
_.defaults(this.panel.options, this.panelDefaults.options);
QueryProcessing: Observable query interface and RxJS for query & stream processing (#18899) * I needed to learn some rxjs and understand this more, so just playing around * Updated * Removed all the complete calls * Refactoring * StreamHandler -> observable start * progress * simple singal works * Handle update time range * added error handling * wrap old function * minor changes * handle data format in the subscribe function * Use replay subject to return last value to subscribers * Set loading state after no response in 50ms * added missing file * updated comment * Added cancelation of network requests * runRequest: Added unit test scenario framework * Progress on tests * minor refactor of unit tests * updated test * removed some old code * Shared queries work again, and also became so much simplier * unified query and observe methods * implict any fix * Fixed closed subject issue * removed comment * Use last returned data for loading state * WIP: Explore to runRequest makover step1 * Minor progress * Minor progress on explore and runRequest * minor progress * Things are starting to work in explore * Updated prometheus to use new observable query response, greatly simplified code * Revert refId change * Found better solution for key/refId/requestId problem * use observable with loki * tests compile * fix loki query prep * Explore: correct first response handling * Refactorings * Refactoring * Explore: Fixes LoadingState and GraphResults between runs (#18986) * Refactor: Adds state to DataQueryResponse * Fix: Fixes so we do not empty results before new data arrives Fixes: #17409 * Transformations work * observable test data * remove single() from loki promise * Fixed comment * Explore: Fixes failing Loki and Prometheus unit tests (#18995) * Tests: Makes datasource tests work again * Fix: Fixes loki datasource so highligthing works * Chore: Runs Prettier * Fixed query runner tests * Delay loading state indication to 200ms * Fixed test * fixed unit tests * Clear cached calcs * Fixed bug getProcesedDataFrames * Fix the correct test is a better idea * Fix: Fixes so queries in Explore are only run if Graph/Table is shown (#19000) * Fix: Fixes so queries in Explore are only run if Graph/Table is shown Fixes: #18618 * Refactor: Removes unnecessary condition * PanelData: provide legacy data only when needed (#19018) * no legacy * invert logic... now compiles * merge getQueryResponseData and getDataRaw * update comment about query editor * use single getData() function * only send legacy when it is used in explore * pre process rather than post process * pre process rather than post process * Minor refactoring * Add missing tags to test datasource response * MixedDatasource: Adds query observable pattern to MixedDatasource (#19037) * start mixed datasource * Refactor: Refactors into observable parttern * Tests: Fixes tests * Tests: Removes console.log * Refactor: Adds unique requestId
2019-09-12 10:28:46 -05:00
this.useDataFrames = true;
this.processor = new DataProcessor(this.panel);
Graph: Add data links feature (click on graph) (#17267) * WIP: initial panel links editor * WIP: Added dashboard migration to new panel drilldown link schema * Make link_srv interpolate new variables * Fix failing tests * Drilldown: Add context menu to graph viz (#17284) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Move graph context menu controller to separate file * Drilldown: datapoint variables interpolation (#17328) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Add util for absolute time range transformation * Add series name and datapoint timestamp interpolation * Rename drilldown link variables tot snake case, use const values instead of strings in tests * Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning * Rename seriesLabel to seriesName * Drilldown: use separate editors for panel and series links (#17355) * Use correct target ini context menu links * Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui * Expose DrilldownLinksEditor as an angular directive * Enable visualization specifix drilldown links * Props interfaces rename * Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391) * Add variables suggestion in drilldown link editor * Enable prism * Fix backspace not working * Move slate value helpers to grafana/ui * Add syntax higlighting for links input * Rename drilldown link components to data links * Add template variabe suggestions * Bugfix * Fix regexp not working in Firefox * Display correct links in panel header corner * bugfix * bugfix * Bugfix * Context menu UI tweaks * Use data link terminology instead of drilldown * DataLinks: changed autocomplete syntax * Use singular form for data link * Use the same syntax higlighting for built-in and template variables in data links editor * UI improvements to context menu * UI review tweaks * Tweak layout of data link editor * Fix vertical spacing * Remove data link header in context menu * Remove pointer cursor from series label in context menu * Fix variable selection on click * DataLinks: migrations for old links * Update docs about data links * Use value time instead of time range when interpolating datapoint timestamp * Remove not used util * Update docs * Moved icon a bit more down * Interpolate value ts only when using __value_time variable * Bring href property back to LinkModel * Add any type annotations * Fix TS error on slate's Value type * minor changes
2019-06-25 04:38:51 -05:00
this.contextMenuCtrl = new GraphContextMenuCtrl($scope);
this.annotationsPromise = Promise.resolve({ annotations: [] });
this.events.on(PanelEvents.render, this.onRender.bind(this));
this.events.on(PanelEvents.dataFramesReceived, this.onDataFramesReceived.bind(this));
this.events.on(PanelEvents.dataSnapshotLoad, this.onDataSnapshotLoad.bind(this));
this.events.on(PanelEvents.editModeInitialized, this.onInitEditMode.bind(this));
this.events.on(PanelEvents.initPanelActions, this.onInitPanelActions.bind(this));
Graph: Add data links feature (click on graph) (#17267) * WIP: initial panel links editor * WIP: Added dashboard migration to new panel drilldown link schema * Make link_srv interpolate new variables * Fix failing tests * Drilldown: Add context menu to graph viz (#17284) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Move graph context menu controller to separate file * Drilldown: datapoint variables interpolation (#17328) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Add util for absolute time range transformation * Add series name and datapoint timestamp interpolation * Rename drilldown link variables tot snake case, use const values instead of strings in tests * Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning * Rename seriesLabel to seriesName * Drilldown: use separate editors for panel and series links (#17355) * Use correct target ini context menu links * Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui * Expose DrilldownLinksEditor as an angular directive * Enable visualization specifix drilldown links * Props interfaces rename * Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391) * Add variables suggestion in drilldown link editor * Enable prism * Fix backspace not working * Move slate value helpers to grafana/ui * Add syntax higlighting for links input * Rename drilldown link components to data links * Add template variabe suggestions * Bugfix * Fix regexp not working in Firefox * Display correct links in panel header corner * bugfix * bugfix * Bugfix * Context menu UI tweaks * Use data link terminology instead of drilldown * DataLinks: changed autocomplete syntax * Use singular form for data link * Use the same syntax higlighting for built-in and template variables in data links editor * UI improvements to context menu * UI review tweaks * Tweak layout of data link editor * Fix vertical spacing * Remove data link header in context menu * Remove pointer cursor from series label in context menu * Fix variable selection on click * DataLinks: migrations for old links * Update docs about data links * Use value time instead of time range when interpolating datapoint timestamp * Remove not used util * Update docs * Moved icon a bit more down * Interpolate value ts only when using __value_time variable * Bring href property back to LinkModel * Add any type annotations * Fix TS error on slate's Value type * minor changes
2019-06-25 04:38:51 -05:00
// set axes format from field config
const fieldConfigUnit = this.panel.fieldConfig.defaults.unit;
if (fieldConfigUnit) {
this.panel.yaxes[0].format = fieldConfigUnit;
}
}
onInitEditMode() {
this.addEditorTab('Display', 'public/app/plugins/panel/graph/tab_display.html');
this.addEditorTab('Series overrides', 'public/app/plugins/panel/graph/tab_series_overrides.html');
2018-11-20 04:06:36 -06:00
this.addEditorTab('Axes', axesEditorComponent);
this.addEditorTab('Legend', 'public/app/plugins/panel/graph/tab_legend.html');
this.addEditorTab('Thresholds', 'public/app/plugins/panel/graph/tab_thresholds.html');
this.addEditorTab('Time regions', 'public/app/plugins/panel/graph/tab_time_regions.html');
this.subTabIndex = 0;
this.hiddenSeriesTainted = false;
}
onInitPanelActions(actions: any[]) {
actions.push({ text: 'Toggle legend', click: 'ctrl.toggleLegend()', shortcut: 'p l' });
}
issueQueries(datasource: any) {
this.annotationsPromise = this.annotationsSrv.getAnnotations({
dashboard: this.dashboard,
panel: this.panel,
range: this.range,
});
/* Wait for annotationSrv requests to get datasources to
* resolve before issuing queries. This allows the annotations
* service to fire annotations queries before graph queries
* (but not wait for completion). This resolves
* issue 11806.
*/
return this.annotationsSrv.datasourcePromises.then((r: any) => {
return super.issueQueries(datasource);
});
}
zoomOut(evt: any) {
this.publishAppEvent(CoreEvents.zoomOut, 2);
}
onDataSnapshotLoad(snapshotData: any) {
this.annotationsPromise = this.annotationsSrv.getAnnotations({
dashboard: this.dashboard,
panel: this.panel,
range: this.range,
});
const frames = getProcessedDataFrames(snapshotData);
this.onDataFramesReceived(frames);
}
onDataFramesReceived(data: DataFrame[]) {
this.dataList = data;
this.seriesList = this.processor.getSeriesList({
dataList: this.dataList,
range: this.range,
});
2016-09-27 07:39:51 -05:00
this.dataWarning = this.getDataWarning();
this.annotationsPromise.then(
(result: { alertState: any; annotations: any }) => {
this.loading = false;
this.alertState = result.alertState;
this.annotations = result.annotations;
// Temp alerting & react hack
// Add it to the seriesList so react can access it
if (this.alertState) {
(this.seriesList as any).alertState = this.alertState.state;
}
if (this.panelData!.annotations?.length) {
this.annotations = getAnnotationsFromData(this.panelData!.annotations!);
}
this.render(this.seriesList);
},
() => {
this.loading = false;
this.render(this.seriesList);
}
);
}
getDataWarning(): DataWarning | undefined {
const datapointsCount = this.seriesList.reduce((prev, series) => {
return prev + series.datapoints.length;
}, 0);
if (datapointsCount === 0) {
if (this.dataList) {
for (const frame of this.dataList) {
if (frame.length && frame.fields?.length) {
return {
title: 'Unable to graph data',
tip: 'Data exists, but is not timeseries',
actionText: 'Switch to table view',
action: () => {
dispatch(changePanelPlugin(this.panel, 'table'));
},
};
}
}
}
return {
title: 'No data',
tip: 'No data returned from query',
};
}
// If any data is in range, do not return an error
for (const series of this.seriesList) {
if (!series.isOutsideRange) {
return undefined;
}
}
// All data is outside the time range
const dataWarning: DataWarning = {
title: 'Data outside time range',
tip: 'Can be caused by timezone mismatch or missing time filter in query',
};
const range = getDataTimeRange(this.dataList);
if (range) {
dataWarning.actionText = 'Zoom to data';
dataWarning.action = () => {
getLocationSrv().update({
partial: true,
query: {
from: range.from,
to: range.to,
},
});
};
}
return dataWarning;
}
onRender() {
if (!this.seriesList) {
return;
}
ThresholdMapper.alertToGraphThresholds(this.panel);
for (const series of this.seriesList) {
series.applySeriesOverrides(this.panel.seriesOverrides);
2016-04-12 13:26:49 -05:00
// Always use the configured field unit
2016-04-12 13:26:49 -05:00
if (series.unit) {
this.panel.yaxes[series.yaxis - 1].format = series.unit;
2016-04-12 13:26:49 -05:00
}
if (this.hiddenSeriesTainted === false && series.hiddenSeries === true) {
this.hiddenSeries[series.alias] = true;
}
}
}
onColorChange = (series: any, color: string) => {
series.setColor(getColorForTheme(color, config.theme));
this.panel.aliasColors[series.alias] = color;
this.render();
};
onToggleSeries = (hiddenSeries: any) => {
this.hiddenSeriesTainted = true;
this.hiddenSeries = hiddenSeries;
this.render();
};
onToggleSort = (sortBy: any, sortDesc: any) => {
this.panel.legend.sort = sortBy;
this.panel.legend.sortDesc = sortDesc;
this.render();
};
onToggleAxis = (info: { alias: any; yaxis: any }) => {
2019-04-15 05:11:52 -05:00
let override: any = _.find(this.panel.seriesOverrides, { alias: info.alias });
if (!override) {
override = { alias: info.alias };
this.panel.seriesOverrides.push(override);
}
override.yaxis = info.yaxis;
this.render();
};
addSeriesOverride(override: any) {
this.panel.seriesOverrides.push(override || {});
}
removeSeriesOverride(override: any) {
this.panel.seriesOverrides = _.without(this.panel.seriesOverrides, override);
this.render();
}
toggleLegend() {
this.panel.legend.show = !this.panel.legend.show;
this.render();
}
legendValuesOptionChanged() {
const legend = this.panel.legend;
legend.values = legend.min || legend.max || legend.avg || legend.current || legend.total;
this.render();
}
Graph: Add data links feature (click on graph) (#17267) * WIP: initial panel links editor * WIP: Added dashboard migration to new panel drilldown link schema * Make link_srv interpolate new variables * Fix failing tests * Drilldown: Add context menu to graph viz (#17284) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Move graph context menu controller to separate file * Drilldown: datapoint variables interpolation (#17328) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Add util for absolute time range transformation * Add series name and datapoint timestamp interpolation * Rename drilldown link variables tot snake case, use const values instead of strings in tests * Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning * Rename seriesLabel to seriesName * Drilldown: use separate editors for panel and series links (#17355) * Use correct target ini context menu links * Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui * Expose DrilldownLinksEditor as an angular directive * Enable visualization specifix drilldown links * Props interfaces rename * Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391) * Add variables suggestion in drilldown link editor * Enable prism * Fix backspace not working * Move slate value helpers to grafana/ui * Add syntax higlighting for links input * Rename drilldown link components to data links * Add template variabe suggestions * Bugfix * Fix regexp not working in Firefox * Display correct links in panel header corner * bugfix * bugfix * Bugfix * Context menu UI tweaks * Use data link terminology instead of drilldown * DataLinks: changed autocomplete syntax * Use singular form for data link * Use the same syntax higlighting for built-in and template variables in data links editor * UI improvements to context menu * UI review tweaks * Tweak layout of data link editor * Fix vertical spacing * Remove data link header in context menu * Remove pointer cursor from series label in context menu * Fix variable selection on click * DataLinks: migrations for old links * Update docs about data links * Use value time instead of time range when interpolating datapoint timestamp * Remove not used util * Update docs * Moved icon a bit more down * Interpolate value ts only when using __value_time variable * Bring href property back to LinkModel * Add any type annotations * Fix TS error on slate's Value type * minor changes
2019-06-25 04:38:51 -05:00
onContextMenuClose = () => {
this.contextMenuCtrl.toggleMenu();
};
DateTime: adding support to select preferred timezone for presentation of date and time values. (#23586) * added moment timezone package. * added a qnd way of selecting timezone. * added a first draft to display how it can be used. * fixed failing tests. * made moment.local to be in utc when running tests. * added tests to verify that the timeZone support works as expected. * Fixed so we use the formatter in the graph context menu. * changed so we will format d3 according to timeZone. * changed from class base to function based for easier consumption. * fixed so tests got green. * renamed to make it shorter. * fixed formatting in logRow. * removed unused value. * added time formatter to flot. * fixed failing tests. * changed so history will use the formatting with support for timezone. * added todo. * added so we append the correct abbrivation behind time. * added time zone abbrevation in timepicker. * adding timezone in rangeutil tool. * will use timezone when formatting range. * changed so we use new functions to format date so timezone is respected. * wip - dashboard settings. * changed so the time picker settings is in react. * added force update. * wip to get the react graph to work. * fixed formatting and parsing on the timepicker. * updated snap to be correct. * fixed so we format values properly in time picker. * make sure we pass timezone on all the proper places. * fixed so we use correct timeZone in explore. * fixed failing tests. * fixed so we always parse from local to selected timezone. * removed unused variable. * reverted back. * trying to fix issue with directive. * fixed issue. * fixed strict null errors. * fixed so we still can select default. * make sure we reads the time zone from getTimezone
2020-04-27 08:28:06 -05:00
getTimeZone = () => this.dashboard.getTimezone();
DataLinks: enable access to labels & field names (#18918) * POC: trying to see if there is a way to support objects in template interpolations * Added support for nested objects, and arrays * Added accessor cache * fixed unit tests * First take * Use links supplier in graph * Add field's index to cache items * Get field index from field cache * CHange FiledCacheItem to FieldWithIndex * Add refId to TimeSeries class * Make field link supplier work with _series, _field and _value vars * use field link supplier in graph * Fix yaxis settings * Update dashboard schema version and add migration for data links variables * Update snapshots * Update build in data link variables * FieldCache - idx -> index * Add current query results to panel editor * WIP Updated data links dropdown to display new variables * Fix build * Update variables syntac in field display, update migration * Field links supplier: review updates * Add data frame view and field name to TimeSeries for later inspection * Retrieve data frame from TimeSeries when clicking on plot graph * Use data frame's index instead of view * Retrieve data frame by index instead of view on TimeSeries * Update data links prism regex * Fix typecheck * Add value variables to suggestions list * UI update * Rename field to config in DisplayProcessorOptions * Proces single value of a field instead of entire data frame * Updated font size from 10px to 12px for auto complete * Replace fieldName with fieldIndex in TimeSeries * Don't use .entries() for iterating in field cache * Don't use FieldCache when retrieving field for datalinks in graph * Add value calculation variable to data links (#19031) * Add support for labels with dots in the name (#19033) * Docs update * Use field name instead of removed series.fieldName * Add test dashboard * Typos fix * Make visualization tab subscribe to query results * Added tags to dashboard so it shows up in lists * minor docs fix * Update singlestat-ish variables suggestions to contain series variables * Decrease suggestions update debounce * Enable whitespace characters(new line, space) in links and strip them when processing the data link * minor data links UI update * DataLinks: Add __from and __to variables suggestions to data links (#19093) * Add from and to variables suggestions to data links * Update docs * UI update and added info text * Change ESC global bind to bind (doesn't capture ESC on input) * Close datalinks suggestions on ESC * Remove unnecessary fragment
2019-09-13 09:38:21 -05:00
getDataFrameByRefId = (refId: string) => {
return this.dataList.filter((dataFrame) => dataFrame.refId === refId)[0];
DataLinks: enable access to labels & field names (#18918) * POC: trying to see if there is a way to support objects in template interpolations * Added support for nested objects, and arrays * Added accessor cache * fixed unit tests * First take * Use links supplier in graph * Add field's index to cache items * Get field index from field cache * CHange FiledCacheItem to FieldWithIndex * Add refId to TimeSeries class * Make field link supplier work with _series, _field and _value vars * use field link supplier in graph * Fix yaxis settings * Update dashboard schema version and add migration for data links variables * Update snapshots * Update build in data link variables * FieldCache - idx -> index * Add current query results to panel editor * WIP Updated data links dropdown to display new variables * Fix build * Update variables syntac in field display, update migration * Field links supplier: review updates * Add data frame view and field name to TimeSeries for later inspection * Retrieve data frame from TimeSeries when clicking on plot graph * Use data frame's index instead of view * Retrieve data frame by index instead of view on TimeSeries * Update data links prism regex * Fix typecheck * Add value variables to suggestions list * UI update * Rename field to config in DisplayProcessorOptions * Proces single value of a field instead of entire data frame * Updated font size from 10px to 12px for auto complete * Replace fieldName with fieldIndex in TimeSeries * Don't use .entries() for iterating in field cache * Don't use FieldCache when retrieving field for datalinks in graph * Add value calculation variable to data links (#19031) * Add support for labels with dots in the name (#19033) * Docs update * Use field name instead of removed series.fieldName * Add test dashboard * Typos fix * Make visualization tab subscribe to query results * Added tags to dashboard so it shows up in lists * minor docs fix * Update singlestat-ish variables suggestions to contain series variables * Decrease suggestions update debounce * Enable whitespace characters(new line, space) in links and strip them when processing the data link * minor data links UI update * DataLinks: Add __from and __to variables suggestions to data links (#19093) * Add from and to variables suggestions to data links * Update docs * UI update and added info text * Change ESC global bind to bind (doesn't capture ESC on input) * Close datalinks suggestions on ESC * Remove unnecessary fragment
2019-09-13 09:38:21 -05:00
};
}
Graph Panel: use FieldConfig for displayName and DataLinks (#25917) * graph with new controls * graph with new controls * Fix categories * fix test imports * Chore: Fix spelling (#25905) * grafana-ui: Make output chunks correct (#25922) * Explore/Loki: Show results of instant queries only in table and time series only in graph (#25845) * Show results of instant queries only in table and rest in graph * Add type to QueryResultMeta * Update log row hover background only if context is not open * Revert "Update log row hover background only if context is not open" This reverts commit 144197c9540565273515a6d7dd38d3e12a436f05. * Explore/Loki: Fix field type in table for instant queries (#25907) * Update field type for instant queries to number * Remove fieldtype as in prometheus * Revert "Remove fieldtype as in prometheus" This reverts commit f887ad1125deb1053e33f7ef385d5f518ac27892. * Chore: Disable scopelint for tests (#25923) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * grafana/ui: Fix storybook dev (#25928) * Minimize css and js only for storybook build * Update CodeEditor story, make it internal * Update storybook webpack config * TimeZonePicker: added possibility to toggle if internal time zones should be included or not. (#25934) * made some small adjustments after feedback. * made the flag optional. * Docker: Upgrade to base on Alpine 3.12 (#25936) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * DataLinks: Add internal links in table and allow custom query (#25613) * Add internal links in table and with custom query * Add specific types for internal and external link * Change the datalink types to be more backward compatible * Refactor the link utils for explore * Add internal linking to table panels * Fix derived field condition * Prettify * Add and fix tests * Prettify * Fix imports and tests * Remove unused type * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * CircleCI: Upgrade grabpl (#25939) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Provisioning: Use folders structure from the file system to create desired folders in dashboard provisioning. (#23117) Fixes #12016 * Added options to customize chart data listening (#25918) * Explore: Remove legend formatting when switching from panel to Explore (#25848) * Remove legend formatting when switching from panel to explore * Add test coverage * Query history: Add search for query history and starred queries (#25747) * Add searching functionality to Queries tab * Implement search for starred queries * Update tests and add test coverage for searching * Changes based on provided feedback * Remove redundant storing of results * Update naming of onSearchFilterChange function in tests * Update filterQueriesBySearchFilter function * Update filterQueriesBySearchFilter function * Debounce search * Remove console.log() * Use useDebouncedCallback * Update tests, remove redundant props * When in starred, search only in starred * Add timefilter as dependency * Remove redundant dependency, refactor * Grafana-UI: Add FileUpload (#25835) * Grafana UI: Setup component * Grafana UI: DashboardFileUpload => FileUpload * Grafana UI: Expand docs * Grafana UI: Add className * Grafana UI: Update import * Grafana UI: Clarify props * Update packages/grafana-ui/src/components/FileUpload/FileUpload.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Grafana UI: Style icon * Grafana UI: Show uploaded file name * Grafana UI: Add tests * Grafana UI: Add useStyles + useCallback * Grafana UI: Remove stylesFactory * Grafana UI: Revert to useTheme Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Fix: Value mappings match against string values (#25929) * Use standard input for value mappings value * add test and case for matching string values * re add number on rangemap * remove FieldTypeNumber required * Docs: Changelog update 7.05 & latest.json update (#25941) * Docs: Changelog update for 7.0.5 * Update latest.json * Fixed alignment * Stackdriver: Rename Stackdriver to Google Cloud Monitoring (#25807) * Update backend * Update frontend * Keep old plugin id * Update docs * Place doc images to a new directory * Legacy support for stackdriver-auto alignment * Consistent plugin name * Apply suggestions from code review Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Update docs * Update public/app/plugins/datasource/cloud-monitoring/README.md Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> * Add reference to the data source formerly being named Stackdriver * Update pkg/models/datasource.go Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix gofmt Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix strict null errors that resulted from search (#25950) * Arrow: when exporting arrow use the calculated names (#25871) * PanelHeader: Fixed loading icon position (#25949) * PanelHeader: Fixed loading icon position * revert back to text weak color * Azure/Log Analytics: return more error information (#25937) When there is an error message in the HTTP response, this copies that error so it is relayed to the user by being shown in the frontend. This also makes it so when there is an error the interpolated query string (ExecutedQueryString) is returned so users can see it in the query inspector. * Azure: Multiple dimension support for Azure Monitor Service (#25947) Azure Monitor (metrics) support multiple dimensions instead of just one. Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Docs: Update alert-list-panel.md (#25779) Fixed minor typo and format updates * Docs: Update add-a-panel.md (#25780) * Linting fixes for the provisioning package (#25690) * Chore: whatwg-fetch version bump (#25952) * Use latest fetch polyfill/shim * Updated lockfile * Monaco: option to hide line numbers (#25920) * Docs: Reorganize reference topics (#25915) * moved annotations.md * Update annotations.md * moved dashboard_folders.md * moved dashboard_history.md * moved playlist.md * moved search.md * migrations test * docs: spelling (#24383) * Docs: spelling * Docs: spelling (contribute/ directory) * Drop whats-new-in changes * migrations test Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Richard Hartmann <RichiH@users.noreply.github.com> Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com> Co-authored-by: Maksim Nabokikh <32434187+nabokihms@users.noreply.github.com> Co-authored-by: Steven Vachon <contact@svachon.com> Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com> Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Carl Bergquist <carl@grafana.com> Co-authored-by: Kyle Brandt <kyle@grafana.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2020-07-01 02:39:06 -05:00
// Use new react style configuration
export const plugin = new PanelPlugin<GraphPanelOptions, GraphFieldConfig>(null)
.useFieldConfig({
disableStandardOptions: [
FieldConfigProperty.NoValue,
FieldConfigProperty.Thresholds,
FieldConfigProperty.Max,
FieldConfigProperty.Min,
FieldConfigProperty.Decimals,
FieldConfigProperty.Color,
FieldConfigProperty.Mappings,
Graph Panel: use FieldConfig for displayName and DataLinks (#25917) * graph with new controls * graph with new controls * Fix categories * fix test imports * Chore: Fix spelling (#25905) * grafana-ui: Make output chunks correct (#25922) * Explore/Loki: Show results of instant queries only in table and time series only in graph (#25845) * Show results of instant queries only in table and rest in graph * Add type to QueryResultMeta * Update log row hover background only if context is not open * Revert "Update log row hover background only if context is not open" This reverts commit 144197c9540565273515a6d7dd38d3e12a436f05. * Explore/Loki: Fix field type in table for instant queries (#25907) * Update field type for instant queries to number * Remove fieldtype as in prometheus * Revert "Remove fieldtype as in prometheus" This reverts commit f887ad1125deb1053e33f7ef385d5f518ac27892. * Chore: Disable scopelint for tests (#25923) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * grafana/ui: Fix storybook dev (#25928) * Minimize css and js only for storybook build * Update CodeEditor story, make it internal * Update storybook webpack config * TimeZonePicker: added possibility to toggle if internal time zones should be included or not. (#25934) * made some small adjustments after feedback. * made the flag optional. * Docker: Upgrade to base on Alpine 3.12 (#25936) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * DataLinks: Add internal links in table and allow custom query (#25613) * Add internal links in table and with custom query * Add specific types for internal and external link * Change the datalink types to be more backward compatible * Refactor the link utils for explore * Add internal linking to table panels * Fix derived field condition * Prettify * Add and fix tests * Prettify * Fix imports and tests * Remove unused type * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * CircleCI: Upgrade grabpl (#25939) Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Provisioning: Use folders structure from the file system to create desired folders in dashboard provisioning. (#23117) Fixes #12016 * Added options to customize chart data listening (#25918) * Explore: Remove legend formatting when switching from panel to Explore (#25848) * Remove legend formatting when switching from panel to explore * Add test coverage * Query history: Add search for query history and starred queries (#25747) * Add searching functionality to Queries tab * Implement search for starred queries * Update tests and add test coverage for searching * Changes based on provided feedback * Remove redundant storing of results * Update naming of onSearchFilterChange function in tests * Update filterQueriesBySearchFilter function * Update filterQueriesBySearchFilter function * Debounce search * Remove console.log() * Use useDebouncedCallback * Update tests, remove redundant props * When in starred, search only in starred * Add timefilter as dependency * Remove redundant dependency, refactor * Grafana-UI: Add FileUpload (#25835) * Grafana UI: Setup component * Grafana UI: DashboardFileUpload => FileUpload * Grafana UI: Expand docs * Grafana UI: Add className * Grafana UI: Update import * Grafana UI: Clarify props * Update packages/grafana-ui/src/components/FileUpload/FileUpload.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Grafana UI: Style icon * Grafana UI: Show uploaded file name * Grafana UI: Add tests * Grafana UI: Add useStyles + useCallback * Grafana UI: Remove stylesFactory * Grafana UI: Revert to useTheme Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Fix: Value mappings match against string values (#25929) * Use standard input for value mappings value * add test and case for matching string values * re add number on rangemap * remove FieldTypeNumber required * Docs: Changelog update 7.05 & latest.json update (#25941) * Docs: Changelog update for 7.0.5 * Update latest.json * Fixed alignment * Stackdriver: Rename Stackdriver to Google Cloud Monitoring (#25807) * Update backend * Update frontend * Keep old plugin id * Update docs * Place doc images to a new directory * Legacy support for stackdriver-auto alignment * Consistent plugin name * Apply suggestions from code review Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * Update docs * Update public/app/plugins/datasource/cloud-monitoring/README.md Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> * Add reference to the data source formerly being named Stackdriver * Update pkg/models/datasource.go Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix gofmt Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Carl Bergquist <carl@grafana.com> * Fix strict null errors that resulted from search (#25950) * Arrow: when exporting arrow use the calculated names (#25871) * PanelHeader: Fixed loading icon position (#25949) * PanelHeader: Fixed loading icon position * revert back to text weak color * Azure/Log Analytics: return more error information (#25937) When there is an error message in the HTTP response, this copies that error so it is relayed to the user by being shown in the frontend. This also makes it so when there is an error the interpolated query string (ExecutedQueryString) is returned so users can see it in the query inspector. * Azure: Multiple dimension support for Azure Monitor Service (#25947) Azure Monitor (metrics) support multiple dimensions instead of just one. Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Docs: Update alert-list-panel.md (#25779) Fixed minor typo and format updates * Docs: Update add-a-panel.md (#25780) * Linting fixes for the provisioning package (#25690) * Chore: whatwg-fetch version bump (#25952) * Use latest fetch polyfill/shim * Updated lockfile * Monaco: option to hide line numbers (#25920) * Docs: Reorganize reference topics (#25915) * moved annotations.md * Update annotations.md * moved dashboard_folders.md * moved dashboard_history.md * moved playlist.md * moved search.md * migrations test * docs: spelling (#24383) * Docs: spelling * Docs: spelling (contribute/ directory) * Drop whats-new-in changes * migrations test Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Richard Hartmann <RichiH@users.noreply.github.com> Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com> Co-authored-by: Maksim Nabokikh <32434187+nabokihms@users.noreply.github.com> Co-authored-by: Steven Vachon <contact@svachon.com> Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com> Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Carl Bergquist <carl@grafana.com> Co-authored-by: Kyle Brandt <kyle@grafana.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2020-07-01 02:39:06 -05:00
],
})
.setMigrationHandler(graphPanelMigrationHandler);
// Use the angular ctrt rather than a react one
plugin.angularPanelCtrl = GraphCtrl;