健康风险分析,右下角新增图例;图例颜色方案重新设计,高风险(红色),低风险(绿色),符合常规颜色表达;
This commit is contained in:
@@ -6,6 +6,12 @@ import MapToolbar from "@app/OlMap/Controls/Toolbar";
|
||||
import { HealthRiskProvider } from "@components/olmap/HealthRiskAnalysis/HealthRiskContext";
|
||||
import HealthRiskPieChart from "@components/olmap/HealthRiskAnalysis/HealthRiskPieChart";
|
||||
import PredictDataPanel from "@components/olmap/HealthRiskAnalysis/PredictDataPanel";
|
||||
import StyleLegend from "@app/OlMap/Controls/StyleLegend";
|
||||
import {
|
||||
RAINBOW_COLORS,
|
||||
RISK_BREAKS,
|
||||
} from "@components/olmap/HealthRiskAnalysis/types";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
@@ -19,6 +25,17 @@ export default function Home() {
|
||||
/>
|
||||
<Timeline />
|
||||
<HealthRiskPieChart />
|
||||
<Box className="absolute bottom-40 right-4 drop-shadow-xl flex flex-row items-end max-w-screen-lg overflow-x-auto z-10">
|
||||
<StyleLegend
|
||||
layerName="管道"
|
||||
layerId="health-risk"
|
||||
property="健康风险"
|
||||
colors={RAINBOW_COLORS}
|
||||
type="line"
|
||||
dimensions={Array(RAINBOW_COLORS.length).fill(2)}
|
||||
breaks={[0, ...RISK_BREAKS]}
|
||||
/>
|
||||
</Box>
|
||||
</MapComponent>
|
||||
</HealthRiskProvider>
|
||||
</div>
|
||||
|
||||
@@ -112,7 +112,9 @@ const fetchFromBackend = async (
|
||||
]);
|
||||
|
||||
const cleanedData = transformBackendData(cleanedRes, featureIds);
|
||||
const rawData = transformBackendData(rawRes, featureIds);
|
||||
// 如果清洗数据有值,则不显示原始监测值
|
||||
const rawData =
|
||||
cleanedData.length > 0 ? [] : transformBackendData(rawRes, featureIds);
|
||||
|
||||
return mergeTimeSeriesData(
|
||||
cleanedData,
|
||||
@@ -136,7 +138,9 @@ const fetchFromBackend = async (
|
||||
]);
|
||||
|
||||
const cleanedData = transformBackendData(cleanedRes, featureIds);
|
||||
const rawData = transformBackendData(rawRes, featureIds);
|
||||
// 如果清洗数据有值,则不显示原始监测值
|
||||
const rawData =
|
||||
cleanedData.length > 0 ? [] : transformBackendData(rawRes, featureIds);
|
||||
const schemeSimData = transformBackendData(schemeSimRes, featureIds);
|
||||
|
||||
// 合并三组数据
|
||||
@@ -186,7 +190,9 @@ const fetchFromBackend = async (
|
||||
]);
|
||||
|
||||
const cleanedData = transformBackendData(cleanedRes, featureIds);
|
||||
const rawData = transformBackendData(rawRes, featureIds);
|
||||
// 如果清洗数据有值,则不显示原始监测值
|
||||
const rawData =
|
||||
cleanedData.length > 0 ? [] : transformBackendData(rawRes, featureIds);
|
||||
const simulationData = transformBackendData(simulationRes, featureIds);
|
||||
|
||||
// 合并三组数据
|
||||
|
||||
@@ -185,6 +185,7 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
|
||||
const {
|
||||
currentJunctionCalData,
|
||||
currentPipeCalData,
|
||||
pipeData,
|
||||
junctionText,
|
||||
pipeText,
|
||||
setShowJunctionTextLayer,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import React from "react";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
|
||||
@@ -45,14 +45,13 @@ interface DataContextType {
|
||||
currentJunctionCalData?: any[]; // 当前计算结果
|
||||
setCurrentJunctionCalData?: React.Dispatch<React.SetStateAction<any[]>>;
|
||||
currentPipeCalData?: any[]; // 当前计算结果
|
||||
pipeData?: any[]; // 管道数据(含坐标等信息)
|
||||
setCurrentPipeCalData?: React.Dispatch<React.SetStateAction<any[]>>;
|
||||
pipeData?: any[]; // 管道数据(含坐标)
|
||||
showJunctionText?: boolean; // 是否显示节点文本
|
||||
showPipeText?: boolean; // 是否显示管道文本
|
||||
setShowJunctionTextLayer?: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
setShowPipeTextLayer?: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
setShowContourLayer?: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
// flowAnimation?: React.RefObject<boolean>;
|
||||
isContourLayerAvailable?: boolean;
|
||||
setShowWaterflowLayer?: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
setContourLayerAvailable?: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
@@ -972,7 +971,6 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
|
||||
setShowJunctionTextLayer,
|
||||
setShowPipeTextLayer,
|
||||
setShowContourLayer,
|
||||
// flowAnimation,
|
||||
isContourLayerAvailable,
|
||||
setContourLayerAvailable,
|
||||
isWaterflowLayerAvailable,
|
||||
|
||||
Reference in New Issue
Block a user