fix: Adjust panel size calculations and clean up realTimeViz styles
This commit is contained in:
@@ -126,16 +126,15 @@ const Panel: React.FC<PanelProps> = ({
|
|||||||
const bottomActive = previousPanels.includes("bottom");
|
const bottomActive = previousPanels.includes("bottom");
|
||||||
|
|
||||||
// Dynamic panel sizes based on canvas width
|
// Dynamic panel sizes based on canvas width
|
||||||
const panelSizeWidth = Math.max(canvasDimensions.width * 0.165, 200); // Ensure minimum width of 200px
|
const panelSizeWidth = isPlaying ? Math.max(canvasDimensions.width * 0.14, 200) : Math.max(canvasDimensions.width * 0.165, 200); // Ensure minimum width of 200px
|
||||||
const panelSizeHeight = Math.max(canvasDimensions.width * 0.13, 200); // Ensure minimum height of 200px
|
const panelSizeHeight = isPlaying ? Math.max(canvasDimensions.width * 0.13, 200) : Math.max(canvasDimensions.width * 0.13, 200); // Ensure minimum height of 200px
|
||||||
|
|
||||||
switch (side) {
|
switch (side) {
|
||||||
case "top":
|
case "top":
|
||||||
case "bottom":
|
case "bottom":
|
||||||
return {
|
return {
|
||||||
// minWidth: "200px", // Minimum width constraint
|
// minWidth: "200px", // Minimum width constraint
|
||||||
width: `calc(100% - ${
|
width: `calc(100% - ${(leftActive ? panelSizeWidth : 0) +
|
||||||
(leftActive ? panelSizeWidth : 0) +
|
|
||||||
(rightActive ? panelSizeWidth : 0)
|
(rightActive ? panelSizeWidth : 0)
|
||||||
}px)`,
|
}px)`,
|
||||||
minHeight: "200px", // Minimum height constraint
|
minHeight: "200px", // Minimum height constraint
|
||||||
@@ -151,8 +150,7 @@ const Panel: React.FC<PanelProps> = ({
|
|||||||
minWidth: "200px", // Minimum width constraint
|
minWidth: "200px", // Minimum width constraint
|
||||||
width: `${panelSizeWidth - 2}px`, // Subtracting for border or margin
|
width: `${panelSizeWidth - 2}px`, // Subtracting for border or margin
|
||||||
// minHeight: "200px", // Minimum height constraint
|
// minHeight: "200px", // Minimum height constraint
|
||||||
height: `calc(100% - ${
|
height: `calc(100% - ${(topActive ? panelSizeHeight : 0) +
|
||||||
(topActive ? panelSizeHeight : 0) +
|
|
||||||
(bottomActive ? panelSizeHeight : 0)
|
(bottomActive ? panelSizeHeight : 0)
|
||||||
}px)`,
|
}px)`,
|
||||||
top: topActive ? `${panelSizeHeight}px` : "0",
|
top: topActive ? `${panelSizeHeight}px` : "0",
|
||||||
@@ -299,8 +297,7 @@ const Panel: React.FC<PanelProps> = ({
|
|||||||
{selectedZone.activeSides.map((side) => (
|
{selectedZone.activeSides.map((side) => (
|
||||||
<div
|
<div
|
||||||
key={side}
|
key={side}
|
||||||
className={`panel ${side}-panel absolute ${isPlaying ? "" : ""} ${
|
className={`panel ${side}-panel absolute ${isPlaying ? "" : ""} ${hiddenPanels.includes(side) ? "hidePanel" : ""
|
||||||
hiddenPanels.includes(side) ? "hidePanel" : ""
|
|
||||||
}`}
|
}`}
|
||||||
style={getPanelStyle(side)}
|
style={getPanelStyle(side)}
|
||||||
onDrop={(e) => handleDrop(e, side)}
|
onDrop={(e) => handleDrop(e, side)}
|
||||||
|
|||||||
@@ -306,7 +306,6 @@
|
|||||||
min-height: 150px;
|
min-height: 150px;
|
||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
|
|
||||||
min-width: 160px;
|
min-width: 160px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -324,14 +323,12 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.right-panel {
|
&.right-panel {
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.left-panel,
|
&.left-panel,
|
||||||
@@ -342,7 +339,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
@@ -355,8 +351,6 @@
|
|||||||
background-color: var(--background-color);
|
background-color: var(--background-color);
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,8 +362,8 @@
|
|||||||
|
|
||||||
.playingFlase {
|
.playingFlase {
|
||||||
.zone-wrapper.bottom {
|
.zone-wrapper.bottom {
|
||||||
bottom: calc(var(--realTimeViz-container-height) * 0.3);
|
bottom: calc(var(--realTimeViz-container-height) * 0.25);
|
||||||
bottom: 210px;
|
// bottom: 210px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -658,9 +652,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -756,14 +747,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.connectionSuccess {
|
.connectionSuccess {
|
||||||
outline-color: #43C06D;
|
outline-color: #43c06d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.connectionFails {
|
.connectionFails {
|
||||||
outline-color: #ffe3e0;
|
outline-color: #ffe3e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.editWidgetOptions {
|
.editWidgetOptions {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
// top: 50%;
|
// top: 50%;
|
||||||
|
|||||||
Reference in New Issue
Block a user