{localExports.map((exports) => (
-
- {planetConfig?.excludeFromTotals ? "ex" : ""}
-
+ control={
+
+ }
+ label=""
+ />
))}
diff --git a/src/app/components/PlanetaryInteraction/ProductionChainVisualization.tsx b/src/app/components/PlanetaryInteraction/ProductionChainVisualization.tsx
index 71c2615..d1381fd 100644
--- a/src/app/components/PlanetaryInteraction/ProductionChainVisualization.tsx
+++ b/src/app/components/PlanetaryInteraction/ProductionChainVisualization.tsx
@@ -1,7 +1,9 @@
import React from 'react';
-import { Box, Paper, Typography, Grid, Stack, Divider } from '@mui/material';
+import { Box, Paper, Typography, Grid, Stack, Divider, Tooltip } from '@mui/material';
import { EVE_IMAGE_URL } from '@/const';
import { PI_TYPES_MAP } from '@/const';
+import { DateTime } from 'luxon';
+import Countdown from 'react-countdown';
interface Factory {
schematic_id: number;
@@ -29,6 +31,7 @@ interface ProductionChainVisualizationProps {
typeId: number;
baseValue: number;
cycleTime: number;
+ expiryTime: string;
}>;
factories: Factory[];
extractorTotals: Map;
@@ -39,8 +42,10 @@ export const ProductionChainVisualization: React.FC {
+
// Get all type IDs involved in the production chain
const allTypeIds = new Set();
const requiredInputs = new Set();
@@ -214,9 +219,15 @@ export const ProductionChainVisualization: React.FC {
- const node = nodesByOutput.get(typeId);
- if (!node) return 0;
- return factories.find(f => f.schematic_id === node.schematicId)?.count ?? 0;
+ // First find the node that produces this type
+ const producingNode = productionNodes.find(node =>
+ node.outputs.some(output => output.typeId === typeId)
+ );
+
+ if (!producingNode) return 0;
+
+ // Then find the factory count for this schematic
+ return factories.find(f => f.schematic_id === producingNode.schematicId)?.count ?? 0;
};
// Get input requirements for a type
@@ -232,6 +243,11 @@ export const ProductionChainVisualization: React.FC {
+ return extractors.find(e => e.typeId === typeId)?.expiryTime;
+ };
+
return (
@@ -258,6 +274,7 @@ export const ProductionChainVisualization: React.FC
@@ -292,19 +309,49 @@ export const ProductionChainVisualization: React.FC
- {production > 0 && (
- <>
-
- Production: {production.toFixed(1)} units total
+ {factoryCount > 0 && (
+
+ Factories: {factoryCount}
+
+ )}
+ {inputs.length > 0 && (
+
+
+ Inputs:
- >
+ {inputs.map(input => (
+
+ {PI_TYPES_MAP[input.typeId]?.name}: {input.quantity * factoryCount}/cycle
+
+ ))}
+
+ )}
+ {expiryTime && (
+
+
+ Extractor expires in:
+
+
+
+
+
+ )}
+ {production > 0 && (
+
+ Production: {production.toFixed(1)} units total
+
)}
{consumption > 0 && (
- <>
-
- Consumption: {consumption.toFixed(1)} units total
-
- >
+
+ Consumption: {consumption.toFixed(1)} units total
+
)}
{isImported && (
<>
diff --git a/src/planets.ts b/src/planets.ts
index 55ae177..5982905 100644
--- a/src/planets.ts
+++ b/src/planets.ts
@@ -61,10 +61,19 @@ export const planetCalculations = (planet: PlanetWithInfo) => {
const schematic = PI_SCHEMATICS.find(
(s) => s.schematic_id == f.schematic_id,
);
- if (schematic) acc.set(f.schematic_id, schematic);
+ if (schematic) {
+ const existing = acc.get(f.schematic_id);
+ if (existing) {
+ // If we already have this schematic, increment its count
+ existing.count = (existing.count || 0) + 1;
+ } else {
+ // First time seeing this schematic, set count to 1
+ acc.set(f.schematic_id, { ...schematic, count: 1 });
+ }
+ }
}
return acc;
- }, new Map());
+ }, new Map());
const locallyProduced = Array.from(localProduction)
.flatMap((p) => p[1].outputs)