Skip to content
This repository was archived by the owner on Oct 29, 2022. It is now read-only.

Commit 53541a4

Browse files
committed
feat!: trigger version 1
1 parent 5822653 commit 53541a4

File tree

8 files changed

+222
-115
lines changed

8 files changed

+222
-115
lines changed

README.md

Lines changed: 85 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Project Status: WIPInitial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
1+
[![Project Status: ActiveThe project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
22
![Maintenance score](https://img.shields.io/npms-io/maintenance-score/@asyncapi/modelina)
33
[![Npm latest version](https://img.shields.io/npm/v/@lagoni/edavisualiser)](https://www.npmjs.com/package/@lagoni/edavisualiser)
44
[![License](https://img.shields.io/github/license/jonaslagoni/EDAVisualiser)](https://github.com/asyncapi/modelina/blob/master/LICENSE)
@@ -9,10 +9,6 @@
99

1010
---
1111

12-
## :loudspeaker: ATTENTION:
13-
14-
This package is still under development and has not reached version 1.0.0 yet. This means that its API may contain breaking changes until we're able to deploy the first stable version and begin semantic versioning. Please use tests to ensure expected outputs or to hardcode the version.
15-
1612
https://user-images.githubusercontent.com/13396189/169362612-0b6129b6-09b6-4807-aff9-8b545bcbc5dc.mp4
1713

1814
---
@@ -21,46 +17,109 @@ https://user-images.githubusercontent.com/13396189/169362612-0b6129b6-09b6-4807-
2117

2218
<!-- toc -->
2319

24-
- [:loudspeaker: ATTENTION:](#loudspeaker-attention)
2520
- [EDAVisualiser](#edavisualiser)
26-
- [Inputs](#inputs)
27-
- [Views](#views)
28-
- [Installation](#installation)
29-
- [Contributors ✨](#contributors-)
21+
* [Installation](#installation)
22+
* [Inputs](#inputs)
23+
* [Views](#views)
24+
+ [ApplicationFocusView](#applicationfocusview)
25+
- [**Configurations**](#configurations)
26+
+ [ApplicationView](#applicationview)
27+
- [**Configurations**](#configurations-1)
28+
+ [SystemView](#systemview)
29+
- [**Configurations**](#configurations-2)
30+
* [Showcases](#showcases)
31+
* [Contributors ✨](#contributors-%E2%9C%A8)
3032

3133
<!-- tocstop -->
3234

33-
## EDAVisualiser
34-
EDAVisualiser is a visualization library to show various views revolving around your application. An Application is seen something that communicate with others through incoming and outgoing connections. This is what makes up the foundation for the views.
35+
# EDAVisualiser
36+
EDAVisualiser is a visualization library to show various views revolving around your application. An Application is seen as something that communicates with others through incoming and outgoing "connections". This is what makes up the foundation for the views.
3537

3638
It is written in React, however, it also supports the most used frameworks such as [Vue](./examples/vue/) and [Angular](./examples/angular/), check out the [examples](./examples/) for concrete code examples.
3739

40+
## Installation
41+
42+
Run this command to install the visualizer in your project:
43+
44+
```bash
45+
npm install @lagoni/edavisualiser
46+
```
47+
3848
## Inputs
39-
The library uses a domain-driven approach, meaning we don't assume one or the other input but build on top of a domain model that is specific for this problem we are trying to solve.
49+
The library uses a domain-driven approach, meaning we don't assume one or the other input but build on top of a domain model that is specific to this problem we are trying to solve.
4050

4151
| Input | Example | Description|
4252
|:---:|:---:|:---:|
43-
| [**AsyncAPI**](asyncapi.com/) | <a href="https://jonaslagoni.github.io/EDAVisualiser/asyncapi">Preview</a>, <a href="https://github.com/jonaslagoni/EDAVisualiser/blob/main/examples/simple-react/src/SimpleAsyncapi.tsx">code</a> | *Allows you to reuse pre-parsed AsyncAPI documents from the [official AsyncAPI parser](github.com/asyncapi/parser-js), underneath it splits up the AsyncAPI document into the core building blocks.* |
44-
| **Core building blocks** | <a href="https://jonaslagoni.github.io/EDAVisualiser/asyncapi">Preview</a>, <a href="https://github.com/jonaslagoni/EDAVisualiser/blob/main/examples/simple-react/src/SimpleApp.tsx">code</a> | *The core building blocks that is the domain abstraction for inputs, is what any other input type is converted to.* |
53+
| [**AsyncAPI**](https://www.asyncapi.com/) | <a href="https://jonaslagoni.github.io/EDAVisualiser/asyncapi">Preview</a>, <a href="https://github.com/jonaslagoni/EDAVisualiser/blob/main/examples/simple-react/src/SimpleAsyncapi.tsx">code</a> | *Allows you to reuse pre-parsed AsyncAPI documents from the [official AsyncAPI parser](github.com/asyncapi/parser-js), underneath it splits up the AsyncAPI document into the core building blocks. AsyncAPI v2.0 -> v2.5 is supported.* |
54+
| **Core building blocks** | <a href="https://jonaslagoni.github.io/EDAVisualiser/">Preview</a>, <a href="https://github.com/jonaslagoni/EDAVisualiser/blob/main/examples/simple-react/src/SimpleApp.tsx">code</a> | *The core building blocks is the domain abstraction for inputs this is what any other input type is converted to.* |
4555

4656

4757
## Views
4858

49-
A view could for example be how a ["system" of applications are related](https://jonaslagoni.github.io/EDAVisualiser/social-media), [how a single application relate to others](https://jonaslagoni.github.io/EDAVisualiser/social-media/application/notification_service), only the fantasy sets the limitations, and [feel free to propose new ideas](https://github.com/jonaslagoni/EDAVisualiser/issues/new)!
59+
A view could for example be how a ["system" of applications is related](https://jonaslagoni.github.io/EDAVisualiser/social-media), [how a single application relates to others](https://jonaslagoni.github.io/EDAVisualiser/social-media/application/notification_service), only the fantasy sets the limitations, and [feel free to propose new ideas](https://github.com/jonaslagoni/EDAVisualiser/issues/new)!
5060

51-
| View | Example | Description|
52-
|:---:|:---:|:---:|
53-
| **ApplicationFocusView** | <a href="https://jonaslagoni.github.io/EDAVisualiser/social-media/application/notification_service"><img src="./docs/img/applicationFocusView.png" /></a> | *Puts a single application in focus as part of a larger system. Used to figure out who are "connected" to the application* |
54-
| **ApplicationView** | <a href="https://jonaslagoni.github.io/EDAVisualiser/"><img src="./docs/img/applicationView.png" /></a> | *Puts a single application is focus.* |
55-
| **SystemView** | <a href="https://jonaslagoni.github.io/EDAVisualiser/social-media"><img src="./docs/img/systemView.png" /></a> | *Puts the system/collection of application in focus to figure out how they are all connected.* |
61+
### ApplicationFocusView
62+
Puts a single application in focus as part of a larger system. Used to figure out who is "connected" to the application.
5663

57-
## Installation
64+
<a href="https://jonaslagoni.github.io/EDAVisualiser/social-media/application/notification_service"><img src="./docs/img/applicationFocusView.png" /></a>
5865

59-
Run this command to install the visualizer in your project:
66+
#### **Configurations**
6067

61-
```bash
62-
npm install @lagoni/edavisualiser
63-
```
68+
These are all the arguments you can use to configure the view.
69+
| Arguments | Description | Value type | Default |
70+
|:---:|:---:|:---:|:---:|
71+
| `application` | The core building block for setting the application information. | `ApplicationNodeData \| undefined` | `undefined` |
72+
| `incomingOperations` | The core building block for setting incoming operations for the application. | `Array<IncomingNodeData> \| undefined` | undefined |
73+
| `outgoingOperations` | The core building block for setting incoming operations for the application. | `Array<OutgoingNodeData> \| undefined` | undefined |
74+
| `external` | This is the main difference from the `ApplicationView` as it shows how external applications interact with it. | `Array<ApplicationViewData> \| undefined` | undefined |
75+
| `asyncapi` | If the application is to be loaded from a pre-parsed AsyncAPI document, which can extend the node with a custom react component in the top of the node. I.e., if you want to render a button or whatever it can be. | `AsyncapiApplicationData \| undefined` | undefined |
76+
| `layout` | Used to customize the layout of nodes by setting their position. | `(elements: FlowElement[]) => React.JSXElementConstructor<LayoutProps> \| undefined` | A column layout (`ColumnLayout`) |
77+
| `sideMenu` | Used to create a custom menu, or whatever you wish to display within the view on top of the nodes. | `() => React.JSXElementConstructor<any> \| undefined` | Simple headline with the library name |
78+
| `includeControls` | Include controls to zoom in and out, focus and lock nodes. | `boolean \| undefined` | `false` |
79+
| `edgeType` | Determine the type of edge between nodes. | Either `'smoothstep'`, `'step'`, `'straight'`, `'floating'`, `'default'`, `'simplebezier'`, `'animated'` | `smoothstep` 
80+
81+
82+
### ApplicationView
83+
Puts a single application in focus with only it's near connections that are incoming to the application or outgoing from it.
84+
85+
<a href="https://jonaslagoni.github.io/EDAVisualiser/"><img src="./docs/img/applicationView.png" /></a>
86+
87+
#### **Configurations**
88+
89+
These are all the arguments you can use to configure the view.
90+
| Arguments | Description | Value type | Default |
91+
|:---:|:---:|:---:|:---:|
92+
| `application` | The core building block for setting the application information. | `ApplicationNodeData \| undefined` | `undefined` |
93+
| `incomingOperations` | The core building block for setting incoming operations for the application. | `Array<IncomingNodeData> \| undefined` | undefined |
94+
| `outgoingOperations` | The core building block for setting incoming operations for the application. | `Array<OutgoingNodeData> \| undefined` | undefined |
95+
| `asyncapi` | If the application is to be loaded from a pre-parsed AsyncAPI document, which can extend the node with a custom react component in the top of the node. I.e., if you want to render a button or whatever it can be. | `AsyncapiApplicationData \| undefined` | undefined |
96+
| `layout` | Used to customize the layout of nodes by setting their position. | `(elements: FlowElement[]) => React.JSXElementConstructor<LayoutProps> \| undefined` | A column layout (`ColumnLayout`) |
97+
| `sideMenu` | Used to create a custom menu, or whatever you wish to display within the view on top of the nodes. | `() => React.JSXElementConstructor<any> \| undefined` | Simple headline with the library name |
98+
| `includeControls` | Include controls to zoom in and out, focus and lock nodes. | `boolean \| undefined` | `false` |
99+
| `edgeType` | Determine the type of edge between nodes. | Either `'smoothstep'`, `'step'`, `'straight'`, `'floating'`, `'default'`, `'simplebezier'`, `'animated'` | `smoothstep` 
100+
101+
### SystemView
102+
Puts the system/collection of applications in focus to figure out how they are all connected.
103+
104+
<a href="https://jonaslagoni.github.io/EDAVisualiser/social-media"><img src="./docs/img/systemView.png" /></a>
105+
106+
#### **Configurations**
107+
108+
These are all the arguments you can use to configure the view.
109+
| Arguments | Description | Value type | Default |
110+
|:---:|:---:|:---:|:---:|
111+
| `applications` | A list of all the applications within your "system". | `Array<ApplicationViewData> \| undefined` | `undefined` |
112+
| `layout` | Used to customize the layout of nodes by setting their position. | `(elements: FlowElement[]) => React.JSXElementConstructor<LayoutProps> \| undefined` | A circle layout (`CircleLayout`) |
113+
| `sideMenu` | Used to create a custom menu, or whatever you wish to display within the view on top of the nodes. | `() => React.JSXElementConstructor<any> \| undefined` | Simple headline with the library name |
114+
| `includeControls` | Include controls to zoom in and out, focus and lock nodes. | `boolean \| undefined` | `false` |
115+
| `edgeType` | Determine the type of edge between nodes. | Either `'smoothstep'`, `'step'`, `'straight'`, `'floating'`, `'default'`, `'simplebezier'`, `'animated'` | `smoothstep` 
116+
117+
## Showcases
118+
These are the use-cases and where this library is used that you can use as inspiration.
119+
120+
- AsyncAPI Studio, was where this library's components was [originally created and split out from](https://github.com/asyncapi/studio/pull/342). It uses this library to visualize AsyncAPI documents.
121+
122+
Feel free to add your own projects that are using this library and why.
64123

65124
## Contributors ✨
66125
Thanks go to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

examples/simple-react/src/social_media/System.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Asyncapi() {
2727
node = (
2828
<SystemView
2929
includeControls={true}
30-
sideMenu={() => Menu}
30+
sideMenu={() => <Menu/> as any}
3131
applications={asyncapiDocuments.map(({ parsedDoc, name }) => {
3232
return {
3333
asyncapi: {

examples/simple-react/src/social_media/application.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function Asyncapi() {
3535
if (externalApplications.length > 0 && focusedApplication !== undefined) {
3636
node = (
3737
<ApplicationFocusView
38-
sideMenu={() => Menu}
38+
sideMenu={() => <Menu/> as any}
3939
asyncapi={{ document: focusedApplication.parsedDoc }}
4040
external={externalApplications.map(({ parsedDoc, name }) => {
4141
return {

examples/simple-react/src/social_media/menu.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ export function Menu() {
44
<div className="space-x-2 py-2 m-4 inline-block text-lg px-2 text-gray-800">
55
<span className="font-bold">Visualiser</span>
66
</div>
7-
<div style={{padding: "0 30px"}}><a href="/social-media/system" className="font-light capitalize">View system</a></div>
8-
<div style={{padding: "0 30px"}}><a href="/social-media/application/frontend" className="font-light capitalize">View frontend application</a></div>
9-
<div style={{padding: "0 30px"}}><a href="/social-media/application/backend" className="font-light capitalize">View backend application</a></div>
10-
<div style={{padding: "0 30px"}}><a href="/social-media/application/comments_service" className="font-light capitalize">View comments application</a></div>
11-
<div style={{padding: "0 30px"}}><a href="/social-media/application/notification_service" className="font-light capitalize">View notification application</a></div>
12-
<div style={{padding: "0 30px"}}><a href="/social-media/application/public_api" className="font-light capitalize">View public application</a></div>
7+
<div style={{padding: "0 30px"}}><a href="/EDAVisualiser/social-media" className="font-light capitalize">View system</a></div>
8+
<div style={{padding: "0 30px"}}><a href="/EDAVisualiser/social-media/application/frontend" className="font-light capitalize">View frontend application</a></div>
9+
<div style={{padding: "0 30px"}}><a href="/EDAVisualiser/social-media/application/backend" className="font-light capitalize">View backend application</a></div>
10+
<div style={{padding: "0 30px"}}><a href="/EDAVisualiser/social-media/application/comments_service" className="font-light capitalize">View comments application</a></div>
11+
<div style={{padding: "0 30px"}}><a href="/EDAVisualiser/social-media/application/notification_service" className="font-light capitalize">View notification application</a></div>
12+
<div style={{padding: "0 30px"}}><a href="/EDAVisualiser/social-media/application/public_api" className="font-light capitalize">View public application</a></div>
1313
</div>
1414
);
1515
}

library/package-lock.json

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

library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"get:version": "echo $npm_package_version"
5151
},
5252
"dependencies": {
53-
"@asyncapi/parser": "^1.15.0",
53+
"@asyncapi/parser": "^1.17.0",
5454
"canvas": "^2.9.1",
5555
"dompurify": "^2.3.8",
5656
"highlight.js": "^11.5.1",

0 commit comments

Comments
 (0)