@backstage/plugin-catalog-graph 0.4.1 → 0.4.3

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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # @backstage/plugin-catalog-graph
2
2
 
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - e8f026a: Use ESM exports of react-use library
8
+ - Updated dependencies
9
+ - @backstage/catalog-client@1.6.3
10
+ - @backstage/core-components@0.14.3
11
+ - @backstage/plugin-catalog-react@1.11.2
12
+ - @backstage/frontend-plugin-api@0.6.3
13
+ - @backstage/core-compat-api@0.2.3
14
+ - @backstage/core-plugin-api@1.9.1
15
+ - @backstage/catalog-model@1.4.5
16
+ - @backstage/types@1.1.1
17
+
18
+ ## 0.4.2
19
+
20
+ ### Patch Changes
21
+
22
+ - e8f026a: Use ESM exports of react-use library
23
+ - Updated dependencies
24
+ - @backstage/catalog-client@1.6.2
25
+ - @backstage/core-components@0.14.2
26
+ - @backstage/plugin-catalog-react@1.11.1
27
+ - @backstage/frontend-plugin-api@0.6.2
28
+ - @backstage/core-compat-api@0.2.2
29
+ - @backstage/core-plugin-api@1.9.1
30
+ - @backstage/catalog-model@1.4.5
31
+ - @backstage/types@1.1.1
32
+
3
33
  ## 0.4.1
4
34
 
5
35
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-graph",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/alpha.esm.js CHANGED
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { createSchemaFromZod, createPageExtension, createPlugin } from '@backstage/frontend-plugin-api';
3
3
  import { compatWrapper, convertLegacyRouteRef } from '@backstage/core-compat-api';
4
4
  import { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha';
5
- import { c as catalogGraphRouteRef, D as Direction, a as catalogEntityRouteRef } from './esm/routes-d114b668.esm.js';
5
+ import { c as catalogGraphRouteRef, D as Direction, a as catalogEntityRouteRef } from './esm/routes-B7pnW8AZ.esm.js';
6
6
  import '@backstage/catalog-model';
7
7
  import '@backstage/core-components';
8
8
  import '@backstage/core-plugin-api';
@@ -12,8 +12,8 @@ import 'classnames';
12
12
  import '@material-ui/core/styles/makeStyles';
13
13
  import '@backstage/plugin-catalog-react';
14
14
  import '@material-ui/core/SvgIcon';
15
- import 'react-use/lib/useDebounce';
16
- import 'react-use/lib/useAsyncFn';
15
+ import 'react-use/esm/useDebounce';
16
+ import 'react-use/esm/useAsyncFn';
17
17
 
18
18
  function getEntityGraphRelationsConfigSchema(z) {
19
19
  return z.object({
@@ -40,7 +40,7 @@ const CatalogGraphEntityCard = createEntityCardExtension({
40
40
  // For more details, see this comment: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
41
41
  }).merge(getEntityGraphRelationsConfigSchema(z))
42
42
  ),
43
- loader: async ({ config: { filter, ...props } }) => import('./esm/index-36ed2693.esm.js').then(
43
+ loader: async ({ config: { filter, ...props } }) => import('./esm/index-Dy8_Ufah.esm.js').then(
44
44
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.CatalogGraphCard, { ...props }))
45
45
  )
46
46
  });
@@ -65,7 +65,7 @@ const CatalogGraphPage = createPageExtension({
65
65
  }).merge(getEntityGraphRelationsConfigSchema(z)).optional()
66
66
  })
67
67
  ),
68
- loader: ({ config: { path, ...props } }) => import('./esm/index-a204af4f.esm.js').then(
68
+ loader: ({ config: { path, ...props } }) => import('./esm/index-CyVoUbSq.esm.js').then(
69
69
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.CatalogGraphPage, { ...props }))
70
70
  )
71
71
  });
@@ -11,7 +11,7 @@ import ZoomOutMap from '@material-ui/icons/ZoomOutMap';
11
11
  import ToggleButton from '@material-ui/lab/ToggleButton';
12
12
  import React, { useCallback, useRef, useState, useEffect, useMemo } from 'react';
13
13
  import { useLocation, useNavigate } from 'react-router-dom';
14
- import { D as Direction, E as EntityRelationsGraph, A as ALL_RELATION_PAIRS } from './routes-d114b668.esm.js';
14
+ import { D as Direction, E as EntityRelationsGraph, A as ALL_RELATION_PAIRS } from './routes-B7pnW8AZ.esm.js';
15
15
  import Box from '@material-ui/core/Box';
