Skip to content

Commit d822669

Browse files
Merge pull request #792 from oliviajanejohns/explore-cytoscape-merge
Add CALM Visualizer to README / CodeOwners
2 parents 0826268 + b9e60a6 commit d822669

File tree

16 files changed

+30423
-27042
lines changed

16 files changed

+30423
-27042
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/cli/ @aidanm3341 @lbulanti-ms @willosborne @grahampacker-ms @jpgough-ms @rocketstack-matt @Thels
88

9+
/calm-visualizer/ @oliviajanejohns @aidanm3341 @aamanrebello @yoofitt96
10+
911
/shared/ @aidanm3341 @lbulanti-ms @willosborne @grahampacker-ms @jpgough-ms @rocketstack-matt @Thels
1012

1113
/translator/ @Budlee @matthewgardner @jpgough-ms @rocketstack-matt

.github/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ calm-hub:
88
- "calm-hub/**"
99
calm:
1010
- "calm/**"
11+
calm-visualizer:
12+
- "calm-visualizer/**"
1113
config:
1214
- "pom.xml"
1315
- "**/package.json"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build CALM Visualizer
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- "calm-visualizer/**"
9+
push:
10+
branches:
11+
- "main"
12+
paths:
13+
- "calm-visualizer/**"
14+
15+
jobs:
16+
shared:
17+
name: Build, Test, and Lint Shared Module
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout PR Branch
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: v20
28+
29+
- name: Install workspace
30+
run: npm ci
31+
32+
- name: Lint Shared Module
33+
run: npm run lint --workspace=calm-visualizer
34+
35+
- name: Build workspace
36+
run: npm run build --workspace=calm-visualizer
37+
38+
- name: Run tests for Shared
39+
run: npm run test --workspace=calm-visualizer

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ your project.
2424

2525
## Projects
2626

