Merge pull request #1457 from bluewave-labs/fix/response-chart-color
fix: pie chart colors and Metrics box that was overflowing
This commit is contained in:
5 files changed
+18
-18
No files matched your search
@@ -101,21 +101,21 @@ PieValueLabel.propTypes = {
|
|||||||
highlighted: PropTypes.bool.isRequired,
|
highlighted: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Weight constants for different performance metrics.
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
|
const weights = {
|
||||||
|
fcp: 10,
|
||||||
|
si: 10,
|
||||||
|
lcp: 25,
|
||||||
|
tbt: 30,
|
||||||
|
cls: 25,
|
||||||
|
};
|
||||||
|
|
||||||
const PieChart = ({ audits }) => {
|
const PieChart = ({ audits }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
/**
|
|
||||||
* Weight constants for different performance metrics.
|
|
||||||
* @type {Object}
|
|
||||||
*/
|
|
||||||
const weights = {
|
|
||||||
fcp: 10,
|
|
||||||
si: 10,
|
|
||||||
lcp: 25,
|
|
||||||
tbt: 30,
|
|
||||||
cls: 25,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves color properties based on the performance value.
|
* Retrieves color properties based on the performance value.
|
||||||
*
|
*
|
||||||
@@ -128,7 +128,7 @@ const PieChart = ({ audits }) => {
|
|||||||
stroke: theme.palette.success.main,
|
stroke: theme.palette.success.main,
|
||||||
strokeBg: theme.palette.success.light,
|
strokeBg: theme.palette.success.light,
|
||||||
text: theme.palette.success.contrastText,
|
text: theme.palette.success.contrastText,
|
||||||
bg: theme.palette.success.dark,
|
bg: theme.palette.success.light,
|
||||||
};
|
};
|
||||||
else if (value >= 50 && value < 90)
|
else if (value >= 50 && value < 90)
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ const PageSpeedDetails = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
<ChartBox
|
<ChartBox
|
||||||
flex={1}
|
flex={1}
|
||||||
|
/* TODO apply 1fr 1fr for columns, and auto 1fr for Rows */
|
||||||
sx={{ gridTemplateColumns: "50% 50%", gridTemplateRows: "15% 85%" }}
|
sx={{ gridTemplateColumns: "50% 50%", gridTemplateRows: "15% 85%" }}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Stack, styled } from "@mui/material";
|
|||||||
|
|
||||||
export const ChartBox = styled(Stack)(({ theme }) => ({
|
export const ChartBox = styled(Stack)(({ theme }) => ({
|
||||||
display: "grid",
|
display: "grid",
|
||||||
height: 300,
|
minHeight: 300,
|
||||||
minWidth: 250,
|
minWidth: 250,
|
||||||
border: 1,
|
border: 1,
|
||||||
borderStyle: "solid",
|
borderStyle: "solid",
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import timezones from "../../Utils/timezones.json";
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { networkService } from "../../main";
|
import { networkService } from "../../main";
|
||||||
import { settingsValidation } from "../../Validation/validation";
|
import { settingsValidation } from "../../Validation/validation";
|
||||||
import { useNavigate } from "react-router";
|
|
||||||
import Dialog from "../../Components/Dialog";
|
import Dialog from "../../Components/Dialog";
|
||||||
import { useIsAdmin } from "../../Hooks/useIsAdmin";
|
import { useIsAdmin } from "../../Hooks/useIsAdmin";
|
||||||
import ConfigBox from "../../Components/ConfigBox";
|
import ConfigBox from "../../Components/ConfigBox";
|
||||||
@@ -44,7 +43,6 @@ const Settings = () => {
|
|||||||
const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false };
|
const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false };
|
||||||
const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState);
|
const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
//Fetching latest release version from github
|
//Fetching latest release version from github
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const paletteColors = {
|
|||||||
green50: "#D4F4E1",
|
green50: "#D4F4E1",
|
||||||
green150: "#45BB7A",
|
green150: "#45BB7A",
|
||||||
green400: "#079455",
|
green400: "#079455",
|
||||||
|
green500: "#07B467",
|
||||||
green800: "#1C4428",
|
green800: "#1C4428",
|
||||||
green900: "#12261E",
|
green900: "#12261E",
|
||||||
red50: "#F9ECED",
|
red50: "#F9ECED",
|
||||||
@@ -96,10 +97,10 @@ const semanticColors = {
|
|||||||
},
|
},
|
||||||
contrastText: {
|
contrastText: {
|
||||||
light: paletteColors.green50,
|
light: paletteColors.green50,
|
||||||
dark: paletteColors.green900,
|
dark: paletteColors.green50,
|
||||||
},
|
},
|
||||||
light: {
|
light: {
|
||||||
light: paletteColors.green50,
|
light: paletteColors.green500,
|
||||||
dark: paletteColors.green800,
|
dark: paletteColors.green800,
|
||||||
},
|
},
|
||||||
dark: {
|
dark: {
|
||||||
|
|||||||
Reference in new issue
Block a user