@neo4j-ndl/react-graph 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/graph-visualization-buttons.js +85 -20
- package/lib/cjs/graph-visualization-buttons.js.map +1 -1
- package/lib/esm/graph-visualization-buttons.js +85 -20
- package/lib/esm/graph-visualization-buttons.js.map +1 -1
- package/lib/types/graph-visualization-buttons.d.ts +13 -5
- package/lib/types/graph-visualization-buttons.d.ts.map +1 -1
- package/lib/types/graph-visualization.d.ts +58 -3
- package/lib/types/graph-visualization.d.ts.map +1 -1
- package/package.json +3 -3
- package/lib/cjs/stories/graph-visualization-barebones.story.js +0 -93
- package/lib/cjs/stories/graph-visualization-barebones.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-custom.story.js +0 -77
- package/lib/cjs/stories/graph-visualization-custom.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-default.story.js +0 -93
- package/lib/cjs/stories/graph-visualization-default.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-highlighting.story.js +0 -30
- package/lib/cjs/stories/graph-visualization-highlighting.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-maximalist.story.js +0 -107
- package/lib/cjs/stories/graph-visualization-maximalist.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-range-styling.story.js +0 -100
- package/lib/cjs/stories/graph-visualization-range-styling.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js +0 -270
- package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js +0 -181
- package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js +0 -81
- package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-search.story.js +0 -36
- package/lib/cjs/stories/graph-visualization-search.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-simple-styling.story.js +0 -59
- package/lib/cjs/stories/graph-visualization-simple-styling.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-unique-colors-styling.story.js +0 -71
- package/lib/cjs/stories/graph-visualization-unique-colors-styling.story.js.map +0 -1
- package/lib/cjs/stories/index.js +0 -80
- package/lib/cjs/stories/index.js.map +0 -1
- package/lib/cjs/stories/preview-graph-visualization.story.js +0 -68
- package/lib/cjs/stories/preview-graph-visualization.story.js.map +0 -1
- package/lib/cjs/stories/story-data.js +0 -992
- package/lib/cjs/stories/story-data.js.map +0 -1
- package/lib/esm/stories/graph-visualization-barebones.story.js +0 -90
- package/lib/esm/stories/graph-visualization-barebones.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-custom.story.js +0 -74
- package/lib/esm/stories/graph-visualization-custom.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-default.story.js +0 -90
- package/lib/esm/stories/graph-visualization-default.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-highlighting.story.js +0 -28
- package/lib/esm/stories/graph-visualization-highlighting.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-maximalist.story.js +0 -104
- package/lib/esm/stories/graph-visualization-maximalist.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-range-styling.story.js +0 -97
- package/lib/esm/stories/graph-visualization-range-styling.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js +0 -267
- package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js +0 -178
- package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-rule-based-styling.story.js +0 -78
- package/lib/esm/stories/graph-visualization-rule-based-styling.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-search.story.js +0 -34
- package/lib/esm/stories/graph-visualization-search.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-simple-styling.story.js +0 -56
- package/lib/esm/stories/graph-visualization-simple-styling.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-unique-colors-styling.story.js +0 -69
- package/lib/esm/stories/graph-visualization-unique-colors-styling.story.js.map +0 -1
- package/lib/esm/stories/index.js +0 -61
- package/lib/esm/stories/index.js.map +0 -1
- package/lib/esm/stories/preview-graph-visualization.story.js +0 -66
- package/lib/esm/stories/preview-graph-visualization.story.js.map +0 -1
- package/lib/esm/stories/story-data.js +0 -989
- package/lib/esm/stories/story-data.js.map +0 -1
- package/lib/types/stories/graph-visualization-barebones.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-barebones.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-custom.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-custom.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-default.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-default.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-highlighting.story.d.ts +0 -23
- package/lib/types/stories/graph-visualization-highlighting.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-maximalist.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-maximalist.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-range-styling.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-range-styling.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts +0 -33
- package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-search.story.d.ts +0 -23
- package/lib/types/stories/graph-visualization-search.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-simple-styling.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-simple-styling.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-unique-colors-styling.story.d.ts +0 -23
- package/lib/types/stories/graph-visualization-unique-colors-styling.story.d.ts.map +0 -1
- package/lib/types/stories/index.d.ts +0 -47
- package/lib/types/stories/index.d.ts.map +0 -1
- package/lib/types/stories/preview-graph-visualization.story.d.ts +0 -23
- package/lib/types/stories/preview-graph-visualization.story.d.ts.map +0 -1
- package/lib/types/stories/story-data.d.ts +0 -31
- package/lib/types/stories/story-data.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-buttons.js","sourceRoot":"","sources":["../../src/graph-visualization-buttons.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,UAAU,EACV,GAAG,EACH,IAAI,EACJ,gBAAgB,EAChB,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,0BAA0B,EAC1B,+BAA+B,EAC/B,8BAA8B,EAC9B,UAAU,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAEL,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAmClD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAoC,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Ae,EAAE,KAAC,GAAG,IAAC,IAAI,EAAE,CAAC,YAAY,CAAC,GAAc,CAAC,CAAC,GAAI,EAC9D,SAAS,EAAE,GAAG,KAAK,OAAO,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,GAAc,CAAC,IALtC,GAAG,CAMR,CACH,CAAC,GACG,IACN,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {\n CleanIconButton,\n IconButton,\n Kbd,\n Menu,\n SelectIconButton,\n TextInput,\n type Tooltip,\n} from '@neo4j-ndl/react';\nimport {\n ArrowDownTrayIconOutline,\n DocumentTextIconOutline,\n ExploreIcon,\n FitToScreenIcon,\n HierarchyTwoIcon,\n LassoIcon,\n MagnifyingGlassIconOutline,\n MagnifyingGlassMinusIconOutline,\n MagnifyingGlassPlusIconOutline,\n SelectIcon,\n SquareDashIcon,\n XMarkIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport { type Layout } from '@neo4j-nvl/base';\nimport { default as cx } from 'classnames';\nimport {\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type Gesture,\n useGraphVisualizationContext,\n} from './graph-visualization-context';\nimport { useSemicontrolledState } from './use-semi-controlled-state';\nimport { searchNodes, searchRels } from './utils';\n\ntype GraphVisualizationButtonProps = {\n tooltipPlacement?: React.ComponentProps<typeof Tooltip>['placement'];\n className?: string;\n /**\n * Additional css styling. Will be applied to the root element.\n */\n style?: React.CSSProperties;\n\n /**\n * Html attributes to apply to the root element. This will override any default html attributes, use with caution.\n */\n htmlAttributes?: React.ComponentPropsWithRef<\n typeof CleanIconButton\n >['htmlAttributes'];\n\n /**\n * A ref to apply to the root element.\n */\n ref?: React.ComponentPropsWithRef<'button'>['ref'];\n};\n\ntype BaseProperties = GraphVisualizationButtonProps & {\n description: string;\n testid?: string;\n ariaLabel?: string;\n isActive?: boolean;\n isDisabled?: boolean;\n onClick?: () => void;\n onMouseDown?: () => void;\n};\n\nexport type GraphVisualizationGroupButton = PropsWithChildren<BaseProperties>;\n\nexport const GroupButton = (props: GraphVisualizationGroupButton) => {\n const {\n isActive,\n ariaLabel,\n isDisabled,\n description,\n onClick,\n onMouseDown,\n tooltipPlacement,\n className,\n style,\n htmlAttributes,\n children,\n } = props;\n return (\n <CleanIconButton\n description={description ?? ariaLabel}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: { isPortaled: false, placement: tooltipPlacement },\n }}\n size=\"small\"\n className={className}\n style={style}\n isActive={isActive}\n isDisabled={isDisabled}\n onClick={onClick}\n htmlAttributes={{\n onMouseDown,\n ...htmlAttributes,\n }}\n >\n {children}\n </CleanIconButton>\n );\n};\n\nconst targetIsTextInput = (target: EventTarget | null): boolean => {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n return (\n target.isContentEditable || ['INPUT', 'TEXTAREA'].includes(target.tagName)\n );\n};\n\nconst isEditingText = (e: KeyboardEvent): boolean => {\n return targetIsTextInput(e.target);\n};\n\nconst GESTURE_KEYS: Record<Gesture, string> = {\n box: 'B',\n lasso: 'L',\n single: 'S',\n};\n\nconst useRegisterKeyboardGestureSwitcher = (gestures: Gesture[]) => {\n const { setGesture } = useGraphVisualizationContext();\n const handleKeyDown = useCallback(\n (evt: KeyboardEvent) => {\n if (!isEditingText(evt) && setGesture !== undefined) {\n const upperKey = evt.key.toUpperCase();\n for (const gesture of gestures) {\n if (upperKey === GESTURE_KEYS[gesture]) {\n setGesture(gesture);\n }\n }\n }\n },\n [gestures, setGesture],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [handleKeyDown]);\n};\n\nconst NON_BREAKING_SPACE = '\\u00A0';\n\nexport const SingleSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher(['single']);\n\n return (\n <GroupButton\n isActive={gesture === 'single'}\n isDisabled={interactionMode !== 'select'}\n ariaLabel=\"Individual Select Button\"\n description={`Individual Select ${NON_BREAKING_SPACE} ${GESTURE_KEYS.single}`}\n onClick={() => {\n setGesture?.('single');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-individual-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SelectIcon aria-label=\"Individual Select\" />\n </GroupButton>\n );\n};\n\nexport const BoxSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher(['box']);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'box'}\n ariaLabel=\"Box Select Button\"\n description={`Box Select ${NON_BREAKING_SPACE} ${GESTURE_KEYS.box}`}\n onClick={() => {\n setGesture?.('box');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-box-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SquareDashIcon aria-label=\"Box select\" />\n </GroupButton>\n );\n};\n\nexport const LassoSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher(['lasso']);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'lasso'}\n ariaLabel=\"Lasso Select Button\"\n description={`Lasso Select ${NON_BREAKING_SPACE} ${GESTURE_KEYS.lasso}`}\n onClick={() => {\n setGesture?.('lasso');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-lasso-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <LassoIcon aria-label=\"Lasso select\" />\n </GroupButton>\n );\n};\n\nexport const ZoomInButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomIn = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 1.3);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomIn}\n description=\"Zoom in\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassPlusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomOutButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomOut = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 0.7);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomOut}\n description=\"Zoom out\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassMinusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomToFitButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const getNodesToFit = useCallback(() => {\n const instance = nvlInstance.current;\n if (!instance) {\n return [];\n }\n\n const selectedNodes = instance.getSelectedNodes();\n const selectedRels = instance.getSelectedRelationships();\n const nodeIds = new Set<string>();\n\n if (selectedNodes.length || selectedRels.length) {\n selectedNodes.forEach((n) => nodeIds.add(n.id));\n selectedRels.forEach((r) => nodeIds.add(r.from).add(r.to));\n return [...nodeIds];\n }\n\n const allNodes = instance.getNodes();\n const allRels = instance.getRelationships();\n\n allNodes.forEach((n) => n.disabled !== true && nodeIds.add(n.id));\n allRels.forEach(\n (r) => r.disabled !== true && nodeIds.add(r.from).add(r.to),\n );\n\n if (nodeIds.size > 0) {\n return [...nodeIds];\n }\n\n return allNodes.map((node) => node.id);\n }, [nvlInstance]);\n\n const handleZoomToFit = useCallback(() => {\n nvlInstance.current?.fit(getNodesToFit());\n }, [getNodesToFit, nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomToFit}\n description=\"Zoom to fit\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <FitToScreenIcon />\n </GroupButton>\n );\n};\n\nexport const ToggleSidePanelButton = ({\n className,\n htmlAttributes,\n style,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { sidepanel } = useGraphVisualizationContext();\n if (!sidepanel) {\n throw new Error(\n 'Using the ToggleSidePanelButton requires having a sidepanel',\n );\n }\n const { isSidePanelOpen, setIsSidePanelOpen } = sidepanel;\n return (\n <IconButton\n size=\"small\"\n onClick={() => setIsSidePanelOpen?.(!isSidePanelOpen)}\n isFloating\n description=\"Details\"\n isActive={isSidePanelOpen}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n shouldCloseOnReferenceClick: true,\n },\n }}\n className={cx('ndl-graph-visualization-toggle-sidepanel', className)}\n style={style}\n htmlAttributes={{\n 'aria-label': 'Toggle graph details panel',\n ...htmlAttributes,\n }}\n >\n <DocumentTextIconOutline className=\"ndl-graph-visualization-toggle-icon\" />\n </IconButton>\n );\n};\n\ntype SearchButtonProps = GraphVisualizationButtonProps & {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n open?: boolean;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n searchTerm?: string;\n setSearchTerm?: React.Dispatch<React.SetStateAction<string>>;\n onSearch?: (\n nodeIds: string[] | undefined,\n relationshipIds: string[] | undefined,\n ) => void;\n};\n\nexport const SearchButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n open: rawOpen,\n setOpen: rawSetOpen,\n searchTerm: rawSearchTerm,\n setSearchTerm: rawSetSearchTerm,\n onSearch = () => {\n // no-op\n },\n}: SearchButtonProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isOpen, setIsOpen] = useSemicontrolledState({\n isControlled: rawOpen !== undefined,\n onChange: rawSetOpen,\n state: rawOpen ?? false,\n });\n const [searchTerm, setSearchTerm] = useSemicontrolledState({\n isControlled: rawSearchTerm !== undefined,\n onChange: rawSetSearchTerm,\n state: rawSearchTerm ?? '',\n });\n const { nvlGraph } = useGraphVisualizationContext();\n\n const handleSearchChange = (newValue: string) => {\n setSearchTerm(newValue);\n if (newValue === '') {\n onSearch(undefined, undefined);\n return;\n }\n\n onSearch(searchNodes(nvlGraph, newValue), searchRels(nvlGraph, newValue));\n };\n\n return (\n <>\n {isOpen ? (\n <TextInput\n ref={inputRef}\n size=\"small\"\n leadingElement={<MagnifyingGlassIconOutline />}\n trailingElement={\n <CleanIconButton\n onClick={() => {\n handleSearchChange('');\n inputRef.current?.focus();\n }}\n description=\"Clear search\"\n >\n <XMarkIconOutline />\n </CleanIconButton>\n }\n placeholder=\"Search...\"\n value={searchTerm}\n onChange={(e) => handleSearchChange(e.target.value)}\n htmlAttributes={{\n autoFocus: true,\n onBlur: () => {\n if (searchTerm === '') {\n setIsOpen(false);\n }\n },\n }}\n />\n ) : (\n <IconButton\n size=\"small\"\n isFloating\n onClick={() => setIsOpen((o) => !o)}\n description=\"Search\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipProps={{\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n },\n }}\n >\n <MagnifyingGlassIconOutline />\n </IconButton>\n )}\n </>\n );\n};\n\nexport const DownloadButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance, portalTarget } = useGraphVisualizationContext();\n\n const [isDownloadMenuOpen, setOpen] = useState(false);\n const closeFileMenu = () => setOpen(false);\n const downloadButtonRef = useRef<HTMLButtonElement>(null);\n return (\n <>\n <IconButton\n ref={downloadButtonRef}\n size=\"small\"\n isFloating\n onClick={() => setOpen((o) => !o)}\n description=\"Download\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n >\n <ArrowDownTrayIconOutline />\n </IconButton>\n\n <Menu\n isOpen={isDownloadMenuOpen}\n onClose={closeFileMenu}\n anchorRef={downloadButtonRef}\n portalTarget={portalTarget}\n >\n <Menu.Item\n title=\"Download as PNG\"\n onClick={() => {\n nvlInstance.current?.saveToFile({});\n closeFileMenu();\n }}\n />\n <Menu.Item\n title=\"Download as SVG\"\n onClick={() => {\n nvlInstance.current?.saveToSvg({});\n closeFileMenu();\n }}\n />\n </Menu>\n </>\n );\n};\n\nexport type LayoutSelectOption = Record<\n Layout,\n {\n icon: React.ReactNode;\n title: string;\n }\n>;\n\nconst DEFAULT_LAYOUT_OPTIONS: Partial<LayoutSelectOption> = {\n d3Force: {\n icon: <ExploreIcon />,\n title: 'Force-based layout',\n },\n hierarchical: {\n icon: <HierarchyTwoIcon />,\n title: 'Hierarchical layout',\n },\n};\n\nexport const LayoutSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n layoutOptions = DEFAULT_LAYOUT_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n layoutOptions?: Partial<LayoutSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { layout, setLayout, portalTarget } = useGraphVisualizationContext();\n\n return (\n <>\n <SelectIconButton\n description=\"Select layout\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {layoutOptions[layout]?.icon ?? <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(layoutOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title}\n leadingVisual={item.icon}\n isChecked={key === layout}\n onClick={() => setLayout?.(key as Layout)}\n />\n ))}\n </Menu>\n </>\n );\n};\n\nexport type GestureSelectOption = Record<\n Gesture,\n {\n icon: React.ReactNode;\n title: string;\n }\n>;\n\n// oxlint-disable-next-line sort-keys\nconst DEFAULT_GESTURE_OPTIONS: Partial<GestureSelectOption> = {\n single: {\n icon: <SelectIcon />,\n title: 'Individual',\n },\n box: {\n icon: <SquareDashIcon />,\n title: 'Box',\n },\n lasso: {\n icon: <LassoIcon />,\n title: 'Lasso',\n },\n};\n\nexport const GestureSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n gestureOptions = DEFAULT_GESTURE_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n gestureOptions?: Partial<GestureSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { gesture, setGesture, portalTarget } = useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher(Object.keys(gestureOptions) as Gesture[]);\n\n return (\n <>\n <SelectIconButton\n description=\"Select gesture\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {gestureOptions[gesture]?.icon ?? <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(gestureOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title}\n leadingVisual={item.icon}\n trailingContent={<Kbd keys={[GESTURE_KEYS[key as Gesture]]} />}\n isChecked={key === gesture}\n onClick={() => setGesture?.(key as Gesture)}\n />\n ))}\n </Menu>\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"graph-visualization-buttons.js","sourceRoot":"","sources":["../../src/graph-visualization-buttons.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,UAAU,EACV,GAAG,EACH,IAAI,EACJ,gBAAgB,EAChB,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,0BAA0B,EAC1B,+BAA+B,EAC/B,8BAA8B,EAC9B,UAAU,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAE3C,O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AAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;;oBAAC,OAAA,CACnD,KAAC,IAAI,CAAC,SAAS,IAEb,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,2BAA2B,CAAC,GAAc,CAAC,EAChE,aAAa,EAAE,IAAI,CAAC,IAAI,EACxB,eAAe,EACb,KAAC,GAAG,IACF,IAAI,EAAE,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,EAC5B,YAAY,EAAE,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,GACvD,EAEJ,SAAS,EAAE,GAAG,KAAK,OAAO,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,GAAc,CAAC,IAVtC,GAAG,CAWR,CACH,CAAA;iBAAA,CAAC,GACG,IACN,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {\n CleanIconButton,\n IconButton,\n Kbd,\n Menu,\n SelectIconButton,\n TextInput,\n type Tooltip,\n} from '@neo4j-ndl/react';\nimport {\n ArrowDownTrayIconOutline,\n DocumentTextIconOutline,\n ExploreIcon,\n FitToScreenIcon,\n HierarchyTwoIcon,\n LassoIcon,\n MagnifyingGlassIconOutline,\n MagnifyingGlassMinusIconOutline,\n MagnifyingGlassPlusIconOutline,\n SelectIcon,\n SquareDashIcon,\n XMarkIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport { type Layout } from '@neo4j-nvl/base';\nimport { default as cx } from 'classnames';\nimport type React from 'react';\nimport {\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type Gesture,\n useGraphVisualizationContext,\n} from './graph-visualization-context';\nimport { useSemicontrolledState } from './use-semi-controlled-state';\nimport { searchNodes, searchRels } from './utils';\n\ntype GraphVisualizationButtonProps = {\n tooltipPlacement?: React.ComponentProps<typeof Tooltip>['placement'];\n className?: string;\n /**\n * Additional css styling. Will be applied to the root element.\n */\n style?: React.CSSProperties;\n\n /**\n * Html attributes to apply to the root element. This will override any default html attributes, use with caution.\n */\n htmlAttributes?: React.ComponentPropsWithRef<\n typeof CleanIconButton\n >['htmlAttributes'];\n\n /**\n * A ref to apply to the root element.\n */\n ref?: React.ComponentPropsWithRef<'button'>['ref'];\n shortcutKey?: {\n keys: string[];\n isMetaKey: boolean;\n isShiftKey: boolean;\n };\n};\n\ntype BaseProperties = GraphVisualizationButtonProps & {\n description: string;\n testid?: string;\n ariaLabel?: string;\n isActive?: boolean;\n isDisabled?: boolean;\n onClick?: () => void;\n onMouseDown?: () => void;\n descriptionKbdProps?: React.ComponentPropsWithRef<\n typeof CleanIconButton\n >['descriptionKbdProps'];\n};\n\nexport type GraphVisualizationGroupButton = PropsWithChildren<BaseProperties>;\n\nexport const GroupButton = (props: GraphVisualizationGroupButton) => {\n const {\n isActive,\n ariaLabel,\n isDisabled,\n description,\n onClick,\n onMouseDown,\n tooltipPlacement,\n className,\n style,\n htmlAttributes,\n children,\n descriptionKbdProps,\n } = props;\n return (\n <CleanIconButton\n description={description ?? ariaLabel}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: { isPortaled: false, placement: tooltipPlacement },\n }}\n size=\"small\"\n className={className}\n style={style}\n isActive={isActive}\n isDisabled={isDisabled}\n descriptionKbdProps={descriptionKbdProps}\n onClick={onClick}\n htmlAttributes={{\n onMouseDown,\n ...htmlAttributes,\n }}\n >\n {children}\n </CleanIconButton>\n );\n};\n\nconst targetIsTextInput = (target: EventTarget | null): boolean => {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n return (\n target.isContentEditable || ['INPUT', 'TEXTAREA'].includes(target.tagName)\n );\n};\n\nconst isEditingText = (e: KeyboardEvent): boolean => {\n return targetIsTextInput(e.target);\n};\n\nconst GESTURE_KEYS_DEFAULT: Record<Gesture, string> = {\n box: 'B',\n lasso: 'L',\n single: 'S',\n};\n\nconst GESTURE_KEYS_DEFAULT_ICONS: Record<Gesture, React.ReactNode> = {\n box: <SquareDashIcon />,\n lasso: <LassoIcon />,\n single: <SelectIcon />,\n};\n\nconst GESTURE_KEYS_DEFAULT_TITLES: Record<Gesture, string> = {\n box: 'Box',\n lasso: 'Lasso',\n single: 'Single',\n};\n\ntype ShortcutKey = NonNullable<GraphVisualizationButtonProps['shortcutKey']>;\n\nconst getShortcutModifierKeys = (\n shortcutKey: Pick<ShortcutKey, 'isMetaKey' | 'isShiftKey'> | undefined,\n): NonNullable<React.ComponentProps<typeof Kbd>['modifierKeys']> => [\n ...(shortcutKey?.isMetaKey ? (['meta'] as const) : []),\n ...(shortcutKey?.isShiftKey ? (['shift'] as const) : []),\n];\n\nconst isShortcutMatch = (\n evt: KeyboardEvent,\n shortcutKey: GraphVisualizationButtonProps['shortcutKey'],\n): boolean => {\n if (shortcutKey === undefined || shortcutKey.keys.length !== 1) {\n return false;\n }\n\n return (\n evt.key.toUpperCase() === shortcutKey.keys[0].toUpperCase() &&\n evt.metaKey === shortcutKey.isMetaKey &&\n evt.shiftKey === shortcutKey.isShiftKey &&\n !evt.altKey &&\n !evt.ctrlKey\n );\n};\n\nconst useRegisterKeyboardGestureSwitcher = (\n gestureShortcuts: ReadonlyArray<{\n gesture: Gesture;\n shortcutKey: GraphVisualizationButtonProps['shortcutKey'];\n }>,\n) => {\n const { setGesture } = useGraphVisualizationContext();\n const handleKeyDown = useCallback(\n (evt: KeyboardEvent) => {\n if (!isEditingText(evt) && setGesture !== undefined) {\n for (const { gesture, shortcutKey } of gestureShortcuts) {\n if (isShortcutMatch(evt, shortcutKey)) {\n setGesture(gesture);\n }\n }\n }\n },\n [gestureShortcuts, setGesture],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [handleKeyDown]);\n};\n\nexport const SingleSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.single],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'single', shortcutKey }]);\n\n return (\n <GroupButton\n isActive={gesture === 'single'}\n isDisabled={interactionMode !== 'select'}\n ariaLabel=\"Individual Select Button\"\n description=\"Individual Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('single');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-individual-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SelectIcon aria-label=\"Individual Select\" />\n </GroupButton>\n );\n};\n\nexport const BoxSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.box],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'box', shortcutKey }]);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'box'}\n ariaLabel=\"Box Select Button\"\n description=\"Box Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('box');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-box-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SquareDashIcon aria-label=\"Box select\" />\n </GroupButton>\n );\n};\n\nexport const LassoSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.lasso],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'lasso', shortcutKey }]);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'lasso'}\n ariaLabel=\"Lasso Select Button\"\n description=\"Lasso Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('lasso');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-lasso-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <LassoIcon aria-label=\"Lasso select\" />\n </GroupButton>\n );\n};\n\nexport const ZoomInButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomIn = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 1.3);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomIn}\n description=\"Zoom in\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassPlusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomOutButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomOut = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 0.7);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomOut}\n description=\"Zoom out\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassMinusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomToFitButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const getNodesToFit = useCallback(() => {\n const instance = nvlInstance.current;\n if (!instance) {\n return [];\n }\n\n const selectedNodes = instance.getSelectedNodes();\n const selectedRels = instance.getSelectedRelationships();\n const nodeIds = new Set<string>();\n\n if (selectedNodes.length || selectedRels.length) {\n selectedNodes.forEach((n) => nodeIds.add(n.id));\n selectedRels.forEach((r) => nodeIds.add(r.from).add(r.to));\n return [...nodeIds];\n }\n\n const allNodes = instance.getNodes();\n const allRels = instance.getRelationships();\n\n allNodes.forEach((n) => n.disabled !== true && nodeIds.add(n.id));\n allRels.forEach(\n (r) => r.disabled !== true && nodeIds.add(r.from).add(r.to),\n );\n\n if (nodeIds.size > 0) {\n return [...nodeIds];\n }\n\n return allNodes.map((node) => node.id);\n }, [nvlInstance]);\n\n const handleZoomToFit = useCallback(() => {\n nvlInstance.current?.fit(getNodesToFit());\n }, [getNodesToFit, nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomToFit}\n description=\"Zoom to fit\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <FitToScreenIcon />\n </GroupButton>\n );\n};\n\nexport const ToggleSidePanelButton = ({\n className,\n htmlAttributes,\n style,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { sidepanel } = useGraphVisualizationContext();\n if (!sidepanel) {\n throw new Error(\n 'Using the ToggleSidePanelButton requires having a sidepanel',\n );\n }\n const { isSidePanelOpen, setIsSidePanelOpen } = sidepanel;\n return (\n <IconButton\n size=\"small\"\n onClick={() => setIsSidePanelOpen?.(!isSidePanelOpen)}\n isFloating\n description=\"Details\"\n isActive={isSidePanelOpen}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n shouldCloseOnReferenceClick: true,\n },\n }}\n className={cx('ndl-graph-visualization-toggle-sidepanel', className)}\n style={style}\n htmlAttributes={{\n 'aria-label': 'Toggle graph details panel',\n ...htmlAttributes,\n }}\n >\n <DocumentTextIconOutline className=\"ndl-graph-visualization-toggle-icon\" />\n </IconButton>\n );\n};\n\ntype SearchButtonProps = GraphVisualizationButtonProps & {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n open?: boolean;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n searchTerm?: string;\n setSearchTerm?: React.Dispatch<React.SetStateAction<string>>;\n onSearch?: (\n nodeIds: string[] | undefined,\n relationshipIds: string[] | undefined,\n ) => void;\n};\n\nexport const SearchButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n open: rawOpen,\n setOpen: rawSetOpen,\n searchTerm: rawSearchTerm,\n setSearchTerm: rawSetSearchTerm,\n onSearch = () => {\n // no-op\n },\n}: SearchButtonProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isOpen, setIsOpen] = useSemicontrolledState({\n isControlled: rawOpen !== undefined,\n onChange: rawSetOpen,\n state: rawOpen ?? false,\n });\n const [searchTerm, setSearchTerm] = useSemicontrolledState({\n isControlled: rawSearchTerm !== undefined,\n onChange: rawSetSearchTerm,\n state: rawSearchTerm ?? '',\n });\n const { nvlGraph } = useGraphVisualizationContext();\n\n const handleSearchChange = (newValue: string) => {\n setSearchTerm(newValue);\n if (newValue === '') {\n onSearch(undefined, undefined);\n return;\n }\n\n onSearch(searchNodes(nvlGraph, newValue), searchRels(nvlGraph, newValue));\n };\n\n return (\n <>\n {isOpen ? (\n <TextInput\n ref={inputRef}\n size=\"small\"\n leadingElement={<MagnifyingGlassIconOutline />}\n trailingElement={\n <CleanIconButton\n onClick={() => {\n handleSearchChange('');\n inputRef.current?.focus();\n }}\n description=\"Clear search\"\n >\n <XMarkIconOutline />\n </CleanIconButton>\n }\n placeholder=\"Search...\"\n value={searchTerm}\n onChange={(e) => handleSearchChange(e.target.value)}\n htmlAttributes={{\n autoFocus: true,\n onBlur: () => {\n if (searchTerm === '') {\n setIsOpen(false);\n }\n },\n }}\n />\n ) : (\n <IconButton\n size=\"small\"\n isFloating\n onClick={() => setIsOpen((o) => !o)}\n description=\"Search\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipProps={{\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n },\n }}\n >\n <MagnifyingGlassIconOutline />\n </IconButton>\n )}\n </>\n );\n};\n\nexport const DownloadButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance, portalTarget } = useGraphVisualizationContext();\n\n const [isDownloadMenuOpen, setOpen] = useState(false);\n const closeFileMenu = () => setOpen(false);\n const downloadButtonRef = useRef<HTMLButtonElement>(null);\n return (\n <>\n <IconButton\n ref={downloadButtonRef}\n size=\"small\"\n isFloating\n onClick={() => setOpen((o) => !o)}\n description=\"Download\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n >\n <ArrowDownTrayIconOutline />\n </IconButton>\n\n <Menu\n isOpen={isDownloadMenuOpen}\n onClose={closeFileMenu}\n anchorRef={downloadButtonRef}\n portalTarget={portalTarget}\n >\n <Menu.Item\n title=\"Download as PNG\"\n onClick={() => {\n nvlInstance.current?.saveToFile({});\n closeFileMenu();\n }}\n />\n <Menu.Item\n title=\"Download as SVG\"\n onClick={() => {\n nvlInstance.current?.saveToSvg({});\n closeFileMenu();\n }}\n />\n </Menu>\n </>\n );\n};\n\nexport type LayoutSelectOption = Record<\n Layout,\n {\n icon: React.ReactNode;\n title: string;\n }\n>;\n\nconst DEFAULT_LAYOUT_OPTIONS: Partial<LayoutSelectOption> = {\n d3Force: {\n icon: <ExploreIcon />,\n title: 'Force-based layout',\n },\n hierarchical: {\n icon: <HierarchyTwoIcon />,\n title: 'Hierarchical layout',\n },\n};\n\nexport const LayoutSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n layoutOptions = DEFAULT_LAYOUT_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n layoutOptions?: Partial<LayoutSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { layout, setLayout, portalTarget } = useGraphVisualizationContext();\n\n return (\n <>\n <SelectIconButton\n description=\"Select layout\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {layoutOptions[layout]?.icon ?? <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(layoutOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title}\n leadingVisual={item.icon}\n isChecked={key === layout}\n onClick={() => setLayout?.(key as Layout)}\n />\n ))}\n </Menu>\n </>\n );\n};\n\nexport type GestureSelectOption = Record<\n Gesture,\n {\n icon?: React.ReactNode;\n title?: string;\n shortcutKey?: GraphVisualizationButtonProps['shortcutKey'];\n }\n>;\n\n// oxlint-disable-next-line sort-keys\nconst DEFAULT_GESTURE_OPTIONS: Partial<GestureSelectOption> = {\n single: {\n icon: <SelectIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.single],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Individual',\n },\n box: {\n icon: <SquareDashIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.box],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Box',\n },\n lasso: {\n icon: <LassoIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.lasso],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Lasso',\n },\n};\n\nexport const GestureSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n gestureOptions = DEFAULT_GESTURE_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n gestureOptions?: Partial<GestureSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { gesture, setGesture, portalTarget } = useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher(\n Object.entries(gestureOptions).map(([gesture, item]) => ({\n gesture: gesture as Gesture,\n shortcutKey: item.shortcutKey,\n })),\n );\n\n const gestureIcon =\n gestureOptions[gesture]?.icon ?? GESTURE_KEYS_DEFAULT_ICONS[gesture];\n return (\n <>\n <SelectIconButton\n description=\"Select gesture\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {gestureOptions[gesture] ? gestureIcon : <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(gestureOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title ?? GESTURE_KEYS_DEFAULT_TITLES[key as Gesture]}\n leadingVisual={item.icon}\n trailingContent={\n <Kbd\n keys={item.shortcutKey?.keys}\n modifierKeys={getShortcutModifierKeys(item.shortcutKey)}\n />\n }\n isChecked={key === gesture}\n onClick={() => setGesture?.(key as Gesture)}\n />\n ))}\n </Menu>\n </>\n );\n};\n"]}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { CleanIconButton, Menu, type Tooltip } from '@neo4j-ndl/react';
|
|
22
22
|
import { type Layout } from '@neo4j-nvl/base';
|
|
23
|
+
import type React from 'react';
|
|
23
24
|
import { type PropsWithChildren } from 'react';
|
|
24
25
|
import { type Gesture } from './graph-visualization-context';
|
|
25
26
|
type GraphVisualizationButtonProps = {
|
|
@@ -37,6 +38,11 @@ type GraphVisualizationButtonProps = {
|
|
|
37
38
|
* A ref to apply to the root element.
|
|
38
39
|
*/
|
|
39
40
|
ref?: React.ComponentPropsWithRef<'button'>['ref'];
|
|
41
|
+
shortcutKey?: {
|
|
42
|
+
keys: string[];
|
|
43
|
+
isMetaKey: boolean;
|
|
44
|
+
isShiftKey: boolean;
|
|
45
|
+
};
|
|
40
46
|
};
|
|
41
47
|
type BaseProperties = GraphVisualizationButtonProps & {
|
|
42
48
|
description: string;
|
|
@@ -46,12 +52,13 @@ type BaseProperties = GraphVisualizationButtonProps & {
|
|
|
46
52
|
isDisabled?: boolean;
|
|
47
53
|
onClick?: () => void;
|
|
48
54
|
onMouseDown?: () => void;
|
|
55
|
+
descriptionKbdProps?: React.ComponentPropsWithRef<typeof CleanIconButton>['descriptionKbdProps'];
|
|
49
56
|
};
|
|
50
57
|
export type GraphVisualizationGroupButton = PropsWithChildren<BaseProperties>;
|
|
51
58
|
export declare const GroupButton: (props: GraphVisualizationGroupButton) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
-
export declare const SingleSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
export declare const BoxSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
export declare const LassoSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const SingleSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, shortcutKey, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export declare const BoxSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, shortcutKey, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export declare const LassoSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, shortcutKey, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
62
|
export declare const ZoomInButton: ({ className, style, htmlAttributes, tooltipPlacement, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
63
|
export declare const ZoomOutButton: ({ className, style, htmlAttributes, tooltipPlacement, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
64
|
export declare const ZoomToFitButton: ({ className, style, htmlAttributes, tooltipPlacement, }: GraphVisualizationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -74,8 +81,9 @@ export declare const LayoutSelectButton: ({ className, style, htmlAttributes, to
|
|
|
74
81
|
layoutOptions?: Partial<LayoutSelectOption>;
|
|
75
82
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
76
83
|
export type GestureSelectOption = Record<Gesture, {
|
|
77
|
-
icon
|
|
78
|
-
title
|
|
84
|
+
icon?: React.ReactNode;
|
|
85
|
+
title?: string;
|
|
86
|
+
shortcutKey?: GraphVisualizationButtonProps['shortcutKey'];
|
|
79
87
|
}>;
|
|
80
88
|
export declare const GestureSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, menuPlacement, gestureOptions, }: GraphVisualizationButtonProps & {
|
|
81
89
|
menuPlacement?: React.ComponentProps<typeof Menu>["placement"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-buttons.d.ts","sourceRoot":"","sources":["../../src/graph-visualization-buttons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EAGf,IAAI,EAGJ,KAAK,OAAO,EACb,MAAM,kBAAkB,CAAC;AAe1B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EACL,KAAK,iBAAiB,EAKvB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,KAAK,OAAO,EAEb,MAAM,+BAA+B,CAAC;AAIvC,KAAK,6BAA6B,GAAG;IACnC,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAC1C,OAAO,eAAe,CACvB,CAAC,gBAAgB,CAAC,CAAC;IAEpB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-visualization-buttons.d.ts","sourceRoot":"","sources":["../../src/graph-visualization-buttons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eA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,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AAaF,eAAO,MAAM,kBAAkB,GAAI,uFAOhC,6BAA6B,GAAG;IACjC,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC;IAC/D,aAAa,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC7C,4CAyCA,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC,OAAO,EACP;IACE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,6BAA6B,CAAC,aAAa,CAAC,CAAC;CAC5D,CACF,CAAC;AAiCF,eAAO,MAAM,mBAAmB,GAAI,wFAOjC,6BAA6B,GAAG;IACjC,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC/C,4CAuDA,CAAC"}
|
|
@@ -130,6 +130,11 @@ export declare namespace GraphVisualization {
|
|
|
130
130
|
style?: React.CSSProperties;
|
|
131
131
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
132
132
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
133
|
+
shortcutKey?: {
|
|
134
|
+
keys: string[];
|
|
135
|
+
isMetaKey: boolean;
|
|
136
|
+
isShiftKey: boolean;
|
|
137
|
+
};
|
|
133
138
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
134
139
|
var ZoomOutButton: ({ className, style, htmlAttributes, tooltipPlacement, }: {
|
|
135
140
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
@@ -137,6 +142,11 @@ export declare namespace GraphVisualization {
|
|
|
137
142
|
style?: React.CSSProperties;
|
|
138
143
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
139
144
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
145
|
+
shortcutKey?: {
|
|
146
|
+
keys: string[];
|
|
147
|
+
isMetaKey: boolean;
|
|
148
|
+
isShiftKey: boolean;
|
|
149
|
+
};
|
|
140
150
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
141
151
|
var ZoomToFitButton: ({ className, style, htmlAttributes, tooltipPlacement, }: {
|
|
142
152
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
@@ -144,6 +154,11 @@ export declare namespace GraphVisualization {
|
|
|
144
154
|
style?: React.CSSProperties;
|
|
145
155
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
146
156
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
157
|
+
shortcutKey?: {
|
|
158
|
+
keys: string[];
|
|
159
|
+
isMetaKey: boolean;
|
|
160
|
+
isShiftKey: boolean;
|
|
161
|
+
};
|
|
147
162
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
148
163
|
var ToggleSidePanelButton: ({ className, htmlAttributes, style, tooltipPlacement, }: {
|
|
149
164
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
@@ -151,6 +166,11 @@ export declare namespace GraphVisualization {
|
|
|
151
166
|
style?: React.CSSProperties;
|
|
152
167
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
153
168
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
169
|
+
shortcutKey?: {
|
|
170
|
+
keys: string[];
|
|
171
|
+
isMetaKey: boolean;
|
|
172
|
+
isShiftKey: boolean;
|
|
173
|
+
};
|
|
154
174
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
155
175
|
var DownloadButton: ({ className, style, htmlAttributes, tooltipPlacement, }: {
|
|
156
176
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
@@ -158,27 +178,47 @@ export declare namespace GraphVisualization {
|
|
|
158
178
|
style?: React.CSSProperties;
|
|
159
179
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
160
180
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
181
|
+
shortcutKey?: {
|
|
182
|
+
keys: string[];
|
|
183
|
+
isMetaKey: boolean;
|
|
184
|
+
isShiftKey: boolean;
|
|
185
|
+
};
|
|
161
186
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
162
|
-
var BoxSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, }: {
|
|
187
|
+
var BoxSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, shortcutKey, }: {
|
|
163
188
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
164
189
|
className?: string;
|
|
165
190
|
style?: React.CSSProperties;
|
|
166
191
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
167
192
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
193
|
+
shortcutKey?: {
|
|
194
|
+
keys: string[];
|
|
195
|
+
isMetaKey: boolean;
|
|
196
|
+
isShiftKey: boolean;
|
|
197
|
+
};
|
|
168
198
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
169
|
-
var LassoSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, }: {
|
|
199
|
+
var LassoSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, shortcutKey, }: {
|
|
170
200
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
171
201
|
className?: string;
|
|
172
202
|
style?: React.CSSProperties;
|
|
173
203
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
174
204
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
205
|
+
shortcutKey?: {
|
|
206
|
+
keys: string[];
|
|
207
|
+
isMetaKey: boolean;
|
|
208
|
+
isShiftKey: boolean;
|
|
209
|
+
};
|
|
175
210
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
176
|
-
var SingleSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, }: {
|
|
211
|
+
var SingleSelectButton: ({ className, style, htmlAttributes, tooltipPlacement, shortcutKey, }: {
|
|
177
212
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
178
213
|
className?: string;
|
|
179
214
|
style?: React.CSSProperties;
|
|
180
215
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
181
216
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
217
|
+
shortcutKey?: {
|
|
218
|
+
keys: string[];
|
|
219
|
+
isMetaKey: boolean;
|
|
220
|
+
isShiftKey: boolean;
|
|
221
|
+
};
|
|
182
222
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
183
223
|
var SearchButton: ({ className, style, htmlAttributes, tooltipPlacement, open: rawOpen, setOpen: rawSetOpen, searchTerm: rawSearchTerm, setSearchTerm: rawSetSearchTerm, onSearch, }: {
|
|
184
224
|
tooltipPlacement?: import("@floating-ui/react").Placement | undefined;
|
|
@@ -186,6 +226,11 @@ export declare namespace GraphVisualization {
|
|
|
186
226
|
style?: React.CSSProperties;
|
|
187
227
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
188
228
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
229
|
+
shortcutKey?: {
|
|
230
|
+
keys: string[];
|
|
231
|
+
isMetaKey: boolean;
|
|
232
|
+
isShiftKey: boolean;
|
|
233
|
+
};
|
|
189
234
|
} & {
|
|
190
235
|
open?: boolean;
|
|
191
236
|
setOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -200,6 +245,11 @@ export declare namespace GraphVisualization {
|
|
|
200
245
|
style?: React.CSSProperties;
|
|
201
246
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
202
247
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
248
|
+
shortcutKey?: {
|
|
249
|
+
keys: string[];
|
|
250
|
+
isMetaKey: boolean;
|
|
251
|
+
isShiftKey: boolean;
|
|
252
|
+
};
|
|
203
253
|
} & {
|
|
204
254
|
menuPlacement?: ("bottom-end-top-end" | "bottom-start-top-start" | "bottom-middle-top-middle" | "top-end-bottom-end" | "top-start-bottom-start" | "top-middle-bottom-middle" | "bottom-start-bottom-end" | "top-start-top-end" | "middle-start-middle-end" | "bottom-end-bottom-start" | "top-end-top-start" | "middle-end-middle-start") | undefined;
|
|
205
255
|
layoutOptions?: Partial<import("./graph-visualization-buttons").LayoutSelectOption>;
|
|
@@ -210,6 +260,11 @@ export declare namespace GraphVisualization {
|
|
|
210
260
|
style?: React.CSSProperties;
|
|
211
261
|
htmlAttributes?: React.ComponentPropsWithRef<typeof import("@neo4j-ndl/react").CleanIconButton>["htmlAttributes"];
|
|
212
262
|
ref?: React.ComponentPropsWithRef<"button">["ref"];
|
|
263
|
+
shortcutKey?: {
|
|
264
|
+
keys: string[];
|
|
265
|
+
isMetaKey: boolean;
|
|
266
|
+
isShiftKey: boolean;
|
|
267
|
+
};
|
|
213
268
|
} & {
|
|
214
269
|
menuPlacement?: ("bottom-end-top-end" | "bottom-start-top-start" | "bottom-middle-top-middle" | "top-end-bottom-end" | "top-start-bottom-start" | "top-middle-bottom-middle" | "bottom-start-bottom-end" | "top-start-top-end" | "middle-start-middle-end" | "bottom-end-bottom-start" | "top-end-top-start" | "middle-end-middle-start") | undefined;
|
|
215
270
|
gestureOptions?: Partial<import("./graph-visualization-buttons").GestureSelectOption>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization.d.ts","sourceRoot":"","sources":["../../src/graph-visualization.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAA8C,MAAM,OAAO,CAAC;AAenE,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EAEnB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,SAAS,EACf,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiC5D,eAAO,MAAM,mBAAmB;;;;;;CAM/B,CAAC;AAkBF,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI;IACzE,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAE9B,OAAO,CAAC,EAA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WAAW,GAAG,KAAK,EAAE,EACtE,MAAM,EAAE,SAAS,EACjB,YAAY,EACZ,UAAU,EACV,SAAS,EAAE,YAAY,EACvB,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,OAAO,EACb,kBAAkB,EAClB,0BAA0B,EAC1B,aAAgD,EAChD,cAAkD,EAClD,gBAAsD,EACtD,kBAA0D,EAC1D,iBAAwD,EACxD,OAAkB,EAClB,UAAU,EACV,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,YAAY,EACvB,YAAY,EACZ,QAAQ,EAAE,WAAW,EACrB,WAAW,EAAE,cAAc,EAC3B,eAAe,EAAE,kBAAkB,EACnC,kBAAkB,EAAE,qBAAqB,EACzC,mBAAwB,EACxB,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,EACH,EAAE,EACF,UAAU,EACV,GAAG,SAAS,EACb,EAAE,uBAAuB,CAAC,CAAC,CAAC,2CA+K5B;yBA9Me,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA4V8kC,CAAC;qBAAiE,CAAC;;;;;;;;;;;;;;qBAAmvE,CAAC;sBAAkE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react-graph",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of the graph visualization from Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@neo4j-nvl/base": "^1.2.0",
|
|
58
58
|
"@neo4j-nvl/interaction-handlers": "^1.2.0",
|
|
59
59
|
"@neo4j-nvl/react": "^1.2.0",
|
|
60
|
-
"@neo4j-ndl/
|
|
61
|
-
"@neo4j-ndl/
|
|
60
|
+
"@neo4j-ndl/base": "^4.17.3",
|
|
61
|
+
"@neo4j-ndl/react": "^4.18.3"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"classnames": "2.5.1",
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.containerClasses = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) "Neo4j"
|
|
8
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Neo4j.
|
|
11
|
-
*
|
|
12
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
13
|
-
* it under the terms of the GNU General Public License as published by
|
|
14
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
15
|
-
* (at your option) any later version.
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
-
*/
|
|
25
|
-
const graph_visualization_1 = require("../graph-visualization");
|
|
26
|
-
const nodes = [
|
|
27
|
-
{
|
|
28
|
-
id: 'node1',
|
|
29
|
-
labels: ['Pokemon', 'Legendary'],
|
|
30
|
-
properties: {
|
|
31
|
-
durationToWinBattle: {
|
|
32
|
-
stringified: 'P0M0DT0.000000001S',
|
|
33
|
-
type: 'duration',
|
|
34
|
-
},
|
|
35
|
-
favoriteColors: {
|
|
36
|
-
stringified: '["red", "blue", "green"]',
|
|
37
|
-
type: 'list',
|
|
38
|
-
},
|
|
39
|
-
getsBeatBy: {
|
|
40
|
-
stringified: 'null',
|
|
41
|
-
type: 'null',
|
|
42
|
-
},
|
|
43
|
-
isAwesome: {
|
|
44
|
-
stringified: 'true',
|
|
45
|
-
type: 'boolean',
|
|
46
|
-
},
|
|
47
|
-
location: {
|
|
48
|
-
stringified: 'point({srid:1, x:100, y:200, z:300})',
|
|
49
|
-
type: 'point',
|
|
50
|
-
},
|
|
51
|
-
name: {
|
|
52
|
-
stringified: '"Rayquaza"',
|
|
53
|
-
type: 'string',
|
|
54
|
-
},
|
|
55
|
-
weight: {
|
|
56
|
-
stringified: '392.0',
|
|
57
|
-
type: 'float',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: 'node2',
|
|
63
|
-
labels: ['Type'],
|
|
64
|
-
properties: { name: { stringified: 'Dragon', type: 'String' } },
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: 'node3',
|
|
68
|
-
labels: ['Type'],
|
|
69
|
-
properties: { name: { stringified: 'Flying', type: 'String' } },
|
|
70
|
-
},
|
|
71
|
-
];
|
|
72
|
-
const rels = [
|
|
73
|
-
{
|
|
74
|
-
from: 'node1',
|
|
75
|
-
id: 'rel1',
|
|
76
|
-
properties: {},
|
|
77
|
-
to: 'node2',
|
|
78
|
-
type: 'HAS_TYPE',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
from: 'node1',
|
|
82
|
-
id: 'rel2',
|
|
83
|
-
properties: {},
|
|
84
|
-
to: 'node3',
|
|
85
|
-
type: 'HAS_TYPE',
|
|
86
|
-
},
|
|
87
|
-
];
|
|
88
|
-
exports.containerClasses = 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';
|
|
89
|
-
const Component = () => {
|
|
90
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { bottomLeftIsland: null, bottomCenterIsland: null, bottomRightIsland: null, nodes: nodes, rels: rels, sidepanel: null, topLeftIsland: null, topRightIsland: null, className: exports.containerClasses }) }));
|
|
91
|
-
};
|
|
92
|
-
exports.default = Component;
|
|
93
|
-
//# sourceMappingURL=graph-visualization-barebones.story.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-barebones.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-barebones.story.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gEAA4D;AAG5D,MAAM,KAAK,GAAc;IACvB;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;QAChC,UAAU,EAAE;YACV,mBAAmB,EAAE;gBACnB,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,UAAU;aACjB;YACD,cAAc,EAAE;gBACd,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,MAAM;aACb;YACD,UAAU,EAAE;gBACV,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;aACb;YACD,SAAS,EAAE;gBACT,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,SAAS;aAChB;YACD,QAAQ,EAAE;gBACR,WAAW,EAAE,sCAAsC;gBACnD,IAAI,EAAE,OAAO;aACd;YACD,IAAI,EAAE;gBACJ,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;aACd;SACF;KACF;IACD;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KAChE;IACD;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KAChE;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX;QACE,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,MAAM;QACV,UAAU,EAAE,EAAE;QACd,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;KACjB;IACD;QACE,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,MAAM;QACV,UAAU,EAAE,EAAE;QACd,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AACW,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAEvE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC7B,uBAAC,wCAAkB,IACjB,gBAAgB,EAAE,IAAI,EACtB,kBAAkB,EAAE,IAAI,EACxB,iBAAiB,EAAE,IAAI,EACvB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAI,EACf,aAAa,EAAE,IAAI,EACnB,cAAc,EAAE,IAAI,EACpB,SAAS,EAAE,wBAAgB,GAC3B,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { GraphVisualization } from '../graph-visualization';\nimport { type NeoNode } from '../graph-visualization-context';\n\nconst nodes: NeoNode[] = [\n {\n id: 'node1',\n labels: ['Pokemon', 'Legendary'],\n properties: {\n durationToWinBattle: {\n stringified: 'P0M0DT0.000000001S',\n type: 'duration',\n },\n favoriteColors: {\n stringified: '[\"red\", \"blue\", \"green\"]',\n type: 'list',\n },\n getsBeatBy: {\n stringified: 'null',\n type: 'null',\n },\n isAwesome: {\n stringified: 'true',\n type: 'boolean',\n },\n location: {\n stringified: 'point({srid:1, x:100, y:200, z:300})',\n type: 'point',\n },\n name: {\n stringified: '\"Rayquaza\"',\n type: 'string',\n },\n weight: {\n stringified: '392.0',\n type: 'float',\n },\n },\n },\n {\n id: 'node2',\n labels: ['Type'],\n properties: { name: { stringified: 'Dragon', type: 'String' } },\n },\n {\n id: 'node3',\n labels: ['Type'],\n properties: { name: { stringified: 'Flying', type: 'String' } },\n },\n];\n\nconst rels = [\n {\n from: 'node1',\n id: 'rel1',\n properties: {},\n to: 'node2',\n type: 'HAS_TYPE',\n },\n {\n from: 'node1',\n id: 'rel2',\n properties: {},\n to: 'node3',\n type: 'HAS_TYPE',\n },\n];\nexport const containerClasses =\n 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';\n\nconst Component = () => {\n return (\n <div style={{ height: '600px' }}>\n <GraphVisualization\n bottomLeftIsland={null}\n bottomCenterIsland={null}\n bottomRightIsland={null}\n nodes={nodes}\n rels={rels}\n sidepanel={null}\n topLeftIsland={null}\n topRightIsland={null}\n className={containerClasses}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.containerClasses = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) "Neo4j"
|
|
8
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Neo4j.
|
|
11
|
-
*
|
|
12
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
13
|
-
* it under the terms of the GNU General Public License as published by
|
|
14
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
15
|
-
* (at your option) any later version.
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
-
*/
|
|
25
|
-
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
-
const react_2 = require("react");
|
|
27
|
-
const graph_visualization_1 = require("../graph-visualization");
|
|
28
|
-
const nodes = [
|
|
29
|
-
{
|
|
30
|
-
id: 'node1',
|
|
31
|
-
labels: ['Pokemon', 'Legendary'],
|
|
32
|
-
properties: {},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: 'node2',
|
|
36
|
-
labels: ['Type'],
|
|
37
|
-
properties: { name: { stringified: 'Dragon', type: 'String' } },
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'node3',
|
|
41
|
-
labels: ['Type'],
|
|
42
|
-
properties: { name: { stringified: 'Flying', type: 'String' } },
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
const rels = [
|
|
46
|
-
{
|
|
47
|
-
from: 'node1',
|
|
48
|
-
id: 'rel1',
|
|
49
|
-
properties: {},
|
|
50
|
-
to: 'node2',
|
|
51
|
-
type: 'HAS_TYPE',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
from: 'node1',
|
|
55
|
-
id: 'rel2',
|
|
56
|
-
properties: {},
|
|
57
|
-
to: 'node3',
|
|
58
|
-
type: 'HAS_TYPE',
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
exports.containerClasses = 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';
|
|
62
|
-
const Component = () => {
|
|
63
|
-
const [gesture, setGesture] = (0, react_2.useState)('box');
|
|
64
|
-
const [isSidePanelOpen, setIsSidePanelOpen] = (0, react_2.useState)(false);
|
|
65
|
-
const [search, setSearch] = (0, react_2.useState)('');
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { gesture: gesture, setGesture: setGesture, bottomLeftIsland: (0, jsx_runtime_1.jsx)("div", { children: "\u2199\uFE0F" }), bottomCenterIsland: (0, jsx_runtime_1.jsx)("div", { children: "\u2B07\uFE0F" }), bottomRightIsland: (0, jsx_runtime_1.jsxs)(react_1.IconButtonArray, { size: "small", children: [(0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.LassoSelectButton, {}), (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.SingleSelectButton, {}), (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.BoxSelectButton, {})] }), nodes: nodes, rels: rels, sidepanel: {
|
|
67
|
-
children: ((0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Search in custom panel", value: search, onChange: (e) => setSearch(e.target.value) })),
|
|
68
|
-
isSidePanelOpen,
|
|
69
|
-
setIsSidePanelOpen,
|
|
70
|
-
onSidePanelResize: () => {
|
|
71
|
-
/* no op */
|
|
72
|
-
},
|
|
73
|
-
sidePanelWidth: 300,
|
|
74
|
-
}, topLeftIsland: (0, jsx_runtime_1.jsx)("div", { children: "\u2196\uFE0F" }), topRightIsland: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.ToggleSidePanelButton, {}), className: exports.containerClasses }) }));
|
|
75
|
-
};
|
|
76
|
-
exports.default = Component;
|
|
77
|
-
//# sourceMappingURL=graph-visualization-custom.story.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-custom.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-custom.story.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4CAA8D;AAC9D,iCAAiC;AAEjC,gEAA4D;AAG5D,MAAM,KAAK,GAAc;IACvB;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;QAChC,UAAU,EAAE,EAAE;KACf;IACD;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KAChE;IACD;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KAChE;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX;QACE,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,MAAM;QACV,UAAU,EAAE,EAAE;QACd,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;KACjB;IACD;QACE,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,MAAM;QACV,UAAU,EAAE,EAAE;QACd,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AACW,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAEvE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACvD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IAEzC,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC7B,uBAAC,wCAAkB,IACjB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,2DAAa,EAC/B,kBAAkB,EAAE,2DAAa,EACjC,iBAAiB,EACf,wBAAC,uBAAe,IAAC,IAAI,EAAC,OAAO,aAC3B,uBAAC,wCAAkB,CAAC,iBAAiB,KAAG,EACxC,uBAAC,wCAAkB,CAAC,kBAAkB,KAAG,EACzC,uBAAC,wCAAkB,CAAC,eAAe,KAAG,IACtB,EAEpB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE;gBACT,QAAQ,EAAE,CACR,uBAAC,iBAAS,IACR,KAAK,EAAC,wBAAwB,EAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC1C,CACH;gBACD,eAAe;gBACf,kBAAkB;gBAClB,iBAAiB,EAAE,GAAG,EAAE;oBACtB,WAAW;gBACb,CAAC;gBACD,cAAc,EAAE,GAAG;aACpB,EACD,aAAa,EAAE,2DAAa,EAC5B,cAAc,EAAE,uBAAC,wCAAkB,CAAC,qBAAqB,KAAG,EAC5D,SAAS,EAAE,wBAAgB,GAC3B,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { IconButtonArray, TextInput } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nimport { GraphVisualization } from '../graph-visualization';\nimport { type Gesture, type NeoNode } from '../graph-visualization-context';\n\nconst nodes: NeoNode[] = [\n {\n id: 'node1',\n labels: ['Pokemon', 'Legendary'],\n properties: {},\n },\n {\n id: 'node2',\n labels: ['Type'],\n properties: { name: { stringified: 'Dragon', type: 'String' } },\n },\n {\n id: 'node3',\n labels: ['Type'],\n properties: { name: { stringified: 'Flying', type: 'String' } },\n },\n];\n\nconst rels = [\n {\n from: 'node1',\n id: 'rel1',\n properties: {},\n to: 'node2',\n type: 'HAS_TYPE',\n },\n {\n from: 'node1',\n id: 'rel2',\n properties: {},\n to: 'node3',\n type: 'HAS_TYPE',\n },\n];\nexport const containerClasses =\n 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';\n\nconst Component = () => {\n const [gesture, setGesture] = useState<Gesture>('box');\n const [isSidePanelOpen, setIsSidePanelOpen] = useState(false);\n const [search, setSearch] = useState('');\n\n return (\n <div style={{ height: '600px' }}>\n <GraphVisualization\n gesture={gesture}\n setGesture={setGesture}\n bottomLeftIsland={<div>↙️</div>}\n bottomCenterIsland={<div>⬇️</div>}\n bottomRightIsland={\n <IconButtonArray size=\"small\">\n <GraphVisualization.LassoSelectButton />\n <GraphVisualization.SingleSelectButton />\n <GraphVisualization.BoxSelectButton />\n </IconButtonArray>\n }\n nodes={nodes}\n rels={rels}\n sidepanel={{\n children: (\n <TextInput\n label=\"Search in custom panel\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n ),\n isSidePanelOpen,\n setIsSidePanelOpen,\n onSidePanelResize: () => {\n /* no op */\n },\n sidePanelWidth: 300,\n }}\n topLeftIsland={<div>↖️</div>}\n topRightIsland={<GraphVisualization.ToggleSidePanelButton />}\n className={containerClasses}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|