27-
| Project | Lead Maintainers | Builds |
28-
|----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
29-
| [Common Architecture Language Model](./calm) | [@rocketstack-matt](https://github.com/rocketstack-matt), [@jpgough-ms](https://github.com/jpgough-ms) | [![Validation of CALM Samples](https://github.com/finos/architecture-as-code/actions/workflows/validate-spectral.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/validate-spectral.yml) |
30-
| [Docs](./docs) | [@rocketstack-matt](https://github.com/rocketstack-matt) | [![Sync Docs to S3](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml) [![Build Docs](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml) |
31-
| [CLI](./cli) & [Shared](./shared) | [@aidanm3341](https://github.com/aidanm3341), [@lbulanti-ms](https://github.com/lbulanti-ms), [@willosborne](https://github.com/willosborne), [@grahampacker-ms](https://github.com/grahampacker-ms) [@Thels](https://github.com/Thels) | [![Build CLI](https://github.com/finos/architecture-as-code/actions/workflows/build-cli.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-cli.yml)|
32-
| [Translators](./translator) | [@Budlee](https://github.com/Budlee) [@matthewgardner](https://github.com/matthewgardner) [@jpgough-ms](https://github.com/jpgough-ms) | [![Build Translator](https://github.com/finos/architecture-as-code/actions/workflows/build-translator.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-translator.yml) |
27+
| Project | Lead Maintainers | Builds |
28+
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29+
| [Common Architecture Language Model](./calm) | [@rocketstack-matt](https://github.com/rocketstack-matt), [@jpgough-ms](https://github.com/jpgough-ms) | [![Validation of CALM Samples](https://github.com/finos/architecture-as-code/actions/workflows/validate-spectral.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/validate-spectral.yml) |
30+
| [Docs](./docs) | [@rocketstack-matt](https://github.com/rocketstack-matt) | [![Sync Docs to S3](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml) [![Build Docs](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml) |
31+
| [CLI](./cli) & [Shared](./shared) | [@aidanm3341](https://github.com/aidanm3341), [@lbulanti-ms](https://github.com/lbulanti-ms), [@willosborne](https://github.com/willosborne), [@grahampacker-ms](https://github.com/grahampacker-ms) [@Thels](https://github.com/Thels) | [![Build CLI](https://github.com/finos/architecture-as-code/actions/workflows/build-cli.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-cli.yml) |
32+
| [Visualizer](./calm-visualizer) | [@oliviajanejohns](https://github.com/oliviajanejohns) [@aidanm3341](https://github.com/aidanm3341) [@aamanrebello](https://github.com/aamanrebello) [@yoofitt96](https://github.com/YoofiTT96) |
33+
| [Translators](./translator) | [@Budlee](https://github.com/Budlee) [@matthewgardner](https://github.com/matthewgardner) [@jpgough-ms](https://github.com/jpgough-ms) | [![Build Translator](https://github.com/finos/architecture-as-code/actions/workflows/build-translator.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-translator.yml) |
3334

3435
## Getting Involved
3536

@@ -58,22 +59,19 @@ We accept contributions via Pull Request, to make a contribution:
5859
6. Push to the branch (`git push origin feature/fooBar`)
5960
7. Create a new Pull Request
6061

61-
6262
## GitHub actions
6363

6464
There aren't many standards to follow when it comes to Github actions - but some good rules of thumb for this project are;
6565

6666
- GitHub actions should follow the naming conventions of pre-existing actions to maintain consistency. So that users can find other build-related steps in the same place.
6767
- Ensure that any obscure actions are documented so that others can follow and maintain them.
6868

69-
7069
## Language Dependencies
7170

7271
### TypeScript Packages
7372

7473
Currently we have three typescript packages - two of which are managed via `npm workspaces` and one which is just raw `npm`. How these are built and manages slightly differs until they are all under the same worksapce - please look at their related github actions to learn how to build/test each of them.
7574

76-
7775
## License
7876

7977
Copyright 2024 FINOS

calm-visualizer/README.md

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
1-
# React + TypeScript + Vite
1+
## Calm Visualizer
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3+
Calm Visualizer is a tool designed to help visualize and manage software architecture through a UI.
44

5-
Currently, two official plugins are available:
5+
### Features
66

7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7+
- Visualize uploaded architecure JSON file using cytoscape JS
8+
- Toggle connection and node descriptions
99

10-
## Expanding the ESLint configuration
10+
### Installation
1111

12-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
12+
To install Calm Visualizer, clone the repository and install the dependencies:
1313

14-
- Configure the top-level `parserOptions` property like this:
14+
```sh
15+
cd calm-visualizer
16+
npm install
17+
```
18+
19+
### Usage
20+
21+
To start the UI, run:
1522

16-
```js
17-
export default tseslint.config({
18-
languageOptions: {
19-
// other options...
20-
parserOptions: {
21-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
22-
tsconfigRootDir: import.meta.dirname,
23-
},
24-
},
25-
});
23+
```sh
24+
npm run dev
2625
```
2726

28-
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29-
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31-
32-
```js
33-
// eslint.config.js
34-
import react from 'eslint-plugin-react';
35-
36-
export default tseslint.config({
37-
// Set the react version
38-
settings: { react: { version: '18.3' } },
39-
plugins: {
40-
// Add the react plugin
41-
react,
42-
},
43-
rules: {
44-
// other rules...
45-
// Enable its recommended rules
46-
...react.configs.recommended.rules,
47-
...react.configs['jsx-runtime'].rules,
48-
},
49-
});
27+
This will start the UI and you can access the application at `http://localhost:5174`.
28+
29+
### Building for Production
30+
31+
To build the application for production, run:
32+
33+
```sh
34+
npm run build
5035
```
36+
37+
This will create a `dist` directory with the production build of the application.
38+
39+
## License
40+
41+
Copyright 2024 FINOS
42+
43+
Distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
44+
45+
SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)

calm-visualizer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="en" data-theme="cupcake">
2+
<html lang="en" data-theme="emerald">
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />

calm-visualizer/package-lock.json

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

calm-visualizer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"devDependencies": {
2929
"@eslint/js": "^9.14.0",
30+
"@tailwindcss/typography": "^0.5.16",
3031
"@testing-library/jest-dom": "^6.6.3",
3132
"@testing-library/react": "^16.1.0",
3233
"@testing-library/user-event": "^14.5.2",

calm-visualizer/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { useState } from 'react';
22
import './App.css';
33
import Drawer from './components/drawer/Drawer';
44
import Navbar from './components/navbar/Navbar';
5-
import { CALMInstantiation } from '../../shared/src/types';
5+
import { CALMArchitecture } from '../../shared/src/types';
66
import React from 'react';
77

88
function App() {
99
const [title, setTitle] = useState<string | undefined>(undefined);
10-
const [instance, setCALMInstance] = useState<CALMInstantiation | undefined>(undefined);
10+
const [instance, setCALMInstance] = useState<CALMArchitecture | undefined>(undefined);
1111
const [isConDescActive, setConDescActive] = React.useState(false);
1212
const [isNodeDescActive, setNodeDescActive] = React.useState(false);
1313

calm-visualizer/src/components/cytoscape-renderer/CytoscapeRenderer.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export type Edge = {
6969
};
7070
};
7171

72+
7273
interface Props {
7374
title?: string;
7475
isNodeDescActive: boolean;
@@ -91,7 +92,8 @@ const CytoscapeRenderer = ({
9192

9293
useEffect(() => {
9394
if (cy) {
94-
(cy as any).nodeHtmlLabel([
95+
/* eslint-disable @typescript-eslint/no-explicit-any */
96+
(cy as Core & { nodeHtmlLabel: any }).nodeHtmlLabel([
9597
{
9698
query: '.node',
9799
halign: 'center',
@@ -128,7 +130,7 @@ const CytoscapeRenderer = ({
128130
cy.destroy();
129131
};
130132
}
131-
}, [cy]);
133+
}, [cy, isNodeDescActive]);
132134

133135
useEffect(() => {
134136
// Initialize Cytoscape instance
@@ -164,13 +166,14 @@ const CytoscapeRenderer = ({
164166
layout: fcoseLayoutOptions,
165167
})
166168
);
167-
}, [nodes, edges]); // Re-render on cy, nodes or edges change
169+
}, [nodes, edges, isConDescActive]); // Re-render on cy, nodes or edges change
168170

169171
return (
170172
<div className="relative flex m-auto border">
171173
{title && (
172-
<div className="graph-title absolute m-5 bg-primary-content shadow-md">
173-
<span className="text-m">Architecture: {title}</span>
174+
<div className="graph-title absolute m-5 bg-primary shadow-md">
175+
<span className="text-m font-thin">Architecture: </span>
176+
<span className="text-m font-semibold">{title}</span>
174177
</div>
175178
)}
176179
<div

0 commit comments

Comments
 (0)