16
16
  import FormControl from '@material-ui/core/FormControl';
17
17
  import IconButton from '@material-ui/core/IconButton';
@@ -25,16 +25,16 @@ import CheckBoxIcon from '@material-ui/icons/CheckBox';
25
25
  import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
26
26
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
27
27
  import Autocomplete from '@material-ui/lab/Autocomplete';
28
- import useAsync from 'react-use/lib/useAsync';
28
+ import useAsync from 'react-use/esm/useAsync';
29
29
  import Switch from '@material-ui/core/Switch';
30
30
  import qs from 'qs';
31
- import usePrevious from 'react-use/lib/usePrevious';
31
+ import usePrevious from 'react-use/esm/usePrevious';
32
32
  import '@material-ui/core/CircularProgress';
33
33
  import 'classnames';
34
34
  import '@material-ui/core/styles/makeStyles';
35
35
  import '@material-ui/core/SvgIcon';
36
- import 'react-use/lib/useDebounce';
37
- import 'react-use/lib/useAsyncFn';
36
+ import 'react-use/esm/useDebounce';
37
+ import 'react-use/esm/useAsyncFn';
38
38
 
39
39
  const CURVE_DISPLAY_NAMES = {
40
40
  curveMonotoneX: "Monotone X",
@@ -667,4 +667,4 @@ const CatalogGraphPage = (props) => {
667
667
  };
668
668
 
669
669
  export { CatalogGraphPage };
670
- //# sourceMappingURL=index-a204af4f.esm.js.map
670
+ //# sourceMappingURL=index-CyVoUbSq.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-a204af4f.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/Box';\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/Box';\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 Box from '@material-ui/core/Box';\nimport FormControl from '@material-ui/core/FormControl';\nimport IconButton from '@material-ui/core/IconButton';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport OutlinedInput from '@material-ui/core/OutlinedInput';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\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 from '@material-ui/core/Box';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Switch from '@material-ui/core/Switch';\nimport { makeStyles } from '@material-ui/core/styles';\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 from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\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 &amp; 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,CAAA,CAAA;AAOA,MAAM,MAAA,GAAuB,CAAC,gBAAA,EAAkB,iBAAiB,CAAA,CAAA;AAE1D,MAAM,WAAc,GAAA,CAAC,EAAE,KAAA,EAAO,UAAsB,KAAA;AACzD,EAAA,MAAM,YAAe,GAAA,WAAA;AAAA,IACnB,CAAC,CAAqB,KAAA,QAAA,CAAS,CAAU,CAAA;AAAA,IACzC,CAAC,QAAQ,CAAA;AAAA,GACX,CAAA;AAEA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,IAAI,CACd,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,OAAA;AAAA,MACN,QAAU,EAAA,KAAA;AAAA,MACV,KAAA,EAAO,MAAO,CAAA,GAAA,CAAI,CAAM,CAAA,MAAA;AAAA,QACtB,KAAA,EAAO,oBAAoB,CAAC,CAAA;AAAA,QAC5B,KAAO,EAAA,CAAA;AAAA,OACP,CAAA,CAAA;AAAA,MACF,QAAU,EAAA,YAAA;AAAA,KAAA;AAAA,GAEd,CAAA,CAAA;AAEJ,CAAA;;AC/BA,MAAM,uBAA0B,GAAA;AAAA,EAC9B,CAAC,SAAU,CAAA,UAAU,GAA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EN,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-CyVoUbSq.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/Box';\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/Box';\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 Box from '@material-ui/core/Box';\nimport FormControl from '@material-ui/core/FormControl';\nimport IconButton from '@material-ui/core/IconButton';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport OutlinedInput from '@material-ui/core/OutlinedInput';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/esm/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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\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 from '@material-ui/core/Box';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Switch from '@material-ui/core/Switch';\nimport { makeStyles } from '@material-ui/core/styles';\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/esm/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 from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\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 &amp; 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,CAAA,CAAA;AAOA,MAAM,MAAA,GAAuB,CAAC,gBAAA,EAAkB,iBAAiB,CAAA,CAAA;AAE1D,MAAM,WAAc,GAAA,CAAC,EAAE,KAAA,EAAO,UAAsB,KAAA;AACzD,EAAA,MAAM,YAAe,GAAA,WAAA;AAAA,IACnB,CAAC,CAAqB,KAAA,QAAA,CAAS,CAAU,CAAA;AAAA,IACzC,CAAC,QAAQ,CAAA;AAAA,GACX,CAAA;AAEA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAA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,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;;;;"}
@@ -6,13 +6,13 @@ import { makeStyles } from '@material-ui/core/styles';
6
6
  import qs from 'qs';
7
7
  import React, { useCallback } from 'react';
8
8
  import { useNavigate } from 'react-router-dom';
9
- import { A as ALL_RELATION_PAIRS, D as Direction, c as catalogGraphRouteRef, E as EntityRelationsGraph } from './routes-d114b668.esm.js';
9
+ import { A as ALL_RELATION_PAIRS, D as Direction, c as catalogGraphRouteRef, E as EntityRelationsGraph } from './routes-B7pnW8AZ.esm.js';
10
10
  import '@material-ui/core/CircularProgress';
11
11
  import 'classnames';
12
12
  import '@material-ui/core/styles/makeStyles';
13
13
  import '@material-ui/core/SvgIcon';
14
- import 'react-use/lib/useDebounce';
15
- import 'react-use/lib/useAsyncFn';
14
+ import 'react-use/esm/useDebounce';
15
+ import 'react-use/esm/useAsyncFn';
16
16
 
17
17
  const useStyles = makeStyles(
18
18
  {
@@ -115,4 +115,4 @@ const CatalogGraphCard = (props) => {
115
115
  };
116
116
 
117
117
  export { CatalogGraphCard };
118
- //# sourceMappingURL=index-36ed2693.esm.js.map
118
+ //# sourceMappingURL=index-Dy8_Ufah.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-36ed2693.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/styles';\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;AAC9C,EAAM,MAAA,kBAAA,GAAqB,YAAY,cAAc,CAAA,CAAA;AACrD,EAAM,MAAA,iBAAA,GAAoB,YAAY,oBAAoB,CAAA,CAA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AE,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;;;;"}
1
+ {"version":3,"file":"index-Dy8_Ufah.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/styles';\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,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AA,QACA,SAAA;AAAA,QACA,aAAA;AAAA,QACA,IAAA;AAAA,OAAA;AAAA,KACF;AAAA,GACF,CAAA;AAEJ;;;;"}
@@ -8,8 +8,8 @@ import React, { useState, useRef, useLayoutEffect, useCallback, useEffect, useMe
8
8
  import makeStyles from '@material-ui/core/styles/makeStyles';
9
9
  import { humanizeEntityRef, catalogApiRef } from '@backstage/plugin-catalog-react';
10
10
  import SvgIcon from '@material-ui/core/SvgIcon';
11
- import useDebounce from 'react-use/lib/useDebounce';
12
- import useAsyncFn from 'react-use/lib/useAsyncFn';
11
+ import useDebounce from 'react-use/esm/useDebounce';
12
+ import useAsyncFn from 'react-use/esm/useAsyncFn';
13
13
 
14
14
  const useStyles$2 = makeStyles(
15
15
  (theme) => ({
@@ -486,4 +486,4 @@ const catalogEntityRouteRef = createExternalRouteRef({
486
486
  });
487
487
 
488
488
  export { ALL_RELATION_PAIRS as A, Direction as D, EntityRelationsGraph as E, catalogEntityRouteRef as a, catalogGraphRouteRef as c };
489
- //# sourceMappingURL=routes-d114b668.esm.js.map
489
+ //# sourceMappingURL=routes-B7pnW8AZ.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes-d114b668.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"],"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 React from 'react';\nimport SvgIcon from '@material-ui/core/SvgIcon';\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')}`) ?? SvgIcon;\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 { useApp } from '@backstage/core-plugin-api';\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 app = useApp();\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 hasKindIcon = app.getSystemIcon(\n `kind:${kind.toLocaleLowerCase('en-US')}`,\n );\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = hasKindIcon ? 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 {hasKindIcon && (\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, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\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\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, cachedEntities } = state.current;\n const entityRefs: string[] = Array.from(requestedEntities).filter(\n entityRef => !cachedEntities.has(entityRef),\n );\n if (entityRefs.length === 0) {\n updateEntities();\n return;\n }\n\n const { items } = await catalogClient.getEntitiesByRefs({ entityRefs });\n items.forEach(ent => {\n if (ent) {\n const entityRef = stringifyEntityRef(ent);\n cachedEntities.set(entityRef, ent);\n }\n });\n\n updateEntities();\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 from '@material-ui/core/CircularProgress';\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\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 showArrowHeads?: boolean;\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 showArrowHeads,\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 showArrowHeads={showArrowHeads}\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"],"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,SAA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B,cAAe,CAAA;AAAA,EACjD,EAAI,EAAA,eAAA;AACN,CAAC,EAAA;AASM,MAAM,wBAAwB,sBAAuB,CAAA;AAAA,EAC1D,EAAI,EAAA,gBAAA;AAAA,EACJ,MAAQ,EAAA,CAAC,WAAa,EAAA,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpC,QAAU,EAAA,IAAA;AACZ,CAAC;;;;"}
1
+ {"version":3,"file":"routes-B7pnW8AZ.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"],"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 React from 'react';\nimport SvgIcon from '@material-ui/core/SvgIcon';\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')}`) ?? SvgIcon;\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 { useApp } from '@backstage/core-plugin-api';\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 app = useApp();\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 hasKindIcon = app.getSystemIcon(\n `kind:${kind.toLocaleLowerCase('en-US')}`,\n );\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = hasKindIcon ? 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 {hasKindIcon && (\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, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { Dispatch, useCallback, useRef, useState } from 'react';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\n\n// TODO: This is a good use case for a graphql API, once it is available in the\n// future.\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, cachedEntities } = state.current;\n const entityRefs: string[] = Array.from(requestedEntities).filter(\n entityRef => !cachedEntities.has(entityRef),\n );\n if (entityRefs.length === 0) {\n updateEntities();\n return;\n }\n\n const { items } = await catalogClient.getEntitiesByRefs({ entityRefs });\n items.forEach(ent => {\n if (ent) {\n const entityRef = stringifyEntityRef(ent);\n cachedEntities.set(entityRef, ent);\n }\n });\n\n updateEntities();\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/esm/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 from '@material-ui/core/CircularProgress';\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\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 showArrowHeads?: boolean;\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 showArrowHeads,\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 showArrowHeads={showArrowHeads}\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"],"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,KA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,2CACG,KAAI,EAAA,EAAA,SAAA,EAAW,UAAW,CAAA,OAAA,CAAQ,WAAW,SAAS,CAAA,EAAA,EACpD,OAAW,oBAAA,KAAA,CAAA,aAAA,CAAC,oBAAiB,SAAW,EAAA,OAAA,CAAQ,QAAU,EAAA,CAAA,EAC1D,SAAS,KACR,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,KAAA;AAAA,MACA,YAAY,UAAc,IAAA,iBAAA;AAAA,MAC1B,aAAa,WAAe,IAAA,kBAAA;AAAA,MAC5B,SAAA;AAAA,MACA,WAAW,OAAQ,CAAA,KAAA;AAAA,MACnB,QAAA,EAAU,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACzB,QAAA,EAAU,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACzB,aAAA,EAAe,qBAAqB,aAAc,CAAA,KAAA;AAAA,MAClD,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC5B,IAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,KAAA;AAAA,GAGN,CAAA,CAAA;AAEJ;;AC3IO,MAAM,uBAAuB,cAAe,CAAA;AAAA,EACjD,EAAI,EAAA,eAAA;AACN,CAAC,EAAA;AASM,MAAM,wBAAwB,sBAAuB,CAAA;AAAA,EAC1D,EAAI,EAAA,gBAAA;AAAA,EACJ,MAAQ,EAAA,CAAC,WAAa,EAAA,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpC,QAAU,EAAA,IAAA;AACZ,CAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -201,4 +201,4 @@ declare const catalogGraphPlugin: _backstage_core_plugin_api.BackstagePlugin<{
201
201
  */
202
202
  declare const catalogGraphRouteRef: _backstage_core_plugin_api.RouteRef<undefined>;
203
203
 
204
- export { ALL_RELATION_PAIRS, CatalogGraphPage, Direction, EntityCatalogGraphCard, EntityEdge, EntityEdgeData, EntityNode, EntityNodeData, EntityRelationsGraph, EntityRelationsGraphProps, RelationPairs, catalogGraphPlugin, catalogGraphRouteRef };
204
+ export { ALL_RELATION_PAIRS, CatalogGraphPage, Direction, EntityCatalogGraphCard, type EntityEdge, type EntityEdgeData, type EntityNode, type EntityNodeData, EntityRelationsGraph, type EntityRelationsGraphProps, type RelationPairs, catalogGraphPlugin, catalogGraphRouteRef };
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c as catalogGraphRouteRef, a as catalogEntityRouteRef } from './esm/routes-d114b668.esm.js';
2
- export { A as ALL_RELATION_PAIRS, D as Direction, E as EntityRelationsGraph, c as catalogGraphRouteRef } from './esm/routes-d114b668.esm.js';
1
+ import { c as catalogGraphRouteRef, a as catalogEntityRouteRef } from './esm/routes-B7pnW8AZ.esm.js';
2
+ export { A as ALL_RELATION_PAIRS, D as Direction, E as EntityRelationsGraph } from './esm/routes-B7pnW8AZ.esm.js';
3
3
  import { createPlugin, createComponentExtension, createRoutableExtension } from '@backstage/core-plugin-api';
4
4
  import '@backstage/catalog-model';
5
5
  import '@backstage/core-components';
@@ -10,8 +10,8 @@ import 'react';
10
10
  import '@material-ui/core/styles/makeStyles';
11
11
  import '@backstage/plugin-catalog-react';
12
12
  import '@material-ui/core/SvgIcon';
13
- import 'react-use/lib/useDebounce';
14
- import 'react-use/lib/useAsyncFn';
13
+ import 'react-use/esm/useDebounce';
14
+ import 'react-use/esm/useAsyncFn';
15
15
 
16
16
  const catalogGraphPlugin = createPlugin({
17
17
  id: "catalog-graph",
@@ -27,17 +27,17 @@ const EntityCatalogGraphCard = catalogGraphPlugin.provide(
27
27
  createComponentExtension({
28
28
  name: "EntityCatalogGraphCard",
29
29
  component: {
30
- lazy: () => import('./esm/index-36ed2693.esm.js').then((m) => m.CatalogGraphCard)
30
+ lazy: () => import('./esm/index-Dy8_Ufah.esm.js').then((m) => m.CatalogGraphCard)
31
31
  }
32
32
  })
33
33
  );
34
34
  const CatalogGraphPage = catalogGraphPlugin.provide(
35
35
  createRoutableExtension({
36
36
  name: "CatalogGraphPage",
37
- component: () => import('./esm/index-a204af4f.esm.js').then((m) => m.CatalogGraphPage),
37
+ component: () => import('./esm/index-CyVoUbSq.esm.js').then((m) => m.CatalogGraphPage),
38
38
  mountPoint: catalogGraphRouteRef
39
39
  })
40
40
  );
41
41
 
42
- export { CatalogGraphPage, EntityCatalogGraphCard, catalogGraphPlugin };
42
+ export { CatalogGraphPage, EntityCatalogGraphCard, catalogGraphPlugin, catalogGraphRouteRef };
43
43
  //# sourceMappingURL=index.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-graph",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin"
6
6
  },
@@ -44,13 +44,13 @@
44
44
  "test": "backstage-cli package test"
45
45
  },
46
46
  "dependencies": {
47
- "@backstage/catalog-client": "^1.6.1",
47
+ "@backstage/catalog-client": "^1.6.3",
48
48
  "@backstage/catalog-model": "^1.4.5",
49
- "@backstage/core-compat-api": "^0.2.1",
50
- "@backstage/core-components": "^0.14.1",
49
+ "@backstage/core-compat-api": "^0.2.3",
50
+ "@backstage/core-components": "^0.14.3",
51
51
  "@backstage/core-plugin-api": "^1.9.1",
52
- "@backstage/frontend-plugin-api": "^0.6.1",
53
- "@backstage/plugin-catalog-react": "^1.11.0",
52
+ "@backstage/frontend-plugin-api": "^0.6.3",
53
+ "@backstage/plugin-catalog-react": "^1.11.2",
54
54
  "@backstage/types": "^1.1.1",
55
55
  "@material-ui/core": "^4.12.2",
56
56
  "@material-ui/icons": "^4.9.1",
@@ -63,11 +63,11 @@
63
63
  "react-use": "^17.2.4"
64
64
  },
65
65
  "devDependencies": {
66
- "@backstage/cli": "^0.26.0",
67
- "@backstage/core-app-api": "^1.12.1",
68
- "@backstage/dev-utils": "^1.0.28",
69
- "@backstage/plugin-catalog": "^1.18.0",
70
- "@backstage/test-utils": "^1.5.1",
66
+ "@backstage/cli": "^0.26.2",
67
+ "@backstage/core-app-api": "^1.12.3",
68
+ "@backstage/dev-utils": "^1.0.30",
69
+ "@backstage/plugin-catalog": "^1.18.2",
70
+ "@backstage/test-utils": "^1.5.3",
71
71
  "@testing-library/dom": "^9.0.0",
72
72
  "@testing-library/jest-dom": "^6.0.0",
73
73
  "@testing-library/react": "^14.0.0",