diff --git a/.dockerignore b/.dockerignore index cc789a21346935cc4b7cdcf9a8c1f9572f79e263..03316d380d309a42e2d6f1fa4d98a8d7ef4f9074 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,9 @@ node_modules -libs/storybook \ No newline at end of file +node_modules/ +libs/storybook +apps/web/dist +apps/web/dist/ +apps/web/node_modules +apps/web/node_modules/ +libs/shared/node_modules +libs/shared/node_modules/ \ No newline at end of file diff --git a/apps/web/.env b/apps/web/.env index 9c219932b759534bb6bd8f4cda51a316d978dd91..24c5fc8011a15e2667ee824127862d572488625a 100644 --- a/apps/web/.env +++ b/apps/web/.env @@ -1,10 +1,24 @@ -GRAPHPOLARIS_VERSION=dev -BACKEND_URL=http://localhost -BACKEND_WSS_URL=ws://localhost:3001/ -STAGING=dev -SKIP_LOGIN=true -BACKEND_USER=:3000 -GRAPHPOLARIS_VERSION=dev - -SENTRY_ENABLED=false -SENTRY_URL= GP_AUTH_URL= \ No newline at end of file +GRAPHPOLARIS_VERSION=dev +BACKEND_URL=http://localhost +BACKEND_WSS_URL=ws://localhost:3001/ +STAGING=dev +SKIP_LOGIN=true +BACKEND_USER=:3000 +GRAPHPOLARIS_VERSION=dev + +SENTRY_ENABLED=false +SENTRY_URL= + +GP_AUTH_URL= + +WIP_TABLEVIS=false +WIP_NODELINKVIS=false +WIP_RAWJSONVIS=false +WIP_PAOHVIS=true +WIP_MATRIXVIS=true +WIP_SEMANTICSUBSTRATESVIS=true +WIP_MAPVIS=true + +WIP_INSIGHT_SHARING=true +WIP_VIEWER_PERMISSIONS=true +WIP_SHARABLE_EXPLORATION=true \ No newline at end of file diff --git a/apps/web/.env.development b/apps/web/.env.development index 1f749acb0332d125d620b1574915e07369d23cad..8375aafc0b890666fab135b373ac0bf934ff6ae4 100644 --- a/apps/web/.env.development +++ b/apps/web/.env.development @@ -9,4 +9,16 @@ VITE_BACKEND_SCHEMA=:3002 SENTRY_ENABLED=false SENTRY_URL= -GP_AUTH_URL= \ No newline at end of file +GP_AUTH_URL= + +WIP_TABLEVIS=false +WIP_NODELINKVIS=false +WIP_RAWJSONVIS=false +WIP_PAOHVIS=true +WIP_MATRIXVIS=true +WIP_SEMANTICSUBSTRATESVIS=true +WIP_MAPVIS=true + +WIP_INSIGHT_SHARING=true +WIP_VIEWER_PERMISSIONS=true +WIP_SHARABLE_EXPLORATION=true \ No newline at end of file diff --git a/apps/web/.env.example b/apps/web/.env.example index 45aa34e0031f68e83c6a715c8bf5cc626e61d32d..10dba96b2cb93fd301955fdadba669ad9a910159 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -8,4 +8,16 @@ BACKEND_USER= SENTRY_ENABLED=false SENTRY_URL= -GP_AUTH_URL= \ No newline at end of file +GP_AUTH_URL= + +WIP_TABLEVIS=false +WIP_NODELINKVIS=false +WIP_RAWJSONVIS=false +WIP_PAOHVIS=true +WIP_MATRIXVIS=true +WIP_SEMANTICSUBSTRATESVIS=true +WIP_MAPVIS=true + +WIP_INSIGHT_SHARING=true +WIP_VIEWER_PERMISSIONS=true +WIP_SHARABLE_EXPLORATION=true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b38fad5cdaeef9679f31ec736c2428342489abd5..7f845721e277932a42f143b86444e4557cbd5413 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,10 @@ -version: '3.9' - services: frontend: - image: harbor.graphpolaris.com/graphpolaris/frontend:latest + image: harbor.graphpolaris.com/graphpolaris/frontend-dev:latest build: context: ./ dockerfile: ./Dockerfile + container_name: frontend ports: - 4200:4200 environment: @@ -17,12 +16,25 @@ services: # - BACKEND_USER=user-management-service - STAGING=dev - GRAPHPOLARIS_VERSION=dev - - GRAPHPOLARIS_VERSION=compose + - SKIP_LOGIN=false + - SENTRY_ENABLED=false + - SENTRY_URL=http://localhost + - GP_AUTH_URL=https://auth.staging.graphpolaris.com/ + - WIP_TABLEVIS=false + - WIP_NODELINKVIS=false + - WIP_RAWJSONVIS=false + - WIP_PAOHVIS=true + - WIP_MATRIXVIS=true + - WIP_SEMANTICSUBSTRATESVIS=true + - WIP_MAPVIS=true + - WIP_INSIGHT_SHARING=true + - WIP_VIEWER_PERMISSIONS=true + - WIP_SHARABLE_EXPLORATION=true restart: always - networks: - - graphpolaris_network + # networks: + # - graphpolaris_network -networks: - graphpolaris_network: - name: custom_network - external: true +# networks: +# graphpolaris_network: +# name: custom_network +# external: true diff --git a/libs/shared/lib/statistics/graphStatistics.ts b/libs/shared/lib/statistics/graphStatistics.ts index ffaf9fb4ffbac110ed58f826dfbc34dffedf1812..53ead16bd4182a63d62696d428f4a55ab5f770f3 100644 --- a/libs/shared/lib/statistics/graphStatistics.ts +++ b/libs/shared/lib/statistics/graphStatistics.ts @@ -9,7 +9,7 @@ const getGraphStatistics = (graph: GraphQueryResultFromBackend): GraphStatistics const n_edges = edges.length; const metaData: GraphStatistics = { - topological: { density: (n_edges * 2) / (n_nodes * (n_nodes - 1)), self_loops: 0 }, + topological: { density: (n_edges * 2) / (n_nodes * (n_nodes - 1)) || 0, self_loops: 0 }, nodes: { labels: [], count: n_nodes, types: {} }, edges: { labels: [], count: n_edges, types: {} }, }; diff --git a/libs/shared/lib/statistics/tests/graphStatistics.spec.ts b/libs/shared/lib/statistics/tests/graphStatistics.spec.ts index 772de801127f89e251dd3d3b34d53457d233b1cb..9d59f2906c7a1908c0dc5f252cfa6320f4cbe792 100644 --- a/libs/shared/lib/statistics/tests/graphStatistics.spec.ts +++ b/libs/shared/lib/statistics/tests/graphStatistics.spec.ts @@ -21,8 +21,8 @@ describe('getGraphStatistics', () => { it('should return correct statistics for a graph with nodes and no edges', () => { const graph: GraphQueryResultFromBackend = { nodes: [ - { _id: '1', attributes: { age: 25 } }, - { _id: '2', attributes: { age: 30, city: 'New York' } }, + { _id: '1', label: 'Person', attributes: { age: 25 } }, + { _id: '2', label: 'Person', attributes: { age: 30, city: 'New York' } }, ], edges: [], }; @@ -51,19 +51,19 @@ describe('getGraphStatistics', () => { it('should return correct statistics for a graph with edges and nodes', () => { const graph: GraphQueryResultFromBackend = { nodes: [ - { _id: '1', attributes: { age: 25 } }, - { _id: '2', attributes: { age: 30 } }, + { _id: '1', label: 'Person', attributes: { age: 25 } }, + { _id: '2', label: 'Person', attributes: { age: 30 } }, ], edges: [ - { _id: 'e1', attributes: { weight: 5 }, from: '1', to: '2' }, - { _id: 'e2', attributes: { weight: 10 }, from: '2', to: '2' }, // self-loop + { _id: 'e1', label: 'Relationship', attributes: { weight: 5 }, from: '1', to: '2' }, + { _id: 'e2', label: 'Relationship', attributes: { weight: 10 }, from: '2', to: '2' }, // self-loop ], }; const stats = getGraphStatistics(graph); expect(stats).toEqual({ - topological: { density: 1, self_loops: 1 }, + topological: { density: 2, self_loops: 1 }, nodes: { labels: ['Person'], // Assuming default label count: 2, diff --git a/libs/shared/lib/statistics/utils/getNodeOrEdgeType.ts b/libs/shared/lib/statistics/utils/getNodeOrEdgeType.ts index 54caff5a0692faad3aa6bbcfde821f3656ec0fe2..3ebc861319db14d4690c1b57853c933bcfb39fcf 100644 --- a/libs/shared/lib/statistics/utils/getNodeOrEdgeType.ts +++ b/libs/shared/lib/statistics/utils/getNodeOrEdgeType.ts @@ -17,6 +17,7 @@ const getEdgeType = (edge: GraphQueryResultFromBackend['edges'][number]): string if (!edge._id.includes('/')) { edgeType = edge.attributes.Type as string; } + if (edge.label) edgeType = edge.label; return edgeType; };