@backstage/plugin-catalog-graph 0.6.8 → 0.6.9-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/alpha.esm.js.map +1 -1
  3. package/dist/api/CatalogGraphApi.esm.js.map +1 -1
  4. package/dist/api/DefaultCatalogGraphApi.esm.js.map +1 -1
  5. package/dist/components/CatalogGraphCard/CatalogGraphCard.esm.js.map +1 -1
  6. package/dist/components/CatalogGraphPage/CatalogGraphPage.esm.js.map +1 -1
  7. package/dist/components/CatalogGraphPage/CurveFilter.esm.js.map +1 -1
  8. package/dist/components/CatalogGraphPage/DirectionFilter.esm.js.map +1 -1
  9. package/dist/components/CatalogGraphPage/MaxDepthFilter.esm.js.map +1 -1
  10. package/dist/components/CatalogGraphPage/SelectedKindsFilter.esm.js.map +1 -1
  11. package/dist/components/CatalogGraphPage/SelectedRelationsFilter.esm.js.map +1 -1
  12. package/dist/components/CatalogGraphPage/SwitchFilter.esm.js.map +1 -1
  13. package/dist/components/CatalogGraphPage/useCatalogGraphPage.esm.js.map +1 -1
  14. package/dist/components/EntityRelationsGraph/DefaultRenderLabel.esm.js.map +1 -1
  15. package/dist/components/EntityRelationsGraph/DefaultRenderNode.esm.js.map +1 -1
  16. package/dist/components/EntityRelationsGraph/EntityIcon.esm.js.map +1 -1
  17. package/dist/components/EntityRelationsGraph/EntityRelationsGraph.esm.js +1 -1
  18. package/dist/components/EntityRelationsGraph/EntityRelationsGraph.esm.js.map +1 -1
  19. package/dist/components/EntityRelationsGraph/useEntityRelationGraph.esm.js.map +1 -1
  20. package/dist/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.esm.js.map +1 -1
  21. package/dist/components/EntityRelationsGraph/useEntityStore.esm.js.map +1 -1
  22. package/dist/extensions.esm.js.map +1 -1
  23. package/dist/hooks/useRelations.esm.js.map +1 -1
  24. package/dist/lib/graph/build-graph.esm.js.map +1 -1
  25. package/dist/lib/graph-transformations/index.esm.js.map +1 -1
  26. package/dist/lib/graph-transformations/merge-relations.esm.js.map +1 -1
  27. package/dist/lib/graph-transformations/order-forward.esm.js.map +1 -1
  28. package/dist/lib/graph-transformations/reduce-edges.esm.js.map +1 -1
  29. package/dist/lib/graph-transformations/remove-backward-edges.esm.js.map +1 -1
  30. package/dist/lib/graph-transformations/set-distance.esm.js.map +1 -1
  31. package/dist/lib/graph-transformations/strip-distant-edges.esm.js.map +1 -1
  32. package/dist/lib/types/graph.esm.js.map +1 -1
  33. package/dist/lib/types/relations.esm.js.map +1 -1
  34. package/dist/package.json.esm.js +1 -1
  35. package/dist/package.json.esm.js.map +1 -1
  36. package/dist/plugin.esm.js.map +1 -1
  37. package/dist/routes.esm.js.map +1 -1
  38. package/dist/translation.esm.js.map +1 -1
  39. package/package.json +15 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @backstage/plugin-catalog-graph
2
2
 
3
+ ## 0.6.9-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/core-components@0.18.15-next.0
9
+ - @backstage/core-plugin-api@1.12.11-next.0
10
+ - @backstage/frontend-plugin-api@0.18.2-next.0
11
+ - @backstage/catalog-client@1.16.3-next.0
12
+ - @backstage/catalog-model@1.10.2-next.0
13
+ - @backstage/plugin-catalog-react@3.2.4-next.0
14
+
3
15
  ## 0.6.8
4
16
 
5
17
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 ApiBlueprint,\n createFrontendPlugin,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { z } from 'zod/v4';\nimport { RiMindMap } from '@remixicon/react';\nimport { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogGraphRouteRef, catalogEntityRouteRef } from './routes';\nimport {\n catalogGraphApiRef,\n DefaultCatalogGraphApi,\n Direction,\n} from '@backstage/plugin-catalog-graph';\n\nconst CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({\n name: 'relations',\n configSchema: {\n kinds: z.array(z.string()).optional(),\n relations: z.array(z.string()).optional(),\n maxDepth: z.number().optional(),\n unidirectional: z.boolean().optional(),\n mergeRelations: z.boolean().optional(),\n showArrowHeads: z.boolean().optional(),\n direction: z.nativeEnum(Direction).optional(),\n relationPairs: z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n curve: z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n // Skipping a \"variant\" config for now, defaulting to \"gridItem\" in the component\n // For more details, see this comment: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n title: z.string().optional(),\n height: z.number().optional(),\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () =>\n import('./components/CatalogGraphCard').then(m => (\n <m.CatalogGraphCard {...config} />\n )),\n });\n },\n});\n\nconst CatalogGraphPage = PageBlueprint.makeWithOverrides({\n configSchema: {\n selectedKinds: z.array(z.string()).optional(),\n selectedRelations: z.array(z.string()).optional(),\n rootEntityRefs: z.array(z.string()).optional(),\n maxDepth: z.number().optional(),\n unidirectional: z.boolean().optional(),\n mergeRelations: z.boolean().optional(),\n showArrowHeads: z.boolean().optional(),\n direction: z.nativeEnum(Direction).optional(),\n showFilters: z.boolean().optional(),\n curve: z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n kinds: z.array(z.string()).optional(),\n relations: z.array(z.string()).optional(),\n relationPairs: z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n path: '/catalog-graph',\n routeRef: catalogGraphRouteRef,\n loader: () =>\n import('./components/CatalogGraphPage').then(m => (\n <m.CatalogGraphPage {...config} initialState={config} />\n )),\n });\n },\n});\n\nconst CatalogGraphApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: catalogGraphApiRef,\n deps: {},\n factory: () => new DefaultCatalogGraphApi(),\n }),\n});\n\nexport default createFrontendPlugin({\n pluginId: 'catalog-graph',\n title: 'Catalog Graph',\n icon: <RiMindMap />,\n info: { packageJson: () => import('../package.json') },\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n extensions: [CatalogGraphPage, CatalogGraphEntityCard, CatalogGraphApi],\n});\n\nimport { catalogGraphTranslationRef as _catalogGraphTranslationRef } from './translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-catalog-graph` instead.\n */\nexport const catalogGraphTranslationRef = _catalogGraphTranslationRef;\n"],"names":["_catalogGraphTranslationRef"],"mappings":";;;;;;;;;AA+BA,MAAM,sBAAA,GAAyB,oBAAoB,iBAAA,CAAkB;AAAA,EACnE,IAAA,EAAM,WAAA;AAAA,EACN,YAAA,EAAc;AAAA,IACZ,OAAO,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,IACpC,WAAW,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,IACxC,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC9B,cAAA,EAAgB,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,IACrC,cAAA,EAAgB,CAAA,CAAE,OAAA,EAAQ,CAA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AAG,MAAA,EAAQ,YAAA,EAAc,QAAQ,CACvD;AAAA,KACJ,CAAA;AAAA,EACH;AACF,CAAC,CAAA;AAED,MAAM,eAAA,GAAkB,aAAa,IAAA,CAAK;AAAA,EACxC,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,kBAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,OAAA,EAAS,MAAM,IAAI,sBAAA;AAAuB,GAC3C;AACL,CAAC,CAAA;AAED,YAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,eAAA;AAAA,EACV,KAAA,EAAO,eAAA;AAAA,EACP,IAAA,sBAAO,SAAA,EAAA,EAAU,CAAA;AAAA,EACjB,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAA,EAAE;AAAA,EACrD,MAAA,EAAQ;AAAA,IACN,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,aAAA,EAAe;AAAA,GACjB;AAAA,EACA,UAAA,EAAY,CAAC,gBAAA,EAAkB,sBAAA,EAAwB,eAAe;AACxE,CAAC,CAAA;AAQM,MAAM,0BAAA,GAA6BA;;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 ApiBlueprint,\n createFrontendPlugin,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { z } from 'zod/v4';\nimport { RiMindMap } from '@remixicon/react';\nimport { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogGraphRouteRef, catalogEntityRouteRef } from './routes';\nimport {\n catalogGraphApiRef,\n DefaultCatalogGraphApi,\n Direction,\n} from '@backstage/plugin-catalog-graph';\n\nconst CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({\n name: 'relations',\n configSchema: {\n kinds: z.array(z.string()).optional(),\n relations: z.array(z.string()).optional(),\n maxDepth: z.number().optional(),\n unidirectional: z.boolean().optional(),\n mergeRelations: z.boolean().optional(),\n showArrowHeads: z.boolean().optional(),\n direction: z.nativeEnum(Direction).optional(),\n relationPairs: z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n curve: z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n // Skipping a \"variant\" config for now, defaulting to \"gridItem\" in the component\n // For more details, see this comment: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n title: z.string().optional(),\n height: z.number().optional(),\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () =>\n import('./components/CatalogGraphCard').then(m => (\n <m.CatalogGraphCard {...config} />\n )),\n });\n },\n});\n\nconst CatalogGraphPage = PageBlueprint.makeWithOverrides({\n configSchema: {\n selectedKinds: z.array(z.string()).optional(),\n selectedRelations: z.array(z.string()).optional(),\n rootEntityRefs: z.array(z.string()).optional(),\n maxDepth: z.number().optional(),\n unidirectional: z.boolean().optional(),\n mergeRelations: z.boolean().optional(),\n showArrowHeads: z.boolean().optional(),\n direction: z.nativeEnum(Direction).optional(),\n showFilters: z.boolean().optional(),\n curve: z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n kinds: z.array(z.string()).optional(),\n relations: z.array(z.string()).optional(),\n relationPairs: z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n path: '/catalog-graph',\n routeRef: catalogGraphRouteRef,\n loader: () =>\n import('./components/CatalogGraphPage').then(m => (\n <m.CatalogGraphPage {...config} initialState={config} />\n )),\n });\n },\n});\n\nconst CatalogGraphApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: catalogGraphApiRef,\n deps: {},\n factory: () => new DefaultCatalogGraphApi(),\n }),\n});\n\nexport default createFrontendPlugin({\n pluginId: 'catalog-graph',\n title: 'Catalog Graph',\n icon: <RiMindMap />,\n info: { packageJson: () => import('../package.json') },\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n extensions: [CatalogGraphPage, CatalogGraphEntityCard, CatalogGraphApi],\n});\n\nimport { catalogGraphTranslationRef as _catalogGraphTranslationRef } from './translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-catalog-graph` instead.\n */\nexport const catalogGraphTranslationRef = _catalogGraphTranslationRef;\n"],"names":["_catalogGraphTranslationRef"],"mappings":";;;;;;;;;AA+BA,MAAM,sBAAA,GAAyB,oBAAoB,iBAAA,CAAkB;AAAA,EACnE,IAAA,EAAM,WAAA;AAAA,EACN,YAAA,EAAc;AAAA,IACZ,OAAO,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,IACpC,WAAW,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,IACxC,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC9B,cAAA,EAAgB,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,IACrC,cAAA,EAAgB,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,IACrC,cAAA,EAAgB,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,IACrC,SAAA,EAAW,CAAA,CAAE,UAAA,CAAW,SAAS,EAAE,QAAA,EAAS;AAAA,IAC5C,aAAA,EAAe,CAAA,CAA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,EAAK,kBAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,OAAA,EAAS,MAAM,IAAI,sBAAA;AAAuB,GAC3C;AACL,CAAC,CAAA;AAED,YAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,eAAA;AAAA,EACV,KAAA,EAAO,eAAA;AAAA,EACP,IAAA,sBAAO,SAAA,EAAA,EAAU,CAAA;AAAA,EACjB,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAA,EAAE;AAAA,EACrD,MAAA,EAAQ;AAAA,IACN,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,aAAA,EAAe;AAAA,GACjB;AAAA,EACA,UAAA,EAAY,CAAC,gBAAA,EAAkB,sBAAA,EAAwB,eAAe;AACxE,CAAC,CAAA;AAQM,MAAM,0BAAA,GAA6BA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogGraphApi.esm.js","sources":["../../src/api/CatalogGraphApi.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * Utility API reference for the {@link CatalogGraphApi}.\n *\n * @public\n */\nexport const catalogGraphApiRef = createApiRef<CatalogGraphApi>({\n id: 'plugin.catalog-graph.service',\n});\n\n/** @public */\nexport type DefaultRelationsInclude = { include: string[] };\n\n/** @public */\nexport type DefaultRelationsExclude = { exclude: string[] };\n\n/**\n * Default relations. Can either be a list of relations to use by default, or\n * a list of relations to _not_ use, i.e. include all other relations.\n *\n * @public\n */\nexport type DefaultRelations =\n | DefaultRelationsInclude\n | DefaultRelationsExclude;\n\n/**\n * API for driving catalog imports.\n *\n * @public\n */\nexport interface CatalogGraphApi {\n /** All known relations */\n readonly knownRelations: string[];\n\n /** All known relation pairs */\n readonly knownRelationPairs: [string, string][];\n\n /** The default relations to show in the graph */\n readonly defaultRelations: string[];\n}\n"],"names":[],"mappings":";;AAuBO,MAAM,qBAAqB,YAAA,CAA8B;AAAA,EAC9D,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"CatalogGraphApi.esm.js","sources":["../../src/api/CatalogGraphApi.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * Utility API reference for the {@link CatalogGraphApi}.\n *\n * @public\n */\nexport const catalogGraphApiRef = createApiRef<CatalogGraphApi>({\n id: 'plugin.catalog-graph.service',\n});\n\n/** @public */\nexport type DefaultRelationsInclude = { include: string[] };\n\n/** @public */\nexport type DefaultRelationsExclude = { exclude: string[] };\n\n/**\n * Default relations. Can either be a list of relations to use by default, or\n * a list of relations to _not_ use, i.e. include all other relations.\n *\n * @public\n */\nexport type DefaultRelations =\n | DefaultRelationsInclude\n | DefaultRelationsExclude;\n\n/**\n * API for driving catalog imports.\n *\n * @public\n */\nexport interface CatalogGraphApi {\n /** All known relations */\n readonly knownRelations: string[];\n\n /** All known relation pairs */\n readonly knownRelationPairs: [string, string][];\n\n /** The default relations to show in the graph */\n readonly defaultRelations: string[];\n}\n"],"names":[],"mappings":";;AAuBO,MAAM,qBAAqB,YAAA,CAA8B;AAAA,EAC9D,EAAA,EAAI;AACN,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultCatalogGraphApi.esm.js","sources":["../../src/api/DefaultCatalogGraphApi.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { ALL_RELATION_PAIRS, ALL_RELATIONS, RelationPairs } from '../lib/types';\nimport {\n CatalogGraphApi,\n DefaultRelations,\n DefaultRelationsExclude,\n DefaultRelationsInclude,\n} from './CatalogGraphApi';\n\n/**\n * Options for the {@link DefaultCatalogGraphApi}.\n *\n * @public\n */\nexport interface DefaultCatalogGraphApiOptions {\n readonly knownRelations?: string[];\n readonly knownRelationPairs?: RelationPairs;\n readonly defaultRelationTypes?: DefaultRelations;\n}\n\n/**\n * The default implementation of the {@link CatalogGraphApi}.\n *\n * @public\n */\nexport class DefaultCatalogGraphApi implements CatalogGraphApi {\n readonly knownRelations: string[];\n readonly knownRelationPairs: [string, string][];\n readonly defaultRelations: string[];\n\n constructor(\n options: DefaultCatalogGraphApiOptions = {\n knownRelations: ALL_RELATIONS,\n knownRelationPairs: ALL_RELATION_PAIRS,\n defaultRelationTypes: { exclude: [] },\n },\n ) {\n this.knownRelations = options.knownRelations ?? ALL_RELATIONS;\n this.knownRelationPairs = options.knownRelationPairs ?? ALL_RELATION_PAIRS;\n\n const defaultRelations = options.defaultRelationTypes;\n\n if (Array.isArray((defaultRelations as DefaultRelationsInclude).include)) {\n const defaultRelationsInclude =\n defaultRelations as DefaultRelationsInclude;\n\n this.defaultRelations = this.knownRelations.filter(rel =>\n defaultRelationsInclude.include.includes(rel),\n );\n } else {\n const defaultRelationsExclude =\n defaultRelations as DefaultRelationsExclude;\n\n this.defaultRelations = this.knownRelations.filter(\n rel => !defaultRelationsExclude.exclude.includes(rel),\n );\n }\n }\n}\n"],"names":[],"mappings":";;AAwCO,MAAM,sBAAA,CAAkD;AAAA,EACpD,cAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EAET,YACE,OAAA,GAAyC;AAAA,IACvC,cAAA,EAAgB,aAAA;AAAA,IAChB,kBAAA,EAAoB,kBAAA;AAAA,IACpB,oBAAA,EAAsB,EAAE,OAAA,EAAS,EAAC;AAAE,GACtC,EACA;AACA,IAAA,IAAA,CAAK,cAAA,GAAiB,QAAQ,cAAA,IAAkB,aAAA;AAChD,IAAA,IAAA,CAAK,kBAAA,GAAqB,QAAQ,kBAAA,IAAsB,kBAAA;AAExD,IAAA,MAAM,mBAAmB,OAAA,CAAQ,oBAAA;AAEjC,IAAA,IAAI,KAAA,CAAM,OAAA,CAAS,gBAAA,CAA6C,OAAO,CAAA,EAAG;AACxE,MAAA,MAAM,uBAAA,GACJ,gBAAA;AAEF,MAAA,IAAA,CAAK,gBAAA,GAAmB,KAAK,cAAA,CAAe,MAAA;AAAA,QAAO,CAAA,GAAA,KACjD,uBAAA,CAAwB,OAAA,CAAQ,QAAA,CAAS,GAAG;AAAA,OAC9C;AAAA,IACF,CAAA,MAAO;AACL,MAAA,MAAM,uBAAA,GACJ,gBAAA;AAEF,MAAA,IAAA,CAAK,gBAAA,GAAmB,KAAK,cAAA,CAAe,MAAA;AAAA,QAC1C,CAAA,GAAA,KAAO,CAAC,uBAAA,CAAwB,OAAA,CAAQ,SAAS,GAAG;AAAA,OACtD;AAAA,IACF;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"DefaultCatalogGraphApi.esm.js","sources":["../../src/api/DefaultCatalogGraphApi.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { ALL_RELATION_PAIRS, ALL_RELATIONS, RelationPairs } from '../lib/types';\nimport {\n CatalogGraphApi,\n DefaultRelations,\n DefaultRelationsExclude,\n DefaultRelationsInclude,\n} from './CatalogGraphApi';\n\n/**\n * Options for the {@link DefaultCatalogGraphApi}.\n *\n * @public\n */\nexport interface DefaultCatalogGraphApiOptions {\n readonly knownRelations?: string[];\n readonly knownRelationPairs?: RelationPairs;\n readonly defaultRelationTypes?: DefaultRelations;\n}\n\n/**\n * The default implementation of the {@link CatalogGraphApi}.\n *\n * @public\n */\nexport class DefaultCatalogGraphApi implements CatalogGraphApi {\n readonly knownRelations: string[];\n readonly knownRelationPairs: [string, string][];\n readonly defaultRelations: string[];\n\n constructor(\n options: DefaultCatalogGraphApiOptions = {\n knownRelations: ALL_RELATIONS,\n knownRelationPairs: ALL_RELATION_PAIRS,\n defaultRelationTypes: { exclude: [] },\n },\n ) {\n this.knownRelations = options.knownRelations ?? ALL_RELATIONS;\n this.knownRelationPairs = options.knownRelationPairs ?? ALL_RELATION_PAIRS;\n\n const defaultRelations = options.defaultRelationTypes;\n\n if (Array.isArray((defaultRelations as DefaultRelationsInclude).include)) {\n const defaultRelationsInclude =\n defaultRelations as DefaultRelationsInclude;\n\n this.defaultRelations = this.knownRelations.filter(rel =>\n defaultRelationsInclude.include.includes(rel),\n );\n } else {\n const defaultRelationsExclude =\n defaultRelations as DefaultRelationsExclude;\n\n this.defaultRelations = this.knownRelations.filter(\n rel => !defaultRelationsExclude.exclude.includes(rel),\n );\n }\n }\n}\n"],"names":[],"mappings":";;AAwCO,MAAM,sBAAA,CAAkD;AAAA,EACpD,cAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EAET,YACE,OAAA,GAAyC;AAAA,IACvC,cAAA,EAAgB,aAAA;AAAA,IAChB,kBAAA,EAAoB,kBAAA;AAAA,IACpB,oBAAA,EAAsB,EAAE,OAAA,EAAS,EAAC;AAAE,GACtC,EACA;AACA,IAAA,IAAA,CAAK,cAAA,GAAiB,QAAQ,cAAA,IAAkB,aAAA;AAChD,IAAA,IAAA,CAAK,kBAAA,GAAqB,QAAQ,kBAAA,IAAsB,kBAAA;AAExD,IAAA,MAAM,mBAAmB,OAAA,CAAQ,oBAAA;AAEjC,IAAA,IAAI,KAAA,CAAM,OAAA,CAAS,gBAAA,CAA6C,OAAO,CAAA,EAAG;AACxE,MAAA,MAAM,uBAAA,GACJ,gBAAA;AAEF,MAAA,IAAA,CAAK,gBAAA,GAAmB,KAAK,cAAA,CAAe,MAAA;AAAA,QAAO,CAAA,GAAA,KACjD,uBAAA,CAAwB,OAAA,CAAQ,QAAA,CAAS,GAAG;AAAA,OAC9C;AAAA,IACF,CAAA,MAAO;AACL,MAAA,MAAM,uBAAA,GACJ,gBAAA;AAEF,MAAA,IAAA,CAAK,gBAAA,GAAmB,KAAK,cAAA,CAAe,MAAA;AAAA,QAC1C,CAAA,GAAA,KAAO,CAAC,uBAAA,CAAwB,OAAA,CAAQ,SAAS,GAAG;AAAA,OACtD;AAAA,IACF;AAAA,EACF;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogGraphCard.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 { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n EntityInfoCard,\n entityPresentationSnapshot,\n useEntity,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { ButtonLink } from '@backstage/ui';\nimport { RiArrowRightLine } from '@remixicon/react';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport qs from 'qs';\nimport { MouseEvent, ReactNode, useCallback, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { Direction, EntityNode } from '../../lib/types';\nimport classNames from 'classnames';\n\n/** @public */\nexport type CatalogGraphCardClassKey = 'graph';\n\nconst useStyles = makeStyles<Theme, { height?: number }>(\n {\n graph: ({ height }) => ({\n height: height ?? '100%',\n minHeight: 0,\n }),\n },\n { name: 'PluginCatalogGraphCatalogGraphCard' },\n);\n\nexport const CatalogGraphCard = (\n props: Partial<EntityRelationsGraphProps> & {\n height?: number;\n title?: string;\n action?: ReactNode;\n },\n) => {\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n const {\n relationPairs,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n showArrowHeads,\n direction = Direction.LEFT_RIGHT,\n kinds,\n relations,\n entityFilter,\n height,\n className,\n action,\n rootEntityNames,\n onNodeClick,\n title = t('catalogGraphCard.title'),\n zoom = 'enable-on-click',\n } = props;\n\n const { entity } = useEntity();\n const entityName = useMemo(() => getCompoundEntityRef(entity), [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.toLowerCase(),\n namespace: nodeEntityName.namespace.toLowerCase(),\n name: nodeEntityName.name,\n });\n analytics.captureEvent(\n 'click',\n entityPresentationSnapshot(node.entity).primaryTitle,\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 <EntityInfoCard\n title={title}\n headerActions={action}\n footerActions={\n <ButtonLink\n iconEnd={<RiArrowRightLine />}\n variant=\"tertiary\"\n href={catalogGraphUrl}\n >\n {t('catalogGraphCard.deepLinkTitle')}\n </ButtonLink>\n }\n >\n <EntityRelationsGraph\n {...props}\n rootEntityNames={rootEntityNames || entityName}\n onNodeClick={onNodeClick || defaultOnNodeClick}\n className={classNames(classes.graph, className)}\n maxDepth={maxDepth}\n unidirectional={unidirectional}\n mergeRelations={mergeRelations}\n direction={direction}\n relationPairs={relationPairs}\n entityFilter={entityFilter}\n zoom={zoom}\n showArrowHeads={showArrowHeads}\n />\n </EntityInfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+CA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,KAAA,EAAO,CAAC,EAAE,MAAA,EAAO,MAAO;AAAA,MACtB,QAAQ,MAAA,IAAU,MAAA;AAAA,MAClB,SAAA,EAAW;AAAA,KACb;AAAA,GACF;AAAA,EACA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C,aAAa,WAAA,IAAe,kBAAA;AAAA,UAC5B,SAAA,EAAW,UAAA,CAAW,OAAA,CAAQ,KAAA,EAAO,SAAS,CAAA;AAAA,UAC9C,QAAA;AAAA,UACA,cAAA;AAAA,UACA,cAAA;AAAA,UACA,SAAA;AAAA,UACA,aAAA;AAAA,UACA,YAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"CatalogGraphCard.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 { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n EntityInfoCard,\n entityPresentationSnapshot,\n useEntity,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { ButtonLink } from '@backstage/ui';\nimport { RiArrowRightLine } from '@remixicon/react';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport qs from 'qs';\nimport { MouseEvent, ReactNode, useCallback, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { Direction, EntityNode } from '../../lib/types';\nimport classNames from 'classnames';\n\n/** @public */\nexport type CatalogGraphCardClassKey = 'graph';\n\nconst useStyles = makeStyles<Theme, { height?: number }>(\n {\n graph: ({ height }) => ({\n height: height ?? '100%',\n minHeight: 0,\n }),\n },\n { name: 'PluginCatalogGraphCatalogGraphCard' },\n);\n\nexport const CatalogGraphCard = (\n props: Partial<EntityRelationsGraphProps> & {\n height?: number;\n title?: string;\n action?: ReactNode;\n },\n) => {\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n const {\n relationPairs,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n showArrowHeads,\n direction = Direction.LEFT_RIGHT,\n kinds,\n relations,\n entityFilter,\n height,\n className,\n action,\n rootEntityNames,\n onNodeClick,\n title = t('catalogGraphCard.title'),\n zoom = 'enable-on-click',\n } = props;\n\n const { entity } = useEntity();\n const entityName = useMemo(() => getCompoundEntityRef(entity), [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.toLowerCase(),\n namespace: nodeEntityName.namespace.toLowerCase(),\n name: nodeEntityName.name,\n });\n analytics.captureEvent(\n 'click',\n entityPresentationSnapshot(node.entity).primaryTitle,\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 <EntityInfoCard\n title={title}\n headerActions={action}\n footerActions={\n <ButtonLink\n iconEnd={<RiArrowRightLine />}\n variant=\"tertiary\"\n href={catalogGraphUrl}\n >\n {t('catalogGraphCard.deepLinkTitle')}\n </ButtonLink>\n }\n >\n <EntityRelationsGraph\n {...props}\n rootEntityNames={rootEntityNames || entityName}\n onNodeClick={onNodeClick || defaultOnNodeClick}\n className={classNames(classes.graph, className)}\n maxDepth={maxDepth}\n unidirectional={unidirectional}\n mergeRelations={mergeRelations}\n direction={direction}\n relationPairs={relationPairs}\n entityFilter={entityFilter}\n zoom={zoom}\n showArrowHeads={showArrowHeads}\n />\n </EntityInfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+CA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,KAAA,EAAO,CAAC,EAAE,MAAA,EAAO,MAAO;AAAA,MACtB,QAAQ,MAAA,IAAU,MAAA;AAAA,MAClB,SAAA,EAAW;AAAA,KACb;AAAA,GACF;AAAA,EACA,EAAE,MAAM,oCAAA;AACV,CAAA;AAEO,MAAM,gBAAA,GAAmB,CAC9B,KAAA,KAKG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM;AAAA,IACJ,aAAA;AAAA,IACA,QAAA,GAAW,CAAA;AAAA,IACX,cAAA,GAAiB,IAAA;AAAA,IACjB,cAAA,GAAiB,IAAA;AAAA,IACjB,cAAA;AAAA,IACA,YAAY,SAAA,CAAU,UAAA;AAAA,IACtB,KAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,eAAA;AAAA,IACA,WAAA;AAAA,IACA,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,IAAA,GAAO;AAAA,GACT,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,UAAA,GAAa,QAAQ,MAAM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,UAAA,EAAY,cAAA,EAAgB,IAAA;AAAK,GAClD;AACA,EAAA,MAAM,eAAA,GAAkB,CAAA,EAAG,iBAAA,EAAmB,GAAG,kBAAkB,CAAA,CAAA;AAEnE,EAAA,uBACE,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,aAAA,EAAe,MAAA;AAAA,MACf,aAAA,kBACE,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,OAAA,sBAAU,gBAAA,EAAA,EAAiB,CAAA;AAAA,UAC3B,OAAA,EAAQ,UAAA;AAAA,UACR,IAAA,EAAM,eAAA;AAAA,UAEL,YAAE,gCAAgC;AAAA;AAAA,OACrC;AAAA,MAGF,QAAA,kBAAA,GAAA;AAAA,QAAC,oBAAA;AAAA,QAAA;AAAA,UACE,GAAG,KAAA;AAAA,UACJ,iBAAiB,eAAA,IAAmB,UAAA;AAAA,UACpC,aAAa,WAAA,IAAe,kBAAA;AAAA,UAC5B,SAAA,EAAW,UAAA,CAAW,OAAA,CAAQ,KAAA,EAAO,SAAS,CAAA;AAAA,UAC9C,QAAA;AAAA,UACA,cAAA;AAAA,UACA,cAAA;AAAA,UACA,SAAA;AAAA,UACA,aAAA;AAAA,UACA,YAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogGraphPage.esm.js","sources":["../../../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 */\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 entityPresentationSnapshot,\n entityRouteRef,\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 { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\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';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { Direction, EntityNode } from '../../lib/types';\n\n/** @public */\nexport type CatalogGraphPageClassKey =\n | 'content'\n | 'container'\n | 'fullHeight'\n | 'graphWrapper'\n | 'graph'\n | 'legend'\n | 'filters';\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, initialState, entityFilter, showArrowHeads } = props;\n const { t } = useTranslationRef(catalogGraphTranslationRef);\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 const nodeTitle = entityPresentationSnapshot(node.entity).primaryTitle;\n\n if (event.shiftKey) {\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLowerCase(),\n namespace: nodeEntityName.namespace.toLowerCase(),\n name: nodeEntityName.name,\n });\n\n analytics.captureEvent('click', nodeTitle, {\n attributes: { to: path },\n });\n navigate(path);\n } else {\n analytics.captureEvent('click', nodeTitle);\n setRootEntityNames([nodeEntityName]);\n }\n },\n [catalogEntityRoute, navigate, setRootEntityNames, analytics],\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n title={t('catalogGraphPage.title')}\n subtitle={rootEntityNames\n .map(e => entityPresentationSnapshot(e).primaryTitle)\n .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 /> {t('catalogGraphPage.filterToggleButtonTitle')}\n </ToggleButton>\n }\n >\n <SupportButton>\n {t('catalogGraphPage.supportButtonDescription')}\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 />\n <DirectionFilter value={direction} onChange={setDirection} />\n <CurveFilter value={curve} onChange={setCurve} />\n <SwitchFilter\n value={unidirectional}\n onChange={setUnidirectional}\n label={t('catalogGraphPage.simplifiedSwitchLabel')}\n />\n <SwitchFilter\n value={mergeRelations}\n onChange={setMergeRelations}\n label={t('catalogGraphPage.mergeRelationsSwitchLabel')}\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\" />{' '}\n {t('catalogGraphPage.zoomOutDescription')}\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 showArrowHeads={showArrowHeads}\n onNodeClick={onNodeClick}\n direction={direction}\n relationPairs={relationPairs}\n entityFilter={entityFilter}\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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,SAAA,EAAW;AAAA,KACb;AAAA,IACA,SAAA,EAAW;AAAA,MACT,MAAA,EAAQ,MAAA;AAAA,MACR,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW;AAAA,KACb;AAAA,IACA,UAAA,EAAY;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,OAAA,EAAS,MAAA;AAAA,MACT,SAAA,EAAW;AAAA,KACb;AAAA,IACA,YAAA,EAAc;AAAA,MACZ,QAAA,EAAU,UAAA;AAAA,MACV,IAAA,EAAM,CAAA;AAAA,MACN,SAAA,EAAW,CAAA;AAAA,MACX,OAAA,EAAS;AAAA,KACX;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,CAAA;AAAA,MACN,SAAA,EAAW;AAAA,KACb;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,QAAA,EAAU,UAAA;AAAA,MACV,MAAA,EAAQ,CAAA;AAAA,MACR,KAAA,EAAO,CAAA;AAAA,MACP,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACxB,SAAA,EAAW;AAAA,QACT,aAAA,EAAe;AAAA;AACjB,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,OAAA,EAAS,MAAA;AAAA,MACT,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACxB,YAAA,EAAc,MA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AA,CAAkB,MAAA,GAAS,IAC5C,iBAAA,GACA,MAAA;AAAA,cAEN,cAAA;AAAA,cACA,cAAA;AAAA,cACA,cAAA;AAAA,cACA,WAAA;AAAA,cACA,SAAA;AAAA,cACA,aAAA;AAAA,cACA,YAAA;AAAA,cACA,WAAW,OAAA,CAAQ,KAAA;AAAA,cACnB,IAAA,EAAK,SAAA;AAAA,cACL;AAAA;AAAA;AACF,SAAA,EACF,CAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"CatalogGraphPage.esm.js","sources":["../../../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 */\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 entityPresentationSnapshot,\n entityRouteRef,\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 { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\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';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { Direction, EntityNode } from '../../lib/types';\n\n/** @public */\nexport type CatalogGraphPageClassKey =\n | 'content'\n | 'container'\n | 'fullHeight'\n | 'graphWrapper'\n | 'graph'\n | 'legend'\n | 'filters';\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, initialState, entityFilter, showArrowHeads } = props;\n const { t } = useTranslationRef(catalogGraphTranslationRef);\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 const nodeTitle = entityPresentationSnapshot(node.entity).primaryTitle;\n\n if (event.shiftKey) {\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLowerCase(),\n namespace: nodeEntityName.namespace.toLowerCase(),\n name: nodeEntityName.name,\n });\n\n analytics.captureEvent('click', nodeTitle, {\n attributes: { to: path },\n });\n navigate(path);\n } else {\n analytics.captureEvent('click', nodeTitle);\n setRootEntityNames([nodeEntityName]);\n }\n },\n [catalogEntityRoute, navigate, setRootEntityNames, analytics],\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n title={t('catalogGraphPage.title')}\n subtitle={rootEntityNames\n .map(e => entityPresentationSnapshot(e).primaryTitle)\n .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 /> {t('catalogGraphPage.filterToggleButtonTitle')}\n </ToggleButton>\n }\n >\n <SupportButton>\n {t('catalogGraphPage.supportButtonDescription')}\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 />\n <DirectionFilter value={direction} onChange={setDirection} />\n <CurveFilter value={curve} onChange={setCurve} />\n <SwitchFilter\n value={unidirectional}\n onChange={setUnidirectional}\n label={t('catalogGraphPage.simplifiedSwitchLabel')}\n />\n <SwitchFilter\n value={mergeRelations}\n onChange={setMergeRelations}\n label={t('catalogGraphPage.mergeRelationsSwitchLabel')}\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\" />{' '}\n {t('catalogGraphPage.zoomOutDescription')}\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 showArrowHeads={showArrowHeads}\n onNodeClick={onNodeClick}\n direction={direction}\n relationPairs={relationPairs}\n entityFilter={entityFilter}\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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,SAAA,EAAW;AAAA,KACb;AAAA,IACA,SAAA,EAAW;AAAA,MACT,MAAA,EAAQ,MAAA;AAAA,MACR,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW;AAAA,KAC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,EAAA,EAAE,IAAA,EAAC,SAAA,EAAW,OAAA,CAAQ,UAAA,EAC/B,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAW,QAAQ,YAAA,EACxB,QAAA,EAAA;AAAA,0BAAA,IAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,SAAA;AAAA,cACR,KAAA,EAAM,eAAA;AAAA,cACN,OAAA,EAAQ,OAAA;AAAA,cACR,WAAW,OAAA,CAAQ,MAAA;AAAA,cAEnB,QAAA,EAAA;AAAA,gCAAA,GAAA,CAAC,UAAA,EAAA,EAAW,WAAU,MAAA,EAAO,CAAA;AAAA,gBAAG,GAAA;AAAA,gBAC/B,EAAE,qCAAqC;AAAA;AAAA;AAAA,WAC1C;AAAA,0BACA,GAAA;AAAA,YAAC,oBAAA;AAAA,YAAA;AAAA,cACE,GAAG,KAAA;AAAA,cACJ,eAAA;AAAA,cACA,QAAA;AAAA,cACA,KAAA,EACE,aAAA,IAAiB,aAAA,CAAc,MAAA,GAAS,IACpC,aAAA,GACA,MAAA;AAAA,cAEN,SAAA,EACE,iBAAA,IAAqB,iBAAA,CAAkB,MAAA,GAAS,IAC5C,iBAAA,GACA,MAAA;AAAA,cAEN,cAAA;AAAA,cACA,cAAA;AAAA,cACA,cAAA;AAAA,cACA,WAAA;AAAA,cACA,SAAA;AAAA,cACA,aAAA;AAAA,cACA,YAAA;AAAA,cACA,WAAW,OAAA,CAAQ,KAAA;AAAA,cACnB,IAAA,EAAK,SAAA;AAAA,cACL;AAAA;AAAA;AACF,SAAA,EACF,CAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CurveFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/CurveFilter.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 { useCallback } from 'react';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\ntype Curve = 'curveStepBefore' | 'curveMonotoneX';\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 { t } = useTranslationRef(catalogGraphTranslationRef);\n const CURVE_DISPLAY_NAMES: Record<Curve, string> = {\n curveMonotoneX: t('catalogGraphPage.curveFilter.curveMonotoneX'),\n curveStepBefore: t('catalogGraphPage.curveFilter.curveStepBefore'),\n };\n\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={t('catalogGraphPage.curveFilter.title')}\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"],"names":[],"mappings":";;;;;;;AA4BA,MAAM,MAAA,GAAuB,CAAC,gBAAA,EAAkB,iBAAiB,CAAA;AAE1D,MAAM,WAAA,GAAc,CAAC,EAAE,KAAA,EAAO,UAAS,KAAa;AACzD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM,mBAAA,GAA6C;AAAA,IACjD,cAAA,EAAgB,EAAE,6CAA6C,CAAA;AAAA,IAC/D,eAAA,EAAiB,EAAE,8CAA8C;AAAA,GACnE;AAEA,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,CAAA,KAAqB,QAAA,CAAS,CAAU,CAAA;AAAA,IACzC,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,IAAI,CAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,oCAAoC,CAAA;AAAA,MAC7C,QAAA,EAAU,KAAA;AAAA,MACV,KAAA,EAAO,MAAA,CAAO,GAAA,CAAI,CAAA,CAAA,MAAM;AAAA,QACtB,KAAA,EAAO,oBAAoB,CAAC,CAAA;AAAA,QAC5B,KAAA,EAAO;AAAA,OACT,CAAE,CAAA;AAAA,MACF,QAAA,EAAU;AAAA;AAAA,GACZ,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"CurveFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/CurveFilter.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 { useCallback } from 'react';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\ntype Curve = 'curveStepBefore' | 'curveMonotoneX';\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 { t } = useTranslationRef(catalogGraphTranslationRef);\n const CURVE_DISPLAY_NAMES: Record<Curve, string> = {\n curveMonotoneX: t('catalogGraphPage.curveFilter.curveMonotoneX'),\n curveStepBefore: t('catalogGraphPage.curveFilter.curveStepBefore'),\n };\n\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={t('catalogGraphPage.curveFilter.title')}\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"],"names":[],"mappings":";;;;;;;AA4BA,MAAM,MAAA,GAAuB,CAAC,gBAAA,EAAkB,iBAAiB,CAAA;AAE1D,MAAM,WAAA,GAAc,CAAC,EAAE,KAAA,EAAO,UAAS,KAAa;AACzD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM,mBAAA,GAA6C;AAAA,IACjD,cAAA,EAAgB,EAAE,6CAA6C,CAAA;AAAA,IAC/D,eAAA,EAAiB,EAAE,8CAA8C;AAAA,GACnE;AAEA,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,CAAA,KAAqB,QAAA,CAAS,CAAU,CAAA;AAAA,IACzC,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,IAAI,CAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,oCAAoC,CAAA;AAAA,MAC7C,QAAA,EAAU,KAAA;AAAA,MACV,KAAA,EAAO,MAAA,CAAO,GAAA,CAAI,CAAA,CAAA,MAAM;AAAA,QACtB,KAAA,EAAO,oBAAoB,CAAC,CAAA;AAAA,QAC5B,KAAA,EAAO;AAAA,OACT,CAAE,CAAA;AAAA,MACF,QAAA,EAAU;AAAA;AAAA,GACZ,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DirectionFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/DirectionFilter.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 { useCallback } from 'react';\nimport { Direction } from '../../lib/types';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\n\nexport type Props = {\n value: Direction;\n onChange: (value: Direction) => void;\n};\n\nexport const DirectionFilter = ({ value, onChange }: Props) => {\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n const DIRECTION_DISPLAY_NAMES = {\n [Direction.LEFT_RIGHT]: t('catalogGraphPage.directionFilter.leftToRight'),\n [Direction.RIGHT_LEFT]: t('catalogGraphPage.directionFilter.rightToLeft'),\n [Direction.TOP_BOTTOM]: t('catalogGraphPage.directionFilter.topToBottom'),\n [Direction.BOTTOM_TOP]: t('catalogGraphPage.directionFilter.bottomToTop'),\n };\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={t('catalogGraphPage.directionFilter.title')}\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"],"names":[],"mappings":";;;;;;;;;AA2BO,MAAM,eAAA,GAAkB,CAAC,EAAE,KAAA,EAAO,UAAS,KAAa;AAC7D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM,uBAAA,GAA0B;AAAA,IAC9B,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C;AAAA,GAC1E;AACA,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,CAAA,KAAqB,QAAA,CAAS,CAAc,CAAA;AAAA,IAC7C,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,IAAI,CAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,wCAAwC,CAAA;AAAA,MACjD,QAAA,EAAU,KAAA;AAAA,MACV,OAAO,MAAA,CAAO,MAAA,CAAO,SAAS,CAAA,CAAE,IAAI,CAAA,CAAA,MAAM;AAAA,QACxC,KAAA,EAAO,wBAAwB,CAAC,CAAA;AAAA,QAChC,KAAA,EAAO;AAAA,OACT,CAAE,CAAA;AAAA,MACF,QAAA,EAAU;AAAA;AAAA,GACZ,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DirectionFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/DirectionFilter.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 { useCallback } from 'react';\nimport { Direction } from '../../lib/types';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\n\nexport type Props = {\n value: Direction;\n onChange: (value: Direction) => void;\n};\n\nexport const DirectionFilter = ({ value, onChange }: Props) => {\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n const DIRECTION_DISPLAY_NAMES = {\n [Direction.LEFT_RIGHT]: t('catalogGraphPage.directionFilter.leftToRight'),\n [Direction.RIGHT_LEFT]: t('catalogGraphPage.directionFilter.rightToLeft'),\n [Direction.TOP_BOTTOM]: t('catalogGraphPage.directionFilter.topToBottom'),\n [Direction.BOTTOM_TOP]: t('catalogGraphPage.directionFilter.bottomToTop'),\n };\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={t('catalogGraphPage.directionFilter.title')}\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"],"names":[],"mappings":";;;;;;;;;AA2BO,MAAM,eAAA,GAAkB,CAAC,EAAE,KAAA,EAAO,UAAS,KAAa;AAC7D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM,uBAAA,GAA0B;AAAA,IAC9B,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C;AAAA,GAC1E;AACA,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,CAAA,KAAqB,QAAA,CAAS,CAAc,CAAA;AAAA,IAC7C,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,IAAI,CAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,wCAAwC,CAAA;AAAA,MACjD,QAAA,EAAU,KAAA;AAAA,MACV,OAAO,MAAA,CAAO,MAAA,CAAO,SAAS,CAAA,CAAE,IAAI,CAAA,CAAA,MAAM;AAAA,QACxC,KAAA,EAAO,wBAAwB,CAAC,CAAA;AAAA,QAChC,KAAA,EAAO;AAAA,OACT,CAAE,CAAA;AAAA,MACF,QAAA,EAAU;AAAA;AAAA,GACZ,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaxDepthFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/MaxDepthFilter.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 { useTranslationRef } from '@backstage/frontend-plugin-api';\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 { ChangeEvent, useCallback, useEffect, useRef, useState } from 'react';\nimport { catalogGraphTranslationRef } from '../../translation';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\n/** @public */\nexport type MaxDepthFilterClassKey = 'formControl';\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 const { t } = useTranslationRef(catalogGraphTranslationRef);\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((event: 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 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\">\n {t('catalogGraphPage.maxDepthFilter.title')}\n </Typography>\n <OutlinedInput\n type=\"number\"\n placeholder={t('catalogGraphPage.maxDepthFilter.inputPlaceholder')}\n value={Number.isFinite(currentValue) ? String(currentValue) : ''}\n onChange={handleChange}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label={t(\n 'catalogGraphPage.maxDepthFilter.clearButtonAriaLabel',\n )}\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"],"names":[],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,WAAA,EAAa;AAAA,MACX,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,kCAAA;AACV,CAAA;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,KAAA,EAAO,UAAS,KAAa;AAC5D,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,WAAA,GAAc,OAAO,QAAQ,CAAA;AACnC,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,KAAK,CAAA;AACtD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAG1D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,WAAA,CAAY,OAAA,GAAU,QAAA;AAAA,EACxB,CAAA,EAAG,CAAC,QAAQ,CAAC,CAAA;AAGb,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,eAAA,CAAgB,KAAK,CAAA;AAAA,EACvB,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAGV,EAAA,MAAM,YAAA,GAAe,WAAA,CAAY,CAAC,KAAA,KAAyC;AACzE,IAAA,MAAM,eAAA,GAAkB,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAK,CAAA;AACjD,IAAA,MAAM,QAAA,GACJ,OAAO,QAAA,CAAS,eAAe,KAAK,eAAA,GAAkB,CAAA,GAClD,kBACA,MAAA,CAAO,iBAAA;AACb,IAAA,eAAA,CAAgB,QAAQ,CAAA;AACx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,EAAY;AAAA;AAAA;AACd,GAAA,EACF,CAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"MaxDepthFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/MaxDepthFilter.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 { useTranslationRef } from '@backstage/frontend-plugin-api';\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 { ChangeEvent, useCallback, useEffect, useRef, useState } from 'react';\nimport { catalogGraphTranslationRef } from '../../translation';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\n/** @public */\nexport type MaxDepthFilterClassKey = 'formControl';\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 const { t } = useTranslationRef(catalogGraphTranslationRef);\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((event: 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 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\">\n {t('catalogGraphPage.maxDepthFilter.title')}\n </Typography>\n <OutlinedInput\n type=\"number\"\n placeholder={t('catalogGraphPage.maxDepthFilter.inputPlaceholder')}\n value={Number.isFinite(currentValue) ? String(currentValue) : ''}\n onChange={handleChange}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label={t(\n 'catalogGraphPage.maxDepthFilter.clearButtonAriaLabel',\n )}\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"],"names":[],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,WAAA,EAAa;AAAA,MACX,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,kCAAA;AACV,CAAA;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,KAAA,EAAO,UAAS,KAAa;AAC5D,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,WAAA,GAAc,OAAO,QAAQ,CAAA;AACnC,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,KAAK,CAAA;AACtD,EAAA,MAAM,EAAE,CAAA,EAAE,GAA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A,EAAK,QAAA;AAAA,QACL,WAAA,EAAa,EAAE,kDAAkD,CAAA;AAAA,QACjE,OAAO,MAAA,CAAO,QAAA,CAAS,YAAY,CAAA,GAAI,MAAA,CAAO,YAAY,CAAA,GAAI,EAAA;AAAA,QAC9D,QAAA,EAAU,YAAA;AAAA,QACV,YAAA,kBACE,GAAA,CAAC,cAAA,EAAA,EAAe,QAAA,EAAS,KAAA,EACvB,QAAA,kBAAA,GAAA;AAAA,UAAC,UAAA;AAAA,UAAA;AAAA,YACC,YAAA,EAAY,CAAA;AAAA,cACV;AAAA,aACF;AAAA,YACA,OAAA,EAAS,KAAA;AAAA,YACT,IAAA,EAAK,KAAA;AAAA,YAEL,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA,SACb,EACF,CAAA;AAAA,QAEF,UAAA,EAAY;AAAA,UACV,YAAA,EAAc;AAAA,SAChB;AAAA,QACA,UAAA,EAAY;AAAA;AAAA;AACd,GAAA,EACF,CAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectedKindsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedKindsFilter.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 { 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 { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport type SelectedKindsFilterClassKey = 'formControl';\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 const { t } = useTranslationRef(catalogGraphTranslationRef);\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.toLowerCase()) : 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\">\n {t('catalogGraphPage.selectedKindsFilter.title')}\n </Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label={t('catalogGraphPage.selectedKindsFilter.title')}\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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,WAAA,EAAa;AAAA,MACX,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,uCAAA;AACV,CAAA;AAOO,MAAM,mBAAA,GAAsB,CAAC,EAAE,KAAA,EAAO,UAAS,KAAa;AACjE,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAE1D,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAM,GAAI,SAAS,YAAY;AACnD,IAAA,OAAO,MAAM,WACV,eAAA,CAAgB,EAAE,QAAQ,CAAC,MAAM,CAAA,EAAG,CAAA,CACpC,IAAA,CAAK,cAAY,QAAA,CAAS,MAAA,CAAO,IAAA,EAAM,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,KAAK,CAAA,CAAE,IAAA,EAAK,IAAK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EJ;;;;"}
1
+ {"version":3,"file":"SelectedKindsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedKindsFilter.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 { 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 { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport type SelectedKindsFilterClassKey = 'formControl';\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 const { t } = useTranslationRef(catalogGraphTranslationRef);\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.toLowerCase()) : 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\">\n {t('catalogGraphPage.selectedKindsFilter.title')}\n </Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label={t('catalogGraphPage.selectedKindsFilter.title')}\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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,WAAA,EAAa;AAAA,MACX,QAAA,EAAU;AAAA;AACZ,GACF;AA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ACE,GAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,IAAA,kBAAM,GAAA,CAAC,wBAAA,EAAA,EAAyB,QAAA,EAAS,OAAA,EAAQ,CAAA;AAAA,gBACjD,WAAA,kBAAa,GAAA,CAAC,YAAA,EAAA,EAAa,QAAA,EAAS,OAAA,EAAQ,CAAA;AAAA,gBAC5C,OAAA,EAAS;AAAA;AAAA,aACX;AAAA,YAEF,OAAO,KAAA,CAAM,eAAA,CAAgB,OAAA,CAAQ,MAAM,CAAC,CAAA,IAAK;AAAA;AAAA,SACnD;AAAA,QAEF,IAAA,EAAK,OAAA;AAAA,QACL,SAAA,kBAAW,GAAA,CAAC,cAAA,EAAA,EAAe,aAAA,EAAY,uBAAA,EAAwB,CAAA;AAAA,QAC/D,aAAa,CAAA,MAAA,qBAAU,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAA,EAAW;AAAA;AAAA;AACnE,GAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectedRelationsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedRelationsFilter.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 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 { useCallback, useMemo } from 'react';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useRelations } from '../../hooks';\n\n/** @public */\nexport type SelectedRelationsFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedRelationsFilter' },\n);\n\nexport type Props = {\n relations?: string[];\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedRelationsFilter = (props: Props) => {\n const { relations: incomingRelations, value, onChange } = props;\n\n const classes = useStyles();\n\n const { relations, includeRelation } = useRelations({\n relations: incomingRelations,\n });\n\n const defaultValue = useMemo(\n () => relations.filter(rel => includeRelation(rel)),\n [relations, includeRelation],\n );\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(v);\n },\n [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\">\n {t('catalogGraphPage.selectedRelationsFilter.title')}\n </Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label={t('catalogGraphPage.selectedRelationsFilter.title')}\n options={relations}\n value={value ?? defaultValue}\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} vari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AA,EACjB,QAAA,EAAA,CAAA,CAAE,gDAAgD,CAAA,EACrD,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,WAAW,OAAA,CAAQ,WAAA;AAAA,QACnB,QAAA,EAAQ,IAAA;AAAA,QACR,SAAA,EAAW,CAAA;AAAA,QACX,oBAAA,EAAoB,IAAA;AAAA,QACpB,YAAA,EAAY,EAAE,gDAAgD,CAAA;AAAA,QAC9D,OAAA,EAAS,SAAA;AAAA,QACT,OAAO,KAAA,IAAS,YAAA;AAAA,QAChB,QAAA,EAAU,YAAA;AAAA,QACV,MAAA,EAAQ,WAAA;AAAA,QACR,YAAA,EAAc,CAAC,MAAA,EAAQ,EAAE,UAAS,qBAChC,GAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,OAAA,kBACE,GAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,IAAA,kBAAM,GAAA,CAAC,wBAAA,EAAA,EAAyB,QAAA,EAAS,OAAA,EAAQ,CAAA;AAAA,gBACjD,WAAA,kBAAa,GAAA,CAAC,YAAA,EAAA,EAAa,QAAA,EAAS,OAAA,EAAQ,CAAA;AAAA,gBAC5C,OAAA,EAAS;AAAA;AAAA,aACX;AAAA,YAEF,KAAA,EAAO;AAAA;AAAA,SACT;AAAA,QAEF,IAAA,EAAK,OAAA;AAAA,QACL,SAAA,kBAAW,GAAA,CAAC,cAAA,EAAA,EAAe,aAAA,EAAY,2BAAA,EAA4B,CAAA;AAAA,QACnE,aAAa,CAAA,MAAA,qBAAU,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAA,EAAW;AAAA;AAAA;AACnE,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"SelectedRelationsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedRelationsFilter.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 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 { useCallback, useMemo } from 'react';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useRelations } from '../../hooks';\n\n/** @public */\nexport type SelectedRelationsFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedRelationsFilter' },\n);\n\nexport type Props = {\n relations?: string[];\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedRelationsFilter = (props: Props) => {\n const { relations: incomingRelations, value, onChange } = props;\n\n const classes = useStyles();\n\n const { relations, includeRelation } = useRelations({\n relations: incomingRelations,\n });\n\n const defaultValue = useMemo(\n () => relations.filter(rel => includeRelation(rel)),\n [relations, includeRelation],\n );\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(v);\n },\n [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\">\n {t('catalogGraphPage.selectedRelationsFilter.title')}\n </Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label={t('catalogGraphPage.selectedRelationsFilter.title')}\n options={relations}\n value={value ?? defaultValue}\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"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,WAAA,EAAa;AAAA,MACX,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,2CAAA;AACV,CAAA;AAQO,MAAM,uBAAA,GAA0B,CAAC,KAAA,KAAiB;AACvD,EAAA,MAAM,EAAE,SAAA,EAAW,iBAAA,EAAmB,KAAA,EAAO,UAAS,GAAI,KAAA;AAE1D,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,MAAM,EAAE,SAAA,EAAW,eAAA,EAAgB,GAAI,YAAA,CAAa;AAAA,IAClD,SAAA,EAAW;AAAA,GACZ,CAAA;AAED,EAAA,MAAM,YAAA,GAAe,OAAA;AAAA,IACnB,MAAM,SAAA,CAAU,MAAA,CAAO,CAAA,GAAA,KAAO,eAAA,CAAgB,GAAG,CAAC,CAAA;AAAA,IAClD,CAAC,WAAW,eAAe;AAAA,GAC7B;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,0BAA0B,CAAA;AAE1D,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,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A,aACX;AAAA,YAEF,KAAA,EAAO;AAAA;AAAA,SACT;AAAA,QAEF,IAAA,EAAK,OAAA;AAAA,QACL,SAAA,kBAAW,GAAA,CAAC,cAAA,EAAA,EAAe,aAAA,EAAY,2BAAA,EAA4B,CAAA;AAAA,QACnE,aAAa,CAAA,MAAA,qBAAU,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAA,EAAW;AAAA;AAAA;AACnE,GAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SwitchFilter.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 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 { ChangeEvent, useCallback } from 'react';\n\nexport type Props = {\n label: string;\n value: boolean;\n onChange: (value: boolean) => void;\n};\n\n/** @public */\nexport type SwitchFilterClassKey = 'root';\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: 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"],"names":[],"mappings":";;;;;;;AA8BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,gCAAA;AACV,CAAA;AAEO,MAAM,eAAe,CAAC,EAAE,KAAA,EAAO,KAAA,EAAO,UAAS,KAAa;AACjE,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,KAAA,KAAyC;AACxC,MAAA,QAAA,CAAS,KAAA,CAAM,OAAO,OAAO,CAAA;AAAA,IAC/B,CAAA;AAAA,IACA,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,IAAI,CAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,OAAA,kBACE,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAS,KAAA;AAAA,UACT,QAAA,EAAU,YAAA;AAAA,UACV,IAAA,EAAM,KAAA;AAAA,UACN,KAAA,EAAM;AAAA;AAAA,OACR;AAAA,MAEF,KAAA;AAAA,MACA,WAAW,OAAA,CAAQ;AAAA;AAAA,GACrB,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"SwitchFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SwitchFilter.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 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 { ChangeEvent, useCallback } from 'react';\n\nexport type Props = {\n label: string;\n value: boolean;\n onChange: (value: boolean) => void;\n};\n\n/** @public */\nexport type SwitchFilterClassKey = 'root';\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: 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"],"names":[],"mappings":";;;;;;;AA8BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB;AAAA,IACE,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,gCAAA;AACV,CAAA;AAEO,MAAM,eAAe,CAAC,EAAE,KAAA,EAAO,KAAA,EAAO,UAAS,KAAa;AACjE,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,KAAA,KAAyC;AACxC,MAAA,QAAA,CAAS,KAAA,CAAM,OAAO,OAAO,CAAA;AAAA,IAC/B,CAAA;AAAA,IACA,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,IAAI,CAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,OAAA,kBACE,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAS,KAAA;AAAA,UACT,QAAA,EAAU,YAAA;AAAA,UACV,IAAA,EAAM,KAAA;AAAA,UACN,KAAA,EAAM;AAAA;AAAA,OACR;AAAA,MAEF,KAAA;AAAA,MACA,WAAW,OAAA,CAAQ;AAAA;AAAA,GACrB,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCatalogGraphPage.esm.js","sources":["../../../src/components/CatalogGraphPage/useCatalogGraphPage.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 {\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, useNavigate } from 'react-router-dom';\nimport { Direction } from '../../lib/types';\n\nexport type CatalogGraphPageValue = {\n rootEntityNames: CompoundEntityRef[];\n setRootEntityNames: (value: CompoundEntityRef[]) => void;\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 navigate = useNavigate();\n\n const query = useMemo(\n () =>\n (qs.parse(location.search, {\n arrayLimit: 10000,\n 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 const rootEntityNames = useMemo(\n () =>\n (Array.isArray(query.rootEntityRefs)\n ? query.rootEntityRefs\n : initialState?.rootEntityRefs ?? []\n ).map(r => parseEntityRef(r)),\n [initialState?.rootEntityRefs, query.rootEntityRefs],\n );\n\n const setRootEntityNames = useCallback(\n (value: CompoundEntityRef[]) => {\n const areSame =\n rootEntityNames.length === value.length &&\n rootEntityNames.every(\n (r, i) => stringifyEntityRef(r) === stringifyEntityRef(value[i]),\n );\n\n if (areSame) {\n return;\n }\n\n const newSearch = qs.stringify(\n {\n ...query,\n rootEntityRefs: value.map(r => stringifyEntityRef(r)),\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n\n navigate(newSearch);\n },\n [rootEntityNames, navigate, query],\n );\n\n const [maxDepth, setMaxDepth] = useState<number>(() =>\n typeof query.maxDepth === 'string'\n ? parseMaxDepth(query.maxDepth)\n : initialState?.maxDepth ?? Number.POSITIVE_INFINITY,\n );\n\n const [selectedRelations, setSelectedRelations] = useState<\n string[] | undefined\n >(() =>\n Array.isArray(query.selectedRelations)\n ? query.selectedRelations\n : initialState?.selectedRelations,\n );\n\n const [selectedKinds, setSelectedKinds] = useState<string[] | undefined>(() =>\n (Array.isArray(query.selectedKinds)\n ? query.selectedKinds\n : initialState?.selectedKinds\n )?.map(k => k.toLowerCase()),\n );\n\n const [unidirectional, setUnidirectional] = useState<boolean>(() =>\n typeof query.unidirectional === 'string'\n ? query.unidirectional === 'true'\n : initialState?.unidirectional ?? true,\n );\n\n const [mergeRelations, setMergeRelations] = useState<boolean>(() =>\n typeof query.mergeRelations === 'string'\n ? query.mergeRelations === 'true'\n : initialState?.mergeRelations ?? true,\n );\n\n const [direction, setDirection] = useState<Direction>(() =>\n typeof query.direction === 'string'\n ? query.direction\n : initialState?.direction ?? Direction.LEFT_RIGHT,\n );\n\n const [curve, setCurve] = useState<'curveStepBefore' | 'curveMonotoneX'>(() =>\n typeof query.curve === 'string'\n ? query.curve\n : initialState?.curve ?? 'curveMonotoneX',\n );\n\n const [showFilters, setShowFilters] = useState<boolean>(() =>\n typeof query.showFilters === 'string'\n ? query.showFilters === 'true'\n : initialState?.showFilters ?? true,\n );\n\n const toggleShowFilters = useCallback(\n () => setShowFilters(s => !s),\n [setShowFilters],\n );\n\n useEffect(() => {\n const newParams = qs.stringify(\n {\n rootEntityRefs: rootEntityNames.map(stringifyEntityRef),\n maxDepth: isFinite(maxDepth) ? maxDepth : '∞',\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n curve,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n\n navigate(newParams, { replace: true });\n }, [\n maxDepth,\n curve,\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n rootEntityNames,\n navigate,\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"],"names":[],"mappings":";;;;;;AAuDO,SAAS,mBAAA,CAAoB;AAAA,EAClC,eAAe;AACjB,CAAA,EAY0B;AACxB,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACG,EAAA,CAAG,KAAA,CAAM,QAAA,CAAS,MAAA,EAAQ;AAAA,MACzB,UAAA,EAAY,GAAA;AAAA,MACZ,iBAAA,EAAmB;AAAA,KACpB,KAAK,EAAC;AAAA,IAWT,CAAC,SAAS,MAAM;AAAA,GAClB;AAEA,EAAA,MAAM,eAAA,GAAkB,OAAA;AAAA,IACtB,OACG,KAAA,CAAM,OAAA,CAAQ,KAAA,CAAM,cAAc,IAC/B,KAAA,CAAM,cAAA,GACN,YAAA,EAAc,cAAA,IAAkB,EAAC,EACnC,GAAA,CAAI,CAAA,CAAA,KAAK,cAAA,CAAe,CAAC,CAAC,CAAA;AAAA,IAC9B,CAAC,YAAA,EAAc,cAAA,EAAgB,KAAA,CAAM,cAAc;AAAA,GACrD;AAEA,EAAA,MAAM,kBAAA,GAAqB,WAAA;AAAA,IACzB,CAAC,KAAA,KAA+B;AAC9B,MAAA,MAAM,OAAA,GACJ,eAAA,CAAgB,MAAA,KAAW,KAAA,CAAM,UACjC,eAAA,CAAgB,KAAA;AAAA,QACd,CAAC,GAAG,CAAA,KAAM,kBAAA,CAAmB,C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AAA;AAAA,QACA,cAAA;AAAA,QACA,cAAA;AAAA,QACA,SAAA;AAAA,QACA,WAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,EAAE,WAAA,EAAa,UAAA,EAAY,cAAA,EAAgB,IAAA;AAAK,KAClD;AAEA,IAAA,QAAA,CAAS,SAAA,EAAW,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA;AAAA,EACvC,CAAA,EAAG;AAAA,IACD,QAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,OAAO;AAAA,IACL,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,oBAAA;AAAA,IACA,aAAA;AAAA,IACA,gBAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;AAEA,SAAS,cAAc,KAAA,EAAuB;AAC5C,EAAA,OAAO,KAAA,KAAU,QAAA,GAAM,MAAA,CAAO,iBAAA,GAAoB,OAAO,KAAK,CAAA;AAChE;;;;"}
1
+ {"version":3,"file":"useCatalogGraphPage.esm.js","sources":["../../../src/components/CatalogGraphPage/useCatalogGraphPage.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 {\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, useNavigate } from 'react-router-dom';\nimport { Direction } from '../../lib/types';\n\nexport type CatalogGraphPageValue = {\n rootEntityNames: CompoundEntityRef[];\n setRootEntityNames: (value: CompoundEntityRef[]) => void;\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 navigate = useNavigate();\n\n const query = useMemo(\n () =>\n (qs.parse(location.search, {\n arrayLimit: 10000,\n 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 const rootEntityNames = useMemo(\n () =>\n (Array.isArray(query.rootEntityRefs)\n ? query.rootEntityRefs\n : initialState?.rootEntityRefs ?? []\n ).map(r => parseEntityRef(r)),\n [initialState?.rootEntityRefs, query.rootEntityRefs],\n );\n\n const setRootEntityNames = useCallback(\n (value: CompoundEntityRef[]) => {\n const areSame =\n rootEntityNames.length === value.length &&\n rootEntityNames.every(\n (r, i) => stringifyEntityRef(r) === stringifyEntityRef(value[i]),\n );\n\n if (areSame) {\n return;\n }\n\n const newSearch = qs.stringify(\n {\n ...query,\n rootEntityRefs: value.map(r => stringifyEntityRef(r)),\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n\n navigate(newSearch);\n },\n [rootEntityNames, navigate, query],\n );\n\n const [maxDepth, setMaxDepth] = useState<number>(() =>\n typeof query.maxDepth === 'string'\n ? parseMaxDepth(query.maxDepth)\n : initialState?.maxDepth ?? Number.POSITIVE_INFINITY,\n );\n\n const [selectedRelations, setSelectedRelations] = useState<\n string[] | undefined\n >(() =>\n Array.isArray(query.selectedRelations)\n ? query.selectedRelations\n : initialState?.selectedRelations,\n );\n\n const [selectedKinds, setSelectedKinds] = useState<string[] | undefined>(() =>\n (Array.isArray(query.selectedKinds)\n ? query.selectedKinds\n : initialState?.selectedKinds\n )?.map(k => k.toLowerCase()),\n );\n\n const [unidirectional, setUnidirectional] = useState<boolean>(() =>\n typeof query.unidirectional === 'string'\n ? query.unidirectional === 'true'\n : initialState?.unidirectional ?? true,\n );\n\n const [mergeRelations, setMergeRelations] = useState<boolean>(() =>\n typeof query.mergeRelations === 'string'\n ? query.mergeRelations === 'true'\n : initialState?.mergeRelations ?? true,\n );\n\n const [direction, setDirection] = useState<Direction>(() =>\n typeof query.direction === 'string'\n ? query.direction\n : initialState?.direction ?? Direction.LEFT_RIGHT,\n );\n\n const [curve, setCurve] = useState<'curveStepBefore' | 'curveMonotoneX'>(() =>\n typeof query.curve === 'string'\n ? query.curve\n : initialState?.curve ?? 'curveMonotoneX',\n );\n\n const [showFilters, setShowFilters] = useState<boolean>(() =>\n typeof query.showFilters === 'string'\n ? query.showFilters === 'true'\n : initialState?.showFilters ?? true,\n );\n\n const toggleShowFilters = useCallback(\n () => setShowFilters(s => !s),\n [setShowFilters],\n );\n\n useEffect(() => {\n const newParams = qs.stringify(\n {\n rootEntityRefs: rootEntityNames.map(stringifyEntityRef),\n maxDepth: isFinite(maxDepth) ? maxDepth : '∞',\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n curve,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n\n navigate(newParams, { replace: true });\n }, [\n maxDepth,\n curve,\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n rootEntityNames,\n navigate,\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"],"names":[],"mappings":";;;;;;AAuDO,SAAS,mBAAA,CAAoB;AAAA,EAClC,eAAe;AACjB,CAAA,EAY0B;AACxB,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACG,EAAA,CAAG,KAAA,CAAM,QAAA,CAAS,MAAA,EAAQ;AAAA,MACzB,UAAA,EAAY,GAAA;AAAA,MACZ,iBAAA,EAAmB;AAAA,KACpB,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AAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;AAEA,SAAS,cAAc,KAAA,EAAuB;AAC5C,EAAA,OAAO,KAAA,KAAU,QAAA,GAAM,MAAA,CAAO,iBAAA,GAAoB,OAAO,KAAK,CAAA;AAChE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultRenderLabel.esm.js","sources":["../../../src/components/EntityRelationsGraph/DefaultRenderLabel.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { EntityEdgeData } from '../../lib/types';\nimport classNames from 'classnames';\n\n/** @public */\nexport type CustomLabelClassKey = 'text' | 'secondary';\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 % 2 !== 0 && classes.secondary)}>\n {i > 0 && <tspan> / </tspan>}\n {r}\n </tspan>\n ))}\n </text>\n );\n}\n"],"names":[],"mappings":";;;;AAuBA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,MAAM,OAAA,CAAQ;AAAA,KACtB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MAAM,OAAA,CAAQ;AAAA;AACtB,GACF,CAAA;AAAA,EACA,EAAE,MAAM,+BAAA;AACV,CAAA;AAEO,SAAS,kBAAA,CAAmB;AAAA,EACjC,IAAA,EAAM,EAAE,SAAA;AACV,CAAA,EAA0D;AACxD,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,uBACE,GAAA,CAAC,UAAK,SAAA,EAAW,OAAA,CAAQ,MAAM,UAAA,EAAW,QAAA,EACvC,oBAAU,GAAA,CAAI,CAAC,GAAG,CAAA,qBACjB,IAAA,CAAC,WAAc,SAAA,EAAW,UAAA,CAAW,IAAI,CAAA,KAAM,CAAA,IAAK,OAAA,CAAQ,SAAS,CAAA,EAClE,QAAA,EAAA;AAAA,IAAA,CAAA,GAAI,CAAA,oBAAK,GAAA,CAAC,OAAA,EAAA,EAAM,QAAA,EAAA,KAAA,EAAG,CAAA;AAAA,IACnB;AAAA,GAAA,EAAA,EAFS,CAGZ,CACD,CAAA,EACH,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultRenderLabel.esm.js","sources":["../../../src/components/EntityRelationsGraph/DefaultRenderLabel.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { EntityEdgeData } from '../../lib/types';\nimport classNames from 'classnames';\n\n/** @public */\nexport type CustomLabelClassKey = 'text' | 'secondary';\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 % 2 !== 0 && classes.secondary)}>\n {i > 0 && <tspan> / </tspan>}\n {r}\n </tspan>\n ))}\n </text>\n );\n}\n"],"names":[],"mappings":";;;;AAuBA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,MAAM,OAAA,CAAQ;AAAA,KACtB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MAAM,OAAA,CAAQ;AAAA;AACtB,GACF,CAAA;AAAA,EACA,EAAE,MAAM,+BAAA;AACV,CAAA;AAEO,SAAS,kBAAA,CAAmB;AAAA,EACjC,IAAA,EAAM,EAAE,SAAA;AACV,CAAA,EAA0D;AACxD,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,uBACE,GAAA,CAAC,UAAK,SAAA,EAAW,OAAA,CAAQ,MAAM,UAAA,EAAW,QAAA,EACvC,oBAAU,GAAA,CAAI,CAAC,GAAG,CAAA,qBACjB,IAAA,CAAC,WAAc,SAAA,EAAW,UAAA,CAAW,IAAI,CAAA,KAAM,CAAA,IAAK,OAAA,CAAQ,SAAS,CAAA,EAClE,QAAA,EAAA;AAAA,IAAA,CAAA,GAAI,CAAA,oBAAK,GAAA,CAAC,OAAA,EAAA,EAAM,QAAA,EAAA,KAAA,EAAG,CAAA;AAAA,IACnB;AAAA,GAAA,EAAA,EAFS,CAGZ,CACD,CAAA,EACH,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultRenderNode.esm.js","sources":["../../../src/components/EntityRelationsGraph/DefaultRenderNode.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { useLayoutEffect, useRef, useState } from 'react';\nimport { EntityIcon } from './EntityIcon';\nimport { EntityNodeData } from '../../lib/types';\nimport { DEFAULT_NAMESPACE } from '@backstage/catalog-model';\n\n/** @public */\nexport type CustomNodeClassKey = 'node' | 'text' | 'clickable';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n }),\n { name: 'PluginCatalogGraphCustomNode' },\n);\n\nexport function DefaultRenderNode({\n node: { id, entity, color = 'default', focused, onClick },\n}: DependencyGraphTypes.RenderNodeProps<EntityNodeData>) {\n const classes = useStyles();\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n const entityRefPresentationSnapshot = useEntityPresentation(entity, {\n defaultNamespace: DEFAULT_NAMESPACE,\n });\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 hasKindIcon = !!entityRefPresentationSnapshot.Icon;\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 = entityRefPresentationSnapshot.primaryTitle ?? 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 <EntityIcon\n icon={entityRefPresentationSnapshot.Icon as IconComponent}\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 <title>{entityRefPresentationSnapshot.entityRef}</title>\n </g>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,K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AAA,6BAAA,CAA8B,SAAA,EAAU;AAAA,GAAA,EAClD,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultRenderNode.esm.js","sources":["../../../src/components/EntityRelationsGraph/DefaultRenderNode.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { useLayoutEffect, useRef, useState } from 'react';\nimport { EntityIcon } from './EntityIcon';\nimport { EntityNodeData } from '../../lib/types';\nimport { DEFAULT_NAMESPACE } from '@backstage/catalog-model';\n\n/** @public */\nexport type CustomNodeClassKey = 'node' | 'text' | 'clickable';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n }),\n { name: 'PluginCatalogGraphCustomNode' },\n);\n\nexport function DefaultRenderNode({\n node: { id, entity, color = 'default', focused, onClick },\n}: DependencyGraphTypes.RenderNodeProps<EntityNodeData>) {\n const classes = useStyles();\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n const entityRefPresentationSnapshot = useEntityPresentation(entity, {\n defaultNamespace: DEFAULT_NAMESPACE,\n });\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 hasKindIcon = !!entityRefPresentationSnapshot.Icon;\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 = entityRefPresentationSnapshot.primaryTitle ?? 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 <EntityIcon\n icon={entityRefPresentationSnapshot.Icon as IconComponent}\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 <title>{entityRefPresentationSnapshot.entityRef}</title>\n </g>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,SAAA,GAAY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,OAAA,EAAA,EAAO,QAAA,EAAA,6BAAA,CAA8B,SAAA,EAAU;AAAA,GAAA,EAClD,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityIcon.esm.js","sources":["../../../src/components/EntityRelationsGraph/EntityIcon.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 SvgIcon from '@material-ui/core/SvgIcon';\nimport { OverridableComponent } from '@material-ui/core/OverridableComponent';\nimport { SvgIconTypeMap } from '@material-ui/core/SvgIcon/SvgIcon';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nexport function EntityIcon({\n icon,\n width,\n height,\n ...props\n}: {\n icon: IconComponent | undefined;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const Icon = (icon as OverridableComponent<SvgIconTypeMap>) ?? SvgIcon;\n return (\n <Icon\n style={{ width, height, fontSize: height }}\n width={width}\n height={height}\n {...props}\n />\n );\n}\n"],"names":[],"mappings":";;;AAoBO,SAAS,UAAA,CAAW;AAAA,EACzB,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,EAOG;AACD,EAAA,MAAM,OAAQ,IAAA,IAAiD,OAAA;AAC/D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,EAAQ,UAAU,MAAA,EAAO;AAAA,MACzC,KAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityIcon.esm.js","sources":["../../../src/components/EntityRelationsGraph/EntityIcon.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 SvgIcon from '@material-ui/core/SvgIcon';\nimport { OverridableComponent } from '@material-ui/core/OverridableComponent';\nimport { SvgIconTypeMap } from '@material-ui/core/SvgIcon/SvgIcon';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nexport function EntityIcon({\n icon,\n width,\n height,\n ...props\n}: {\n icon: IconComponent | undefined;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const Icon = (icon as OverridableComponent<SvgIconTypeMap>) ?? SvgIcon;\n return (\n <Icon\n style={{ width, height, fontSize: height }}\n width={width}\n height={height}\n {...props}\n />\n );\n}\n"],"names":[],"mappings":";;;AAoBO,SAAS,UAAA,CAAW;AAAA,EACzB,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,EAOG;AACD,EAAA,MAAM,OAAQ,IAAA,IAAiD,OAAA;AAC/D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,EAAQ,UAAU,MAAA,EAAO;AAAA,MACzC,KAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;"}
@@ -3,7 +3,7 @@ import { stringifyEntityRef } from '@backstage/catalog-model';
3
3
  import { DependencyGraph, DependencyGraphTypes } from '@backstage/core-components';
4
4
  import { useApi, errorApiRef } from '@backstage/core-plugin-api';
5
5
  import CircularProgress from '@material-ui/core/CircularProgress';
6
- import { makeStyles, useTheme } from '@material-ui/core/styles';
6
+ import { useTheme, makeStyles } from '@material-ui/core/styles';
7
7
  import classNames from 'classnames';
8
8
  import { useMemo, useEffect } from 'react';
9
9
  import { DefaultRenderLabel } from './DefaultRenderLabel.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"EntityRelationsGraph.esm.js","sources":["../../../src/components/EntityRelationsGraph/EntityRelationsGraph.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 CompoundEntityRef,\n Entity,\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 { MouseEvent, useEffect, useMemo } from 'react';\nimport { DefaultRenderLabel } from './DefaultRenderLabel';\nimport { DefaultRenderNode } from './DefaultRenderNode';\nimport { RelationPairs } from '../../lib/types';\nimport { Direction, EntityEdge, EntityNode } from '../../lib/types';\nimport { useEntityRelationNodesAndEdges } from './useEntityRelationNodesAndEdges';\n\n/** @public */\nexport type EntityRelationsGraphClassKey = 'progress' | 'container' | 'graph';\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 entityFilter?: (entity: Entity) => boolean;\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 renderEdge?: DependencyGraphTypes.RenderEdgeFunction<EntityEdge>;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n showArrowHeads?: boolean;\n allowFullscreen?: 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 entityFilter,\n direction = Direction.LEFT_RIGHT,\n onNodeClick,\n relationPairs,\n className,\n zoom = 'enabled',\n renderNode,\n renderLabel,\n renderEdge,\n curve,\n showArrowHeads,\n allowFullscreen,\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 entityFilter,\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 renderEdge={renderEdge}\n direction={direction}\n className={classes.graph}\n fit=\"contain\"\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 allowFullscreen={allowFullscreen}\n />\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,QAAA,EAAU;AAAA,MACR,QAAA,EAAU,UAAA;AAAA,MACV,IAAA,EAAM,KAAA;AAAA,MACN,GAAA,EAAK,KAAA;AAAA,MACL,UAAA,EAAY,OAAA;AAAA,MACZ,SAAA,EAAW;AAAA,KACb;AAAA,IACA,SAAA,EAAW;AAAA,MACT,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,MAAA;AAAA,MACP,OAAA,EAAS,MAAA;AAAA,MACT,aAAA,EAAe;AAAA,KACjB;AAAA,IACA,KAAA,EAAO;AAAA,MACL,KAAA,EAAO,MAAA;AAAA,MACP,IAAA,EAAM,CAAA;AAAA;AAAA;AAAA,MAGN,oBAAA,EAAsB;AAAA,QACpB,UAAA,EAAY;AAAA,OACd;AAAA,MACA,0BAAA,EAA4B;AAAA,QAC1B,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,YAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,QAAA,CAAS,KAAK,KAAK,CAAA;AAAA,IACrB;AAAA,EACF,CAAA,EAAG,CAAC,QAAA,EAAU,KAAK,CAAC,CAAA;AAEpB,EAAA,4BACG,KAAA,EAAA,EAAI,SAAA,EAAW,WAAW,OAAA,CAAQ,SAAA,EAAW,SAAS,CAAA,EACpD,QAAA,EAAA;AAAA,IAAA,OAAA,oBAAW,GAAA,CAAC,gBAAA,EAAA,EAAiB,SAAA,EAAW,OAAA,CAAQ,QAAA,EAAU,CAAA;AAAA,IAC1D,SAAS,KAAA,oBACR,GAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACC,KAAA;AAAA,QACA,KAAA;AAAA,QACA,YAAY,UAAA,IAAc,iBAAA;AAAA,QAC1B,aAAa,WAAA,IAAe,kBAAA;AAAA,QAC5B,UAAA;AAAA,QACA,SAAA;AAAA,QACA,WAAW,OAAA,CAAQ,KAAA;AAAA,QACnB,GAAA,EAAI,SAAA;AAAA,QACJ,QAAA,EAAU,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QACzB,QAAA,EAAU,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QACzB,aAAA,EAAe,qBAAqB,aAAA,CAAc,KAAA;AAAA,QAClD,WAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QAC5B,IAAA;AAAA,QACA,KAAA;AAAA,QACA,cAAA;AAAA,QACA;AAAA;AAAA;AACF,GAAA,EAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityRelationsGraph.esm.js","sources":["../../../src/components/EntityRelationsGraph/EntityRelationsGraph.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 CompoundEntityRef,\n Entity,\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 { MouseEvent, useEffect, useMemo } from 'react';\nimport { DefaultRenderLabel } from './DefaultRenderLabel';\nimport { DefaultRenderNode } from './DefaultRenderNode';\nimport { RelationPairs } from '../../lib/types';\nimport { Direction, EntityEdge, EntityNode } from '../../lib/types';\nimport { useEntityRelationNodesAndEdges } from './useEntityRelationNodesAndEdges';\n\n/** @public */\nexport type EntityRelationsGraphClassKey = 'progress' | 'container' | 'graph';\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 entityFilter?: (entity: Entity) => boolean;\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 renderEdge?: DependencyGraphTypes.RenderEdgeFunction<EntityEdge>;\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n showArrowHeads?: boolean;\n allowFullscreen?: 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 entityFilter,\n direction = Direction.LEFT_RIGHT,\n onNodeClick,\n relationPairs,\n className,\n zoom = 'enabled',\n renderNode,\n renderLabel,\n renderEdge,\n curve,\n showArrowHeads,\n allowFullscreen,\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 entityFilter,\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 renderEdge={renderEdge}\n direction={direction}\n className={classes.graph}\n fit=\"contain\"\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 allowFullscreen={allowFullscreen}\n />\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,QAAA,EAAU;AAAA,MACR,QAAA,EAAU,UAAA;AAAA,MACV,IAAA,EAAM,KAAA;AAAA,MACN,GAAA,EAAK,KAAA;AAAA,MACL,UAAA,EAAY,OAAA;AAAA,MACZ,SAAA,EAAW;AAAA,KACb;AAAA,IACA,SAAA,EAAW;AAAA,MACT,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,MAAA;AAAA,MACP,OAAA,EAAS,MAAA;AAAA,MACT,aAAA,EAAe;AAAA,KACjB;AAAA,IACA,KAAA,EAAO;AAAA,MACL,KAAA,EAAO,MAAA;AAAA,MACP,IAAA,EAAM,CAAA;AAAA;AAAA;AAAA,MAGN,oBAAA,EAAsB;AAAA,QACpB,UAAA,EAAY;AAAA,OACd;AAAA,MACA,0BAAA,EAA4B;AAAA,QAC1B,MAAA,EAAQ,CAAA,wBAAA,EAA2B,KAAA,CAAM,OAAA,CAAQ,QAAQ,IAAI,CAAA,EAAA;AAAA,OAC/D;AAAA,MACA,wBAAA,EAA0B;AAAA,QACxB,UAAA,EAAY;AAAA;AACd;AACF,GACF,CAAA;AAAA,EACA,EAAE,MAAM,wCAAA;AACV,CAAA;AA+BO,MAAM,oBAAA,GAAuB,CAAC,KAAA,KAAqC;AACxE,EAAA,MAAM;AAAA,IACJ,eAAA;AAAA,IACA,QAAA,GAAW,CAAA;AAAA,IACX,cAAA,GAAiB,IAAA;AAAA,IACjB,cAAA,GAAiB,IAAA;AAAA,IACjB,KAAA;AAAA,IACA,SAA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,EAAU,CAAA;AAAA,IAC1D,SAAS,KAAA,oBACR,GAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACC,KAAA;AAAA,QACA,KAAA;AAAA,QACA,YAAY,UAAA,IAAc,iBAAA;AAAA,QAC1B,aAAa,WAAA,IAAe,kBAAA;AAAA,QAC5B,UAAA;AAAA,QACA,SAAA;AAAA,QACA,WAAW,OAAA,CAAQ,KAAA;AAAA,QACnB,GAAA,EAAI,SAAA;AAAA,QACJ,QAAA,EAAU,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QACzB,QAAA,EAAU,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QACzB,aAAA,EAAe,qBAAqB,aAAA,CAAc,KAAA;AAAA,QAClD,WAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QAC5B,IAAA;AAAA,QACA,KAAA;AAAA,QACA,cAAA;AAAA,QACA;AAAA;AAAA;AACF,GAAA,EAEJ,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityRelationGraph.esm.js","sources":["../../../src/components/EntityRelationsGraph/useEntityRelationGraph.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 { Entity } from '@backstage/catalog-model';\nimport { useEffect, useMemo } from 'react';\nimport { useEntityStore } from './useEntityStore';\nimport { pickBy } from 'lodash';\nimport { useRelations } from '../../hooks/useRelations';\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: {\n maxDepth = Number.POSITIVE_INFINITY,\n relations,\n kinds,\n entityFilter,\n } = {},\n}: {\n rootEntityRefs: string[];\n filter?: {\n maxDepth?: number;\n relations?: string[];\n kinds?: string[];\n entityFilter?: (entity: Entity) => boolean;\n };\n}): {\n entities?: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n} {\n const { entities, loading, error, requestEntities } = useEntityStore();\n const { includeRelation } = useRelations({ relations });\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 // If the entity is filtered out then no need to check any\n // of its outgoing relationships to other entities\n if (entityFilter && !entityFilter(entity)) {\n continue;\n }\n for (const rel of entity.relations) {\n if (\n includeRelation(rel.type) &&\n (!kinds ||\n kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLowerCase()}:`),\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 requestEntities([...expectedEntities]);\n }, [\n entities,\n rootEntityRefs,\n maxDepth,\n includeRelation,\n kinds,\n entityFilter,\n requestEntities,\n ]);\n\n const filteredEntities = useMemo(() => {\n if (loading) {\n return {};\n }\n\n return entityFilter\n ? pickBy(entities, (value, _key) => entityFilter(value))\n : entities;\n }, [loading, entities, entityFilter]);\n\n return {\n entities: filteredEntities,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AA0BO,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K,CAAA,IAAA,KACT,IAAI,SAAA,CAAU,UAAA,CAAW,GAAG,IAAA,CAAK,WAAA,EAAa,CAAA,CAAA,CAAG;AAAA,aACnD,CAAA,EACF;AACA,cAAA,IAAI,CAAC,mBAAA,CAAoB,GAAA,CAAI,GAAA,CAAI,SAAS,CAAA,EAAG;AAC3C,gBAAA,iBAAA,CAAkB,IAAA,CAAK,IAAI,SAAS,CAAA;AACpC,gBAAA,gBAAA,CAAiB,GAAA,CAAI,IAAI,SAAS,CAAA;AAAA,cACpC;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAEA,MAAA,EAAE,KAAA;AAAA,IACJ;AACA,IAAA,eAAA,CAAgB,CAAC,GAAG,gBAAgB,CAAC,CAAA;AAAA,EACvC,CAAA,EAAG;AAAA,IACD,QAAA;AAAA,IACA,cAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,MAAM,gBAAA,GAAmB,QAAQ,MAAM;AACrC,IAAA,IAAI,OAAA,EAAS;AACX,MAAA,OAAO,EAAC;AAAA,IACV;AAEA,IAAA,OAAO,YAAA,GACH,OAAO,QAAA,EAAU,CAAC,OAAO,IAAA,KAAS,YAAA,CAAa,KAAK,CAAC,CAAA,GACrD,QAAA;AAAA,EACN,CAAA,EAAG,CAAC,OAAA,EAAS,QAAA,EAAU,YAAY,CAAC,CAAA;AAEpC,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,gBAAA;AAAA,IACV,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"useEntityRelationGraph.esm.js","sources":["../../../src/components/EntityRelationsGraph/useEntityRelationGraph.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 { Entity } from '@backstage/catalog-model';\nimport { useEffect, useMemo } from 'react';\nimport { useEntityStore } from './useEntityStore';\nimport { pickBy } from 'lodash';\nimport { useRelations } from '../../hooks/useRelations';\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: {\n maxDepth = Number.POSITIVE_INFINITY,\n relations,\n kinds,\n entityFilter,\n } = {},\n}: {\n rootEntityRefs: string[];\n filter?: {\n maxDepth?: number;\n relations?: string[];\n kinds?: string[];\n entityFilter?: (entity: Entity) => boolean;\n };\n}): {\n entities?: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n} {\n const { entities, loading, error, requestEntities } = useEntityStore();\n const { includeRelation } = useRelations({ relations });\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 // If the entity is filtered out then no need to check any\n // of its outgoing relationships to other entities\n if (entityFilter && !entityFilter(entity)) {\n continue;\n }\n for (const rel of entity.relations) {\n if (\n includeRelation(rel.type) &&\n (!kinds ||\n kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLowerCase()}:`),\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 requestEntities([...expectedEntities]);\n }, [\n entities,\n rootEntityRefs,\n maxDepth,\n includeRelation,\n kinds,\n entityFilter,\n requestEntities,\n ]);\n\n const filteredEntities = useMemo(() => {\n if (loading) {\n return {};\n }\n\n return entityFilter\n ? pickBy(entities, (value, _key) => entityFilter(value))\n : entities;\n }, [loading, entities, entityFilter]);\n\n return {\n entities: filteredEntities,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AA0BO,SAAS,sBAAA,CAAuB;AAAA,EACrC,cAAA;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,WAAW,MAAA,CAAO,iBAAA;AAAA,IAClB,SAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,MACE;AACN,CAAA,EAYE;AACA,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,EAAO,eAAA,KAAoB,cAAA,EAAe;AACrE,EAAA,MAAM,EAAE,eAAA,EAAgB,GAAI,YAAA,CAAa,EAAE,WAAW,CAAA;AAEtD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,mCAAmB,IAAI,GAAA,CAAI,CAAC,GAAG,cAAc,CAAC,CAAA;AACpD,IAAA,MAAM,mBAAA,uBAA0B,GAAA,EAAY;AAE5C,IAAA,IAAI,iBAAA,GAAoB,CAAC,GAAG,cAAc,CAAA;AAC1C,IAAA,IAAI,KAAA,GAAQ,CAAA;AAEZ,IAAA,OACE,iBAAA,CAAkB,SAAS,CAAA,KAC1B,CAAC,SAAS,QAAQ,CAAA,IAAK,QAAQ,QAAA,CAAA,EAChC;AACA,MAAA,MAAM,cAAA,GAAiB,iBAAA;AACvB,MAAA,iBAAA,GAAoB,EAAC;AAErB,MAAA,OAAO,cAAA,CAAe,SAAS,CAAA,EAAG;AAChC,QAAA,MAAM,SAAA,GAAY,eAAe,KAAA,EAAM;AACvC,QAAA,MAAM,MAAA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EAAS,QAAA,EAAU,YAAY,CAAC,CAAA;AAEpC,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,gBAAA;AAAA,IACV,OAAA;AAAA,IACA;AAAA,GACF;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityRelationNodesAndEdges.esm.js","sources":["../../../src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.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 { MouseEvent, useState } from 'react';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport { RelationPairs } from '../../lib/types';\nimport { EntityEdge, EntityNode } from '../../lib/types';\nimport { useEntityRelationGraph } from './useEntityRelationGraph';\nimport { Entity, DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { useRelations } from '../../hooks/useRelations';\nimport { buildGraph } from '../../lib/graph';\nimport {\n BuiltInTransformations,\n builtInTransformations,\n GraphTransformer,\n TransformationContext,\n} from '../../lib/graph-transformations';\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 entityFilter,\n onNodeClick,\n relationPairs: incomingRelationPairs,\n}: {\n rootEntityRefs: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n entityFilter?: (entity: Entity) => boolean;\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 entityFilter,\n },\n });\n\n const { relationPairs, includeRelation } = useRelations({\n relations,\n relationPairs: incomingRelationPairs,\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 = buildGraph({\n rootEntityRefs,\n entities,\n includeRelation,\n kinds,\n mergeRelations,\n relationPairs,\n unidirectional,\n });\n\n const transformationContext: TransformationContext = {\n nodeDistances: new Map(),\n edges,\n nodes,\n\n rootEntityRefs,\n unidirectional,\n maxDepth,\n };\n\n const runTransformation = (\n transformation: BuiltInTransformations | GraphTransformer,\n ) => {\n if (typeof transformation === 'function') {\n transformation(transformationContext);\n } else {\n builtInTransformations[transformation](transformationContext);\n }\n };\n\n runTransformation('reduce-edges');\n runTransformation('set-distances');\n if (unidirectional) {\n runTransformation('strip-distant-edges');\n }\n if (mergeRelations || unidirectional) {\n // Merge relations even if only unidirectional, the next transformer\n // 'remove-backward-edges' needs to know about all relations before it\n // strips away the backward ones\n runTransformation('merge-relations');\n }\n if (unidirectional && !mergeRelations) {\n runTransformation('order-forward');\n runTransformation('remove-backward-edges');\n }\n\n setNodesAndEdges({\n nodes: transformationContext.nodes,\n edges: transformationContext.edges,\n });\n },\n 100,\n [\n maxDepth,\n entities,\n rootEntityRefs,\n kinds,\n includeRelation,\n unidirectional,\n mergeRelations,\n onNodeClick,\n relationPairs,\n ],\n );\n\n return {\n loading,\n error,\n ...nodesAndEdges,\n };\n}\n"],"names":[],"mappings":";;;;;;;;AAiCO,SAAS,8BAAA,CAA+B;AAAA,EAC7C,cAAA;AAAA,EACA,WAAW,MAAA,CAAO,iBAAA;AAAA,EAClB,cAAA,GAAiB,IAAA;AAAA,EACjB,cAAA,GAAiB,IAAA;AAAA,EACjB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA,EAAe;AACjB,CAAA,EAeE;AACA,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,QAAA,CAGvC,EAAE,CAAA;AACL,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,KAAU,sBAAA,CAAuB;AAAA,IAC1D,cAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,QAAA;AAAA,MACA,KAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA;AACF,GACD,CAAA;AAED,EAAA,MAAM,EAAE,aAAA,EAAe,eAAA,EAAgB,GAAI,YAAA,CAAa;AAAA,IACtD,SAAA;AAAA,IACA,aAAA,EAAe;AAAA,GAChB,CAAA;AAED,EAAA,WAAA;AAAA,IACE,MAAM;AACJ,MAAA,IAAI,CAAC,QAAA,IAAY,MAAA,CAAO,KAAK,QAAQ,CAAA,CAAE,WAAW,CAAA,EAAG;AACnD,QAAA,gBAAA,CAAiB,EAAE,CAAA;AACnB,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,OAAA,CAAQ,QAAQ,CAAA,CAAE,IAAI,CAAC,CAAC,SAAA,EAAW,MAAM,CAAA,KAAM;AAClE,QAAA,MAAM,OAAA,GAAU,cAAA,CAAe,QAAA,CAAS,SAAS,CAAA;AACjD,QAA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AClB,QAAA,iBAAA,CAAkB,qBAAqB,CAAA;AAAA,MACzC;AACA,MAAA,IAAI,kBAAkB,cAAA,EAAgB;AAIpC,QAAA,iBAAA,CAAkB,iBAAiB,CAAA;AAAA,MACrC;AACA,MAAA,IAAI,cAAA,IAAkB,CAAC,cAAA,EAAgB;AACrC,QAAA,iBAAA,CAAkB,eAAe,CAAA;AACjC,QAAA,iBAAA,CAAkB,uBAAuB,CAAA;AAAA,MAC3C;AAEA,MAAA,gBAAA,CAAiB;AAAA,QACf,OAAO,qBAAA,CAAsB,KAAA;AAAA,QAC7B,OAAO,qBAAA,CAAsB;AAAA,OAC9B,CAAA;AAAA,IACH,CAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,MACE,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA,KAAA;AAAA,MACA,eAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAG;AAAA,GACL;AACF;;;;"}
1
+ {"version":3,"file":"useEntityRelationNodesAndEdges.esm.js","sources":["../../../src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.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 { MouseEvent, useState } from 'react';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport { RelationPairs } from '../../lib/types';\nimport { EntityEdge, EntityNode } from '../../lib/types';\nimport { useEntityRelationGraph } from './useEntityRelationGraph';\nimport { Entity, DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { useRelations } from '../../hooks/useRelations';\nimport { buildGraph } from '../../lib/graph';\nimport {\n BuiltInTransformations,\n builtInTransformations,\n GraphTransformer,\n TransformationContext,\n} from '../../lib/graph-transformations';\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 entityFilter,\n onNodeClick,\n relationPairs: incomingRelationPairs,\n}: {\n rootEntityRefs: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n entityFilter?: (entity: Entity) => boolean;\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 entityFilter,\n },\n });\n\n const { relationPairs, includeRelation } = useRelations({\n relations,\n relationPairs: incomingRelationPairs,\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 = buildGraph({\n rootEntityRefs,\n entities,\n includeRelation,\n kinds,\n mergeRelations,\n relationPairs,\n unidirectional,\n });\n\n const transformationContext: TransformationContext = {\n nodeDistances: new Map(),\n edges,\n nodes,\n\n rootEntityRefs,\n unidirectional,\n maxDepth,\n };\n\n const runTransformation = (\n transformation: BuiltInTransformations | GraphTransformer,\n ) => {\n if (typeof transformation === 'function') {\n transformation(transformationContext);\n } else {\n builtInTransformations[transformation](transformationContext);\n }\n };\n\n runTransformation('reduce-edges');\n runTransformation('set-distances');\n if (unidirectional) {\n runTransformation('strip-distant-edges');\n }\n if (mergeRelations || unidirectional) {\n // Merge relations even if only unidirectional, the next transformer\n // 'remove-backward-edges' needs to know about all relations before it\n // strips away the backward ones\n runTransformation('merge-relations');\n }\n if (unidirectional && !mergeRelations) {\n runTransformation('order-forward');\n runTransformation('remove-backward-edges');\n }\n\n setNodesAndEdges({\n nodes: transformationContext.nodes,\n edges: transformationContext.edges,\n });\n },\n 100,\n [\n maxDepth,\n entities,\n rootEntityRefs,\n kinds,\n includeRelation,\n unidirectional,\n mergeRelations,\n onNodeClick,\n relationPairs,\n ],\n );\n\n return {\n loading,\n error,\n ...nodesAndEdges,\n };\n}\n"],"names":[],"mappings":";;;;;;;;AAiCO,SAAS,8BAAA,CAA+B;AAAA,EAC7C,cAAA;AAAA,EACA,WAAW,MAAA,CAAO,iBAAA;AAAA,EAClB,cAAA,GAAiB,IAAA;AAAA,EACjB,cAAA,GAAiB,IAAA;AAAA,EACjB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA,EAAe;AACjB,CAAA,EAeE;AACA,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,QAAA,CAGvC,EAAE,CAAA;AACL,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,KAAU,sBAAA,CAAuB;AAAA,IAC1D,cAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,QAAA;AAAA,MACA,KAAA;AAAA,M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AAA,GACL;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityStore.esm.js","sources":["../../../src/components/EntityRelationsGraph/useEntityStore.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 { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { 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: (entityRefs: string[]) => void;\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"],"names":[],"mappings":";;;;;;AA2BO,SAAS,cAAA,GAKd;AACA,EAAA,MAAM,aAAA,GAAgB,OAAO,aAAa,CAAA;AAC1C,EAAA,MAAM,QAAQ,MAAA,CAAO;AAAA,IACnB,iBAAA,sBAAuB,GAAA,EAAY;AAAA,IACnC,mBAAA,sBAAyB,GAAA,EAAyC;AAAA,IAClE,cAAA,sBAAoB,GAAA;AAAoB,GACzC,CAAA;AACD,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,QAAA,CAE7B,EAAE,CAAA;AAEL,EAAA,MAAM,cAAA,GAAiB,YAAY,MAAM;AACvC,IAAA,MAAM,EAAE,cAAA,EAAgB,iBAAA,EAAkB,GAAI,KAAA,CAAM,OAAA;AACpD,IAAA,MAAM,mBAA8C,EAAC;AACrD,IAAA,iBAAA,CAAkB,QAAQ,CAAA,SAAA,KAAa;AACrC,MAAA,MAAM,MAAA,GAAS,cAAA,CAAe,GAAA,CAAI,SAAS,CAAA;AAE3C,MAAA,IAAI,MAAA,EAAQ;AACV,QAAA,gBAAA,CAAiB,SAAS,CAAA,GAAI,MAAA;AAAA,MAChC;AAAA,IACF,CAAC,CAAA;AACD,IAAA,WAAA,CAAY,gBAAgB,CAAA;AAAA,EAC9B,CAAA,EAAG,CA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AC,CAAA,EACjD;AACA,QAAA,KAAA,CAAM,QAAQ,iBAAA,GAAoB,CAAA;AAClC,QAAA,KAAA,EAAM;AACN,QAAA,cAAA,EAAe;AAAA,MACjB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,KAAA,EAAO,KAAA,EAAO,cAAc;AAAA,GAC/B;AAEA,EAAA,OAAO;AAAA,IACL,QAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"useEntityStore.esm.js","sources":["../../../src/components/EntityRelationsGraph/useEntityStore.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 { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { 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: (entityRefs: string[]) => void;\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"],"names":[],"mappings":";;;;;;AA2BO,SAAS,cAAA,GAKd;AACA,EAAA,MAAM,aAAA,GAAgB,OAAO,aAAa,CAAA;AAC1C,EAAA,MAAM,QAAQ,MAAA,CAAO;AAAA,IACnB,iBAAA,sBAAuB,GAAA,EAAY;AAAA,IACnC,mBAAA,sBAAyB,GAAA,EAAyC;AAAA,IAClE,cAAA,sBAAoB,GAAA;AAAoB,GACzC,CAAA;AACD,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,QAAA,CAE7B,EAAE,CAAA;AAEL,EAAA,MAAM,cAAA,GAAiB,YAAY,MAAM;AACvC,IAAA,MAAM,EAAE,cAAA,EAAgB,iBAAA,EAAkB,GAAI,KAAA,CAAM,OAAA;AACpD,IAAA,MAAM,mBAA8C,EAAC;AACrD,IAAA,iBAAA,CAAkB,Q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,CAAA,GAAI,IAAI,GAAA,CAAI,UAAU,CAAA;AAC5B,MAAA,MAAM,EAAE,iBAAA,EAAkB,GAAI,KAAA,CAAM,OAAA;AAEpC,MAAA,IACE,CAAA,CAAE,IAAA,KAAS,iBAAA,CAAkB,IAAA,IAC7B,MAAM,IAAA,CAAK,CAAC,CAAA,CAAE,IAAA,CAAK,OAAK,CAAC,iBAAA,CAAkB,GAAA,CAAI,CAAC,CAAC,CAAA,EACjD;AACA,QAAA,KAAA,CAAM,QAAQ,iBAAA,GAAoB,CAAA;AAClC,QAAA,KAAA,EAAM;AACN,QAAA,cAAA,EAAe;AAAA,MACjB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,KAAA,EAAO,KAAA,EAAO,cAAc;AAAA,GAC/B;AAEA,EAAA,OAAO;AAAA,IACL,QAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.esm.js","sources":["../src/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { catalogGraphPlugin } from './plugin';\nimport { catalogGraphRouteRef } from './routes';\n\n/**\n * A card that displays the directly related entities to the current entity.\n *\n * @public\n */\nexport const EntityCatalogGraphCard = catalogGraphPlugin.provide(\n createComponentExtension({\n name: 'EntityCatalogGraphCard',\n component: {\n lazy: () =>\n import('./components/CatalogGraphCard').then(m => m.CatalogGraphCard),\n },\n }),\n);\n\n/**\n * A standalone page that can be added to your application providing a viewer\n * for your entities and their relations.\n *\n * @public\n */\nexport const CatalogGraphPage = catalogGraphPlugin.provide(\n createRoutableExtension({\n name: 'CatalogGraphPage',\n component: () =>\n import('./components/CatalogGraphPage').then(m => m.CatalogGraphPage),\n mountPoint: catalogGraphRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;AA2BO,MAAM,yBAAyB,kBAAA,CAAmB,OAAA;AAAA,EACvD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,wBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,4CAA+B,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,gBAAgB;AAAA;AACxE,GACD;AACH;AAQO,MAAM,mBAAmB,kBAAA,CAAmB,OAAA;AAAA,EACjD,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,kBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,4CAA+B,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAA,EAAY;AAAA,GACb;AACH;;;;"}
1
+ {"version":3,"file":"extensions.esm.js","sources":["../src/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { catalogGraphPlugin } from './plugin';\nimport { catalogGraphRouteRef } from './routes';\n\n/**\n * A card that displays the directly related entities to the current entity.\n *\n * @public\n */\nexport const EntityCatalogGraphCard = catalogGraphPlugin.provide(\n createComponentExtension({\n name: 'EntityCatalogGraphCard',\n component: {\n lazy: () =>\n import('./components/CatalogGraphCard').then(m => m.CatalogGraphCard),\n },\n }),\n);\n\n/**\n * A standalone page that can be added to your application providing a viewer\n * for your entities and their relations.\n *\n * @public\n */\nexport const CatalogGraphPage = catalogGraphPlugin.provide(\n createRoutableExtension({\n name: 'CatalogGraphPage',\n component: () =>\n import('./components/CatalogGraphPage').then(m => m.CatalogGraphPage),\n mountPoint: catalogGraphRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;AA2BO,MAAM,yBAAyB,kBAAA,CAAmB,OAAA;AAAA,EACvD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,wBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,4CAA+B,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,gBAAgB;AAAA;AACxE,GACD;AACH;AAQO,MAAM,mBAAmB,kBAAA,CAAmB,OAAA;AAAA,EACjD,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,kBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,4CAA+B,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAA,EAAY;AAAA,GACb;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRelations.esm.js","sources":["../../src/hooks/useRelations.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { useCallback, useMemo } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { catalogGraphApiRef } from '../api';\nimport { RelationPairs } from '../lib/types';\n\nexport interface UseRelationsOptions {\n relations?: string[];\n relationPairs?: RelationPairs;\n}\n\nexport interface UseRelationsResult {\n relations: string[];\n relationPairs: RelationPairs;\n defaultRelations: string[];\n relationsToInclude: string[];\n includeRelation: (type: string) => boolean;\n}\n\n/**\n * Given an optional list of specific relations and/or relation pairs,\n * this hook returns the relations, relation pairs and default relations (to\n * show/select), falling back to the configured setting.\n * It also returns a function `includeRelation` to filter whether a relation\n * should be included or not.\n */\nexport function useRelations(\n opts: UseRelationsOptions = {},\n): UseRelationsResult {\n const { knownRelations, knownRelationPairs, defaultRelations } =\n useApi(catalogGraphApiRef);\n\n const relations = opts.relations ?? knownRelations;\n const relationPairs = opts.relationPairs ?? knownRelationPairs;\n const relationsToInclude = opts.relations ?? defaultRelations;\n\n const includeRelation = useCallback(\n (type: string) => {\n return relationsToInclude.includes(type);\n },\n [relationsToInclude],\n );\n\n return useMemo(\n () => ({\n relations,\n relationPairs,\n defaultRelations,\n relationsToInclude,\n includeRelation,\n }),\n [\n relations,\n relationPairs,\n defaultRelations,\n relationsToInclude,\n includeRelation,\n ],\n );\n}\n"],"names":[],"mappings":";;;;;AA2CO,SAAS,YAAA,CACd,IAAA,GAA4B,EAAC,EACT;AACpB,EAAA,MAAM,EAAE,cAAA,EAAgB,kBAAA,EAAoB,gBAAA,EAAiB,GAC3D,OAAO,kBAAkB,CAAA;AAE3B,EAAA,MAAM,SAAA,GAAY,KAAK,SAAA,IAAa,cAAA;AACpC,EAAA,MAAM,aAAA,GAAgB,KAAK,aAAA,IAAiB,kBAAA;AAC5C,EAAA,MAAM,kBAAA,GAAqB,KAAK,SAAA,IAAa,gBAAA;AAE7C,EAAA,MAAM,eAAA,GAAkB,WAAA;AAAA,IACtB,CAAC,IAAA,KAAiB;AAChB,MAAA,OAAO,kBAAA,CAAmB,SAAS,IAAI,CAAA;AAAA,IACzC,CAAA;AAAA,IACA,CAAC,kBAAkB;AAAA,GACrB;AAEA,EAAA,OAAO,OAAA;AAAA,IACL,OAAO;AAAA,MACL,SAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAA;AAAA,MACA,kBAAA;AAAA,MACA;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,SAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAA;AAAA,MACA,kBAAA;AAAA,MACA;AAAA;AACF,GACF;AACF;;;;"}
1
+ {"version":3,"file":"useRelations.esm.js","sources":["../../src/hooks/useRelations.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { useCallback, useMemo } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { catalogGraphApiRef } from '../api';\nimport { RelationPairs } from '../lib/types';\n\nexport interface UseRelationsOptions {\n relations?: string[];\n relationPairs?: RelationPairs;\n}\n\nexport interface UseRelationsResult {\n relations: string[];\n relationPairs: RelationPairs;\n defaultRelations: string[];\n relationsToInclude: string[];\n includeRelation: (type: string) => boolean;\n}\n\n/**\n * Given an optional list of specific relations and/or relation pairs,\n * this hook returns the relations, relation pairs and default relations (to\n * show/select), falling back to the configured setting.\n * It also returns a function `includeRelation` to filter whether a relation\n * should be included or not.\n */\nexport function useRelations(\n opts: UseRelationsOptions = {},\n): UseRelationsResult {\n const { knownRelations, knownRelationPairs, defaultRelations } =\n useApi(catalogGraphApiRef);\n\n const relations = opts.relations ?? knownRelations;\n const relationPairs = opts.relationPairs ?? knownRelationPairs;\n const relationsToInclude = opts.relations ?? defaultRelations;\n\n const includeRelation = useCallback(\n (type: string) => {\n return relationsToInclude.includes(type);\n },\n [relationsToInclude],\n );\n\n return useMemo(\n () => ({\n relations,\n relationPairs,\n defaultRelations,\n relationsToInclude,\n includeRelation,\n }),\n [\n relations,\n relationPairs,\n defaultRelations,\n relationsToInclude,\n includeRelation,\n ],\n );\n}\n"],"names":[],"mappings":";;;;;AA2CO,SAAS,YAAA,CACd,IAAA,GAA4B,EAAC,EACT;AACpB,EAAA,MAAM,EAAE,cAAA,EAAgB,kBAAA,EAAoB,gBAAA,EAAiB,GAC3D,OAAO,kBAAkB,CAAA;AAE3B,EAAA,MAAM,SAAA,GAAY,KAAK,SAAA,IAAa,cAAA;AACpC,EAAA,MAAM,aAAA,GAAgB,KAAK,aAAA,IAAiB,kBAAA;AAC5C,EAAA,MAAM,kBAAA,GAAqB,KAAK,SAAA,IAAa,gBAAA;AAE7C,EAAA,MAAM,eAAA,GAAkB,WAAA;AAAA,IACtB,CAAC,IAAA,KAAiB;AAChB,MAAA,OAAO,kBAAA,CAAmB,SAAS,IAAI,CAAA;AAAA,IACzC,CAAA;AAAA,IACA,CAAC,kBAAkB;AAAA,GACrB;AAEA,EAAA,OAAO,OAAA;AAAA,IACL,OAAO;AAAA,MACL,SAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAA;AAAA,MACA,kBAAA;AAAA,MACA;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,SAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAA;AAAA,MACA,kBAAA;AAAA,MACA;AAAA;AACF,GACF;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-graph.esm.js","sources":["../../../src/lib/graph/build-graph.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { Entity } from '@backstage/catalog-model';\n\nimport type { EntityEdge, RelationPairs } from '../types';\n\nexport interface BuildGraphOptions {\n rootEntityRefs: readonly string[];\n entities: {\n [ref: string]: Entity;\n };\n includeRelation: (type: string) => boolean;\n kinds: readonly string[] | undefined;\n mergeRelations: boolean;\n relationPairs: RelationPairs;\n unidirectional: boolean;\n}\n\nexport function buildGraph({\n rootEntityRefs,\n entities,\n includeRelation,\n kinds,\n mergeRelations,\n relationPairs,\n unidirectional,\n}: BuildGraphOptions): EntityEdge[] {\n const edges: EntityEdge[] = [];\n const visitedNodes = new Set<string>();\n const nodeQueue = [...rootEntityRefs];\n\n const hasEdge = (\n fromRef: string,\n toRef: string,\n relation: [string, string?],\n ): boolean => {\n return edges.some(\n edge =>\n fromRef === edge.from &&\n toRef === edge.to &&\n edge.relations.some(\n rel => rel[0] === relation[0] && rel[1] === relation[1],\n ),\n );\n };\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 (!includeRelation(rel.type)) {\n return;\n }\n\n if (\n kinds &&\n !kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLowerCase()}:`),\n )\n ) {\n return;\n }\n\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 const from = left === rel.type ? entityRef : rel.targetRef;\n const to = left === rel.type ? rel.targetRef : entityRef;\n if (!unidirectional || !hasEdge(from, to, pair)) {\n edges.push({\n from,\n to,\n relations: pair,\n label: 'visible',\n });\n }\n } else {\n if (\n !unidirectional ||\n !hasEdge(entityRef, rel.targetRef, [rel.type])\n ) {\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 // if unidirectional add missing relations as entities are only visited once\n if (unidirectional) {\n const findIndex = edges.findIndex(\n edge =>\n entityRef === edge.from &&\n rel.targetRef === edge.to &&\n !edge.relations.includes(rel.type),\n );\n if (findIndex >= 0) {\n if (mergeRelations) {\n const pair = relationPairs.find(\n ([l, r]) => l === rel.type || r === rel.type,\n ) ?? [rel.type];\n edges[findIndex].relations = [\n ...edges[findIndex].relations,\n ...pair,\n ];\n } else {\n edges[findIndex].relations = [\n ...edges[findIndex].relations,\n rel.type,\n ];\n }\n }\n }\n });\n }\n }\n\n return edges;\n}\n"],"names":[],"mappings":"AAgCO,SAAS,UAAA,CAAW;AAAA,EACzB,cAAA;AAAA,EACA,QAAA;AAAA,EACA,eAAA;AAAA,EACA,KAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,EAAoC;AAClC,EAAA,MAAM,QAAsB,EAAC;AAC7B,EAAA,MAAM,YAAA,uBAAmB,GAAA,EAAY;AACrC,EAAA,MAAM,SAAA,GAAY,CAAC,GAAG,cAAc,CAAA;AAEpC,EAAA,MAAM,OAAA,GAAU,CACd,OAAA,EACA,KAAA,EACA,QAAA,KACY;AACZ,IAAA,OAAO,KAAA,CAAM,IAAA;AAAA,MACX,CAAA,IAAA,KACE,YAAY,IAAA,CAAK,IAAA,IACjB,UAAU,IAAA,CAAK,EAAA,IACf,KAAK,SAAA,CAAU,IAAA;AAAA,QACb,CAAA,GAAA,KAAO,GAAA,CAAI,CAAC,CAAA,KAAM,QAAA,CAAS,CAAC,CAAA,IAAK,GAAA,CAAI,CAAC,CAAA,KAAM,QAAA,CAAS,CAAC;AAAA;AACxD,KACJ;AAAA,EACF,CAAA;AAEA,EAAA,OAAO,SAA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E,SAAA,GAAY;AAAA,gBAC3B,GAAG,KAAA,CAAM,SAAS,CAAA,CAAE,SAAA;AAAA,gBACpB,GAAG;AAAA,eACL;AAAA,YACF,CAAA,MAAO;AACL,cAAA,KAAA,CAAM,SAAS,EAAE,SAAA,GAAY;AAAA,gBAC3B,GAAG,KAAA,CAAM,SAAS,CAAA,CAAE,SAAA;AAAA,gBACpB,GAAA,CAAI;AAAA,eACN;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,EACF;AAEA,EAAA,OAAO,KAAA;AACT;;;;"}
1
+ {"version":3,"file":"build-graph.esm.js","sources":["../../../src/lib/graph/build-graph.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { Entity } from '@backstage/catalog-model';\n\nimport type { EntityEdge, RelationPairs } from '../types';\n\nexport interface BuildGraphOptions {\n rootEntityRefs: readonly string[];\n entities: {\n [ref: string]: Entity;\n };\n includeRelation: (type: string) => boolean;\n kinds: readonly string[] | undefined;\n mergeRelations: boolean;\n relationPairs: RelationPairs;\n unidirectional: boolean;\n}\n\nexport function buildGraph({\n rootEntityRefs,\n entities,\n includeRelation,\n kinds,\n mergeRelations,\n relationPairs,\n unidirectional,\n}: BuildGraphOptions): EntityEdge[] {\n const edges: EntityEdge[] = [];\n const visitedNodes = new Set<string>();\n const nodeQueue = [...rootEntityRefs];\n\n const hasEdge = (\n fromRef: string,\n toRef: string,\n relation: [string, string?],\n ): boolean => {\n return edges.some(\n edge =>\n fromRef === edge.from &&\n toRef === edge.to &&\n edge.relations.some(\n rel => rel[0] === relation[0] && rel[1] === relation[1],\n ),\n );\n };\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 (!includeRelation(rel.type)) {\n return;\n }\n\n if (\n kinds &&\n !kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLowerCase()}:`),\n )\n ) {\n return;\n }\n\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 const from = left === rel.type ? entityRef : rel.targetRef;\n const to = left === rel.type ? rel.targetRef : entityRef;\n if (!unidirectional || !hasEdge(from, to, pair)) {\n edges.push({\n from,\n to,\n relations: pair,\n label: 'visible',\n });\n }\n } else {\n if (\n !unidirectional ||\n !hasEdge(entityRef, rel.targetRef, [rel.type])\n ) {\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 // if unidirectional add missing relations as entities are only visited once\n if (unidirectional) {\n const findIndex = edges.findIndex(\n edge =>\n entityRef === edge.from &&\n rel.targetRef === edge.to &&\n !edge.relations.includes(rel.type),\n );\n if (findIndex >= 0) {\n if (mergeRelations) {\n const pair = relationPairs.find(\n ([l, r]) => l === rel.type || r === rel.type,\n ) ?? [rel.type];\n edges[findIndex].relations = [\n ...edges[findIndex].relations,\n ...pair,\n ];\n } else {\n edges[findIndex].relations = [\n ...edges[findIndex].relations,\n rel.type,\n ];\n }\n }\n }\n });\n }\n }\n\n return edges;\n}\n"],"names":[],"mappings":"AAgCO,SAAS,UAAA,CAAW;AAAA,EACzB,cAAA;AAAA,EACA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AAK,IAAI,SAAS,CAAA;AAC5B,UAAA,YAAA,CAAa,GAAA,CAAI,IAAI,SAAS,CAAA;AAAA,QAChC;AAGA,QAAA,IAAI,cAAA,EAAgB;AAClB,UAAA,MAAM,YAAY,KAAA,CAAM,SAAA;AAAA,YACtB,CAAA,IAAA,KACE,SAAA,KAAc,IAAA,CAAK,IAAA,IACnB,GAAA,CAAI,SAAA,KAAc,IAAA,CAAK,EAAA,IACvB,CAAC,IAAA,CAAK,SAAA,CAAU,QAAA,CAAS,IAAI,IAAI;AAAA,WACrC;AACA,UAAA,IAAI,aAAa,CAAA,EAAG;AAClB,YAAA,IAAI,cAAA,EAAgB;AAClB,cAAA,MAAM,OAAO,aAAA,CAAc,IAAA;AAAA,gBACzB,CAAC,CAAC,CAAA,EAAG,CAAC,MAAM,CAAA,KAAM,GAAA,CAAI,IAAA,IAAQ,CAAA,KAAM,GAAA,CAAI;AAAA,eAC1C,IAAK,CAAC,GAAA,CAAI,IAAI,CAAA;AACd,cAAA,KAAA,CAAM,SAAS,EAAE,SAAA,GAAY;AAAA,gBAC3B,GAAG,KAAA,CAAM,SAAS,CAAA,CAAE,SAAA;AAAA,gBACpB,GAAG;AAAA,eACL;AAAA,YACF,CAAA,MAAO;AACL,cAAA,KAAA,CAAM,SAAS,EAAE,SAAA,GAAY;AAAA,gBAC3B,GAAG,KAAA,CAAM,SAAS,CAAA,CAAE,SAAA;AAAA,gBACpB,GAAA,CAAI;AAAA,eACN;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,EACF;AAEA,EAAA,OAAO,KAAA;AACT;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/lib/graph-transformations/index.ts"],"sourcesContent":["/*\n * Copyright 2025 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\nexport type { GraphTransformer, TransformationContext } from './types';\n\nimport { reduceEdges } from './reduce-edges';\nimport { setDistances } from './set-distance';\nimport { orderForward } from './order-forward';\nimport { stripDistantEdges } from './strip-distant-edges';\nimport { mergeRelations } from './merge-relations';\nimport { removeBackwardEdges } from './remove-backward-edges';\n\nexport const builtInTransformations = {\n 'reduce-edges': reduceEdges,\n 'set-distances': setDistances,\n 'order-forward': orderForward,\n 'strip-distant-edges': stripDistantEdges,\n 'merge-relations': mergeRelations,\n 'remove-backward-edges': removeBackwardEdges,\n};\n\nexport type BuiltInTransformations = keyof typeof builtInTransformations;\n"],"names":[],"mappings":";;;;;;;AAyBO,MAAM,sBAAA,GAAyB;AAAA,EACpC,cAAA,EAAgB,WAAA;AAAA,EAChB,eAAA,EAAiB,YAAA;AAAA,EACjB,eAAA,EAAiB,YAAA;AAAA,EACjB,qBAAA,EAAuB,iBAAA;AAAA,EACvB,iBAAA,EAAmB,cAAA;AAAA,EACnB,uBAAA,EAAyB;AAC3B;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/lib/graph-transformations/index.ts"],"sourcesContent":["/*\n * Copyright 2025 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\nexport type { GraphTransformer, TransformationContext } from './types';\n\nimport { reduceEdges } from './reduce-edges';\nimport { setDistances } from './set-distance';\nimport { orderForward } from './order-forward';\nimport { stripDistantEdges } from './strip-distant-edges';\nimport { mergeRelations } from './merge-relations';\nimport { removeBackwardEdges } from './remove-backward-edges';\n\nexport const builtInTransformations = {\n 'reduce-edges': reduceEdges,\n 'set-distances': setDistances,\n 'order-forward': orderForward,\n 'strip-distant-edges': stripDistantEdges,\n 'merge-relations': mergeRelations,\n 'remove-backward-edges': removeBackwardEdges,\n};\n\nexport type BuiltInTransformations = keyof typeof builtInTransformations;\n"],"names":[],"mappings":";;;;;;;AAyBO,MAAM,sBAAA,GAAyB;AAAA,EACpC,cAAA,EAAgB,WAAA;AAAA,EAChB,eAAA,EAAiB,YAAA;AAAA,EACjB,eAAA,EAAiB,YAAA;AAAA,EACjB,qBAAA,EAAuB,iBAAA;AAAA,EACvB,iBAAA,EAAmB,cAAA;AAAA,EACnB,uBAAA,EAAyB;AAC3B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"merge-relations.esm.js","sources":["../../../src/lib/graph-transformations/merge-relations.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\nfunction concatRelations(\n a: readonly string[] | undefined,\n b: readonly string[] | undefined,\n): string[] {\n return Array.from(new Set<string>([...(a ?? []), ...(b ?? [])]));\n}\n\n/** Merge relations in multiple edges into one edge */\nexport const mergeRelations: GraphTransformer = options => {\n const mergedEdges = new Map<string, EntityEdge>();\n\n options.edges.forEach(edge => {\n const keyForward = `${edge.from}-${edge.to}`;\n const keyBackward = `${edge.to}-${edge.from}`;\n\n const edgeForward = mergedEdges.get(keyForward);\n const edgeBackward = mergedEdges.get(keyBackward);\n\n if (edgeForward) {\n edgeForward.relations = concatRelations(\n edgeForward.relations,\n edge.relations,\n );\n } else if (edgeBackward) {\n edgeBackward.relations = concatRelations(\n edgeBackward.relations,\n edge.relations,\n );\n } else {\n mergedEdges.set(keyForward, edge);\n }\n });\n\n options.edges = Array.from(mergedEdges.values());\n};\n"],"names":[],"mappings":"AAmBA,SAAS,eAAA,CACP,GACA,CAAA,EACU;AACV,EAAA,OAAO,KAAA,CAAM,IAAA,iBAAK,IAAI,GAAA,CAAY,CAAC,GAAI,CAAA,IAAK,EAAC,EAAI,GAAI,CAAA,IAAK,EAAG,CAAC,CAAC,CAAA;AACjE;AAGO,MAAM,iBAAmC,CAAA,OAAA,KAAW;AACzD,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAAwB;AAEhD,EAAA,OAAA,CAAQ,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AAC5B,IAAA,MAAM,aAAa,CAAA,EAAG,IAAA,CAAK,IAAI,CAAA,CAAA,EAAI,KAAK,EAAE,CAAA,CAAA;AAC1C,IAAA,MAAM,cAAc,CAAA,EAAG,IAAA,CAAK,EAAE,CAAA,CAAA,EAAI,KAAK,IAAI,CAAA,CAAA;AAE3C,IAAA,MAAM,WAAA,GAAc,WAAA,CAAY,GAAA,CAAI,UAAU,CAAA;AAC9C,IAAA,MAAM,YAAA,GAAe,WAAA,CAAY,GAAA,CAAI,WAAW,CAAA;AAEhD,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,WAAA,CAAY,SAAA,GAAY,eAAA;AAAA,QACtB,WAAA,CAAY,SAAA;AAAA,QACZ,IAAA,CAAK;AAAA,OACP;AAAA,IACF,WAAW,YAAA,EAAc;AACvB,MAAA,YAAA,CAAa,SAAA,GAAY,eAAA;AAAA,QACvB,YAAA,CAAa,SAAA;AAAA,QACb,IAAA,CAAK;AAAA,OACP;AAAA,IACF,CAAA,MAAO;AACL,MAAA,WAAA,CAAY,GAAA,CAAI,YAAY,IAAI,CAAA;AAAA,IAClC;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAA,CAAQ,KAAA,GAAQ,KAAA,CAAM,IAAA,CAAK,WAAA,CAAY,QAAQ,CAAA;AACjD;;;;"}
1
+ {"version":3,"file":"merge-relations.esm.js","sources":["../../../src/lib/graph-transformations/merge-relations.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\nfunction concatRelations(\n a: readonly string[] | undefined,\n b: readonly string[] | undefined,\n): string[] {\n return Array.from(new Set<string>([...(a ?? []), ...(b ?? [])]));\n}\n\n/** Merge relations in multiple edges into one edge */\nexport const mergeRelations: GraphTransformer = options => {\n const mergedEdges = new Map<string, EntityEdge>();\n\n options.edges.forEach(edge => {\n const keyForward = `${edge.from}-${edge.to}`;\n const keyBackward = `${edge.to}-${edge.from}`;\n\n const edgeForward = mergedEdges.get(keyForward);\n const edgeBackward = mergedEdges.get(keyBackward);\n\n if (edgeForward) {\n edgeForward.relations = concatRelations(\n edgeForward.relations,\n edge.relations,\n );\n } else if (edgeBackward) {\n edgeBackward.relations = concatRelations(\n edgeBackward.relations,\n edge.relations,\n );\n } else {\n mergedEdges.set(keyForward, edge);\n }\n });\n\n options.edges = Array.from(mergedEdges.values());\n};\n"],"names":[],"mappings":"AAmBA,SAAS,eAAA,CACP,GACA,CAAA,EACU;AACV,EAAA,OAAO,KAAA,CAAM,IAAA,iBAAK,IAAI,GAAA,CAAY,CAAC,GAAI,CAAA,IAAK,EAAC,EAAI,GAAI,CAAA,IAAK,EAAG,CAAC,CAAC,CAAA;AACjE;AAGO,MAAM,iBAAmC,CAAA,OAAA,KAAW;AACzD,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAAwB;AAEhD,EAAA,OAAA,CAAQ,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AAC5B,IAAA,MAAM,aAAa,CAAA,EAAG,IAAA,CAAK,IAAI,CAAA,CAAA,EAAI,KAAK,EAAE,CAAA,CAAA;AAC1C,IAAA,MAAM,cAAc,CAAA,EAAG,IAAA,CAAK,EAAE,CAAA,CAAA,EAAI,KAAK,IAAI,CAAA,CAAA;AAE3C,IAAA,MAAM,WAAA,GAAc,WAAA,CAAY,GAAA,CAAI,UAAU,CAAA;AAC9C,IAAA,MAAM,YAAA,GAAe,WAAA,CAAY,GAAA,CAAI,WAAW,CAAA;AAEhD,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,WAAA,CAAY,SAAA,GAAY,eAAA;AAAA,QACtB,WAAA,CAAY,SAAA;AAAA,QACZ,IAAA,CAAK;AAAA,OACP;AAAA,IACF,WAAW,YAAA,EAAc;AACvB,MAAA,YAAA,CAAa,SAAA,GAAY,eAAA;AAAA,QACvB,YAAA,CAAa,SAAA;AAAA,QACb,IAAA,CAAK;AAAA,OACP;AAAA,IACF,CAAA,MAAO;AACL,MAAA,WAAA,CAAY,GAAA,CAAI,YAAY,IAAI,CAAA;AAAA,IAClC;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAA,CAAQ,KAAA,GAAQ,KAAA,CAAM,IAAA,CAAK,WAAA,CAAY,QAAQ,CAAA;AACjD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"order-forward.esm.js","sources":["../../../src/lib/graph-transformations/order-forward.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/** Orders the edges direction so that the graph goes strictly forward */\nexport const orderForward: GraphTransformer = ({\n rootEntityRefs,\n nodes,\n edges,\n}) => {\n const entityEdges = new Map<string, EntityEdge[]>();\n edges.forEach(edge => {\n let fromEdges = entityEdges.get(edge.from);\n if (!fromEdges) {\n fromEdges = [];\n entityEdges.set(edge.from, fromEdges);\n }\n fromEdges.push(edge);\n\n let toEdges = entityEdges.get(edge.to);\n if (!toEdges) {\n toEdges = [];\n entityEdges.set(edge.to, toEdges);\n }\n toEdges.push(edge);\n });\n\n const visitedNodes = new Set<string>();\n\n for (const rootEntityRef of rootEntityRefs) {\n let currentNodes: string[] = [rootEntityRef].filter(\n node => !visitedNodes.has(node),\n );\n\n while (currentNodes.length > 0) {\n for (const currentNode of currentNodes) {\n visitedNodes.add(currentNode);\n }\n\n const nextNodes: string[] = [];\n\n currentNodes.forEach(node => {\n entityEdges.get(node)?.forEach(edge => {\n if (edge.to === node && !visitedNodes.has(edge.from)) {\n // Reverse direction\n const { from, to } = edge;\n edge.from = to;\n edge.to = from;\n edge.relations.reverse();\n }\n\n nextNodes.push(edge.from, edge.to);\n });\n });\n\n currentNodes = Array.from(new Set(nextNodes)).filter(\n node => !visitedNodes.has(node),\n );\n }\n }\n\n const nodeOrder = Array.from(visitedNodes);\n\n nodes.sort((a, b) => {\n const aOrder = nodeOrder.findIndex(node => node === a.id);\n const bOrder = nodeOrder.findIndex(node => node === b.id);\n return aOrder - bOrder;\n });\n};\n"],"names":[],"mappings":"AAoBO,MAAM,eAAiC,CAAC;AAAA,EAC7C,cAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,MAA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A,IAAQ,CAAC,aAAa,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA,EAAG;AAEpD,YAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,IAAA;AACrB,YAAA,IAAA,CAAK,IAAA,GAAO,EAAA;AACZ,YAAA,IAAA,CAAK,EAAA,GAAK,IAAA;AACV,YAAA,IAAA,CAAK,UAAU,OAAA,EAAQ;AAAA,UACzB;AAEA,UAAA,SAAA,CAAU,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,IAAA,CAAK,EAAE,CAAA;AAAA,QACnC,CAAC,CAAA;AAAA,MACH,CAAC,CAAA;AAED,MAAA,YAAA,GAAe,MAAM,IAAA,CAAK,IAAI,GAAA,CAAI,SAAS,CAAC,CAAA,CAAE,MAAA;AAAA,QAC5C,CAAA,IAAA,KAAQ,CAAC,YAAA,CAAa,GAAA,CAAI,IAAI;AAAA,OAChC;AAAA,IACF;AAAA,EACF;AAEA,EAAA,MAAM,SAAA,GAAY,KAAA,CAAM,IAAA,CAAK,YAAY,CAAA;AAEzC,EAAA,KAAA,CAAM,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAM;AACnB,IAAA,MAAM,SAAS,SAAA,CAAU,SAAA,CAAU,CAAA,IAAA,KAAQ,IAAA,KAAS,EAAE,EAAE,CAAA;AACxD,IAAA,MAAM,SAAS,SAAA,CAAU,SAAA,CAAU,CAAA,IAAA,KAAQ,IAAA,KAAS,EAAE,EAAE,CAAA;AACxD,IAAA,OAAO,MAAA,GAAS,MAAA;AAAA,EAClB,CAAC,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"order-forward.esm.js","sources":["../../../src/lib/graph-transformations/order-forward.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/** Orders the edges direction so that the graph goes strictly forward */\nexport const orderForward: GraphTransformer = ({\n rootEntityRefs,\n nodes,\n edges,\n}) => {\n const entityEdges = new Map<string, EntityEdge[]>();\n edges.forEach(edge => {\n let fromEdges = entityEdges.get(edge.from);\n if (!fromEdges) {\n fromEdges = [];\n entityEdges.set(edge.from, fromEdges);\n }\n fromEdges.push(edge);\n\n let toEdges = entityEdges.get(edge.to);\n if (!toEdges) {\n toEdges = [];\n entityEdges.set(edge.to, toEdges);\n }\n toEdges.push(edge);\n });\n\n const visitedNodes = new Set<string>();\n\n for (const rootEntityRef of rootEntityRefs) {\n let currentNodes: string[] = [rootEntityRef].filter(\n node => !visitedNodes.has(node),\n );\n\n while (currentNodes.length > 0) {\n for (const currentNode of currentNodes) {\n visitedNodes.add(currentNode);\n }\n\n const nextNodes: string[] = [];\n\n currentNodes.forEach(node => {\n entityEdges.get(node)?.forEach(edge => {\n if (edge.to === node && !visitedNodes.has(edge.from)) {\n // Reverse direction\n const { from, to } = edge;\n edge.from = to;\n edge.to = from;\n edge.relations.reverse();\n }\n\n nextNodes.push(edge.from, edge.to);\n });\n });\n\n currentNodes = Array.from(new Set(nextNodes)).filter(\n node => !visitedNodes.has(node),\n );\n }\n }\n\n const nodeOrder = Array.from(visitedNodes);\n\n nodes.sort((a, b) => {\n const aOrder = nodeOrder.findIndex(node => node === a.id);\n const bOrder = nodeOrder.findIndex(node => node === b.id);\n return aOrder - bOrder;\n });\n};\n"],"names":[],"mappings":"AAoBO,MAAM,eAAiC,CAAC;AAAA,EAC7C,cAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAA0B;AAClD,EAAA,KAAA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AAI,CAAA,EAAG;AAEpD,YAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,IAAA;AACrB,YAAA,IAAA,CAAK,IAAA,GAAO,EAAA;AACZ,YAAA,IAAA,CAAK,EAAA,GAAK,IAAA;AACV,YAAA,IAAA,CAAK,UAAU,OAAA,EAAQ;AAAA,UACzB;AAEA,UAAA,SAAA,CAAU,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,IAAA,CAAK,EAAE,CAAA;AAAA,QACnC,CAAC,CAAA;AAAA,MACH,CAAC,CAAA;AAED,MAAA,YAAA,GAAe,MAAM,IAAA,CAAK,IAAI,GAAA,CAAI,SAAS,CAAC,CAAA,CAAE,MAAA;AAAA,QAC5C,CAAA,IAAA,KAAQ,CAAC,YAAA,CAAa,GAAA,CAAI,IAAI;AAAA,OAChC;AAAA,IACF;AAAA,EACF;AAEA,EAAA,MAAM,SAAA,GAAY,KAAA,CAAM,IAAA,CAAK,YAAY,CAAA;AAEzC,EAAA,KAAA,CAAM,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAM;AACnB,IAAA,MAAM,SAAS,SAAA,CAAU,SAAA,CAAU,CAAA,IAAA,KAAQ,IAAA,KAAS,EAAE,EAAE,CAAA;AACxD,IAAA,MAAM,SAAS,SAAA,CAAU,SAAA,CAAU,CAAA,IAAA,KAAQ,IAAA,KAAS,EAAE,EAAE,CAAA;AACxD,IAAA,OAAO,MAAA,GAAS,MAAA;AAAA,EAClB,CAAC,CAAA;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"reduce-edges.esm.js","sources":["../../../src/lib/graph-transformations/reduce-edges.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/**\n * Reduce edges as the dependency graph anyway ignores duplicated edges\n * regarding from / to\n * Additionally, this will improve rendering speed for the dependency graph\n */\nexport const reduceEdges: GraphTransformer = ctx => {\n ctx.edges = ctx.edges.reduce((previousEdges, currentEdge) => {\n const indexFound = previousEdges.findIndex(\n previousEdge =>\n previousEdge.from === currentEdge.from &&\n previousEdge.to === currentEdge.to,\n );\n if (indexFound >= 0) {\n previousEdges[indexFound] = {\n ...previousEdges[indexFound],\n relations: Array.from(\n new Set([\n ...previousEdges[indexFound].relations,\n ...currentEdge.relations,\n ]),\n ),\n };\n return previousEdges;\n }\n return [...previousEdges, currentEdge];\n }, [] as EntityEdge[]);\n};\n"],"names":[],"mappings":"AAwBO,MAAM,cAAgC,CAAA,GAAA,KAAO;AAClD,EAAA,GAAA,CAAI,QAAQ,GAAA,CAAI,KAAA,CAAM,MAAA,CAAO,CAAC,eAAe,WAAA,KAAgB;AAC3D,IAAA,MAAM,aAAa,aAAA,CAAc,SAAA;AAAA,MAC/B,kBACE,YAAA,CAAa,IAAA,KAAS,YAAY,IAAA,IAClC,YAAA,CAAa,OAAO,WAAA,CAAY;AAAA,KACpC;AACA,IAAA,IAAI,cAAc,CAAA,EAAG;AACnB,MAAA,aAAA,CAAc,UAAU,CAAA,GAAI;AAAA,QAC1B,GAAG,cAAc,UAAU,CAAA;AAAA,QAC3B,WAAW,KAAA,CAAM,IAAA;AAAA,8BACX,GAAA,CAAI;AAAA,YACN,GAAG,aAAA,CAAc,UAAU,CAAA,CAAE,SAAA;AAAA,YAC7B,GAAG,WAAA,CAAY;AAAA,WAChB;AAAA;AACH,OACF;AACA,MAAA,OAAO,aAAA;AAAA,IACT;AACA,IAAA,OAAO,CAAC,GAAG,aAAA,EAAe,WAAW,CAAA;AAAA,EACvC,CAAA,EAAG,EAAkB,CAAA;AACvB;;;;"}
1
+ {"version":3,"file":"reduce-edges.esm.js","sources":["../../../src/lib/graph-transformations/reduce-edges.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/**\n * Reduce edges as the dependency graph anyway ignores duplicated edges\n * regarding from / to\n * Additionally, this will improve rendering speed for the dependency graph\n */\nexport const reduceEdges: GraphTransformer = ctx => {\n ctx.edges = ctx.edges.reduce((previousEdges, currentEdge) => {\n const indexFound = previousEdges.findIndex(\n previousEdge =>\n previousEdge.from === currentEdge.from &&\n previousEdge.to === currentEdge.to,\n );\n if (indexFound >= 0) {\n previousEdges[indexFound] = {\n ...previousEdges[indexFound],\n relations: Array.from(\n new Set([\n ...previousEdges[indexFound].relations,\n ...currentEdge.relations,\n ]),\n ),\n };\n return previousEdges;\n }\n return [...previousEdges, currentEdge];\n }, [] as EntityEdge[]);\n};\n"],"names":[],"mappings":"AAwBO,MAAM,cAAgC,CAAA,GAAA,KAAO;AAClD,EAAA,GAAA,CAAI,QAAQ,GAAA,CAAI,KAAA,CAAM,MAAA,CAAO,CAAC,eAAe,WAAA,KAAgB;AAC3D,IAAA,MAAM,aAAa,aAAA,CAAc,SAAA;AAAA,MAC/B,kBACE,YAAA,CAAa,IAAA,KAAS,YAAY,IAAA,IAClC,YAAA,CAAa,OAAO,WAAA,CAAY;AAAA,KACpC;AACA,IAAA,IAAI,cAAc,CAAA,EAAG;AACnB,MAAA,aAAA,CAAc,UAAU,CAAA,GAAI;AAAA,QAC1B,GAAG,cAAc,UAAU,CAAA;AAAA,QAC3B,WAAW,KAAA,CAAM,IAAA;AAAA,8BACX,GAAA,CAAI;AAAA,YACN,GAAG,aAAA,CAAc,UAAU,CAAA,CAAE,SAAA;AAAA,YAC7B,GAAG,WAAA,CAAY;AAAA,WAChB;AAAA;AACH,OACF;AACA,MAAA,OAAO,aAAA;AAAA,IACT;AACA,IAAA,OAAO,CAAC,GAAG,aAAA,EAAe,WAAW,CAAA;AAAA,EACvC,CAAA,EAAG,EAAkB,CAAA;AACvB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"remove-backward-edges.esm.js","sources":["../../../src/lib/graph-transformations/remove-backward-edges.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/**\n * Remove edges going backwards, if unidirectional and we haven't already\n * merged the relations\n */\nexport const removeBackwardEdges: GraphTransformer = ctx => {\n const { edges } = ctx;\n\n const edgesMapFrom = new Map<string, EntityEdge[]>();\n\n edges.forEach(edge => {\n const theseEdges = edgesMapFrom.get(edge.from) ?? [];\n theseEdges.push(edge);\n edgesMapFrom.set(edge.from, theseEdges);\n });\n\n edges.forEach(edge => {\n if (edge.relations.length > 1) {\n edge.relations = edge.relations.slice(0, 1);\n }\n });\n};\n"],"names":[],"mappings":"AAuBO,MAAM,sBAAwC,CAAA,GAAA,KAAO;AAC1D,EAAA,MAAM,EAAE,OAAM,GAAI,GAAA;AAElB,EAAA,MAAM,YAAA,uBAAmB,GAAA,EAA0B;AAEnD,EAAA,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AACpB,IAAA,MAAM,aAAa,YAAA,CAAa,GAAA,CAAI,IAAA,CAAK,IAAI,KAAK,EAAC;AACnD,IAAA,UAAA,CAAW,KAAK,IAAI,CAAA;AACpB,IAAA,YAAA,CAAa,GAAA,CAAI,IAAA,CAAK,IAAA,EAAM,UAAU,CAAA;AAAA,EACxC,CAAC,CAAA;AAED,EAAA,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AACpB,IAAA,IAAI,IAAA,CAAK,SAAA,CAAU,MAAA,GAAS,CAAA,EAAG;AAC7B,MAAA,IAAA,CAAK,SAAA,GAAY,IAAA,CAAK,SAAA,CAAU,KAAA,CAAM,GAAG,CAAC,CAAA;AAAA,IAC5C;AAAA,EACF,CAAC,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"remove-backward-edges.esm.js","sources":["../../../src/lib/graph-transformations/remove-backward-edges.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/**\n * Remove edges going backwards, if unidirectional and we haven't already\n * merged the relations\n */\nexport const removeBackwardEdges: GraphTransformer = ctx => {\n const { edges } = ctx;\n\n const edgesMapFrom = new Map<string, EntityEdge[]>();\n\n edges.forEach(edge => {\n const theseEdges = edgesMapFrom.get(edge.from) ?? [];\n theseEdges.push(edge);\n edgesMapFrom.set(edge.from, theseEdges);\n });\n\n edges.forEach(edge => {\n if (edge.relations.length > 1) {\n edge.relations = edge.relations.slice(0, 1);\n }\n });\n};\n"],"names":[],"mappings":"AAuBO,MAAM,sBAAwC,CAAA,GAAA,KAAO;AAC1D,EAAA,MAAM,EAAE,OAAM,GAAI,GAAA;AAElB,EAAA,MAAM,YAAA,uBAAmB,GAAA,EAA0B;AAEnD,EAAA,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AACpB,IAAA,MAAM,aAAa,YAAA,CAAa,GAAA,CAAI,IAAA,CAAK,IAAI,KAAK,EAAC;AACnD,IAAA,UAAA,CAAW,KAAK,IAAI,CAAA;AACpB,IAAA,YAAA,CAAa,GAAA,CAAI,IAAA,CAAK,IAAA,EAAM,UAAU,CAAA;AAAA,EACxC,CAAC,CAAA;AAED,EAAA,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AACpB,IAAA,IAAI,IAAA,CAAK,SAAA,CAAU,MAAA,GAAS,CAAA,EAAG;AAC7B,MAAA,IAAA,CAAK,SAAA,GAAY,IAAA,CAAK,SAAA,CAAU,KAAA,CAAM,GAAG,CAAC,CAAA;AAAA,IAC5C;AAAA,EACF,CAAC,CAAA;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"set-distance.esm.js","sources":["../../../src/lib/graph-transformations/set-distance.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/** Set the distance of each edge to the distance from a root entity */\nexport const setDistances: GraphTransformer = ({\n nodeDistances,\n edges,\n rootEntityRefs,\n}) => {\n const edgeMap = new Map<string, EntityEdge[]>();\n edges.forEach(edge => {\n const fromEdges = edgeMap.get(edge.from) ?? [];\n fromEdges.push(edge);\n edgeMap.set(edge.from, fromEdges);\n\n const toEdges = edgeMap.get(edge.to) ?? [];\n toEdges.push(edge);\n edgeMap.set(edge.to, toEdges);\n });\n\n rootEntityRefs.forEach(rootEntityRef => {\n nodeDistances.set(rootEntityRef, 0);\n });\n const visitedNodes = new Set<string>(rootEntityRefs);\n let currentNodes = rootEntityRefs;\n let distance = 0;\n\n while (currentNodes.length > 0) {\n const thisDistance = ++distance;\n\n const nextNodes: string[] = [];\n currentNodes.forEach(node => {\n edgeMap.get(node)?.forEach(edge => {\n edge.distance ??= thisDistance;\n\n const fromDistance = nodeDistances.get(edge.from) ?? thisDistance;\n nodeDistances.set(edge.from, fromDistance);\n nextNodes.push(edge.from);\n\n const toDistance = nodeDistances.get(edge.to) ?? thisDistance;\n nodeDistances.set(edge.to, toDistance);\n nextNodes.push(edge.to);\n });\n });\n\n for (const currentNode of currentNodes) {\n visitedNodes.add(currentNode);\n }\n\n currentNodes = Array.from(new Set(nextNodes)).filter(\n node => !visitedNodes.has(node),\n );\n }\n};\n"],"names":[],"mappings":"AAoBO,MAAM,eAAiC,CAAC;AAAA,EAC7C,aAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,uBAAc,GAAA,EAA0B;AAC9C,EAAA,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AACpB,IAAA,MAAM,YAAY,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,IAAI,KAAK,EAAC;AAC7C,IAAA,SAAA,CAAU,KAAK,IAAI,CAAA;AACnB,IAAA,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,IAAA,EAAM,SAAS,CAAA;AAEhC,IAAA,MAAM,UAAU,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,EAAE,KAAK,EAAC;AACzC,IAAA,OAAA,CAAQ,KAAK,IAAI,CAAA;AACjB,IAAA,OAAA,CAAQ,GAAA,C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IAAA,CAAK,IAAI,GAAA,CAAI,SAAS,CAAC,CAAA,CAAE,MAAA;AAAA,MAC5C,CAAA,IAAA,KAAQ,CAAC,YAAA,CAAa,GAAA,CAAI,IAAI;AAAA,KAChC;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"set-distance.esm.js","sources":["../../../src/lib/graph-transformations/set-distance.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/** Set the distance of each edge to the distance from a root entity */\nexport const setDistances: GraphTransformer = ({\n nodeDistances,\n edges,\n rootEntityRefs,\n}) => {\n const edgeMap = new Map<string, EntityEdge[]>();\n edges.forEach(edge => {\n const fromEdges = edgeMap.get(edge.from) ?? [];\n fromEdges.push(edge);\n edgeMap.set(edge.from, fromEdges);\n\n const toEdges = edgeMap.get(edge.to) ?? [];\n toEdges.push(edge);\n edgeMap.set(edge.to, toEdges);\n });\n\n rootEntityRefs.forEach(rootEntityRef => {\n nodeDistances.set(rootEntityRef, 0);\n });\n const visitedNodes = new Set<string>(rootEntityRefs);\n let currentNodes = rootEntityRefs;\n let distance = 0;\n\n while (currentNodes.length > 0) {\n const thisDistance = ++distance;\n\n const nextNodes: string[] = [];\n currentNodes.forEach(node => {\n edgeMap.get(node)?.forEach(edge => {\n edge.distance ??= thisDistance;\n\n const fromDistance = nodeDistances.get(edge.from) ?? thisDistance;\n nodeDistances.set(edge.from, fromDistance);\n nextNodes.push(edge.from);\n\n const toDistance = nodeDistances.get(edge.to) ?? thisDistance;\n nodeDistances.set(edge.to, toDistance);\n nextNodes.push(edge.to);\n });\n });\n\n for (const currentNode of currentNodes) {\n visitedNodes.add(currentNode);\n }\n\n currentNodes = Array.from(new Set(nextNodes)).filter(\n node => !visitedNodes.has(node),\n );\n }\n};\n"],"names":[],"mappings":"AAoBO,MAAM,eAAiC,CAAC;AAAA,EAC7C,aAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,uBAAc,GAAA,EAA0B;AAC9C,EAAA,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AACpB,IAAA,MAAM,YAAY,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,IAAI,KAAK,EAAC;AAC7C,IAAA,SAAA,CAAU,KAAK,IAAI,CAAA;AACnB,IAAA,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,IAAA,EAAM,SAAS,CAAA;AAEhC,IAAA,MAAM,UAAU,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,EAAE,KAAK,EAAC;AACzC,IAAA,OAAA,CAAQ,KAAK,IAAI,CAAA;AACjB,IAAA,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,EAAA,EAAI,OAAO,CAAA;AAAA,EAC9B,CAAC,CAAA;AAED,EAAA,cAAA,CAAe,QAAQ,CAAA,aAAA,KAAiB;AACtC,IAAA,aAAA,CAAc,GAAA,CAAI,eAAe,CAAC,CAAA;AAAA,EACpC,CAAC,CAAA;AACD,EAAA,MAAM,YAAA,GAAe,IAAI,GAAA,CAAY,cAAc,CAAA;AACnD,EAAA,IAAI,YAAA,GAAe,cAAA;AACnB,EAAA,IAAI,QAAA,GAAW,CAAA;AAEf,EAAA,OAAO,YAAA,CAAa,SAAS,CAAA,EAAG;AAC9B,IAAA,MAAM,eAAe,EAAE,QAAA;AAEvB,IAAA,MAAM,YAAsB,EAAC;AAC7B,IAAA,YAAA,CAAa,QAAQ,CAAA,IAAA,KAAQ;AAC3B,MAAA,OAAA,CAAQ,GAAA,CAAI,IAAI,CAAA,EAAG,OAAA,CAAQ,CAAA,IAAA,KAAQ;AACjC,QAAA,IAAA,CAAK,QAAA,KAAa,YAAA;AAElB,QAAA,MAAM,YAAA,GAAe,aAAA,CAAc,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA,IAAK,YAAA;AACrD,QAAA,aAAA,CAAc,GAAA,CAAI,IAAA,CAAK,IAAA,EAAM,YAAY,CAAA;AACzC,QAAA,SAAA,CAAU,IAAA,CAAK,KAAK,IAAI,CAAA;AAExB,QAAA,MAAM,UAAA,GAAa,aAAA,CAAc,GAAA,CAAI,IAAA,CAAK,EAAE,CAAA,IAAK,YAAA;AACjD,QAAA,aAAA,CAAc,GAAA,CAAI,IAAA,CAAK,EAAA,EAAI,UAAU,CAAA;AACrC,QAAA,SAAA,CAAU,IAAA,CAAK,KAAK,EAAE,CAAA;AAAA,MACxB,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAED,IAAA,KAAA,MAAW,eAAe,YAAA,EAAc;AACtC,MAAA,YAAA,CAAa,IAAI,WAAW,CAAA;AAAA,IAC9B;AAEA,IAAA,YAAA,GAAe,MAAM,IAAA,CAAK,IAAI,GAAA,CAAI,SAAS,CAAC,CAAA,CAAE,MAAA;AAAA,MAC5C,CAAA,IAAA,KAAQ,CAAC,YAAA,CAAa,GAAA,CAAI,IAAI;AAAA,KAChC;AAAA,EACF;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"strip-distant-edges.esm.js","sources":["../../../src/lib/graph-transformations/strip-distant-edges.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/**\n * Removes edges that are further away then other edges leading up to the root.\n */\nexport const stripDistantEdges: GraphTransformer = options => {\n const entityEdges = new Map<string, EntityEdge[]>();\n options.edges.forEach(edge => {\n let fromEdges = entityEdges.get(edge.from);\n if (!fromEdges) {\n fromEdges = [];\n entityEdges.set(edge.from, fromEdges);\n }\n fromEdges.push(edge);\n\n let toEdges = entityEdges.get(edge.to);\n if (!toEdges) {\n toEdges = [];\n entityEdges.set(edge.to, toEdges);\n }\n toEdges.push(edge);\n });\n\n // Remove edges that are further away than other edges leading up to the root\n options.edges = options.edges.filter(edge => {\n // Get all edges of the 'from' node except this (and similar) edge\n const fromEdges = entityEdges\n .get(edge.from)!\n .filter(\n fromEdge =>\n !(fromEdge.from === edge.from && fromEdge.to === edge.to) &&\n !(fromEdge.from === edge.to && fromEdge.to === edge.from),\n );\n // Get all edges of the 'from' node except this (and similar) edge\n const toEdges = entityEdges\n .get(edge.to)!\n .filter(\n toEdge =>\n !(toEdge.from === edge.from && toEdge.to === edge.to) &&\n !(toEdge.from === edge.to && toEdge.to === edge.from),\n );\n\n if (fromEdges.length === 0 || toEdges.length === 0) {\n return true;\n }\n\n const shorterFrom = fromEdges.some(\n fromEdge => (fromEdge.distance ?? 0) < (edge.distance ?? 0),\n );\n const shorterTo = toEdges.some(\n toEdge => (toEdge.distance ?? 0) < (edge.distance ?? 0),\n );\n\n if (shorterFrom && shorterTo) {\n // There are shorter edges from both 'from' and 'to' leading to the root,\n // exclude this edge\n return false;\n }\n return true;\n });\n};\n"],"names":[],"mappings":"AAsBO,MAAM,oBAAsC,CAAA,OAAA,KAAW;AAC5D,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAA0B;AAClD,EAAA,OAAA,CAAQ,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AAC5B,IAAA,IAAI,SAAA,GAAY,WAAA,CAAY,GAAA,CAAI,IAAA,CAA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AAA,KAAW,CAAA,IAAK,OAAA,CAAQ,WAAW,CAAA,EAAG;AAClD,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,MAAM,cAAc,SAAA,CAAU,IAAA;AAAA,MAC5B,CAAA,QAAA,KAAA,CAAa,QAAA,CAAS,QAAA,IAAY,CAAA,KAAM,KAAK,QAAA,IAAY,CAAA;AAAA,KAC3D;AACA,IAAA,MAAM,YAAY,OAAA,CAAQ,IAAA;AAAA,MACxB,CAAA,MAAA,KAAA,CAAW,MAAA,CAAO,QAAA,IAAY,CAAA,KAAM,KAAK,QAAA,IAAY,CAAA;AAAA,KACvD;AAEA,IAAA,IAAI,eAAe,SAAA,EAAW;AAG5B,MAAA,OAAO,KAAA;AAAA,IACT;AACA,IAAA,OAAO,IAAA;AAAA,EACT,CAAC,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"strip-distant-edges.esm.js","sources":["../../../src/lib/graph-transformations/strip-distant-edges.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityEdge } from '../types';\nimport { GraphTransformer } from './types';\n\n/**\n * Removes edges that are further away then other edges leading up to the root.\n */\nexport const stripDistantEdges: GraphTransformer = options => {\n const entityEdges = new Map<string, EntityEdge[]>();\n options.edges.forEach(edge => {\n let fromEdges = entityEdges.get(edge.from);\n if (!fromEdges) {\n fromEdges = [];\n entityEdges.set(edge.from, fromEdges);\n }\n fromEdges.push(edge);\n\n let toEdges = entityEdges.get(edge.to);\n if (!toEdges) {\n toEdges = [];\n entityEdges.set(edge.to, toEdges);\n }\n toEdges.push(edge);\n });\n\n // Remove edges that are further away than other edges leading up to the root\n options.edges = options.edges.filter(edge => {\n // Get all edges of the 'from' node except this (and similar) edge\n const fromEdges = entityEdges\n .get(edge.from)!\n .filter(\n fromEdge =>\n !(fromEdge.from === edge.from && fromEdge.to === edge.to) &&\n !(fromEdge.from === edge.to && fromEdge.to === edge.from),\n );\n // Get all edges of the 'from' node except this (and similar) edge\n const toEdges = entityEdges\n .get(edge.to)!\n .filter(\n toEdge =>\n !(toEdge.from === edge.from && toEdge.to === edge.to) &&\n !(toEdge.from === edge.to && toEdge.to === edge.from),\n );\n\n if (fromEdges.length === 0 || toEdges.length === 0) {\n return true;\n }\n\n const shorterFrom = fromEdges.some(\n fromEdge => (fromEdge.distance ?? 0) < (edge.distance ?? 0),\n );\n const shorterTo = toEdges.some(\n toEdge => (toEdge.distance ?? 0) < (edge.distance ?? 0),\n );\n\n if (shorterFrom && shorterTo) {\n // There are shorter edges from both 'from' and 'to' leading to the root,\n // exclude this edge\n return false;\n }\n return true;\n });\n};\n"],"names":[],"mappings":"AAsBO,MAAM,oBAAsC,CAAA,OAAA,KAAW;AAC5D,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAA0B;AAClD,EAAA,OAAA,CAAQ,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AAC5B,IAAA,IAAI,SAAA,GAAY,WAAA,CAAY,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AACzC,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,SAAA,GAAY,EAAC;AACb,MAAA,WAAA,CAAY,GAAA,CAAI,IAAA,CAAK,IAAA,EAAM,SAAS,CAAA;AAAA,IACtC;AACA,IAAA,SAAA,CAAU,KAAK,IAAI,CAAA;AAEnB,IAAA,IAAI,OAAA,GAAU,WAAA,CAAY,GAAA,CAAI,IAAA,CAAK,EAAE,CAAA;AACrC,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,OAAA,GAAU,EAAC;AACX,MAAA,WA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QAAA,IAAY,CAAA;AAAA,KACvD;AAEA,IAAA,IAAI,eAAe,SAAA,EAAW;AAG5B,MAAA,OAAO,KAAA;AAAA,IACT;AACA,IAAA,OAAO,IAAA;AAAA,EACT,CAAC,CAAA;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"graph.esm.js","sources":["../../../src/lib/types/graph.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 */\n/* We want to maintain the same information as an enum, so we disable the redeclaration warning */\n/* eslint-disable @typescript-eslint/no-redeclare */\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 const 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} as const;\n\n/**\n * @public\n */\nexport type Direction = (typeof Direction)[keyof typeof Direction];\n\n/**\n * @public\n */\nexport namespace Direction {\n export type TOP_BOTTOM = typeof Direction.TOP_BOTTOM;\n export type BOTTOM_TOP = typeof Direction.BOTTOM_TOP;\n export type LEFT_RIGHT = typeof Direction.LEFT_RIGHT;\n export type RIGHT_LEFT = typeof Direction.RIGHT_LEFT;\n}\n"],"names":[],"mappings":"AA+GO,MAAM,SAAA,GAAY;AAAA;AAAA;AAAA;AAAA,EAIvB,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY;AACd;;;;"}
1
+ {"version":3,"file":"graph.esm.js","sources":["../../../src/lib/types/graph.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 */\n/* We want to maintain the same information as an enum, so we disable the redeclaration warning */\n/* eslint-disable @typescript-eslint/no-redeclare */\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 const 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} as const;\n\n/**\n * @public\n */\nexport type Direction = (typeof Direction)[keyof typeof Direction];\n\n/**\n * @public\n */\nexport namespace Direction {\n export type TOP_BOTTOM = typeof Direction.TOP_BOTTOM;\n export type BOTTOM_TOP = typeof Direction.BOTTOM_TOP;\n export type LEFT_RIGHT = typeof Direction.LEFT_RIGHT;\n export type RIGHT_LEFT = typeof Direction.RIGHT_LEFT;\n}\n"],"names":[],"mappings":"AA+GO,MAAM,SAAA,GAAY;AAAA;AAAA;AAAA;AAAA,EAIvB,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY;AACd;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"relations.esm.js","sources":["../../../src/lib/types/relations.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 {\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/**\n * A list of built-in relations\n *\n * @public\n */\nexport const ALL_RELATIONS: string[] = [\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];\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"],"names":[],"mappings":";;AA6CO,MAAM,aAAA,GAA0B;AAAA,EACrC,wBAAA;AAAA,EACA,wBAAA;AAAA,EACA,iBAAA;AAAA,EACA,qBAAA;AAAA,EACA,sBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF;AAQO,MAAM,kBAAA,GAAoC;AAAA,EAC/C,CAAC,mBAAmB,iBAAiB,CAAA;AAAA,EACrC,CAAC,uBAAuB,wBAAwB,CAAA;AAAA,EAChD,CAAC,0BAA0B,qBAAqB,CAAA;AAAA,EAChD,CAAC,mBAAmB,gBAAgB,CAAA;AAAA,EACpC,CAAC,oBAAoB,iBAAiB,CAAA;AAAA,EACtC,CAAC,qBAAqB,kBAAkB,CAAA;AAAA,EACxC,CAAC,qBAAqB,sBAAsB;AAC9C;;;;"}
1
+ {"version":3,"file":"relations.esm.js","sources":["../../../src/lib/types/relations.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 {\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/**\n * A list of built-in relations\n *\n * @public\n */\nexport const ALL_RELATIONS: string[] = [\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];\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"],"names":[],"mappings":";;AA6CO,MAAM,aAAA,GAA0B;AAAA,EACrC,wBAAA;AAAA,EACA,wBAAA;AAAA,EACA,iBAAA;AAAA,EACA,qBAAA;AAAA,EACA,sBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF;AAQO,MAAM,kBAAA,GAAoC;AAAA,EAC/C,CAAC,mBAAmB,iBAAiB,CAAA;AAAA,EACrC,CAAC,uBAAuB,wBAAwB,CAAA;AAAA,EAChD,CAAC,0BAA0B,qBAAqB,CAAA;AAAA,EAChD,CAAC,mBAAmB,gBAAgB,CAAA;AAAA,EACpC,CAAC,oBAAoB,iBAAiB,CAAA;AAAA,EACtC,CAAC,qBAAqB,kBAAkB,CAAA;AAAA,EACxC,CAAC,qBAAqB,sBAAsB;AAC9C;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-catalog-graph";
2
- var version = "0.6.8";
2
+ var version = "0.6.9-next.0";
3
3
  var backstage = {
4
4
  role: "frontend-plugin",
5
5
  pluginId: "catalog-graph",
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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 { createApiFactory, createPlugin } from '@backstage/core-plugin-api';\nimport { catalogEntityRouteRef, catalogGraphRouteRef } from './routes';\nimport { catalogGraphApiRef, DefaultCatalogGraphApi } from './api';\n\n/**\n * Catalog Graph Plugin instance.\n * @public\n */\nexport const catalogGraphPlugin = createPlugin({\n id: 'catalog-graph',\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n apis: [\n createApiFactory({\n api: catalogGraphApiRef,\n deps: {},\n factory: () => new DefaultCatalogGraphApi(),\n }),\n ],\n});\n"],"names":[],"mappings":";;;;;AAuBO,MAAM,qBAAqB,YAAA,CAAa;AAAA,EAC7C,EAAA,EAAI,eAAA;AAAA,EACJ,MAAA,EAAQ;AAAA,IACN,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,aAAA,EAAe;AAAA,GACjB;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,kBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,OAAA,EAAS,MAAM,IAAI,sBAAA;AAAuB,KAC3C;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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 { createApiFactory, createPlugin } from '@backstage/core-plugin-api';\nimport { catalogEntityRouteRef, catalogGraphRouteRef } from './routes';\nimport { catalogGraphApiRef, DefaultCatalogGraphApi } from './api';\n\n/**\n * Catalog Graph Plugin instance.\n * @public\n */\nexport const catalogGraphPlugin = createPlugin({\n id: 'catalog-graph',\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n apis: [\n createApiFactory({\n api: catalogGraphApiRef,\n deps: {},\n factory: () => new DefaultCatalogGraphApi(),\n }),\n ],\n});\n"],"names":[],"mappings":";;;;;AAuBO,MAAM,qBAAqB,YAAA,CAAa;AAAA,EAC7C,EAAA,EAAI,eAAA;AAAA,EACJ,MAAA,EAAQ;AAAA,IACN,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,aAAA,EAAe;AAAA,GACjB;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,kBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,OAAA,EAAS,MAAM,IAAI,sBAAA;AAAuB,KAC3C;AAAA;AAEL,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"routes.esm.js","sources":["../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 {\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 defaultTarget: 'catalog.catalogEntity',\n});\n"],"names":[],"mappings":";;AAyBO,MAAM,uBAAuB,cAAA,CAAe;AAAA,EACjD,EAAA,EAAI;AACN,CAAC;AASM,MAAM,wBAAwB,sBAAA,CAAuB;AAAA,EAC1D,EAAA,EAAI,gBAAA;AAAA,EACJ,MAAA,EAAQ,CAAC,WAAA,EAAa,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpC,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe;AACjB,CAAC;;;;"}
1
+ {"version":3,"file":"routes.esm.js","sources":["../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 {\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 defaultTarget: 'catalog.catalogEntity',\n});\n"],"names":[],"mappings":";;AAyBO,MAAM,uBAAuB,cAAA,CAAe;AAAA,EACjD,EAAA,EAAI;AACN,CAAC;AASM,MAAM,wBAAwB,sBAAA,CAAuB;AAAA,EAC1D,EAAA,EAAI,gBAAA;AAAA,EACJ,MAAA,EAAQ,CAAC,WAAA,EAAa,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpC,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe;AACjB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport const catalogGraphTranslationRef = createTranslationRef({\n id: 'catalog-graph',\n messages: {\n catalogGraphCard: {\n title: 'Relations',\n deepLinkTitle: 'View graph',\n },\n catalogGraphPage: {\n title: 'Catalog Graph',\n filterToggleButtonTitle: 'Filters',\n supportButtonDescription:\n 'Start tracking your component in by adding it to the software catalog.',\n simplifiedSwitchLabel: 'Simplified',\n mergeRelationsSwitchLabel: 'Merge relations',\n zoomOutDescription:\n 'Use pinch & zoom to move around the diagram. Click to change active node, shift click to navigate to entity.',\n curveFilter: {\n title: 'Curve',\n curveMonotoneX: 'Monotone X',\n curveStepBefore: 'Step Before',\n },\n directionFilter: {\n title: 'Direction',\n leftToRight: 'Left to right',\n rightToLeft: 'Right to left',\n topToBottom: 'Top to bottom',\n bottomToTop: 'Bottom to top',\n },\n maxDepthFilter: {\n title: 'Max depth',\n inputPlaceholder: '∞ Infinite',\n clearButtonAriaLabel: 'clear max depth',\n },\n selectedKindsFilter: {\n title: 'Kinds',\n },\n selectedRelationsFilter: {\n title: 'Relations',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,6BAA6B,oBAAA,CAAqB;AAAA,EAC7D,EAAA,EAAI,eAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,WAAA;AAAA,MACP,aAAA,EAAe;AAAA,KACjB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,uBAAA,EAAyB,SAAA;AAAA,MACzB,wBAAA,EACE,wEAAA;AAAA,MACF,qBAAA,EAAuB,YAAA;AAAA,MACvB,yBAAA,EAA2B,iBAAA;AAAA,MAC3B,kBAAA,EACE,8GAAA;AAAA,MACF,WAAA,EAAa;AAAA,QACX,KAAA,EAAO,OAAA;AAAA,QACP,cAAA,EAAgB,YAAA;AAAA,QAChB,eAAA,EAAiB;AAAA,OACnB;AAAA,MACA,eAAA,EAAiB;AAAA,QACf,KAAA,EAAO,WAAA;AAAA,QACP,WAAA,EAAa,eAAA;AAAA,QACb,WAAA,EAAa,eAAA;AAAA,QACb,WAAA,EAAa,eAAA;AAAA,QACb,WAAA,EAAa;AAAA,OACf;AAAA,MACA,cAAA,EAAgB;AAAA,QACd,KAAA,EAAO,WAAA;AAAA,QACP,gBAAA,EAAkB,iBAAA;AAAA,QAClB,oBAAA,EAAsB;AAAA,OACxB;AAAA,MACA,mBAAA,EAAqB;AAAA,QACnB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,uBAAA,EAAyB;AAAA,QACvB,KAAA,EAAO;AAAA;AACT;AACF;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport const catalogGraphTranslationRef = createTranslationRef({\n id: 'catalog-graph',\n messages: {\n catalogGraphCard: {\n title: 'Relations',\n deepLinkTitle: 'View graph',\n },\n catalogGraphPage: {\n title: 'Catalog Graph',\n filterToggleButtonTitle: 'Filters',\n supportButtonDescription:\n 'Start tracking your component in by adding it to the software catalog.',\n simplifiedSwitchLabel: 'Simplified',\n mergeRelationsSwitchLabel: 'Merge relations',\n zoomOutDescription:\n 'Use pinch & zoom to move around the diagram. Click to change active node, shift click to navigate to entity.',\n curveFilter: {\n title: 'Curve',\n curveMonotoneX: 'Monotone X',\n curveStepBefore: 'Step Before',\n },\n directionFilter: {\n title: 'Direction',\n leftToRight: 'Left to right',\n rightToLeft: 'Right to left',\n topToBottom: 'Top to bottom',\n bottomToTop: 'Bottom to top',\n },\n maxDepthFilter: {\n title: 'Max depth',\n inputPlaceholder: '∞ Infinite',\n clearButtonAriaLabel: 'clear max depth',\n },\n selectedKindsFilter: {\n title: 'Kinds',\n },\n selectedRelationsFilter: {\n title: 'Relations',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,6BAA6B,oBAAA,CAAqB;AAAA,EAC7D,EAAA,EAAI,eAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,WAAA;AAAA,MACP,aAAA,EAAe;AAAA,KACjB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,uBAAA,EAAyB,SAAA;AAAA,MACzB,wBAAA,EACE,wEAAA;AAAA,MACF,qBAAA,EAAuB,YAAA;AAAA,MACvB,yBAAA,EAA2B,iBAAA;AAAA,MAC3B,kBAAA,EACE,8GAAA;AAAA,MACF,WAAA,EAAa;AAAA,QACX,KAAA,EAAO,OAAA;AAAA,QACP,cAAA,EAAgB,YAAA;AAAA,QAChB,eAAA,EAAiB;AAAA,OACnB;AAAA,MACA,eAAA,EAAiB;AAAA,QACf,KAAA,EAAO,WAAA;AAAA,QACP,WAAA,EAAa,eAAA;AAAA,QACb,WAAA,EAAa,eAAA;AAAA,QACb,WAAA,EAAa,eAAA;AAAA,QACb,WAAA,EAAa;AAAA,OACf;AAAA,MACA,cAAA,EAAgB;AAAA,QACd,KAAA,EAAO,WAAA;AAAA,QACP,gBAAA,EAAkB,iBAAA;AAAA,QAClB,oBAAA,EAAsB;AAAA,OACxB;AAAA,MACA,mBAAA,EAAqB;AAAA,QACnB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,uBAAA,EAAyB;AAAA,QACvB,KAAA,EAAO;AAAA;AACT;AACF;AAEJ,CAAC;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-graph",
3
- "version": "0.6.8",
3
+ "version": "0.6.9-next.0",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "catalog-graph",
@@ -61,14 +61,14 @@
61
61
  "test": "backstage-cli package test"
62
62
  },
63
63
  "dependencies": {
64
- "@backstage/catalog-client": "^1.16.2",
65
- "@backstage/catalog-model": "^1.10.1",
66
- "@backstage/core-components": "^0.18.14",
67
- "@backstage/core-plugin-api": "^1.12.10",
68
- "@backstage/frontend-plugin-api": "^0.18.1",
69
- "@backstage/plugin-catalog-react": "^3.2.3",
70
- "@backstage/types": "^1.2.2",
71
- "@backstage/ui": "^0.18.0",
64
+ "@backstage/catalog-client": "1.16.3-next.0",
65
+ "@backstage/catalog-model": "1.10.2-next.0",
66
+ "@backstage/core-components": "0.18.15-next.0",
67
+ "@backstage/core-plugin-api": "1.12.11-next.0",
68
+ "@backstage/frontend-plugin-api": "0.18.2-next.0",
69
+ "@backstage/plugin-catalog-react": "3.2.4-next.0",
70
+ "@backstage/types": "1.2.2",
71
+ "@backstage/ui": "0.18.0",
72
72
  "@material-ui/core": "^4.12.2",
73
73
  "@material-ui/icons": "^4.9.1",
74
74
  "@material-ui/lab": "4.0.0-alpha.61",
@@ -80,12 +80,12 @@
80
80
  "zod": "^4.0.0"
81
81
  },
82
82
  "devDependencies": {
83
- "@backstage/cli": "^0.36.6",
84
- "@backstage/core-app-api": "^1.20.5",
85
- "@backstage/dev-utils": "^1.1.27",
86
- "@backstage/frontend-test-utils": "^0.6.4",
87
- "@backstage/plugin-catalog": "^2.0.9",
88
- "@backstage/test-utils": "^1.7.22",
83
+ "@backstage/cli": "0.36.7-next.0",
84
+ "@backstage/core-app-api": "1.20.6-next.0",
85
+ "@backstage/dev-utils": "1.1.28-next.0",
86
+ "@backstage/frontend-test-utils": "0.6.5-next.0",
87
+ "@backstage/plugin-catalog": "2.0.10-next.0",
88
+ "@backstage/test-utils": "1.7.23-next.0",
89
89
  "@testing-library/dom": "^10.0.0",
90
90
  "@testing-library/jest-dom": "^6.0.0",
91
91
  "@testing-library/react": "^16.0.0",