From 0895967f20ef33bc0f32c99bac0a93761915b87f Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sat, 16 Oct 2021 23:54:48 +0200 Subject: feat(algos): ability to select coloring --- components/Tweaks/GraphColorSelect.tsx | 59 ++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 components/Tweaks/GraphColorSelect.tsx (limited to 'components/Tweaks/GraphColorSelect.tsx') diff --git a/components/Tweaks/GraphColorSelect.tsx b/components/Tweaks/GraphColorSelect.tsx new file mode 100644 index 0000000..b52dde2 --- /dev/null +++ b/components/Tweaks/GraphColorSelect.tsx @@ -0,0 +1,59 @@ +import React, { useContext } from 'react' +import { + Box, + Button, + Flex, + Menu, + MenuButton, + MenuItem, + MenuList, + Portal, + Text, +} from '@chakra-ui/react' +import { ChevronDownIcon } from '@chakra-ui/icons' + +export interface GraphColorSelectProps { + coloring: string + setColoring: any +} + +export const GraphColorSelect = (props: GraphColorSelectProps) => { + type Theme = { [key: string]: string } + const { coloring, setColoring } = props + return ( + + Graph coloring + + } + > + {coloring === 'degree' ? 'Links' : 'Communities'} + + + + setColoring('degree')} + justifyContent="space-between" + alignItems="center" + display="flex" + > + Number of links + + setColoring('community')} + justifyContent="space-between" + alignItems="center" + display="flex" + > + Communities + + + + + + ) +} -- cgit v1.2.3