Skip to content

Refactor/nx #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2e2db29
refactor: replace with nx workspace
ngfelixl Oct 5, 2021
e5868d1
chore: add copy-files script
ngfelixl Oct 5, 2021
42f546a
chore: install material, fix serving of static files
ngfelixl Oct 5, 2021
7aadfc1
chore: install nestjs
ngfelixl Oct 5, 2021
4be2c8c
feat: add interfaces library
ngfelixl Oct 18, 2021
3dd7b93
feat: github icon, mat-drawer, fix plot add
ngfelixl Oct 18, 2021
a47dbd9
feat: add plotly link, stack components
ngfelixl Oct 18, 2021
3759922
refactor: create standalone server library
ngfelixl Oct 18, 2021
97a9841
chore: update license year
ngfelixl Dec 9, 2021
57f311f
docs: add notes for the implementation
ngfelixl Dec 9, 2021
77477c2
chore: update nestjs dependencies
ngfelixl Dec 9, 2021
05fa404
feat: establish socket.io connection
ngfelixl Dec 9, 2021
d71783f
feat: allow single time plots and realtime streams
ngfelixl Dec 11, 2021
5a9f16b
chore: add webpack copy plugin
ngfelixl Dec 13, 2021
ef1d4fc
chore: add package-lock
ngfelixl Dec 19, 2021
7969f37
chore: update to 13 and run migrations
ngfelixl Dec 19, 2021
2a33793
refactor: use socket.io-client instead of ngx-socket-io
ngfelixl Dec 19, 2021
e5eae61
chore: disconnect from socket on destroy
ngfelixl Dec 19, 2021
3bb27b2
chore: use setup-node@v2 github action
ngfelixl Dec 19, 2021
9a8ffc0
chore: update package name and remove ngrx from eslint plugins
ngfelixl Dec 19, 2021
cf4093b
refactor(web): remove overview component
ngfelixl Dec 19, 2021
d26ee96
tests(web): add tests for plots and app component
ngfelixl Dec 19, 2021
963b964
feat(web): add link to tutorial in toolbar
ngfelixl Dec 19, 2021
b57ebab
styles(web): reduce icon size
ngfelixl Dec 19, 2021
90393de
refactor: merge the nodeplotlib files into one library
ngfelixl Dec 19, 2021
7d0b5b2
fix: copy web files to nodeplotlib build
ngfelixl Dec 19, 2021
83d4b1d
chore(nodeplotlib): fix eslint config
ngfelixl Dec 19, 2021
5bc16ec
chore: add implicitDependencies for dev-server and web-e2e
ngfelixl Dec 20, 2021
131e065
docs: update readmes and tutorial component
ngfelixl Dec 20, 2021
0cad48b
feat(nodeplotlib): add possibility to set NODEPLOTLIB_PORT
ngfelixl Dec 20, 2021
18ddfb5
chore: remove rxjs as it will be listed in the dependencies
ngfelixl Dec 20, 2021
f4ed9f6
refactor: remove clear function and remove export shutdown
ngfelixl Dec 20, 2021
91063b3
docs: add dev description and link to user docs
ngfelixl Dec 20, 2021
3d25860
chore: add package.json descriptive properties
ngfelixl Dec 20, 2021
c1990d9
fix(tools): fix path for copying web files
ngfelixl Dec 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
},
"plugins": [],
"extends": []
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {},
"plugins": []
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
}
]
}
22 changes: 10 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test
env:
CI: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- run: npm ci
- run: npx nx run-many --target=lint --all
- run: npx nx run-many --target=build --all
- run: npx nx run-many --target=test --all
env:
CI: true
42 changes: 36 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
node_modules/
dist/
# See http://help.github.com/ignore-files/ for more about ignoring files.

yarn.lock
# compiled output
/dist
/tmp
/out-tsc

coverage/
# dependencies
/node_modules

**/plotly.js/**
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

**/*.tgz
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting

/dist
/coverage
4 changes: 1 addition & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"printWidth": 120,
"trailingComma": "all",
"singleQuote": true
}
}
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"angular.ng-template",
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Felix Lemke
Copyright (c) 2021 Felix Lemke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
53 changes: 53 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
These are notes for the stream implementation of Nodeplotlib.

## General

- A plot window (**apps/web**) tries to connect to the server via a realtime api (e.g. websockets).
- The server recognizes the count of connected apps.
- If the user executes the `plot` function several times, it will only open a window if there is no
open connection to a **apps/web**.

## Server lifecycle

- The server starts with the execution of the `plot` function if there is no active server running.
- The server stops if all **apps/web** are disconnected (and there were connections before).

## The plot function

- The plot function can either handle a `Plot` or an `Observable<Plot>`.
- It creates an `Observable<Plot>` by using Rxjs' `of` observable constructor.
- The plot streams are saved in a Plots Set.
- If there is an active **apps/web** that listens to the server, it subscribes to all Plots in the Set.
- It does not submit a whole "plots" object, but rather submits all plots one by one. The reason is
realtime data, for which only the updated plot should be transmitted.
- If all **apps/web** are disconnected, it should close the observable subscriptions of the plots and close
the server as mentioned in the **server lifecycle** section.

## The stack function

- Is the `stack` function really needed? Stack served the purpose that only one window opens which
could display several plots.

## The clear function

- The `clear` function is also probably not needed. Just close all windows and it should close the
subscriptions to the plots and streams.

## Backlog

- The user can remove plots from the frontend. If that happened it submits a message to the
backend so that the subscription can be cancelled and the plot stream can be removed from the plots set.

## Frontend only

- The user has the possibility to rearrange plots per drag and drop.
- The user can resize the individual plot windows.

## Development

To start the app for development purposes run

```
npm run build web -- --watch
npm start dev-server
```
Loading