From efb1990a5546169ce07e8202cdae1f83c350a438 Mon Sep 17 00:00:00 2001 From: mahmoodsht <106068383+mahmoodsht@users.noreply.github.com> Date: Mon, 6 Oct 2025 10:49:00 +0330 Subject: [PATCH] =?UTF-8?q?=D8=AC=D8=B2=DB=8C=DB=8C=D8=A7=D8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/strategic-alignment-popup.tsx | 12 ++++++------ app/components/ecosystem/network-graph.tsx | 9 ++++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/components/dashboard/strategic-alignment-popup.tsx b/app/components/dashboard/strategic-alignment-popup.tsx index ad39e81..d430dc3 100644 --- a/app/components/dashboard/strategic-alignment-popup.tsx +++ b/app/components/dashboard/strategic-alignment-popup.tsx @@ -24,7 +24,7 @@ import { TruncatedText } from "../ui/truncatedText"; interface StrategicAlignmentData { strategic_theme: string; - operational_fee_sum: number; + operational_fee_count: number; percentage?: number; } @@ -138,7 +138,7 @@ export function StrategicAlignmentPopup({ ProcessName: "project", OutputFields: [ "strategic_theme", - "sum(operational_fee) as operational_fee_sum", + "count(operational_fee)", ], GroupBy: ["strategic_theme"], }); @@ -168,7 +168,7 @@ export function StrategicAlignmentPopup({ ProcessName: "project", OutputFields: [ "value_technology_and_innovation", - "sum(operational_fee)", + "count(operational_fee)", ], Conditions: [["strategic_theme", "=", item]], GroupBy: ["value_technology_and_innovation"], @@ -233,13 +233,13 @@ export function StrategicAlignmentPopup({ .map((item: any) => ({ strategic_theme: item.strategic_theme || item.value_technology_and_innovation || "N/A", - operational_fee_sum: Math.max(0, Number(item.operational_fee_sum)), + operational_fee_count: Math.max(0, Number(item.operational_fee_count)), })) .filter((item: StrategicAlignmentData) => item.strategic_theme !== ""); const total = processedData.reduce( (acc: number, item: StrategicAlignmentData) => - acc + item.operational_fee_sum, + acc + item.operational_fee_count, 0 ); @@ -247,7 +247,7 @@ export function StrategicAlignmentPopup({ (item: StrategicAlignmentData) => ({ ...item, percentage: - total > 0 ? Math.round((item.operational_fee_sum / total) * 100) : 0, + total > 0 ? Math.round((item.operational_fee_count / total) * 100) : 0, }) ); setData(dataWithPercentage || []); diff --git a/app/components/ecosystem/network-graph.tsx b/app/components/ecosystem/network-graph.tsx index 15b7e44..6cf0d9e 100644 --- a/app/components/ecosystem/network-graph.tsx +++ b/app/components/ecosystem/network-graph.tsx @@ -305,8 +305,8 @@ export function NetworkGraph({ onNodeClick, onLoadingChange }: NetworkGraphProps .enter() .append("g") .attr("class", "node") - .style("cursor", "pointer"); - + .style("cursor", d => d.stageid === -1 ? "default" : "pointer"); + const drag = d3 .drag() .on("start", (event, d) => { @@ -437,9 +437,12 @@ export function NetworkGraph({ onNodeClick, onLoadingChange }: NetworkGraphProps .attr("stroke-width", 3); }); + nodeGroup.on("click", async function (event, d) { event.stopPropagation(); - if (d.isCenter) return; + + // جلوگیری از کلیک روی مرکز و دسته‌بندی‌ها + if (d.isCenter || d.stageid === -1) return; if (onNodeClick && d.stageid) { // Open dialog immediately with basic info