-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Get rid of factory function and Panel class. - Rename panel.js to panel_state.js - Rename dashboard_panel_directive to dashboard_panel
- Loading branch information
1 parent
93afafa
commit aa8d6c8
Showing
5 changed files
with
42 additions
and
84 deletions.
There are no files selected for viewing
77 changes: 0 additions & 77 deletions
77
src/core_plugins/kibana/public/dashboard/components/panel/lib/panel.js
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
src/core_plugins/kibana/public/dashboard/components/panel/lib/panel_state.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export const DEFAULT_PANEL_WIDTH = 3; | ||
export const DEFAULT_PANEL_HEIGHT = 2; | ||
|
||
/** | ||
* Represents a panel on a grid. Keeps track of position in the grid and what visualization it | ||
* contains. | ||
* | ||
* @typedef PanelState | ||
* @property {number} id - Id of the visualization contained in the panel. | ||
* @property {Element} $el - A reference to the gridster widget holding this panel. Used to | ||
* update the size and column attributes. TODO: move out of panel state as this couples state to ui. | ||
* @property {string} type - Type of the visualization in the panel. | ||
* @property {number} panelId - Unique id to represent this panel in the grid. | ||
* @property {number} size_x - Width of the panel. | ||
* @property {number} size_y - Height of the panel. | ||
* @property {number} col - Column index in the grid. | ||
* @property {number} row - Row index in the grid. | ||
*/ | ||
|
||
/** | ||
* Creates and initializes a basic panel state. | ||
* @param {number} id | ||
* @param {string} type | ||
* @param {number} panelId | ||
* @return {PanelState} | ||
*/ | ||
export function createPanelState(id, type, panelId) { | ||
return { | ||
size_x: DEFAULT_PANEL_WIDTH, | ||
size_y: DEFAULT_PANEL_HEIGHT, | ||
panelId: panelId, | ||
type: type, | ||
id: id | ||
}; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/core_plugins/kibana/public/dashboard/components/panel/lib/panel_utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters