mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
Feat: Singlestat panel react progress & refactorings (#16039)
* big value component * big value component * editor for font and sparkline * less logging * remove sparkline from storybook * add display value link wrapper * follow tooltip * follow tooltip * merge master * Just minor refactoring * use series after last merge * Refactoring: moving shared singlestat stuff to grafana-ui * Refactor: Moved final getSingleStatDisplayValues func
This commit is contained in:
committed by
Torkel Ödegaard
parent
1d955a8762
commit
c8b2102500
@@ -5,20 +5,26 @@ import React, { PureComponent } from 'react';
|
||||
import { config } from 'app/core/config';
|
||||
|
||||
// Components
|
||||
import { PieChart } from '@grafana/ui';
|
||||
import { PieChart, getSingleStatDisplayValues } from '@grafana/ui';
|
||||
|
||||
// Types
|
||||
import { PieChartOptions } from './types';
|
||||
import { PanelProps } from '@grafana/ui/src/types';
|
||||
import { getSingleStatValues } from '../singlestat2/SingleStatPanel';
|
||||
|
||||
interface Props extends PanelProps<PieChartOptions> {}
|
||||
|
||||
export class PieChartPanel extends PureComponent<Props> {
|
||||
render() {
|
||||
const { width, height, options } = this.props;
|
||||
const { width, height, options, data, replaceVariables } = this.props;
|
||||
|
||||
const values = getSingleStatValues(this.props);
|
||||
const values = getSingleStatDisplayValues({
|
||||
valueMappings: options.valueMappings,
|
||||
thresholds: options.thresholds,
|
||||
valueOptions: options.valueOptions,
|
||||
data: data,
|
||||
theme: config.theme,
|
||||
replaceVariables: replaceVariables,
|
||||
});
|
||||
|
||||
return (
|
||||
<PieChart
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { PanelEditorProps, PanelOptionsGrid, ValueMappingsEditor, ValueMapping } from '@grafana/ui';
|
||||
import {
|
||||
PanelEditorProps,
|
||||
PanelOptionsGrid,
|
||||
ValueMappingsEditor,
|
||||
ValueMapping,
|
||||
SingleStatValueOptions,
|
||||
SingleStatValueEditor,
|
||||
} from '@grafana/ui';
|
||||
|
||||
import { PieChartOptionsBox } from './PieChartOptionsBox';
|
||||
import { PieChartOptions } from './types';
|
||||
import { SingleStatValueEditor } from '../singlestat2/SingleStatValueEditor';
|
||||
import { SingleStatValueOptions } from '../singlestat2/types';
|
||||
|
||||
export class PieChartPanelEditor extends PureComponent<PanelEditorProps<PieChartOptions>> {
|
||||
onValueMappingsChanged = (valueMappings: ValueMapping[]) =>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { PieChartType, StatID, VizOrientation } from '@grafana/ui';
|
||||
import { SingleStatBaseOptions } from '../singlestat2/types';
|
||||
import { PieChartType, StatID, VizOrientation, SingleStatBaseOptions } from '@grafana/ui';
|
||||
|
||||
export interface PieChartOptions extends SingleStatBaseOptions {
|
||||
pieType: PieChartType;
|
||||
|
||||
Reference in New Issue
Block a user