mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
* Remove unused function in panel utils * remove another unused function
This commit is contained in:
parent
74a4bc5c15
commit
aec8390558
1 changed files with 0 additions and 32 deletions
|
@ -1,29 +1,7 @@
|
|||
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../dashboard_constants';
|
||||
import chrome from 'ui/chrome';
|
||||
|
||||
import _ from 'lodash';
|
||||
|
||||
export class PanelUtils {
|
||||
/**
|
||||
* Fills in default parameters where not specified.
|
||||
* @param {PanelState} panel
|
||||
*/
|
||||
static initializeDefaults(panel) {
|
||||
panel.gridData = panel.gridData || {};
|
||||
panel.gridData.w = panel.gridData.w || DEFAULT_PANEL_WIDTH;
|
||||
panel.gridData.h = panel.gridData.h || DEFAULT_PANEL_HEIGHT;
|
||||
|
||||
if (!panel.id) {
|
||||
// In the interest of backwards comparability
|
||||
if (panel.visId) {
|
||||
panel.id = panel.visId;
|
||||
panel.type = 'visualization';
|
||||
delete panel.visId;
|
||||
} else {
|
||||
throw new Error('Missing object id on panel');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static convertOldPanelData(panel) {
|
||||
panel.gridData = {
|
||||
|
@ -43,16 +21,6 @@ export class PanelUtils {
|
|||
return panel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the panel with the given panelIndex from the panels array (*NOT* the panel at the given index).
|
||||
* @param panelIndex {number} - Note this is *NOT* the index of the panel in the panels array.
|
||||
* panelIndex is really a panelId, but is called panelIndex for BWC reasons.
|
||||
* @param panels {Array<Object>}
|
||||
*/
|
||||
static findPanelByPanelIndex(panelIndex, panels) {
|
||||
return _.find(panels, (panel) => panel.panelIndex === panelIndex);
|
||||
}
|
||||
|
||||
static initPanelIndexes(panels) {
|
||||
// find the largest panelIndex in all the panels
|
||||
let maxIndex = this.getMaxPanelIndex(panels);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue