-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
238 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,9 @@ module.exports = { | |
{ allowConstantExport: true }, | ||
], | ||
}, | ||
settings: { | ||
react: { | ||
version: "detect", | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM registry.hub.docker.com/library/node:18-alpine as base | ||
|
||
ENV APP_DIR /dedi-web | ||
|
||
COPY . ${APP_DIR} | ||
WORKDIR ${APP_DIR} | ||
|
||
RUN npm install | ||
RUN npm run build | ||
|
||
CMD ["npm", "run", "preview"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
# Dedi-web | ||
|
||
A browser tool to calculate the beam centering parameters. Like dedi within dawn science. | ||
[![dedi-web code CI](https://github.com/tizayi/dedi-web/actions/workflows/code.yml/badge.svg)](https://github.com/tizayi/dedi-web/actions/workflows/code.yml) | ||
|
||
A browser tool to calculate the beam centering parameters. Like dedi within dawn science. Built using react and vite. | ||
|
||
## Start dev server | ||
|
||
Start up | ||
|
||
```bash | ||
cd dedi-web | ||
npm run dev | ||
``` | ||
|
||
Start up in a container | ||
|
||
```bash | ||
cd dedi-web | ||
docker build -t dedi-web . | ||
docker run -d dedi-web | ||
``` | ||
|
||
## Test | ||
|
||
Run tests with vitest | ||
|
||
```bash | ||
cd dedi-web | ||
npm run test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,4 @@ | |
"vite": "^4.4.5", | ||
"vitest": "^0.34.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import { expect, test } from "vitest"; | ||
import Vector2D from "./vector"; | ||
|
||
test("Vector inplace addition", () => { | ||
const vector1 = new Vector2D(1, 1); | ||
const vector2 = new Vector2D(1, 1); | ||
vector1.add(vector2); | ||
expect(vector1.equals(new Vector2D(2, 2))); | ||
}); | ||
|
||
test('Vector inplace addition', () => { | ||
const vector1 = new Vector2D(1, 1) | ||
const vector2 = new Vector2D(1, 1) | ||
vector1.add(vector2) | ||
expect(vector1.equals(new Vector2D(2, 2))) | ||
}) | ||
|
||
test('Vector scale addition', () => { | ||
const vector1 = new Vector2D(2, 3) | ||
vector1.scale(2) | ||
expect(vector1.equals(new Vector2D(4, 6))) | ||
}) | ||
test("Vector scale addition", () => { | ||
const vector1 = new Vector2D(2, 3); | ||
vector1.scale(2); | ||
expect(vector1.equals(new Vector2D(4, 6))); | ||
}); | ||
|
||
test("Vector length", () => { | ||
const vector1 = new Vector2D(2, 2) | ||
expect(vector1.length()).toBe(2.8284271247461903); | ||
}) | ||
const vector1 = new Vector2D(2, 2); | ||
expect(vector1.length()).toBe(2.8284271247461903); | ||
}); |
Oops, something went wrong.