@backstage/plugin-catalog-graph 0.2.38-next.1 → 0.3.0
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/CHANGELOG.md +38 -0
- package/README.md +49 -0
- package/dist/esm/{index-a41f88a9.esm.js → index-28d6fd72.esm.js} +3 -3
- package/dist/esm/{index-a41f88a9.esm.js.map → index-28d6fd72.esm.js.map} +1 -1
- package/dist/esm/{index-9d40850a.esm.js → index-7de551c2.esm.js} +2 -2
- package/dist/esm/index-7de551c2.esm.js.map +1 -0
- package/dist/index.d.ts +24 -14
- package/dist/index.esm.js +20 -24
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -11
- package/dist/esm/index-9d40850a.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-graph
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a604623324: Add the entire `Entity` to `EntityNodeData` and deprecate `name`, `kind`, `title`, `namespace` and `spec`.
|
|
8
|
+
|
|
9
|
+
To get the deprecated properties in your custom component you can use:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { DEFAULT_NAMESPACE } from '@backstage/catalog-model';
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
kind,
|
|
16
|
+
metadata: { name, namespace = DEFAULT_NAMESPACE, title },
|
|
17
|
+
} = entity;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 6c2b872153: Add official support for React 18.
|
|
23
|
+
- 62b5922916: Internal theme type updates
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @backstage/plugin-catalog-react@1.9.0
|
|
26
|
+
- @backstage/core-components@0.13.8
|
|
27
|
+
- @backstage/core-plugin-api@1.8.0
|
|
28
|
+
- @backstage/theme@0.4.4
|
|
29
|
+
- @backstage/catalog-client@1.4.6
|
|
30
|
+
- @backstage/catalog-model@1.4.3
|
|
31
|
+
- @backstage/types@1.1.1
|
|
32
|
+
|
|
33
|
+
## 0.2.38-next.2
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
- @backstage/core-components@0.13.8-next.2
|
|
39
|
+
- @backstage/plugin-catalog-react@1.9.0-next.2
|
|
40
|
+
|
|
3
41
|
## 0.2.38-next.1
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -85,6 +85,55 @@ To use the catalog graph plugin, you have to add some things to your Backstage a
|
|
|
85
85
|
</Grid>
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
### Customization
|
|
89
|
+
|
|
90
|
+
Copy the default implementation `DefaultRenderNode.tsx` and add more classes to the styles:
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
const useStyles = makeStyles<Theme>(
|
|
94
|
+
theme => ({
|
|
95
|
+
node: {
|
|
96
|
+
…
|
|
97
|
+
'&.system': {
|
|
98
|
+
fill: '#F5DC70',
|
|
99
|
+
stroke: '#F2CE34',
|
|
100
|
+
},
|
|
101
|
+
'&.domain': {
|
|
102
|
+
fill: '#F5DC70',
|
|
103
|
+
stroke: '#F2CE34',
|
|
104
|
+
},
|
|
105
|
+
…
|
|
106
|
+
);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Now you can use the new classes in your component with `className={classNames(classes.node, kind?.toLowerCase(), type?.toLowerCase())}`
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
return (
|
|
113
|
+
<g onClick={onClick} className={classNames(onClick && classes.clickable)}>
|
|
114
|
+
<rect
|
|
115
|
+
className={classNames(
|
|
116
|
+
classes.node,
|
|
117
|
+
kind?.toLowerCase(),
|
|
118
|
+
type?.toLowerCase(),
|
|
119
|
+
)}
|
|
120
|
+
width={paddedWidth}
|
|
121
|
+
height={paddedHeight}
|
|
122
|
+
/>
|
|
123
|
+
<text
|
|
124
|
+
ref={idRef}
|
|
125
|
+
className={classNames(classes.text, focused && 'focused')}
|
|
126
|
+
y={paddedHeight / 2}
|
|
127
|
+
x={paddedWidth / 2}
|
|
128
|
+
textAnchor="middle"
|
|
129
|
+
alignmentBaseline="middle"
|
|
130
|
+
>
|
|
131
|
+
{displayTitle}
|
|
132
|
+
</text>
|
|
133
|
+
</g>
|
|
134
|
+
);
|
|
135
|
+
```
|
|
136
|
+
|
|
88
137
|
## Development
|
|
89
138
|
|
|
90
139
|
Run `yarn` in the root of this plugin to install all dependencies and then `yarn start` to run a [development version](./dev/index.tsx) of this plugin.
|
|
@@ -562,14 +562,14 @@ const CatalogGraphPage = (props) => {
|
|
|
562
562
|
});
|
|
563
563
|
analytics.captureEvent(
|
|
564
564
|
"click",
|
|
565
|
-
(_a = node.title) != null ? _a : humanizeEntityRef(nodeEntityName),
|
|
565
|
+
(_a = node.entity.metadata.title) != null ? _a : humanizeEntityRef(nodeEntityName),
|
|
566
566
|
{ attributes: { to: path } }
|
|
567
567
|
);
|
|
568
568
|
navigate(path);
|
|
569
569
|
} else {
|
|
570
570
|
analytics.captureEvent(
|
|
571
571
|
"click",
|
|
572
|
-
(_b = node.title) != null ? _b : humanizeEntityRef(nodeEntityName)
|
|
572
|
+
(_b = node.entity.metadata.title) != null ? _b : humanizeEntityRef(nodeEntityName)
|
|
573
573
|
);
|
|
574
574
|
setRootEntityNames([nodeEntityName]);
|
|
575
575
|
}
|
|
@@ -655,4 +655,4 @@ const CatalogGraphPage = (props) => {
|
|
|
655
655
|
};
|
|
656
656
|
|
|
657
657
|
export { CatalogGraphPage };
|
|
658
|
-
//# sourceMappingURL=index-
|
|
658
|
+
//# sourceMappingURL=index-28d6fd72.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-a41f88a9.esm.js","sources":["../../src/components/CatalogGraphPage/CurveFilter.tsx","../../src/components/CatalogGraphPage/DirectionFilter.tsx","../../src/components/CatalogGraphPage/MaxDepthFilter.tsx","../../src/components/CatalogGraphPage/SelectedKindsFilter.tsx","../../src/components/CatalogGraphPage/SelectedRelationsFilter.tsx","../../src/components/CatalogGraphPage/SwitchFilter.tsx","../../src/components/CatalogGraphPage/useCatalogGraphPage.ts","../../src/components/CatalogGraphPage/CatalogGraphPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Select, SelectedItems } from '@backstage/core-components';\nimport { Box } from '@material-ui/core';\nimport React, { useCallback } from 'react';\n\ntype Curve = 'curveStepBefore' | 'curveMonotoneX';\nconst CURVE_DISPLAY_NAMES: Record<Curve, string> = {\n curveMonotoneX: 'Monotone X',\n curveStepBefore: 'Step Before',\n};\n\nexport type Props = {\n value: Curve;\n onChange: (value: 'curveStepBefore' | 'curveMonotoneX') => void;\n};\n\nconst curves: Array<Curve> = ['curveMonotoneX', 'curveStepBefore'];\n\nexport const CurveFilter = ({ value, onChange }: Props) => {\n const handleChange = useCallback(\n (v: SelectedItems) => onChange(v as Curve),\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label=\"Curve\"\n selected={value}\n items={curves.map(v => ({\n label: CURVE_DISPLAY_NAMES[v],\n value: v,\n }))}\n onChange={handleChange}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Select, SelectedItems } from '@backstage/core-components';\nimport { Box } from '@material-ui/core';\nimport React, { useCallback } from 'react';\nimport { Direction } from '../EntityRelationsGraph';\n\nconst DIRECTION_DISPLAY_NAMES = {\n [Direction.LEFT_RIGHT]: 'Left to right',\n [Direction.RIGHT_LEFT]: 'Right to left',\n [Direction.TOP_BOTTOM]: 'Top to bottom',\n [Direction.BOTTOM_TOP]: 'Bottom to top',\n};\n\nexport type Props = {\n value: Direction;\n onChange: (value: Direction) => void;\n};\n\nexport const DirectionFilter = ({ value, onChange }: Props) => {\n const handleChange = useCallback(\n (v: SelectedItems) => onChange(v as Direction),\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label=\"Direction\"\n selected={value}\n items={Object.values(Direction).map(v => ({\n label: DIRECTION_DISPLAY_NAMES[v],\n value: v,\n }))}\n onChange={handleChange}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n FormControl,\n IconButton,\n InputAdornment,\n makeStyles,\n OutlinedInput,\n Typography,\n} from '@material-ui/core';\nimport ClearIcon from '@material-ui/icons/Clear';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\nconst useStyles = makeStyles(\n {\n formControl: {\n width: '100%',\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphMaxDepthFilter' },\n);\n\nexport const MaxDepthFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const onChangeRef = useRef(onChange);\n const [currentValue, setCurrentValue] = useState(value);\n\n // Keep a fresh reference to the latest callback\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n // If the value changes externally, update ourselves\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n // When the entered text changes, update ourselves and communicate externally\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValueNumeric = Number(event.target.value);\n const newValue =\n Number.isFinite(newValueNumeric) && newValueNumeric > 0\n ? newValueNumeric\n : Number.POSITIVE_INFINITY;\n setCurrentValue(newValue);\n onChangeRef.current(newValue);\n },\n [],\n );\n\n const reset = useCallback(() => {\n setCurrentValue(Number.POSITIVE_INFINITY);\n onChangeRef.current(Number.POSITIVE_INFINITY);\n }, [onChangeRef]);\n\n return (\n <Box pb={1} pt={1}>\n <FormControl variant=\"outlined\" className={classes.formControl}>\n <Typography variant=\"button\">Max Depth</Typography>\n <OutlinedInput\n type=\"number\"\n placeholder=\"∞ Infinite\"\n value={Number.isFinite(currentValue) ? String(currentValue) : ''}\n onChange={handleChange}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"clear max depth\"\n onClick={reset}\n edge=\"end\"\n >\n <ClearIcon />\n </IconButton>\n </InputAdornment>\n }\n inputProps={{\n 'aria-label': 'maxp',\n }}\n labelWidth={0}\n />\n </FormControl>\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedKindsFilter' },\n);\n\nexport type Props = {\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedKindsFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const alertApi = useApi(alertApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const { error, value: kinds } = useAsync(async () => {\n return await catalogApi\n .getEntityFacets({ facets: ['kind'] })\n .then(response => response.facets.kind?.map(f => f.value).sort() || []);\n });\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity kinds`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n const normalizedKinds = useMemo(\n () => (kinds ? kinds.map(k => k.toLocaleLowerCase('en-US')) : kinds),\n [kinds],\n );\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(\n normalizedKinds && normalizedKinds.every(r => v.includes(r))\n ? undefined\n : v,\n );\n },\n [normalizedKinds, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n if (!kinds?.length || !normalizedKinds?.length || error) {\n return <></>;\n }\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Kinds</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Kinds\"\n options={normalizedKinds}\n value={value ?? normalizedKinds}\n getOptionLabel={k => kinds[normalizedKinds.indexOf(k)] ?? k}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={kinds[normalizedKinds.indexOf(option)] ?? option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-kinds-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useMemo } from 'react';\nimport { RelationPairs } from '../EntityRelationsGraph';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedRelationsFilter' },\n);\n\nexport type Props = {\n relationPairs: RelationPairs;\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedRelationsFilter = ({\n relationPairs,\n value,\n onChange,\n}: Props) => {\n const classes = useStyles();\n const relations = useMemo(() => relationPairs.flat(), [relationPairs]);\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(relations.every(r => v.includes(r)) ? undefined : v);\n },\n [relations, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Relations</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Relations\"\n options={relations}\n value={value ?? relations}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-relations-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Box, FormControlLabel, makeStyles, Switch } from '@material-ui/core';\nimport React, { useCallback } from 'react';\n\nexport type Props = {\n label: string;\n value: boolean;\n onChange: (value: boolean) => void;\n};\n\nconst useStyles = makeStyles(\n {\n root: {\n width: '100%',\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSwitchFilter' },\n);\n\nexport const SwitchFilter = ({ label, value, onChange }: Props) => {\n const classes = useStyles();\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(event.target.checked);\n },\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <FormControlLabel\n control={\n <Switch\n checked={value}\n onChange={handleChange}\n name={label}\n color=\"primary\"\n />\n }\n label={label}\n className={classes.root}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n CompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport qs from 'qs';\nimport {\n Dispatch,\n DispatchWithoutAction,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router-dom';\nimport usePrevious from 'react-use/lib/usePrevious';\nimport { Direction } from '../EntityRelationsGraph';\n\nexport type CatalogGraphPageValue = {\n rootEntityNames: CompoundEntityRef[];\n setRootEntityNames: Dispatch<React.SetStateAction<CompoundEntityRef[]>>;\n maxDepth: number;\n setMaxDepth: Dispatch<React.SetStateAction<number>>;\n selectedRelations: string[] | undefined;\n setSelectedRelations: Dispatch<React.SetStateAction<string[] | undefined>>;\n selectedKinds: string[] | undefined;\n setSelectedKinds: Dispatch<React.SetStateAction<string[] | undefined>>;\n unidirectional: boolean;\n setUnidirectional: Dispatch<React.SetStateAction<boolean>>;\n mergeRelations: boolean;\n setMergeRelations: Dispatch<React.SetStateAction<boolean>>;\n direction: Direction;\n setDirection: Dispatch<React.SetStateAction<Direction>>;\n curve: 'curveStepBefore' | 'curveMonotoneX';\n setCurve: Dispatch<\n React.SetStateAction<'curveStepBefore' | 'curveMonotoneX'>\n >;\n showFilters: boolean;\n toggleShowFilters: DispatchWithoutAction;\n};\n\nexport function useCatalogGraphPage({\n initialState = {},\n}: {\n initialState?: {\n selectedRelations?: string[] | undefined;\n selectedKinds?: string[] | undefined;\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n };\n}): CatalogGraphPageValue {\n const location = useLocation();\n const query = useMemo(\n () =>\n (qs.parse(location.search, { arrayLimit: 0, ignoreQueryPrefix: true }) ||\n {}) as {\n selectedRelations?: string[] | string;\n selectedKinds?: string[] | string;\n rootEntityRefs?: string[] | string;\n maxDepth?: string[] | string;\n unidirectional?: string[] | string;\n mergeRelations?: string[] | string;\n direction?: string[] | Direction;\n showFilters?: string[] | string;\n curve?: string[] | 'curveStepBefore' | 'curveMonotoneX';\n },\n [location.search],\n );\n\n // Initial state\n const [rootEntityNames, setRootEntityNames] = useState<CompoundEntityRef[]>(\n () =>\n (Array.isArray(query.rootEntityRefs)\n ? query.rootEntityRefs\n : initialState?.rootEntityRefs ?? []\n ).map(r => parseEntityRef(r)),\n );\n const [maxDepth, setMaxDepth] = useState<number>(() =>\n typeof query.maxDepth === 'string'\n ? parseMaxDepth(query.maxDepth)\n : initialState?.maxDepth ?? Number.POSITIVE_INFINITY,\n );\n const [selectedRelations, setSelectedRelations] = useState<\n string[] | undefined\n >(() =>\n Array.isArray(query.selectedRelations)\n ? query.selectedRelations\n : initialState?.selectedRelations,\n );\n const [selectedKinds, setSelectedKinds] = useState<string[] | undefined>(() =>\n (Array.isArray(query.selectedKinds)\n ? query.selectedKinds\n : initialState?.selectedKinds\n )?.map(k => k.toLocaleLowerCase('en-US')),\n );\n const [unidirectional, setUnidirectional] = useState<boolean>(() =>\n typeof query.unidirectional === 'string'\n ? query.unidirectional === 'true'\n : initialState?.unidirectional ?? true,\n );\n const [mergeRelations, setMergeRelations] = useState<boolean>(() =>\n typeof query.mergeRelations === 'string'\n ? query.mergeRelations === 'true'\n : initialState?.mergeRelations ?? true,\n );\n const [direction, setDirection] = useState<Direction>(() =>\n typeof query.direction === 'string'\n ? query.direction\n : initialState?.direction ?? Direction.LEFT_RIGHT,\n );\n const [curve, setCurve] = useState<'curveStepBefore' | 'curveMonotoneX'>(() =>\n typeof query.curve === 'string'\n ? query.curve\n : initialState?.curve ?? 'curveMonotoneX',\n );\n const [showFilters, setShowFilters] = useState<boolean>(() =>\n typeof query.showFilters === 'string'\n ? query.showFilters === 'true'\n : initialState?.showFilters ?? true,\n );\n const toggleShowFilters = useCallback(\n () => setShowFilters(s => !s),\n [setShowFilters],\n );\n\n // Update from query parameters\n const prevQueryParams = usePrevious(location.search);\n useEffect(() => {\n // Only respond to changes to url query params\n if (location.search === prevQueryParams) {\n return;\n }\n\n if (Array.isArray(query.rootEntityRefs)) {\n setRootEntityNames(query.rootEntityRefs.map(r => parseEntityRef(r)));\n }\n\n if (typeof query.maxDepth === 'string') {\n setMaxDepth(parseMaxDepth(query.maxDepth));\n }\n\n if (Array.isArray(query.selectedKinds)) {\n setSelectedKinds(query.selectedKinds);\n }\n\n if (Array.isArray(query.selectedRelations)) {\n setSelectedRelations(query.selectedRelations);\n }\n\n if (typeof query.unidirectional === 'string') {\n setUnidirectional(query.unidirectional === 'true');\n }\n\n if (typeof query.mergeRelations === 'string') {\n setMergeRelations(query.mergeRelations === 'true');\n }\n\n if (typeof query.direction === 'string') {\n setDirection(query.direction);\n }\n\n if (typeof query.showFilters === 'string') {\n setShowFilters(query.showFilters === 'true');\n }\n }, [\n prevQueryParams,\n location.search,\n query,\n setRootEntityNames,\n setMaxDepth,\n setSelectedKinds,\n setSelectedRelations,\n setUnidirectional,\n setMergeRelations,\n setDirection,\n setShowFilters,\n ]);\n\n // Update query parameters\n const previousRootEntityRefs = usePrevious(\n rootEntityNames.map(e => stringifyEntityRef(e)),\n );\n\n useEffect(() => {\n const rootEntityRefs = rootEntityNames.map(e => stringifyEntityRef(e));\n const newParams = qs.stringify(\n {\n rootEntityRefs,\n maxDepth: isFinite(maxDepth) ? maxDepth : '∞',\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n\n // We directly manipulate window history here in order to not re-render\n // infinitely (state => location => state => etc). The intention of this\n // code is just to ensure the right query/filters are loaded when a user\n // clicks the \"back\" button after clicking a result.\n // Only push a new history entry if we switched to another entity, but not\n // if we just changed a viewer setting.\n if (\n !previousRootEntityRefs ||\n (rootEntityRefs.length === previousRootEntityRefs.length &&\n rootEntityRefs.every((v, i) => v === previousRootEntityRefs[i]))\n ) {\n window.history.replaceState(null, document.title, newUrl);\n } else {\n window.history.pushState(null, document.title, newUrl);\n }\n }, [\n rootEntityNames,\n maxDepth,\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n previousRootEntityRefs,\n ]);\n\n return {\n rootEntityNames,\n setRootEntityNames,\n maxDepth,\n setMaxDepth,\n selectedRelations,\n setSelectedRelations,\n selectedKinds,\n setSelectedKinds,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n curve,\n setCurve,\n showFilters,\n toggleShowFilters,\n };\n}\n\nfunction parseMaxDepth(value: string): number {\n return value === '∞' ? Number.POSITIVE_INFINITY : Number(value);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport {\n Content,\n ContentHeader,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n entityRouteRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport { Grid, makeStyles, Paper, Typography } from '@material-ui/core';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport { ToggleButton } from '@material-ui/lab';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\nimport { CurveFilter } from './CurveFilter';\nimport { DirectionFilter } from './DirectionFilter';\nimport { MaxDepthFilter } from './MaxDepthFilter';\nimport { SelectedKindsFilter } from './SelectedKindsFilter';\nimport { SelectedRelationsFilter } from './SelectedRelationsFilter';\nimport { SwitchFilter } from './SwitchFilter';\nimport { useCatalogGraphPage } from './useCatalogGraphPage';\n\nconst useStyles = makeStyles(\n theme => ({\n content: {\n minHeight: 0,\n },\n container: {\n height: '100%',\n maxHeight: '100%',\n minHeight: 0,\n },\n fullHeight: {\n maxHeight: '100%',\n display: 'flex',\n minHeight: 0,\n },\n graphWrapper: {\n position: 'relative',\n flex: 1,\n minHeight: 0,\n display: 'flex',\n },\n graph: {\n flex: 1,\n minHeight: 0,\n },\n legend: {\n position: 'absolute',\n bottom: 0,\n right: 0,\n padding: theme.spacing(1),\n '& .icon': {\n verticalAlign: 'bottom',\n },\n },\n filters: {\n display: 'grid',\n gridGap: theme.spacing(1),\n gridAutoRows: 'auto',\n [theme.breakpoints.up('lg')]: {\n display: 'block',\n },\n [theme.breakpoints.only('md')]: {\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n [theme.breakpoints.only('sm')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n [theme.breakpoints.down('xs')]: {\n gridTemplateColumns: 'repeat(1, 1fr)',\n },\n },\n }),\n { name: 'PluginCatalogGraphCatalogGraphPage' },\n);\n\nexport const CatalogGraphPage = (\n props: {\n initialState?: {\n selectedRelations?: string[];\n selectedKinds?: string[];\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n };\n } & Partial<EntityRelationsGraphProps>,\n) => {\n const { relationPairs = ALL_RELATION_PAIRS, initialState } = props;\n\n const navigate = useNavigate();\n const classes = useStyles();\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const {\n maxDepth,\n setMaxDepth,\n selectedKinds,\n setSelectedKinds,\n selectedRelations,\n setSelectedRelations,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n curve,\n setCurve,\n rootEntityNames,\n setRootEntityNames,\n showFilters,\n toggleShowFilters,\n } = useCatalogGraphPage({ initialState });\n const analytics = useAnalytics();\n const onNodeClick = useCallback(\n (node: EntityNode, event: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n\n if (event.shiftKey) {\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n } else {\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n );\n setRootEntityNames([nodeEntityName]);\n }\n },\n [catalogEntityRoute, navigate, setRootEntityNames, analytics],\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n title=\"Catalog Graph\"\n subtitle={rootEntityNames.map(e => humanizeEntityRef(e)).join(', ')}\n />\n <Content stretch className={classes.content}>\n <ContentHeader\n titleComponent={\n <ToggleButton\n value=\"show filters\"\n selected={showFilters}\n onChange={() => toggleShowFilters()}\n >\n <FilterListIcon /> Filters\n </ToggleButton>\n }\n >\n <SupportButton>\n Start tracking your component in by adding it to the software\n catalog.\n </SupportButton>\n </ContentHeader>\n <Grid container alignItems=\"stretch\" className={classes.container}>\n {showFilters && (\n <Grid item xs={12} lg={2} className={classes.filters}>\n <MaxDepthFilter value={maxDepth} onChange={setMaxDepth} />\n <SelectedKindsFilter\n value={selectedKinds}\n onChange={setSelectedKinds}\n />\n <SelectedRelationsFilter\n value={selectedRelations}\n onChange={setSelectedRelations}\n relationPairs={relationPairs}\n />\n <DirectionFilter value={direction} onChange={setDirection} />\n <CurveFilter value={curve} onChange={setCurve} />\n <SwitchFilter\n value={unidirectional}\n onChange={setUnidirectional}\n label=\"Simplified\"\n />\n <SwitchFilter\n value={mergeRelations}\n onChange={setMergeRelations}\n label=\"Merge Relations\"\n />\n </Grid>\n )}\n <Grid item xs className={classes.fullHeight}>\n <Paper className={classes.graphWrapper}>\n <Typography\n variant=\"caption\"\n color=\"textSecondary\"\n display=\"block\"\n className={classes.legend}\n >\n <ZoomOutMap className=\"icon\" /> Use pinch & zoom to move\n around the diagram. Click to change active node, shift click to\n navigate to entity.\n </Typography>\n <EntityRelationsGraph\n {...props}\n rootEntityNames={rootEntityNames}\n maxDepth={maxDepth}\n kinds={\n selectedKinds && selectedKinds.length > 0\n ? selectedKinds\n : undefined\n }\n relations={\n selectedRelations && selectedRelations.length > 0\n ? selectedRelations\n : undefined\n }\n mergeRelations={mergeRelations}\n unidirectional={unidirectional}\n onNodeClick={onNodeClick}\n direction={direction}\n relationPairs={relationPairs}\n className={classes.graph}\n zoom=\"enabled\"\n curve={curve}\n />\n </Paper>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,mBAA6C,GAAA;AAAA,EACjD,cAAgB,EAAA,YAAA;AAAA,EAChB,eAAiB,EAAA,aAAA;AACnB,CAA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U,EAAA,iBAAA;AAAA,MACV,KAAM,EAAA,iBAAA;AAAA,KAAA;AAAA,GAEV,CAAA,kBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAE,IAAC,EAAA,SAAA,EAAW,QAAQ,UAC/B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,EAAA,EAAA,SAAA,EAAW,QAAQ,YACxB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,SAAA;AAAA,MACR,KAAM,EAAA,eAAA;AAAA,MACN,OAAQ,EAAA,OAAA;AAAA,MACR,WAAW,OAAQ,CAAA,MAAA;AAAA,KAAA;AAAA,oBAEnB,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,MAAO,EAAA,CAAA;AAAA,IAAE,+GAAA;AAAA,GAIjC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,eAAA;AAAA,MACA,QAAA;AAAA,MACA,KACE,EAAA,aAAA,IAAiB,aAAc,CAAA,MAAA,GAAS,IACpC,aACA,GAAA,KAAA,CAAA;AAAA,MAEN,SACE,EAAA,iBAAA,IAAqB,iBAAkB,CAAA,MAAA,GAAS,IAC5C,iBACA,GAAA,KAAA,CAAA;AAAA,MAEN,cAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,SAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAW,OAAQ,CAAA,KAAA;AAAA,MACnB,IAAK,EAAA,SAAA;AAAA,MACL,KAAA;AAAA,KAAA;AAAA,GAEJ,CACF,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"index-28d6fd72.esm.js","sources":["../../src/components/CatalogGraphPage/CurveFilter.tsx","../../src/components/CatalogGraphPage/DirectionFilter.tsx","../../src/components/CatalogGraphPage/MaxDepthFilter.tsx","../../src/components/CatalogGraphPage/SelectedKindsFilter.tsx","../../src/components/CatalogGraphPage/SelectedRelationsFilter.tsx","../../src/components/CatalogGraphPage/SwitchFilter.tsx","../../src/components/CatalogGraphPage/useCatalogGraphPage.ts","../../src/components/CatalogGraphPage/CatalogGraphPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Select, SelectedItems } from '@backstage/core-components';\nimport { Box } from '@material-ui/core';\nimport React, { useCallback } from 'react';\n\ntype Curve = 'curveStepBefore' | 'curveMonotoneX';\nconst CURVE_DISPLAY_NAMES: Record<Curve, string> = {\n curveMonotoneX: 'Monotone X',\n curveStepBefore: 'Step Before',\n};\n\nexport type Props = {\n value: Curve;\n onChange: (value: 'curveStepBefore' | 'curveMonotoneX') => void;\n};\n\nconst curves: Array<Curve> = ['curveMonotoneX', 'curveStepBefore'];\n\nexport const CurveFilter = ({ value, onChange }: Props) => {\n const handleChange = useCallback(\n (v: SelectedItems) => onChange(v as Curve),\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label=\"Curve\"\n selected={value}\n items={curves.map(v => ({\n label: CURVE_DISPLAY_NAMES[v],\n value: v,\n }))}\n onChange={handleChange}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Select, SelectedItems } from '@backstage/core-components';\nimport { Box } from '@material-ui/core';\nimport React, { useCallback } from 'react';\nimport { Direction } from '../EntityRelationsGraph';\n\nconst DIRECTION_DISPLAY_NAMES = {\n [Direction.LEFT_RIGHT]: 'Left to right',\n [Direction.RIGHT_LEFT]: 'Right to left',\n [Direction.TOP_BOTTOM]: 'Top to bottom',\n [Direction.BOTTOM_TOP]: 'Bottom to top',\n};\n\nexport type Props = {\n value: Direction;\n onChange: (value: Direction) => void;\n};\n\nexport const DirectionFilter = ({ value, onChange }: Props) => {\n const handleChange = useCallback(\n (v: SelectedItems) => onChange(v as Direction),\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label=\"Direction\"\n selected={value}\n items={Object.values(Direction).map(v => ({\n label: DIRECTION_DISPLAY_NAMES[v],\n value: v,\n }))}\n onChange={handleChange}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n FormControl,\n IconButton,\n InputAdornment,\n makeStyles,\n OutlinedInput,\n Typography,\n} from '@material-ui/core';\nimport ClearIcon from '@material-ui/icons/Clear';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\nconst useStyles = makeStyles(\n {\n formControl: {\n width: '100%',\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphMaxDepthFilter' },\n);\n\nexport const MaxDepthFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const onChangeRef = useRef(onChange);\n const [currentValue, setCurrentValue] = useState(value);\n\n // Keep a fresh reference to the latest callback\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n // If the value changes externally, update ourselves\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n // When the entered text changes, update ourselves and communicate externally\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValueNumeric = Number(event.target.value);\n const newValue =\n Number.isFinite(newValueNumeric) && newValueNumeric > 0\n ? newValueNumeric\n : Number.POSITIVE_INFINITY;\n setCurrentValue(newValue);\n onChangeRef.current(newValue);\n },\n [],\n );\n\n const reset = useCallback(() => {\n setCurrentValue(Number.POSITIVE_INFINITY);\n onChangeRef.current(Number.POSITIVE_INFINITY);\n }, [onChangeRef]);\n\n return (\n <Box pb={1} pt={1}>\n <FormControl variant=\"outlined\" className={classes.formControl}>\n <Typography variant=\"button\">Max Depth</Typography>\n <OutlinedInput\n type=\"number\"\n placeholder=\"∞ Infinite\"\n value={Number.isFinite(currentValue) ? String(currentValue) : ''}\n onChange={handleChange}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"clear max depth\"\n onClick={reset}\n edge=\"end\"\n >\n <ClearIcon />\n </IconButton>\n </InputAdornment>\n }\n inputProps={{\n 'aria-label': 'maxp',\n }}\n labelWidth={0}\n />\n </FormControl>\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedKindsFilter' },\n);\n\nexport type Props = {\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedKindsFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const alertApi = useApi(alertApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const { error, value: kinds } = useAsync(async () => {\n return await catalogApi\n .getEntityFacets({ facets: ['kind'] })\n .then(response => response.facets.kind?.map(f => f.value).sort() || []);\n });\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity kinds`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n const normalizedKinds = useMemo(\n () => (kinds ? kinds.map(k => k.toLocaleLowerCase('en-US')) : kinds),\n [kinds],\n );\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(\n normalizedKinds && normalizedKinds.every(r => v.includes(r))\n ? undefined\n : v,\n );\n },\n [normalizedKinds, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n if (!kinds?.length || !normalizedKinds?.length || error) {\n return <></>;\n }\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Kinds</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Kinds\"\n options={normalizedKinds}\n value={value ?? normalizedKinds}\n getOptionLabel={k => kinds[normalizedKinds.indexOf(k)] ?? k}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={kinds[normalizedKinds.indexOf(option)] ?? option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-kinds-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useMemo } from 'react';\nimport { RelationPairs } from '../EntityRelationsGraph';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedRelationsFilter' },\n);\n\nexport type Props = {\n relationPairs: RelationPairs;\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedRelationsFilter = ({\n relationPairs,\n value,\n onChange,\n}: Props) => {\n const classes = useStyles();\n const relations = useMemo(() => relationPairs.flat(), [relationPairs]);\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(relations.every(r => v.includes(r)) ? undefined : v);\n },\n [relations, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Relations</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Relations\"\n options={relations}\n value={value ?? relations}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-relations-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Box, FormControlLabel, makeStyles, Switch } from '@material-ui/core';\nimport React, { useCallback } from 'react';\n\nexport type Props = {\n label: string;\n value: boolean;\n onChange: (value: boolean) => void;\n};\n\nconst useStyles = makeStyles(\n {\n root: {\n width: '100%',\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSwitchFilter' },\n);\n\nexport const SwitchFilter = ({ label, value, onChange }: Props) => {\n const classes = useStyles();\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(event.target.checked);\n },\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <FormControlLabel\n control={\n <Switch\n checked={value}\n onChange={handleChange}\n name={label}\n color=\"primary\"\n />\n }\n label={label}\n className={classes.root}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n CompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport qs from 'qs';\nimport {\n Dispatch,\n DispatchWithoutAction,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router-dom';\nimport usePrevious from 'react-use/lib/usePrevious';\nimport { Direction } from '../EntityRelationsGraph';\n\nexport type CatalogGraphPageValue = {\n rootEntityNames: CompoundEntityRef[];\n setRootEntityNames: Dispatch<React.SetStateAction<CompoundEntityRef[]>>;\n maxDepth: number;\n setMaxDepth: Dispatch<React.SetStateAction<number>>;\n selectedRelations: string[] | undefined;\n setSelectedRelations: Dispatch<React.SetStateAction<string[] | undefined>>;\n selectedKinds: string[] | undefined;\n setSelectedKinds: Dispatch<React.SetStateAction<string[] | undefined>>;\n unidirectional: boolean;\n setUnidirectional: Dispatch<React.SetStateAction<boolean>>;\n mergeRelations: boolean;\n setMergeRelations: Dispatch<React.SetStateAction<boolean>>;\n direction: Direction;\n setDirection: Dispatch<React.SetStateAction<Direction>>;\n curve: 'curveStepBefore' | 'curveMonotoneX';\n setCurve: Dispatch<\n React.SetStateAction<'curveStepBefore' | 'curveMonotoneX'>\n >;\n showFilters: boolean;\n toggleShowFilters: DispatchWithoutAction;\n};\n\nexport function useCatalogGraphPage({\n initialState = {},\n}: {\n initialState?: {\n selectedRelations?: string[] | undefined;\n selectedKinds?: string[] | undefined;\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n };\n}): CatalogGraphPageValue {\n const location = useLocation();\n const query = useMemo(\n () =>\n (qs.parse(location.search, { arrayLimit: 0, ignoreQueryPrefix: true }) ||\n {}) as {\n selectedRelations?: string[] | string;\n selectedKinds?: string[] | string;\n rootEntityRefs?: string[] | string;\n maxDepth?: string[] | string;\n unidirectional?: string[] | string;\n mergeRelations?: string[] | string;\n direction?: string[] | Direction;\n showFilters?: string[] | string;\n curve?: string[] | 'curveStepBefore' | 'curveMonotoneX';\n },\n [location.search],\n );\n\n // Initial state\n const [rootEntityNames, setRootEntityNames] = useState<CompoundEntityRef[]>(\n () =>\n (Array.isArray(query.rootEntityRefs)\n ? query.rootEntityRefs\n : initialState?.rootEntityRefs ?? []\n ).map(r => parseEntityRef(r)),\n );\n const [maxDepth, setMaxDepth] = useState<number>(() =>\n typeof query.maxDepth === 'string'\n ? parseMaxDepth(query.maxDepth)\n : initialState?.maxDepth ?? Number.POSITIVE_INFINITY,\n );\n const [selectedRelations, setSelectedRelations] = useState<\n string[] | undefined\n >(() =>\n Array.isArray(query.selectedRelations)\n ? query.selectedRelations\n : initialState?.selectedRelations,\n );\n const [selectedKinds, setSelectedKinds] = useState<string[] | undefined>(() =>\n (Array.isArray(query.selectedKinds)\n ? query.selectedKinds\n : initialState?.selectedKinds\n )?.map(k => k.toLocaleLowerCase('en-US')),\n );\n const [unidirectional, setUnidirectional] = useState<boolean>(() =>\n typeof query.unidirectional === 'string'\n ? query.unidirectional === 'true'\n : initialState?.unidirectional ?? true,\n );\n const [mergeRelations, setMergeRelations] = useState<boolean>(() =>\n typeof query.mergeRelations === 'string'\n ? query.mergeRelations === 'true'\n : initialState?.mergeRelations ?? true,\n );\n const [direction, setDirection] = useState<Direction>(() =>\n typeof query.direction === 'string'\n ? query.direction\n : initialState?.direction ?? Direction.LEFT_RIGHT,\n );\n const [curve, setCurve] = useState<'curveStepBefore' | 'curveMonotoneX'>(() =>\n typeof query.curve === 'string'\n ? query.curve\n : initialState?.curve ?? 'curveMonotoneX',\n );\n const [showFilters, setShowFilters] = useState<boolean>(() =>\n typeof query.showFilters === 'string'\n ? query.showFilters === 'true'\n : initialState?.showFilters ?? true,\n );\n const toggleShowFilters = useCallback(\n () => setShowFilters(s => !s),\n [setShowFilters],\n );\n\n // Update from query parameters\n const prevQueryParams = usePrevious(location.search);\n useEffect(() => {\n // Only respond to changes to url query params\n if (location.search === prevQueryParams) {\n return;\n }\n\n if (Array.isArray(query.rootEntityRefs)) {\n setRootEntityNames(query.rootEntityRefs.map(r => parseEntityRef(r)));\n }\n\n if (typeof query.maxDepth === 'string') {\n setMaxDepth(parseMaxDepth(query.maxDepth));\n }\n\n if (Array.isArray(query.selectedKinds)) {\n setSelectedKinds(query.selectedKinds);\n }\n\n if (Array.isArray(query.selectedRelations)) {\n setSelectedRelations(query.selectedRelations);\n }\n\n if (typeof query.unidirectional === 'string') {\n setUnidirectional(query.unidirectional === 'true');\n }\n\n if (typeof query.mergeRelations === 'string') {\n setMergeRelations(query.mergeRelations === 'true');\n }\n\n if (typeof query.direction === 'string') {\n setDirection(query.direction);\n }\n\n if (typeof query.showFilters === 'string') {\n setShowFilters(query.showFilters === 'true');\n }\n }, [\n prevQueryParams,\n location.search,\n query,\n setRootEntityNames,\n setMaxDepth,\n setSelectedKinds,\n setSelectedRelations,\n setUnidirectional,\n setMergeRelations,\n setDirection,\n setShowFilters,\n ]);\n\n // Update query parameters\n const previousRootEntityRefs = usePrevious(\n rootEntityNames.map(e => stringifyEntityRef(e)),\n );\n\n useEffect(() => {\n const rootEntityRefs = rootEntityNames.map(e => stringifyEntityRef(e));\n const newParams = qs.stringify(\n {\n rootEntityRefs,\n maxDepth: isFinite(maxDepth) ? maxDepth : '∞',\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n\n // We directly manipulate window history here in order to not re-render\n // infinitely (state => location => state => etc). The intention of this\n // code is just to ensure the right query/filters are loaded when a user\n // clicks the \"back\" button after clicking a result.\n // Only push a new history entry if we switched to another entity, but not\n // if we just changed a viewer setting.\n if (\n !previousRootEntityRefs ||\n (rootEntityRefs.length === previousRootEntityRefs.length &&\n rootEntityRefs.every((v, i) => v === previousRootEntityRefs[i]))\n ) {\n window.history.replaceState(null, document.title, newUrl);\n } else {\n window.history.pushState(null, document.title, newUrl);\n }\n }, [\n rootEntityNames,\n maxDepth,\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n previousRootEntityRefs,\n ]);\n\n return {\n rootEntityNames,\n setRootEntityNames,\n maxDepth,\n setMaxDepth,\n selectedRelations,\n setSelectedRelations,\n selectedKinds,\n setSelectedKinds,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n curve,\n setCurve,\n showFilters,\n toggleShowFilters,\n };\n}\n\nfunction parseMaxDepth(value: string): number {\n return value === '∞' ? Number.POSITIVE_INFINITY : Number(value);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport {\n Content,\n ContentHeader,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n entityRouteRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport { Grid, makeStyles, Paper, Typography } from '@material-ui/core';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport { ToggleButton } from '@material-ui/lab';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\nimport { CurveFilter } from './CurveFilter';\nimport { DirectionFilter } from './DirectionFilter';\nimport { MaxDepthFilter } from './MaxDepthFilter';\nimport { SelectedKindsFilter } from './SelectedKindsFilter';\nimport { SelectedRelationsFilter } from './SelectedRelationsFilter';\nimport { SwitchFilter } from './SwitchFilter';\nimport { useCatalogGraphPage } from './useCatalogGraphPage';\n\nconst useStyles = makeStyles(\n theme => ({\n content: {\n minHeight: 0,\n },\n container: {\n height: '100%',\n maxHeight: '100%',\n minHeight: 0,\n },\n fullHeight: {\n maxHeight: '100%',\n display: 'flex',\n minHeight: 0,\n },\n graphWrapper: {\n position: 'relative',\n flex: 1,\n minHeight: 0,\n display: 'flex',\n },\n graph: {\n flex: 1,\n minHeight: 0,\n },\n legend: {\n position: 'absolute',\n bottom: 0,\n right: 0,\n padding: theme.spacing(1),\n '& .icon': {\n verticalAlign: 'bottom',\n },\n },\n filters: {\n display: 'grid',\n gridGap: theme.spacing(1),\n gridAutoRows: 'auto',\n [theme.breakpoints.up('lg')]: {\n display: 'block',\n },\n [theme.breakpoints.only('md')]: {\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n [theme.breakpoints.only('sm')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n [theme.breakpoints.down('xs')]: {\n gridTemplateColumns: 'repeat(1, 1fr)',\n },\n },\n }),\n { name: 'PluginCatalogGraphCatalogGraphPage' },\n);\n\nexport const CatalogGraphPage = (\n props: {\n initialState?: {\n selectedRelations?: string[];\n selectedKinds?: string[];\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n };\n } & Partial<EntityRelationsGraphProps>,\n) => {\n const { relationPairs = ALL_RELATION_PAIRS, initialState } = props;\n\n const navigate = useNavigate();\n const classes = useStyles();\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const {\n maxDepth,\n setMaxDepth,\n selectedKinds,\n setSelectedKinds,\n selectedRelations,\n setSelectedRelations,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n curve,\n setCurve,\n rootEntityNames,\n setRootEntityNames,\n showFilters,\n toggleShowFilters,\n } = useCatalogGraphPage({ initialState });\n const analytics = useAnalytics();\n const onNodeClick = useCallback(\n (node: EntityNode, event: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n\n if (event.shiftKey) {\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n\n analytics.captureEvent(\n 'click',\n node.entity.metadata.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n } else {\n analytics.captureEvent(\n 'click',\n node.entity.metadata.title ?? humanizeEntityRef(nodeEntityName),\n );\n setRootEntityNames([nodeEntityName]);\n }\n },\n [catalogEntityRoute, navigate, setRootEntityNames, analytics],\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n title=\"Catalog Graph\"\n subtitle={rootEntityNames.map(e => humanizeEntityRef(e)).join(', ')}\n />\n <Content stretch className={classes.content}>\n <ContentHeader\n titleComponent={\n <ToggleButton\n value=\"show filters\"\n selected={showFilters}\n onChange={() => toggleShowFilters()}\n >\n <FilterListIcon /> Filters\n </ToggleButton>\n }\n >\n <SupportButton>\n Start tracking your component in by adding it to the software\n catalog.\n </SupportButton>\n </ContentHeader>\n <Grid container alignItems=\"stretch\" className={classes.container}>\n {showFilters && (\n <Grid item xs={12} lg={2} className={classes.filters}>\n <MaxDepthFilter value={maxDepth} onChange={setMaxDepth} />\n <SelectedKindsFilter\n value={selectedKinds}\n onChange={setSelectedKinds}\n />\n <SelectedRelationsFilter\n value={selectedRelations}\n onChange={setSelectedRelations}\n relationPairs={relationPairs}\n />\n <DirectionFilter value={direction} onChange={setDirection} />\n <CurveFilter value={curve} onChange={setCurve} />\n <SwitchFilter\n value={unidirectional}\n onChange={setUnidirectional}\n label=\"Simplified\"\n />\n <SwitchFilter\n value={mergeRelations}\n onChange={setMergeRelations}\n label=\"Merge Relations\"\n />\n </Grid>\n )}\n <Grid item xs className={classes.fullHeight}>\n <Paper className={classes.graphWrapper}>\n <Typography\n variant=\"caption\"\n color=\"textSecondary\"\n display=\"block\"\n className={classes.legend}\n >\n <ZoomOutMap className=\"icon\" /> Use pinch & zoom to move\n around the diagram. Click to change active node, shift click to\n navigate to entity.\n </Typography>\n <EntityRelationsGraph\n {...props}\n rootEntityNames={rootEntityNames}\n maxDepth={maxDepth}\n kinds={\n selectedKinds && selectedKinds.length > 0\n ? selectedKinds\n : undefined\n }\n relations={\n selectedRelations && selectedRelations.length > 0\n ? selectedRelations\n : undefined\n }\n mergeRelations={mergeRelations}\n unidirectional={unidirectional}\n onNodeClick={onNodeClick}\n direction={direction}\n relationPairs={relationPairs}\n className={classes.graph}\n zoom=\"enabled\"\n curve={curve}\n />\n </Paper>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,mBAA6C,GAAA;AAAA,EACjD,cAAgB,EAAA,YAAA;AAAA,EAChB,eAAiB,EAAA,aAAA;AACnB,C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click",
|
|
68
|
-
(_a = node.title) != null ? _a : humanizeEntityRef(nodeEntityName),
|
|
68
|
+
(_a = node.entity.metadata.title) != null ? _a : humanizeEntityRef(nodeEntityName),
|
|
69
69
|
{ attributes: { to: path } }
|
|
70
70
|
);
|
|
71
71
|
navigate(path);
|
|
@@ -116,4 +116,4 @@ const CatalogGraphCard = (props) => {
|
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
export { CatalogGraphCard };
|
|
119
|
-
//# sourceMappingURL=index-
|
|
119
|
+
//# sourceMappingURL=index-7de551c2.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-7de551c2.esm.js","sources":["../../src/components/CatalogGraphCard/CatalogGraphCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n getCompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n humanizeEntityRef,\n useEntity,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { makeStyles, Theme } from '@material-ui/core';\nimport qs from 'qs';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n} from '../EntityRelationsGraph';\nimport { EntityRelationsGraphProps } from '../EntityRelationsGraph';\n\nconst useStyles = makeStyles<Theme, { height: number | undefined }>(\n {\n card: ({ height }) => ({\n display: 'flex',\n flexDirection: 'column',\n maxHeight: height,\n minHeight: height,\n }),\n graph: {\n flex: 1,\n minHeight: 0,\n },\n },\n { name: 'PluginCatalogGraphCatalogGraphCard' },\n);\n\nexport const CatalogGraphCard = (\n props: Partial<EntityRelationsGraphProps> & {\n variant?: InfoCardVariants;\n height?: number;\n title?: string;\n },\n) => {\n const {\n variant = 'gridItem',\n relationPairs = ALL_RELATION_PAIRS,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n direction = Direction.LEFT_RIGHT,\n kinds,\n relations,\n height,\n className,\n rootEntityNames,\n onNodeClick,\n title = 'Relations',\n zoom = 'enable-on-click',\n } = props;\n\n const { entity } = useEntity();\n const entityName = getCompoundEntityRef(entity);\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const catalogGraphRoute = useRouteRef(catalogGraphRouteRef);\n const navigate = useNavigate();\n const classes = useStyles({ height });\n const analytics = useAnalytics();\n\n const defaultOnNodeClick = useCallback(\n (node: EntityNode, _: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n analytics.captureEvent(\n 'click',\n node.entity.metadata.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n },\n [catalogEntityRoute, navigate, analytics],\n );\n\n const catalogGraphParams = qs.stringify(\n {\n rootEntityRefs: [stringifyEntityRef(entity)],\n maxDepth: maxDepth,\n unidirectional,\n mergeRelations,\n selectedKinds: kinds,\n selectedRelations: relations,\n direction,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const catalogGraphUrl = `${catalogGraphRoute()}${catalogGraphParams}`;\n\n return (\n <InfoCard\n title={title}\n cardClassName={classes.card}\n variant={variant}\n noPadding\n deepLink={{\n title: 'View graph',\n link: catalogGraphUrl,\n }}\n >\n <EntityRelationsGraph\n {...props}\n rootEntityNames={rootEntityNames || entityName}\n onNodeClick={onNodeClick || defaultOnNodeClick}\n className={className || classes.graph}\n maxDepth={maxDepth}\n unidirectional={unidirectional}\n mergeRelations={mergeRelations}\n direction={direction}\n relationPairs={relationPairs}\n zoom={zoom}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAyCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,IAAM,EAAA,CAAC,EAAE,MAAA,EAAc,MAAA;AAAA,MACrB,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,QAAA;AAAA,MACf,SAAW,EAAA,MAAA;AAAA,MACX,SAAW,EAAA,MAAA;AAAA,KACb,CAAA;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,CAAA;AAAA,MACN,SAAW,EAAA,CAAA;AAAA,KACb;AAAA,GACF;AAAA,EACA,EAAE,MAAM,oCAAqC,EAAA;AAC/C,CAAA,CAAA;AAEa,MAAA,gBAAA,GAAmB,CAC9B,KAKG,KAAA;AACH,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,UAAA;AAAA,IACV,aAAgB,GAAA,kBAAA;AAAA,IAChB,QAAW,GAAA,CAAA;AAAA,IACX,cAAiB,GAAA,IAAA;AAAA,IACjB,cAAiB,GAAA,IAAA;AAAA,IACjB,YAAY,SAAU,CAAA,UAAA;AAAA,IACtB,KAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,eAAA;AAAA,IACA,WAAA;AAAA,IACA,KAAQ,GAAA,WAAA;AAAA,IACR,IAAO,GAAA,iBAAA;AAAA,GACL,GAAA,KAAA,CAAA;AAEJ,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAM,MAAA,UAAA,GAAa,qBAAqB,MAAM,CAAA,CAAA;AA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ACA,cAAA;AAAA,MACA,aAAe,EAAA,KAAA;AAAA,MACf,iBAAmB,EAAA,SAAA;AAAA,MACnB,SAAA;AAAA,KACF;AAAA,IACA,EAAE,WAAA,EAAa,UAAY,EAAA,cAAA,EAAgB,IAAK,EAAA;AAAA,GAClD,CAAA;AACA,EAAA,MAAM,eAAkB,GAAA,CAAA,EAAG,iBAAkB,EAAC,GAAG,kBAAkB,CAAA,CAAA,CAAA;AAEnE,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,eAAe,OAAQ,CAAA,IAAA;AAAA,MACvB,OAAA;AAAA,MACA,SAAS,EAAA,IAAA;AAAA,MACT,QAAU,EAAA;AAAA,QACR,KAAO,EAAA,YAAA;AAAA,QACP,IAAM,EAAA,eAAA;AAAA,OACR;AAAA,KAAA;AAAA,oBAEA,KAAA,CAAA,aAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACE,GAAG,KAAA;AAAA,QACJ,iBAAiB,eAAmB,IAAA,UAAA;AAAA,QACpC,aAAa,WAAe,IAAA,kBAAA;AAAA,QAC5B,SAAA,EAAW,aAAa,OAAQ,CAAA,KAAA;AAAA,QAChC,QAAA;AAAA,QACA,cAAA;AAAA,QACA,cAAA;AAAA,QACA,SAAA;AAAA,QACA,aAAA;AAAA,QACA,IAAA;AAAA,OAAA;AAAA,KACF;AAAA,GACF,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CompoundEntityRef } from '@backstage/catalog-model';
|
|
2
|
+
import { Entity, CompoundEntityRef } from '@backstage/catalog-model';
|
|
3
3
|
import * as _backstage_core_components from '@backstage/core-components';
|
|
4
4
|
import { DependencyGraphTypes } from '@backstage/core-components';
|
|
5
5
|
import * as react from 'react';
|
|
@@ -49,39 +49,49 @@ type EntityEdge = DependencyGraphTypes.DependencyEdge<EntityEdgeData>;
|
|
|
49
49
|
* @public
|
|
50
50
|
*/
|
|
51
51
|
type EntityNodeData = {
|
|
52
|
+
/**
|
|
53
|
+
* The Entity
|
|
54
|
+
*/
|
|
55
|
+
entity: Entity;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the entity is focused, optional, defaults to false. Focused
|
|
58
|
+
* entities are highlighted in the graph.
|
|
59
|
+
*/
|
|
60
|
+
focused?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Optional color of the entity, defaults to 'default'.
|
|
63
|
+
*/
|
|
64
|
+
color?: 'primary' | 'secondary' | 'default';
|
|
65
|
+
/**
|
|
66
|
+
* Optional click handler.
|
|
67
|
+
*/
|
|
68
|
+
onClick?: MouseEventHandler<unknown>;
|
|
52
69
|
/**
|
|
53
70
|
* Name of the entity.
|
|
71
|
+
* @deprecated use {@link EntityNodeData#entity} instead
|
|
54
72
|
*/
|
|
55
73
|
name: string;
|
|
56
74
|
/**
|
|
57
75
|
* Optional kind of the entity.
|
|
76
|
+
* @deprecated use {@link EntityNodeData#entity} instead
|
|
58
77
|
*/
|
|
59
78
|
kind?: string;
|
|
60
79
|
/**
|
|
61
80
|
* Optional title of the entity.
|
|
81
|
+
* @deprecated use {@link EntityNodeData#entity} instead
|
|
62
82
|
*/
|
|
63
83
|
title?: string;
|
|
64
84
|
/**
|
|
65
85
|
* Namespace of the entity.
|
|
86
|
+
* @deprecated use {@link EntityNodeData#entity} instead
|
|
87
|
+
* The Entity
|
|
66
88
|
*/
|
|
67
89
|
namespace: string;
|
|
68
90
|
/**
|
|
69
91
|
* Optional spec of the entity.
|
|
92
|
+
* @deprecated use {@link EntityNodeData#entity} instead
|
|
70
93
|
*/
|
|
71
94
|
spec?: JsonObject;
|
|
72
|
-
/**
|
|
73
|
-
* Whether the entity is focused, optional, defaults to false. Focused
|
|
74
|
-
* entities are highlighted in the graph.
|
|
75
|
-
*/
|
|
76
|
-
focused?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Optional color of the entity, defaults to 'default'.
|
|
79
|
-
*/
|
|
80
|
-
color?: 'primary' | 'secondary' | 'default';
|
|
81
|
-
/**
|
|
82
|
-
* Optional click handler.
|
|
83
|
-
*/
|
|
84
|
-
onClick?: MouseEventHandler<unknown>;
|
|
85
95
|
};
|
|
86
96
|
/**
|
|
87
97
|
* Node representing an entity.
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RELATION_OWNER_OF, RELATION_OWNED_BY, RELATION_CONSUMES_API, RELATION_API_CONSUMED_BY, RELATION_API_PROVIDED_BY, RELATION_PROVIDES_API, RELATION_HAS_PART, RELATION_PART_OF, RELATION_PARENT_OF, RELATION_CHILD_OF, RELATION_HAS_MEMBER, RELATION_MEMBER_OF, RELATION_DEPENDS_ON, RELATION_DEPENDENCY_OF,
|
|
1
|
+
import { DEFAULT_NAMESPACE, RELATION_OWNER_OF, RELATION_OWNED_BY, RELATION_CONSUMES_API, RELATION_API_CONSUMED_BY, RELATION_API_PROVIDED_BY, RELATION_PROVIDES_API, RELATION_HAS_PART, RELATION_PART_OF, RELATION_PARENT_OF, RELATION_CHILD_OF, RELATION_HAS_MEMBER, RELATION_MEMBER_OF, RELATION_DEPENDS_ON, RELATION_DEPENDENCY_OF, stringifyEntityRef } from '@backstage/catalog-model';
|
|
2
2
|
import { DependencyGraph, DependencyGraphTypes } from '@backstage/core-components';
|
|
3
3
|
import { useApp, useApi, errorApiRef, createRouteRef, createExternalRouteRef, createPlugin, createComponentExtension, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
4
4
|
import { makeStyles as makeStyles$2, useTheme, CircularProgress } from '@material-ui/core';
|
|
@@ -23,7 +23,7 @@ const useStyles$2 = makeStyles(
|
|
|
23
23
|
}),
|
|
24
24
|
{ name: "PluginCatalogGraphCustomLabel" }
|
|
25
25
|
);
|
|
26
|
-
function
|
|
26
|
+
function DefaultRenderLabel({
|
|
27
27
|
edge: { relations }
|
|
28
28
|
}) {
|
|
29
29
|
const classes = useStyles$2();
|
|
@@ -72,17 +72,8 @@ const useStyles$1 = makeStyles$1(
|
|
|
72
72
|
}),
|
|
73
73
|
{ name: "PluginCatalogGraphCustomNode" }
|
|
74
74
|
);
|
|
75
|
-
function
|
|
76
|
-
node: {
|
|
77
|
-
id,
|
|
78
|
-
kind,
|
|
79
|
-
namespace,
|
|
80
|
-
name,
|
|
81
|
-
color = "default",
|
|
82
|
-
focused,
|
|
83
|
-
title,
|
|
84
|
-
onClick
|
|
85
|
-
}
|
|
75
|
+
function DefaultRenderNode({
|
|
76
|
+
node: { id, entity, color = "default", focused, onClick }
|
|
86
77
|
}) {
|
|
87
78
|
const classes = useStyles$1();
|
|
88
79
|
const [width, setWidth] = useState(0);
|
|
@@ -99,6 +90,10 @@ function CustomNode({
|
|
|
99
90
|
}
|
|
100
91
|
}
|
|
101
92
|
}, [width, height]);
|
|
93
|
+
const {
|
|
94
|
+
kind,
|
|
95
|
+
metadata: { name, namespace = DEFAULT_NAMESPACE, title }
|
|
96
|
+
} = entity;
|
|
102
97
|
const padding = 10;
|
|
103
98
|
const iconSize = height;
|
|
104
99
|
const paddedIconWidth = kind ? iconSize + padding : 0;
|
|
@@ -307,17 +302,18 @@ function useEntityRelationNodesAndEdges({
|
|
|
307
302
|
return;
|
|
308
303
|
}
|
|
309
304
|
const nodes = Object.entries(entities).map(([entityRef, entity]) => {
|
|
310
|
-
var _a2, _b, _c, _d;
|
|
311
305
|
const focused = rootEntityRefs.includes(entityRef);
|
|
312
306
|
const node = {
|
|
313
307
|
id: entityRef,
|
|
314
|
-
|
|
308
|
+
entity,
|
|
309
|
+
focused,
|
|
310
|
+
color: focused ? "secondary" : "primary",
|
|
311
|
+
// @deprecated
|
|
315
312
|
kind: entity.kind,
|
|
316
313
|
name: entity.metadata.name,
|
|
317
|
-
namespace:
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
color: focused ? "secondary" : "primary"
|
|
314
|
+
namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,
|
|
315
|
+
title: entity.metadata.title,
|
|
316
|
+
spec: entity.spec
|
|
321
317
|
};
|
|
322
318
|
if (onNodeClick) {
|
|
323
319
|
node.onClick = (event) => onNodeClick(node, event);
|
|
@@ -413,7 +409,7 @@ const useStyles = makeStyles$2(
|
|
|
413
409
|
width: "100%",
|
|
414
410
|
flex: 1,
|
|
415
411
|
// Right now there is no good way to style edges between nodes, we have to
|
|
416
|
-
//
|
|
412
|
+
// fall back to these hacks:
|
|
417
413
|
"& path[marker-end]": {
|
|
418
414
|
transition: "filter 0.1s ease-in-out"
|
|
419
415
|
},
|
|
@@ -471,8 +467,8 @@ const EntityRelationsGraph = (props) => {
|
|
|
471
467
|
{
|
|
472
468
|
nodes,
|
|
473
469
|
edges,
|
|
474
|
-
renderNode: renderNode ||
|
|
475
|
-
renderLabel: renderLabel ||
|
|
470
|
+
renderNode: renderNode || DefaultRenderNode,
|
|
471
|
+
renderLabel: renderLabel || DefaultRenderLabel,
|
|
476
472
|
direction,
|
|
477
473
|
className: classes.graph,
|
|
478
474
|
paddingX: theme.spacing(4),
|
|
@@ -508,14 +504,14 @@ const EntityCatalogGraphCard = catalogGraphPlugin.provide(
|
|
|
508
504
|
createComponentExtension({
|
|
509
505
|
name: "EntityCatalogGraphCard",
|
|
510
506
|
component: {
|
|
511
|
-
lazy: () => import('./esm/index-
|
|
507
|
+
lazy: () => import('./esm/index-7de551c2.esm.js').then((m) => m.CatalogGraphCard)
|
|
512
508
|
}
|
|
513
509
|
})
|
|
514
510
|
);
|
|
515
511
|
const CatalogGraphPage = catalogGraphPlugin.provide(
|
|
516
512
|
createRoutableExtension({
|
|
517
513
|
name: "CatalogGraphPage",
|
|
518
|
-
component: () => import('./esm/index-
|
|
514
|
+
component: () => import('./esm/index-28d6fd72.esm.js').then((m) => m.CatalogGraphPage),
|
|
519
515
|
mountPoint: catalogGraphRouteRef
|
|
520
516
|
})
|
|
521
517
|
);
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/components/EntityRelationsGraph/CustomLabel.tsx","../src/components/EntityRelationsGraph/EntityKindIcon.tsx","../src/components/EntityRelationsGraph/CustomNode.tsx","../src/components/EntityRelationsGraph/relations.ts","../src/components/EntityRelationsGraph/types.ts","../src/components/EntityRelationsGraph/useEntityStore.ts","../src/components/EntityRelationsGraph/useEntityRelationGraph.ts","../src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts","../src/components/EntityRelationsGraph/EntityRelationsGraph.tsx","../src/routes.ts","../src/plugin.ts","../src/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport React from 'react';\nimport { EntityEdgeData } from './types';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles(\n theme => ({\n text: {\n fill: theme.palette.textContrast,\n },\n secondary: {\n fill: theme.palette.textSubtle,\n },\n }),\n { name: 'PluginCatalogGraphCustomLabel' },\n);\n\nexport function CustomLabel({\n edge: { relations },\n}: DependencyGraphTypes.RenderLabelProps<EntityEdgeData>) {\n const classes = useStyles();\n return (\n <text className={classes.text} textAnchor=\"middle\">\n {relations.map((r, i) => (\n <tspan key={r} className={classNames(i > 0 && classes.secondary)}>\n {i > 0 && <tspan> / </tspan>}\n {r}\n </tspan>\n ))}\n </text>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApp } from '@backstage/core-plugin-api';\nimport WorkIcon from '@material-ui/icons/Work';\nimport React from 'react';\n\nexport function EntityKindIcon({\n kind,\n ...props\n}: {\n kind: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const app = useApp();\n const Icon =\n app.getSystemIcon(`kind:${kind.toLocaleLowerCase('en-US')}`) ?? WorkIcon;\n return <Icon {...props} />;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { humanizeEntityRef } from '@backstage/plugin-catalog-react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { EntityKindIcon } from './EntityKindIcon';\nimport { EntityNodeData } from './types';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n }),\n { name: 'PluginCatalogGraphCustomNode' },\n);\n\nexport function CustomNode({\n node: {\n id,\n kind,\n namespace,\n name,\n color = 'default',\n focused,\n title,\n onClick,\n },\n}: DependencyGraphTypes.RenderNodeProps<EntityNodeData>) {\n const classes = useStyles();\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = kind ? iconSize + padding : 0;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const displayTitle =\n title ??\n (kind && name && namespace\n ? humanizeEntityRef({ kind, name, namespace })\n : id);\n\n return (\n <g onClick={onClick} className={classNames(onClick && classes.clickable)}>\n <rect\n className={classNames(\n classes.node,\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n {kind && (\n <EntityKindIcon\n kind={kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n />\n )}\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n RELATION_API_CONSUMED_BY,\n RELATION_API_PROVIDED_BY,\n RELATION_CHILD_OF,\n RELATION_CONSUMES_API,\n RELATION_DEPENDENCY_OF,\n RELATION_DEPENDS_ON,\n RELATION_HAS_MEMBER,\n RELATION_HAS_PART,\n RELATION_MEMBER_OF,\n RELATION_OWNED_BY,\n RELATION_OWNER_OF,\n RELATION_PARENT_OF,\n RELATION_PART_OF,\n RELATION_PROVIDES_API,\n} from '@backstage/catalog-model';\n\n/**\n * A pair of two relations that describe the opposite of each other. The first\n * relation is considered as the primary relation.\n *\n * @public\n */\nexport type RelationPairs = [string, string][];\n\n// TODO: This file only contains the pairs for the built-in relations.\n// How to implement this when custom relations are used? Right now you can pass\n// the relations everywhere.\n// Another option is to move this into @backstage/catalog-model\n\n/**\n * A list of pairs of entity relations, used to define which relations are\n * merged together and which the primary relation is.\n *\n * @public\n */\nexport const ALL_RELATION_PAIRS: RelationPairs = [\n [RELATION_OWNER_OF, RELATION_OWNED_BY],\n [RELATION_CONSUMES_API, RELATION_API_CONSUMED_BY],\n [RELATION_API_PROVIDED_BY, RELATION_PROVIDES_API],\n [RELATION_HAS_PART, RELATION_PART_OF],\n [RELATION_PARENT_OF, RELATION_CHILD_OF],\n [RELATION_HAS_MEMBER, RELATION_MEMBER_OF],\n [RELATION_DEPENDS_ON, RELATION_DEPENDENCY_OF],\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { JsonObject } from '@backstage/types';\nimport { MouseEventHandler } from 'react';\n\n/**\n * Additional Data for entities.\n *\n * @public\n */\nexport type EntityEdgeData = {\n /**\n * Up to two relations that are connecting an entity.\n */\n relations: string[];\n /**\n * Whether the entity is visible or not.\n */\n // Not used, but has to be non empty to draw a label at all!\n label: 'visible';\n};\n\n/**\n * Edge between two entities.\n *\n * @public\n */\nexport type EntityEdge = DependencyGraphTypes.DependencyEdge<EntityEdgeData>;\n\n/**\n * Additional data for Entity Node\n *\n * @public\n */\nexport type EntityNodeData = {\n /**\n * Name of the entity.\n */\n name: string;\n /**\n * Optional kind of the entity.\n */\n kind?: string;\n /**\n * Optional title of the entity.\n */\n title?: string;\n /**\n * Namespace of the entity.\n */\n namespace: string;\n /**\n * Optional spec of the entity.\n */\n spec?: JsonObject;\n /**\n * Whether the entity is focused, optional, defaults to false. Focused\n * entities are highlighted in the graph.\n */\n focused?: boolean;\n /**\n * Optional color of the entity, defaults to 'default'.\n */\n color?: 'primary' | 'secondary' | 'default';\n /**\n * Optional click handler.\n */\n onClick?: MouseEventHandler<unknown>;\n};\n\n/**\n * Node representing an entity.\n *\n * @public\n */\nexport type EntityNode = DependencyGraphTypes.DependencyNode<EntityNodeData>;\n\n/**\n * Render direction of the graph.\n *\n * @public\n */\nexport enum Direction {\n /**\n * Top to bottom.\n */\n TOP_BOTTOM = 'TB',\n /**\n * Bottom to top.\n */\n BOTTOM_TOP = 'BT',\n /**\n * Left to right.\n */\n LEFT_RIGHT = 'LR',\n /**\n * Right to left.\n */\n RIGHT_LEFT = 'RL',\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport limiterFactory from 'p-limit';\nimport { Dispatch, useCallback, useRef, useState } from 'react';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\n\n// TODO: This is a good use case for a graphql API, once it is available in the\n// future.\n\nconst limiter = limiterFactory(10);\n\n/**\n * Ensures that a set of requested entities is loaded.\n */\nexport function useEntityStore(): {\n entities: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n requestEntities: Dispatch<string[]>;\n} {\n const catalogClient = useApi(catalogApiRef);\n const state = useRef({\n requestedEntities: new Set<string>(),\n outstandingEntities: new Map<string, Promise<Entity | undefined>>(),\n cachedEntities: new Map<string, Entity>(),\n });\n const [entities, setEntities] = useState<{\n [ref: string]: Entity;\n }>({});\n\n const updateEntities = useCallback(() => {\n const { cachedEntities, requestedEntities } = state.current;\n const filteredEntities: { [ref: string]: Entity } = {};\n requestedEntities.forEach(entityRef => {\n const entity = cachedEntities.get(entityRef);\n\n if (entity) {\n filteredEntities[entityRef] = entity;\n }\n });\n setEntities(filteredEntities);\n }, [state, setEntities]);\n\n const [asyncState, fetch] = useAsyncFn(async () => {\n const { requestedEntities, outstandingEntities, cachedEntities } =\n state.current;\n\n await Promise.all(\n Array.from(requestedEntities).map(entityRef =>\n limiter(async () => {\n if (cachedEntities.has(entityRef)) {\n return;\n }\n\n if (outstandingEntities.has(entityRef)) {\n await outstandingEntities.get(entityRef);\n return;\n }\n\n const promise = catalogClient.getEntityByRef(entityRef);\n\n outstandingEntities.set(entityRef, promise);\n\n try {\n const entity = await promise;\n\n if (entity) {\n cachedEntities.set(entityRef, entity);\n updateEntities();\n }\n } finally {\n outstandingEntities.delete(entityRef);\n }\n }),\n ),\n );\n }, [state, updateEntities]);\n const { loading, error } = asyncState;\n\n const requestEntities = useCallback(\n (entityRefs: string[]) => {\n const n = new Set(entityRefs);\n const { requestedEntities } = state.current;\n\n if (\n n.size !== requestedEntities.size ||\n Array.from(n).some(e => !requestedEntities.has(e))\n ) {\n state.current.requestedEntities = n;\n fetch();\n updateEntities();\n }\n },\n [state, fetch, updateEntities],\n );\n\n return {\n entities,\n loading,\n error,\n requestEntities,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useEffect } from 'react';\nimport { useEntityStore } from './useEntityStore';\n\n/**\n * Discover the graph of entities connected by relations, starting from a set of\n * root entities. Filters are used to select which relations to includes.\n * Returns all discovered entities once they are loaded.\n */\nexport function useEntityRelationGraph({\n rootEntityRefs,\n filter: { maxDepth = Number.POSITIVE_INFINITY, relations, kinds } = {},\n}: {\n rootEntityRefs: string[];\n filter?: {\n maxDepth?: number;\n relations?: string[];\n kinds?: string[];\n };\n}): {\n entities?: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n} {\n const { entities, loading, error, requestEntities } = useEntityStore();\n\n useEffect(() => {\n const expectedEntities = new Set([...rootEntityRefs]);\n const processedEntityRefs = new Set<string>();\n\n let nextDepthRefQueue = [...rootEntityRefs];\n let depth = 0;\n\n while (\n nextDepthRefQueue.length > 0 &&\n (!isFinite(maxDepth) || depth < maxDepth)\n ) {\n const entityRefQueue = nextDepthRefQueue;\n nextDepthRefQueue = [];\n\n while (entityRefQueue.length > 0) {\n const entityRef = entityRefQueue.shift()!;\n const entity = entities[entityRef];\n\n processedEntityRefs.add(entityRef);\n\n if (entity && entity.relations) {\n for (const rel of entity.relations) {\n if (\n (!relations || relations.includes(rel.type)) &&\n (!kinds ||\n kinds.some(kind =>\n rel.targetRef.startsWith(\n `${kind.toLocaleLowerCase('en-US')}:`,\n ),\n ))\n ) {\n if (!processedEntityRefs.has(rel.targetRef)) {\n nextDepthRefQueue.push(rel.targetRef);\n expectedEntities.add(rel.targetRef);\n }\n }\n }\n }\n }\n\n ++depth;\n }\n\n requestEntities([...expectedEntities]);\n }, [entities, rootEntityRefs, maxDepth, relations, kinds, requestEntities]);\n\n return {\n entities,\n loading,\n error,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { MouseEvent, useState } from 'react';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { RelationPairs, ALL_RELATION_PAIRS } from './relations';\nimport { EntityEdge, EntityNode } from './types';\nimport { useEntityRelationGraph } from './useEntityRelationGraph';\n\n/**\n * Generate nodes and edges to render the entity graph.\n */\nexport function useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth = Number.POSITIVE_INFINITY,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n}: {\n rootEntityRefs: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n}): {\n loading: boolean;\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n error?: Error;\n} {\n const [nodesAndEdges, setNodesAndEdges] = useState<{\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n }>({});\n const { entities, loading, error } = useEntityRelationGraph({\n rootEntityRefs,\n filter: {\n maxDepth,\n kinds,\n relations,\n },\n });\n\n useDebounce(\n () => {\n if (!entities || Object.keys(entities).length === 0) {\n setNodesAndEdges({});\n return;\n }\n\n const nodes = Object.entries(entities).map(([entityRef, entity]) => {\n const focused = rootEntityRefs.includes(entityRef);\n const node: EntityNode = {\n id: entityRef,\n title: entity.metadata?.title ?? undefined,\n kind: entity.kind,\n name: entity.metadata.name,\n namespace: entity.metadata.namespace ?? DEFAULT_NAMESPACE,\n spec: entity.spec ?? undefined,\n focused,\n color: focused ? 'secondary' : 'primary',\n };\n\n if (onNodeClick) {\n node.onClick = event => onNodeClick(node, event);\n }\n\n return node;\n });\n\n const edges: EntityEdge[] = [];\n const visitedNodes = new Set<string>();\n const nodeQueue = [...rootEntityRefs];\n\n while (nodeQueue.length > 0) {\n const entityRef = nodeQueue.pop()!;\n const entity = entities[entityRef];\n visitedNodes.add(entityRef);\n\n if (entity) {\n entity?.relations?.forEach(rel => {\n // Check if the related entity should be displayed, if not, ignore\n // the relation too\n if (!entities[rel.targetRef]) {\n return;\n }\n\n if (relations && !relations.includes(rel.type)) {\n return;\n }\n\n if (\n kinds &&\n !kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLocaleLowerCase('en-US')}:`),\n )\n ) {\n return;\n }\n\n if (!unidirectional || !visitedNodes.has(rel.targetRef)) {\n if (mergeRelations) {\n const pair = relationPairs.find(\n ([l, r]) => l === rel.type || r === rel.type,\n ) ?? [rel.type];\n const [left] = pair;\n\n edges.push({\n from: left === rel.type ? entityRef : rel.targetRef,\n to: left === rel.type ? rel.targetRef : entityRef,\n relations: pair,\n label: 'visible',\n });\n } else {\n edges.push({\n from: entityRef,\n to: rel.targetRef,\n relations: [rel.type],\n label: 'visible',\n });\n }\n }\n\n if (!visitedNodes.has(rel.targetRef)) {\n nodeQueue.push(rel.targetRef);\n visitedNodes.add(rel.targetRef);\n }\n });\n }\n }\n\n setNodesAndEdges({ nodes, edges });\n },\n 100,\n [\n entities,\n rootEntityRefs,\n kinds,\n relations,\n unidirectional,\n mergeRelations,\n onNodeClick,\n relationPairs,\n ],\n );\n\n return {\n loading,\n error,\n ...nodesAndEdges,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n} from '@backstage/core-components';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { CircularProgress, makeStyles, useTheme } from '@material-ui/core';\nimport classNames from 'classnames';\nimport React, { MouseEvent, useEffect, useMemo } from 'react';\nimport { CustomLabel } from './CustomLabel';\nimport { CustomNode } from './CustomNode';\nimport { ALL_RELATION_PAIRS, RelationPairs } from './relations';\nimport { Direction, EntityEdge, EntityNode } from './types';\nimport { useEntityRelationNodesAndEdges } from './useEntityRelationNodesAndEdges';\n\nconst useStyles = makeStyles(\n theme => ({\n progress: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n marginLeft: '-20px',\n marginTop: '-20px',\n },\n container: {\n position: 'relative',\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n },\n graph: {\n width: '100%',\n flex: 1,\n // Right now there is no good way to style edges between nodes, we have to\n // fallback to these hacks:\n '& path[marker-end]': {\n transition: 'filter 0.1s ease-in-out',\n },\n '& path[marker-end]:hover': {\n filter: `drop-shadow(2px 2px 4px ${theme.palette.primary.dark});`,\n },\n '& g[data-testid=label]': {\n transition: 'transform 0s',\n },\n },\n }),\n { name: 'PluginCatalogGraphEntityRelationsGraph' },\n);\n\n/**\n * @public\n */\nexport type EntityRelationsGraphProps = {\n rootEntityNames: CompoundEntityRef | CompoundEntityRef[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n direction?: Direction;\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n className?: string;\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n renderNode?: DependencyGraphTypes.RenderNodeFunction<EntityNode>;\n renderLabel?: DependencyGraphTypes.RenderLabelFunction<EntityEdge>;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n};\n\n/**\n * Core building block for custom entity relations diagrams.\n *\n * @public\n */\nexport const EntityRelationsGraph = (props: EntityRelationsGraphProps) => {\n const {\n rootEntityNames,\n maxDepth = 2,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n direction = Direction.LEFT_RIGHT,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n className,\n zoom = 'enabled',\n renderNode,\n renderLabel,\n curve,\n } = props;\n\n const theme = useTheme();\n const classes = useStyles();\n const rootEntityRefs = useMemo(\n () =>\n (Array.isArray(rootEntityNames)\n ? rootEntityNames\n : [rootEntityNames]\n ).map(e => stringifyEntityRef(e)),\n [rootEntityNames],\n );\n const errorApi = useApi(errorApiRef);\n const { loading, error, nodes, edges } = useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth,\n unidirectional,\n mergeRelations,\n kinds,\n relations,\n onNodeClick,\n relationPairs,\n });\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [errorApi, error]);\n\n return (\n <div className={classNames(classes.container, className)}>\n {loading && <CircularProgress className={classes.progress} />}\n {nodes && edges && (\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={renderNode || CustomNode}\n renderLabel={renderLabel || CustomLabel}\n direction={direction}\n className={classes.graph}\n paddingX={theme.spacing(4)}\n paddingY={theme.spacing(4)}\n labelPosition={DependencyGraphTypes.LabelPosition.RIGHT}\n labelOffset={theme.spacing(1)}\n zoom={zoom}\n curve={curve}\n />\n )}\n </div>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\n/**\n * Route pointing to the standalone catalog graph page.\n *\n * @public\n */\nexport const catalogGraphRouteRef = createRouteRef({\n id: 'catalog-graph',\n});\n\n/**\n * Route pointing to the entity page.\n * Used to navigate from the graph to an entity.\n *\n * @public\n * @deprecated This route is no longer used and can be removed\n */\nexport const catalogEntityRouteRef = createExternalRouteRef({\n id: 'catalog-entity',\n params: ['namespace', 'kind', 'name'],\n optional: true,\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createPlugin } from '@backstage/core-plugin-api';\nimport { catalogEntityRouteRef, catalogGraphRouteRef } from './routes';\n\n/**\n * Catalog Graph Plugin instance.\n * @public\n */\nexport const catalogGraphPlugin = createPlugin({\n id: 'catalog-graph',\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { catalogGraphPlugin } from './plugin';\nimport { catalogGraphRouteRef } from './routes';\n\n/**\n * A card that displays the directly related entities to the current entity.\n *\n * @public\n */\nexport const EntityCatalogGraphCard = catalogGraphPlugin.provide(\n createComponentExtension({\n name: 'EntityCatalogGraphCard',\n component: {\n lazy: () =>\n import('./components/CatalogGraphCard').then(m => m.CatalogGraphCard),\n },\n }),\n);\n\n/**\n * A standalone page that can be added to your application providing a viewer\n * for your entities and their relations.\n *\n * @public\n */\nexport const CatalogGraphPage = catalogGraphPlugin.provide(\n createRoutableExtension({\n name: 'CatalogGraphPage',\n component: () =>\n import('./components/CatalogGraphPage').then(m => m.CatalogGraphPage),\n mountPoint: catalogGraphRouteRef,\n }),\n);\n"],"names":["useStyles","makeStyles","Direction","_a"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAMA,WAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA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AAmB,CAAA,OAAA;AAAA,EACjD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,kBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6BAA+B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAY,EAAA,oBAAA;AAAA,GACb,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/components/EntityRelationsGraph/DefaultRenderLabel.tsx","../src/components/EntityRelationsGraph/EntityKindIcon.tsx","../src/components/EntityRelationsGraph/DefaultRenderNode.tsx","../src/components/EntityRelationsGraph/relations.ts","../src/components/EntityRelationsGraph/types.ts","../src/components/EntityRelationsGraph/useEntityStore.ts","../src/components/EntityRelationsGraph/useEntityRelationGraph.ts","../src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts","../src/components/EntityRelationsGraph/EntityRelationsGraph.tsx","../src/routes.ts","../src/plugin.ts","../src/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport React from 'react';\nimport { EntityEdgeData } from './types';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles(\n theme => ({\n text: {\n fill: theme.palette.textContrast,\n },\n secondary: {\n fill: theme.palette.textSubtle,\n },\n }),\n { name: 'PluginCatalogGraphCustomLabel' },\n);\n\nexport function DefaultRenderLabel({\n edge: { relations },\n}: DependencyGraphTypes.RenderLabelProps<EntityEdgeData>) {\n const classes = useStyles();\n return (\n <text className={classes.text} textAnchor=\"middle\">\n {relations.map((r, i) => (\n <tspan key={r} className={classNames(i > 0 && classes.secondary)}>\n {i > 0 && <tspan> / </tspan>}\n {r}\n </tspan>\n ))}\n </text>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApp } from '@backstage/core-plugin-api';\nimport WorkIcon from '@material-ui/icons/Work';\nimport React from 'react';\n\nexport function EntityKindIcon({\n kind,\n ...props\n}: {\n kind: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const app = useApp();\n const Icon =\n app.getSystemIcon(`kind:${kind.toLocaleLowerCase('en-US')}`) ?? WorkIcon;\n return <Icon {...props} />;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { humanizeEntityRef } from '@backstage/plugin-catalog-react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { EntityKindIcon } from './EntityKindIcon';\nimport { EntityNodeData } from './types';\nimport { DEFAULT_NAMESPACE } from '@backstage/catalog-model';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n }),\n { name: 'PluginCatalogGraphCustomNode' },\n);\n\nexport function DefaultRenderNode({\n node: { id, entity, color = 'default', focused, onClick },\n}: DependencyGraphTypes.RenderNodeProps<EntityNodeData>) {\n const classes = useStyles();\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const {\n kind,\n metadata: { name, namespace = DEFAULT_NAMESPACE, title },\n } = entity;\n\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = kind ? iconSize + padding : 0;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const displayTitle =\n title ??\n (kind && name && namespace\n ? humanizeEntityRef({ kind, name, namespace })\n : id);\n\n return (\n <g onClick={onClick} className={classNames(onClick && classes.clickable)}>\n <rect\n className={classNames(\n classes.node,\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n {kind && (\n <EntityKindIcon\n kind={kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n />\n )}\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n RELATION_API_CONSUMED_BY,\n RELATION_API_PROVIDED_BY,\n RELATION_CHILD_OF,\n RELATION_CONSUMES_API,\n RELATION_DEPENDENCY_OF,\n RELATION_DEPENDS_ON,\n RELATION_HAS_MEMBER,\n RELATION_HAS_PART,\n RELATION_MEMBER_OF,\n RELATION_OWNED_BY,\n RELATION_OWNER_OF,\n RELATION_PARENT_OF,\n RELATION_PART_OF,\n RELATION_PROVIDES_API,\n} from '@backstage/catalog-model';\n\n/**\n * A pair of two relations that describe the opposite of each other. The first\n * relation is considered as the primary relation.\n *\n * @public\n */\nexport type RelationPairs = [string, string][];\n\n// TODO: This file only contains the pairs for the built-in relations.\n// How to implement this when custom relations are used? Right now you can pass\n// the relations everywhere.\n// Another option is to move this into @backstage/catalog-model\n\n/**\n * A list of pairs of entity relations, used to define which relations are\n * merged together and which the primary relation is.\n *\n * @public\n */\nexport const ALL_RELATION_PAIRS: RelationPairs = [\n [RELATION_OWNER_OF, RELATION_OWNED_BY],\n [RELATION_CONSUMES_API, RELATION_API_CONSUMED_BY],\n [RELATION_API_PROVIDED_BY, RELATION_PROVIDES_API],\n [RELATION_HAS_PART, RELATION_PART_OF],\n [RELATION_PARENT_OF, RELATION_CHILD_OF],\n [RELATION_HAS_MEMBER, RELATION_MEMBER_OF],\n [RELATION_DEPENDS_ON, RELATION_DEPENDENCY_OF],\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { MouseEventHandler } from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\n\n/**\n * Additional Data for entities.\n *\n * @public\n */\nexport type EntityEdgeData = {\n /**\n * Up to two relations that are connecting an entity.\n */\n relations: string[];\n /**\n * Whether the entity is visible or not.\n */\n // Not used, but has to be non-empty to draw a label at all!\n label: 'visible';\n};\n\n/**\n * Edge between two entities.\n *\n * @public\n */\nexport type EntityEdge = DependencyGraphTypes.DependencyEdge<EntityEdgeData>;\n\n/**\n * Additional data for Entity Node\n *\n * @public\n */\nexport type EntityNodeData = {\n /**\n * The Entity\n */\n entity: Entity;\n /**\n * Whether the entity is focused, optional, defaults to false. Focused\n * entities are highlighted in the graph.\n */\n focused?: boolean;\n /**\n * Optional color of the entity, defaults to 'default'.\n */\n color?: 'primary' | 'secondary' | 'default';\n /**\n * Optional click handler.\n */\n onClick?: MouseEventHandler<unknown>;\n\n /**\n * Name of the entity.\n * @deprecated use {@link EntityNodeData#entity} instead\n */\n name: string;\n /**\n * Optional kind of the entity.\n * @deprecated use {@link EntityNodeData#entity} instead\n */\n kind?: string;\n /**\n * Optional title of the entity.\n * @deprecated use {@link EntityNodeData#entity} instead\n */\n title?: string;\n /**\n * Namespace of the entity.\n * @deprecated use {@link EntityNodeData#entity} instead\n * The Entity\n */\n namespace: string;\n /**\n * Optional spec of the entity.\n * @deprecated use {@link EntityNodeData#entity} instead\n */\n spec?: JsonObject;\n};\n\n/**\n * Node representing an entity.\n *\n * @public\n */\nexport type EntityNode = DependencyGraphTypes.DependencyNode<EntityNodeData>;\n\n/**\n * Render direction of the graph.\n *\n * @public\n */\nexport enum Direction {\n /**\n * Top to bottom.\n */\n TOP_BOTTOM = 'TB',\n /**\n * Bottom to top.\n */\n BOTTOM_TOP = 'BT',\n /**\n * Left to right.\n */\n LEFT_RIGHT = 'LR',\n /**\n * Right to left.\n */\n RIGHT_LEFT = 'RL',\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport limiterFactory from 'p-limit';\nimport { Dispatch, useCallback, useRef, useState } from 'react';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\n\n// TODO: This is a good use case for a graphql API, once it is available in the\n// future.\n\nconst limiter = limiterFactory(10);\n\n/**\n * Ensures that a set of requested entities is loaded.\n */\nexport function useEntityStore(): {\n entities: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n requestEntities: Dispatch<string[]>;\n} {\n const catalogClient = useApi(catalogApiRef);\n const state = useRef({\n requestedEntities: new Set<string>(),\n outstandingEntities: new Map<string, Promise<Entity | undefined>>(),\n cachedEntities: new Map<string, Entity>(),\n });\n const [entities, setEntities] = useState<{\n [ref: string]: Entity;\n }>({});\n\n const updateEntities = useCallback(() => {\n const { cachedEntities, requestedEntities } = state.current;\n const filteredEntities: { [ref: string]: Entity } = {};\n requestedEntities.forEach(entityRef => {\n const entity = cachedEntities.get(entityRef);\n\n if (entity) {\n filteredEntities[entityRef] = entity;\n }\n });\n setEntities(filteredEntities);\n }, [state, setEntities]);\n\n const [asyncState, fetch] = useAsyncFn(async () => {\n const { requestedEntities, outstandingEntities, cachedEntities } =\n state.current;\n\n await Promise.all(\n Array.from(requestedEntities).map(entityRef =>\n limiter(async () => {\n if (cachedEntities.has(entityRef)) {\n return;\n }\n\n if (outstandingEntities.has(entityRef)) {\n await outstandingEntities.get(entityRef);\n return;\n }\n\n const promise = catalogClient.getEntityByRef(entityRef);\n\n outstandingEntities.set(entityRef, promise);\n\n try {\n const entity = await promise;\n\n if (entity) {\n cachedEntities.set(entityRef, entity);\n updateEntities();\n }\n } finally {\n outstandingEntities.delete(entityRef);\n }\n }),\n ),\n );\n }, [state, updateEntities]);\n const { loading, error } = asyncState;\n\n const requestEntities = useCallback(\n (entityRefs: string[]) => {\n const n = new Set(entityRefs);\n const { requestedEntities } = state.current;\n\n if (\n n.size !== requestedEntities.size ||\n Array.from(n).some(e => !requestedEntities.has(e))\n ) {\n state.current.requestedEntities = n;\n fetch();\n updateEntities();\n }\n },\n [state, fetch, updateEntities],\n );\n\n return {\n entities,\n loading,\n error,\n requestEntities,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useEffect } from 'react';\nimport { useEntityStore } from './useEntityStore';\n\n/**\n * Discover the graph of entities connected by relations, starting from a set of\n * root entities. Filters are used to select which relations to includes.\n * Returns all discovered entities once they are loaded.\n */\nexport function useEntityRelationGraph({\n rootEntityRefs,\n filter: { maxDepth = Number.POSITIVE_INFINITY, relations, kinds } = {},\n}: {\n rootEntityRefs: string[];\n filter?: {\n maxDepth?: number;\n relations?: string[];\n kinds?: string[];\n };\n}): {\n entities?: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n} {\n const { entities, loading, error, requestEntities } = useEntityStore();\n\n useEffect(() => {\n const expectedEntities = new Set([...rootEntityRefs]);\n const processedEntityRefs = new Set<string>();\n\n let nextDepthRefQueue = [...rootEntityRefs];\n let depth = 0;\n\n while (\n nextDepthRefQueue.length > 0 &&\n (!isFinite(maxDepth) || depth < maxDepth)\n ) {\n const entityRefQueue = nextDepthRefQueue;\n nextDepthRefQueue = [];\n\n while (entityRefQueue.length > 0) {\n const entityRef = entityRefQueue.shift()!;\n const entity = entities[entityRef];\n\n processedEntityRefs.add(entityRef);\n\n if (entity && entity.relations) {\n for (const rel of entity.relations) {\n if (\n (!relations || relations.includes(rel.type)) &&\n (!kinds ||\n kinds.some(kind =>\n rel.targetRef.startsWith(\n `${kind.toLocaleLowerCase('en-US')}:`,\n ),\n ))\n ) {\n if (!processedEntityRefs.has(rel.targetRef)) {\n nextDepthRefQueue.push(rel.targetRef);\n expectedEntities.add(rel.targetRef);\n }\n }\n }\n }\n }\n\n ++depth;\n }\n\n requestEntities([...expectedEntities]);\n }, [entities, rootEntityRefs, maxDepth, relations, kinds, requestEntities]);\n\n return {\n entities,\n loading,\n error,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MouseEvent, useState } from 'react';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { RelationPairs, ALL_RELATION_PAIRS } from './relations';\nimport { EntityEdge, EntityNode } from './types';\nimport { useEntityRelationGraph } from './useEntityRelationGraph';\nimport { DEFAULT_NAMESPACE } from '@backstage/catalog-model';\n\n/**\n * Generate nodes and edges to render the entity graph.\n */\nexport function useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth = Number.POSITIVE_INFINITY,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n}: {\n rootEntityRefs: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n}): {\n loading: boolean;\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n error?: Error;\n} {\n const [nodesAndEdges, setNodesAndEdges] = useState<{\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n }>({});\n const { entities, loading, error } = useEntityRelationGraph({\n rootEntityRefs,\n filter: {\n maxDepth,\n kinds,\n relations,\n },\n });\n\n useDebounce(\n () => {\n if (!entities || Object.keys(entities).length === 0) {\n setNodesAndEdges({});\n return;\n }\n\n const nodes = Object.entries(entities).map(([entityRef, entity]) => {\n const focused = rootEntityRefs.includes(entityRef);\n const node: EntityNode = {\n id: entityRef,\n entity,\n focused,\n color: focused ? 'secondary' : 'primary',\n // @deprecated\n kind: entity.kind,\n name: entity.metadata.name,\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n title: entity.metadata.title,\n spec: entity.spec,\n };\n\n if (onNodeClick) {\n node.onClick = event => onNodeClick(node, event);\n }\n\n return node;\n });\n\n const edges: EntityEdge[] = [];\n const visitedNodes = new Set<string>();\n const nodeQueue = [...rootEntityRefs];\n\n while (nodeQueue.length > 0) {\n const entityRef = nodeQueue.pop()!;\n const entity = entities[entityRef];\n visitedNodes.add(entityRef);\n\n if (entity) {\n entity?.relations?.forEach(rel => {\n // Check if the related entity should be displayed, if not, ignore\n // the relation too\n if (!entities[rel.targetRef]) {\n return;\n }\n\n if (relations && !relations.includes(rel.type)) {\n return;\n }\n\n if (\n kinds &&\n !kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLocaleLowerCase('en-US')}:`),\n )\n ) {\n return;\n }\n\n if (!unidirectional || !visitedNodes.has(rel.targetRef)) {\n if (mergeRelations) {\n const pair = relationPairs.find(\n ([l, r]) => l === rel.type || r === rel.type,\n ) ?? [rel.type];\n const [left] = pair;\n\n edges.push({\n from: left === rel.type ? entityRef : rel.targetRef,\n to: left === rel.type ? rel.targetRef : entityRef,\n relations: pair,\n label: 'visible',\n });\n } else {\n edges.push({\n from: entityRef,\n to: rel.targetRef,\n relations: [rel.type],\n label: 'visible',\n });\n }\n }\n\n if (!visitedNodes.has(rel.targetRef)) {\n nodeQueue.push(rel.targetRef);\n visitedNodes.add(rel.targetRef);\n }\n });\n }\n }\n\n setNodesAndEdges({ nodes, edges });\n },\n 100,\n [\n entities,\n rootEntityRefs,\n kinds,\n relations,\n unidirectional,\n mergeRelations,\n onNodeClick,\n relationPairs,\n ],\n );\n\n return {\n loading,\n error,\n ...nodesAndEdges,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n} from '@backstage/core-components';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { CircularProgress, makeStyles, useTheme } from '@material-ui/core';\nimport classNames from 'classnames';\nimport React, { MouseEvent, useEffect, useMemo } from 'react';\nimport { DefaultRenderLabel } from './DefaultRenderLabel';\nimport { DefaultRenderNode } from './DefaultRenderNode';\nimport { ALL_RELATION_PAIRS, RelationPairs } from './relations';\nimport { Direction, EntityEdge, EntityNode } from './types';\nimport { useEntityRelationNodesAndEdges } from './useEntityRelationNodesAndEdges';\n\nconst useStyles = makeStyles(\n theme => ({\n progress: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n marginLeft: '-20px',\n marginTop: '-20px',\n },\n container: {\n position: 'relative',\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n },\n graph: {\n width: '100%',\n flex: 1,\n // Right now there is no good way to style edges between nodes, we have to\n // fall back to these hacks:\n '& path[marker-end]': {\n transition: 'filter 0.1s ease-in-out',\n },\n '& path[marker-end]:hover': {\n filter: `drop-shadow(2px 2px 4px ${theme.palette.primary.dark});`,\n },\n '& g[data-testid=label]': {\n transition: 'transform 0s',\n },\n },\n }),\n { name: 'PluginCatalogGraphEntityRelationsGraph' },\n);\n\n/**\n * @public\n */\nexport type EntityRelationsGraphProps = {\n rootEntityNames: CompoundEntityRef | CompoundEntityRef[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n direction?: Direction;\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n className?: string;\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n renderNode?: DependencyGraphTypes.RenderNodeFunction<EntityNode>;\n renderLabel?: DependencyGraphTypes.RenderLabelFunction<EntityEdge>;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n};\n\n/**\n * Core building block for custom entity relations diagrams.\n *\n * @public\n */\nexport const EntityRelationsGraph = (props: EntityRelationsGraphProps) => {\n const {\n rootEntityNames,\n maxDepth = 2,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n direction = Direction.LEFT_RIGHT,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n className,\n zoom = 'enabled',\n renderNode,\n renderLabel,\n curve,\n } = props;\n\n const theme = useTheme();\n const classes = useStyles();\n const rootEntityRefs = useMemo(\n () =>\n (Array.isArray(rootEntityNames)\n ? rootEntityNames\n : [rootEntityNames]\n ).map(e => stringifyEntityRef(e)),\n [rootEntityNames],\n );\n const errorApi = useApi(errorApiRef);\n const { loading, error, nodes, edges } = useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth,\n unidirectional,\n mergeRelations,\n kinds,\n relations,\n onNodeClick,\n relationPairs,\n });\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [errorApi, error]);\n\n return (\n <div className={classNames(classes.container, className)}>\n {loading && <CircularProgress className={classes.progress} />}\n {nodes && edges && (\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={renderNode || DefaultRenderNode}\n renderLabel={renderLabel || DefaultRenderLabel}\n direction={direction}\n className={classes.graph}\n paddingX={theme.spacing(4)}\n paddingY={theme.spacing(4)}\n labelPosition={DependencyGraphTypes.LabelPosition.RIGHT}\n labelOffset={theme.spacing(1)}\n zoom={zoom}\n curve={curve}\n />\n )}\n </div>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\n/**\n * Route pointing to the standalone catalog graph page.\n *\n * @public\n */\nexport const catalogGraphRouteRef = createRouteRef({\n id: 'catalog-graph',\n});\n\n/**\n * Route pointing to the entity page.\n * Used to navigate from the graph to an entity.\n *\n * @public\n * @deprecated This route is no longer used and can be removed\n */\nexport const catalogEntityRouteRef = createExternalRouteRef({\n id: 'catalog-entity',\n params: ['namespace', 'kind', 'name'],\n optional: true,\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createPlugin } from '@backstage/core-plugin-api';\nimport { catalogEntityRouteRef, catalogGraphRouteRef } from './routes';\n\n/**\n * Catalog Graph Plugin instance.\n * @public\n */\nexport const catalogGraphPlugin = createPlugin({\n id: 'catalog-graph',\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { catalogGraphPlugin } from './plugin';\nimport { catalogGraphRouteRef } from './routes';\n\n/**\n * A card that displays the directly related entities to the current entity.\n *\n * @public\n */\nexport const EntityCatalogGraphCard = catalogGraphPlugin.provide(\n createComponentExtension({\n name: 'EntityCatalogGraphCard',\n component: {\n lazy: () =>\n import('./components/CatalogGraphCard').then(m => m.CatalogGraphCard),\n },\n }),\n);\n\n/**\n * A standalone page that can be added to your application providing a viewer\n * for your entities and their relations.\n *\n * @public\n */\nexport const CatalogGraphPage = catalogGraphPlugin.provide(\n createRoutableExtension({\n name: 'CatalogGraphPage',\n component: () =>\n import('./components/CatalogGraphPage').then(m => m.CatalogGraphPage),\n mountPoint: catalogGraphRouteRef,\n }),\n);\n"],"names":["useStyles","makeStyles","Direction","_a"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAMA,WAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,IAAA,EAAM,MAAM,OAAQ,CAAA,YAAA;AAAA,KACtB;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAQ,CAAA,UAAA;AAAA,KACtB;AAAA,GACF,CAAA;AAAA,EACA,EAAE,MAAM,+BAAgC,EAAA;AAC1C,CAAA,CAAA;AAEO,SAAS,kBAAmB,CAAA;AAAA,EACjC,IAAA,EAAM,EAAE,SAAU,EAAA;AACpB,CAA0D,EAAA;AACxD,EAAA,MAAM,UAAUA,WAAU,EAAA,CAAA;AAC1B,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAK,SAAW,EAAA,OAAA,CAAQ,IAAM,EAAA,UAAA,EAAW,QACvC,EAAA,EAAA,SAAA,CAAU,GAAI,CAAA,CAAC,CAAG,EAAA,CAAA,yCAChB,OAAM,EAAA,EAAA,GAAA,EAAK,CAAG,EAAA,SAAA,EAAW,UAAW,CAAA,CAAA,GAAI,CAAK,IAAA,OAAA,CAAQ,SAAS,CAC5D,EAAA,EAAA,CAAA,GAAI,CAAK,oBAAA,K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aAAe,EAAA,qBAAA;AAAA,GACjB;AACF,CAAC;;ACHM,MAAM,yBAAyB,kBAAmB,CAAA,OAAA;AAAA,EACvD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,wBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,6BAA+B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,KACxE;AAAA,GACD,CAAA;AACH,EAAA;AAQO,MAAM,mBAAmB,kBAAmB,CAAA,OAAA;AAAA,EACjD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,kBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6BAA+B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAY,EAAA,oBAAA;AAAA,GACb,CAAA;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-graph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"clean": "backstage-cli package clean"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@backstage/catalog-client": "^1.4.
|
|
32
|
+
"@backstage/catalog-client": "^1.4.6",
|
|
33
33
|
"@backstage/catalog-model": "^1.4.3",
|
|
34
|
-
"@backstage/core-components": "^0.13.8
|
|
35
|
-
"@backstage/core-plugin-api": "^1.8.0
|
|
36
|
-
"@backstage/plugin-catalog-react": "^1.9.0
|
|
37
|
-
"@backstage/theme": "^0.4.4
|
|
34
|
+
"@backstage/core-components": "^0.13.8",
|
|
35
|
+
"@backstage/core-plugin-api": "^1.8.0",
|
|
36
|
+
"@backstage/plugin-catalog-react": "^1.9.0",
|
|
37
|
+
"@backstage/theme": "^0.4.4",
|
|
38
38
|
"@backstage/types": "^1.1.1",
|
|
39
39
|
"@material-ui/core": "^4.12.2",
|
|
40
40
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@backstage/cli": "^0.24.0
|
|
56
|
-
"@backstage/core-app-api": "^1.11.1
|
|
57
|
-
"@backstage/dev-utils": "^1.0.23
|
|
58
|
-
"@backstage/plugin-catalog": "^1.15.0
|
|
59
|
-
"@backstage/test-utils": "^1.4.5
|
|
55
|
+
"@backstage/cli": "^0.24.0",
|
|
56
|
+
"@backstage/core-app-api": "^1.11.1",
|
|
57
|
+
"@backstage/dev-utils": "^1.0.23",
|
|
58
|
+
"@backstage/plugin-catalog": "^1.15.0",
|
|
59
|
+
"@backstage/test-utils": "^1.4.5",
|
|
60
60
|
"@testing-library/dom": "^9.0.0",
|
|
61
61
|
"@testing-library/jest-dom": "^6.0.0",
|
|
62
62
|
"@testing-library/react": "^14.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-9d40850a.esm.js","sources":["../../src/components/CatalogGraphCard/CatalogGraphCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n getCompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n humanizeEntityRef,\n useEntity,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { makeStyles, Theme } from '@material-ui/core';\nimport qs from 'qs';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n} from '../EntityRelationsGraph';\nimport { EntityRelationsGraphProps } from '../EntityRelationsGraph/EntityRelationsGraph';\n\nconst useStyles = makeStyles<Theme, { height: number | undefined }>(\n {\n card: ({ height }) => ({\n display: 'flex',\n flexDirection: 'column',\n maxHeight: height,\n minHeight: height,\n }),\n graph: {\n flex: 1,\n minHeight: 0,\n },\n },\n { name: 'PluginCatalogGraphCatalogGraphCard' },\n);\n\nexport const CatalogGraphCard = (\n props: Partial<EntityRelationsGraphProps> & {\n variant?: InfoCardVariants;\n height?: number;\n title?: string;\n },\n) => {\n const {\n variant = 'gridItem',\n relationPairs = ALL_RELATION_PAIRS,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n direction = Direction.LEFT_RIGHT,\n kinds,\n relations,\n height,\n className,\n rootEntityNames,\n onNodeClick,\n title = 'Relations',\n zoom = 'enable-on-click',\n } = props;\n\n const { entity } = useEntity();\n const entityName = getCompoundEntityRef(entity);\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const catalogGraphRoute = useRouteRef(catalogGraphRouteRef);\n const navigate = useNavigate();\n const classes = useStyles({ height });\n const analytics = useAnalytics();\n\n const defaultOnNodeClick = useCallback(\n (node: EntityNode, _: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n },\n [catalogEntityRoute, navigate, analytics],\n );\n\n const catalogGraphParams = qs.stringify(\n {\n rootEntityRefs: [stringifyEntityRef(entity)],\n maxDepth: maxDepth,\n unidirectional,\n mergeRelations,\n selectedKinds: kinds,\n selectedRelations: relations,\n direction,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const catalogGraphUrl = `${catalogGraphRoute()}${catalogGraphParams}`;\n\n return (\n <InfoCard\n title={title}\n cardClassName={classes.card}\n variant={variant}\n noPadding\n deepLink={{\n title: 'View graph',\n link: catalogGraphUrl,\n }}\n >\n <EntityRelationsGraph\n {...props}\n rootEntityNames={rootEntityNames || entityName}\n onNodeClick={onNodeClick || defaultOnNodeClick}\n className={className || classes.graph}\n maxDepth={maxDepth}\n unidirectional={unidirectional}\n mergeRelations={mergeRelations}\n direction={direction}\n relationPairs={relationPairs}\n zoom={zoom}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAyCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,IAAM,EAAA,CAAC,EAAE,MAAA,EAAc,MAAA;AAAA,MACrB,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,QAAA;AAAA,MACf,SAAW,EAAA,MAAA;AAAA,MACX,SAAW,EAAA,MAAA;AAAA,KACb,CAAA;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,CAAA;AAAA,MACN,SAAW,EAAA,CAAA;AAAA,KACb;AAAA,GACF;AAAA,EACA,EAAE,MAAM,oCAAqC,EAAA;AAC/C,CAAA,CAAA;AAEa,MAAA,gBAAA,GAAmB,CAC9B,KAKG,KAAA;AACH,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,UAAA;AAAA,IACV,aAAgB,GAAA,kBAAA;AAAA,IAChB,QAAW,GAAA,CAAA;AAAA,IACX,cAAiB,GAA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