@grafana/scenes 4.1.0--canary.658.8513775587.0 → 4.1.0--canary.664.8521108294.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/layout/grid/SceneGridLayout.js +1 -5
- package/dist/esm/components/layout/grid/SceneGridLayout.js.map +1 -1
- package/dist/esm/components/layout/grid/SceneGridLayoutRenderer.js +4 -2
- package/dist/esm/components/layout/grid/SceneGridLayoutRenderer.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersVariable.js +2 -1
- package/dist/esm/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
- package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
- package/dist/index.d.ts +1 -7
- package/dist/index.js +633 -671
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/components/layout/grid/utils.js +0 -42
- package/dist/esm/components/layout/grid/utils.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/scenes",
|
|
3
|
-
"version": "4.1.0--canary.
|
|
3
|
+
"version": "4.1.0--canary.664.8521108294.0",
|
|
4
4
|
"description": "Grafana framework for building dynamic dashboards",
|
|
5
5
|
"author": "Grafana Labs",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"prettier --write"
|
|
116
116
|
]
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "84c19e12e0dc7cf3ef21c98be15dc769fef330f0"
|
|
119
119
|
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from './constants.js';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
function fitPanelsInHeight(cells, height) {
|
|
23
|
-
const visibleHeight = height - GRID_CELL_VMARGIN * 4;
|
|
24
|
-
const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));
|
|
25
|
-
const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));
|
|
26
|
-
const scaleFactor = currentGridHeight / visibleGridHeight;
|
|
27
|
-
console.log("scaleFactor", scaleFactor);
|
|
28
|
-
console.log("y");
|
|
29
|
-
return cells.map((cell) => {
|
|
30
|
-
console.log("cell.y", cell.y);
|
|
31
|
-
console.log("cell.h", cell.h);
|
|
32
|
-
console.log("Math.round(cell.y / scaleFactor)", Math.round(cell.y / scaleFactor));
|
|
33
|
-
console.log("Math.round(cell.h / scaleFactor)", Math.round(cell.h / scaleFactor));
|
|
34
|
-
return __spreadProps(__spreadValues({}, cell), {
|
|
35
|
-
y: Math.round(cell.y / scaleFactor) || 0,
|
|
36
|
-
h: Math.round(cell.h / scaleFactor) || 1
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { fitPanelsInHeight };
|
|
42
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../src/components/layout/grid/utils.ts"],"sourcesContent":["import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from './constants';\n\nexport function fitPanelsInHeight(cells: ReactGridLayout.Layout[], height: number) {\n // Take into account cell margint top + cell margin bottom + adding some marging at the bottom\n const visibleHeight = height - GRID_CELL_VMARGIN * 4;\n const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));\n\n const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));\n const scaleFactor = currentGridHeight / visibleGridHeight;\n\n console.log('scaleFactor', scaleFactor);\n console.log('y');\n return cells.map((cell) => {\n console.log('cell.y', cell.y);\n console.log('cell.h', cell.h);\n console.log('Math.round(cell.y / scaleFactor)', Math.round(cell.y / scaleFactor));\n console.log('Math.round(cell.h / scaleFactor)', Math.round(cell.h / scaleFactor));\n return {\n ...cell,\n y: Math.round(cell.y / scaleFactor) || 0,\n h: Math.round(cell.h / scaleFactor) || 1,\n };\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEgB,SAAA,iBAAA,CAAkB,OAAiC,MAAgB,EAAA;AAEjF,EAAM,MAAA,aAAA,GAAgB,SAAS,iBAAoB,GAAA,CAAA,CAAA;AACnD,EAAA,MAAM,iBAAoB,GAAA,IAAA,CAAK,GAAI,CAAA,GAAG,KAAM,CAAA,GAAA,CAAI,CAAC,IAAA,KAAS,IAAK,CAAA,CAAA,GAAI,IAAK,CAAA,CAAC,CAAC,CAAA,CAAA;AAE1E,EAAA,MAAM,iBAAoB,GAAA,IAAA,CAAK,KAAM,CAAA,aAAA,IAAiB,mBAAmB,iBAAkB,CAAA,CAAA,CAAA;AAC3F,EAAA,MAAM,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