Implemented sorted graph

This commit is contained in:
Sebastian Seedorf
2022-08-15 23:24:58 +02:00
parent 183396f599
commit 9082dcdd26
15 changed files with 464 additions and 71 deletions

View File

@@ -4,6 +4,7 @@
border: 1px solid white;
display: inline-block;
position: relative;
height: fit-content;
}
.amount {

View File

@@ -6,6 +6,7 @@ import styles from "./GroupBox.module.css"
import {EntitySpan} from "../EntitySpan/EntitySpan";
import {useGroups} from "../../contexts/GroupProvider";
import {calculateInputs} from "../../../src/calculateInputs";
import {uniquify} from "../../../src/utils";
interface Props {
group: Group
@@ -44,8 +45,8 @@ const GroupBoxBase: FC<Props> = ({ group }) => {
}, [exports, malls, ignoredFactories, baseFactories, findFactory, exportedFactories])
const [suggestionsExport, suggestionMall] = useMemo<[EnrichedEntity[], EnrichedEntity[]]>(() => {
const selectedValues = Array.from(new Set([...exports, ...malls]))
const availableIngredients = Array.from(new Set([...selectedValues, ...intermediates, ...inputs]))
const selectedValues = uniquify([...exports, ...malls])
const availableIngredients = uniquify([...selectedValues, ...intermediates, ...inputs])
return factories
.filter(factory => {
if (!factory.recipe) return false