Commit 0c8f0416 by Dominik Prokop

Move panel width/height calculation to PanelChrome

parent b3b1c21d
...@@ -19,6 +19,8 @@ import { DashboardModel } from '../dashboard_model'; ...@@ -19,6 +19,8 @@ import { DashboardModel } from '../dashboard_model';
import { PanelPlugin } from 'app/types'; import { PanelPlugin } from 'app/types';
import { TimeRange } from '@grafana/ui'; import { TimeRange } from '@grafana/ui';
import variables from 'sass/_variables.scss';
export interface Props { export interface Props {
panel: PanelModel; panel: PanelModel;
dashboard: DashboardModel; dashboard: DashboardModel;
...@@ -122,8 +124,8 @@ export class PanelChrome extends PureComponent<Props, State> { ...@@ -122,8 +124,8 @@ export class PanelChrome extends PureComponent<Props, State> {
timeSeries={timeSeries} timeSeries={timeSeries}
timeRange={timeRange} timeRange={timeRange}
options={panel.getOptions(plugin.exports.PanelDefaults)} options={panel.getOptions(plugin.exports.PanelDefaults)}
width={width} width={width - 2 * variables.panelHorizontalPadding }
height={height - PANEL_HEADER_HEIGHT} height={height - PANEL_HEADER_HEIGHT - variables.panelVerticalPadding}
renderCounter={renderCounter} renderCounter={renderCounter}
/> />
</div> </div>
......
...@@ -3,7 +3,6 @@ import { GaugeOptions, PanelProps, NullValueMode } from '@grafana/ui'; ...@@ -3,7 +3,6 @@ import { GaugeOptions, PanelProps, NullValueMode } from '@grafana/ui';
import { getTimeSeriesVMs } from 'app/viz/state/timeSeries'; import { getTimeSeriesVMs } from 'app/viz/state/timeSeries';
import Gauge from 'app/viz/Gauge'; import Gauge from 'app/viz/Gauge';
import variables from 'sass/_variables.scss';
interface Props extends PanelProps<GaugeOptions> {} interface Props extends PanelProps<GaugeOptions> {}
...@@ -20,8 +19,8 @@ export class GaugePanel extends PureComponent<Props> { ...@@ -20,8 +19,8 @@ export class GaugePanel extends PureComponent<Props> {
<Gauge <Gauge
timeSeries={vmSeries} timeSeries={vmSeries}
{...this.props.options} {...this.props.options}
width={width - 2 * variables.panelHorizontalPadding} width={width}
height={height - variables.panelVerticalPadding} height={height}
/> />
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment