Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stur86/magresview-2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: CCP-NC/magresview-2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 9,292 additions and 7,229 deletions.
  1. +2 −0 .dockerignore
  2. +31 −0 .github/workflows/node.js.yml
  3. +23 −0 Dockerfile
  4. +19 −1 README.md
  5. +15 −0 docker-compose.yml
  6. +7,806 −6,958 package-lock.json
  7. +6 −3 package.json
  8. +2 −2 public/index.html
  9. +31 −0 src/controls/MVCScaleBar.css
  10. +92 −0 src/controls/MVCScaleBar.js
  11. +1 −1 src/controls/MVCheckBox.css
  12. +2 −2 src/controls/MVListSelect.css
  13. +13 −4 src/controls/MVRange.js
  14. +5 −0 src/controls/MVTooltip.css
  15. +45 −0 src/controls/MVTooltip.js
  16. +175 −6 src/core/plot/MVPlot1D.js
  17. +7 −3 src/core/sidebars/MVSidebarDip.js
  18. +24 −5 src/core/sidebars/MVSidebarEFG.js
  19. +4 −5 src/core/sidebars/MVSidebarEuler.js
  20. +36 −4 src/core/sidebars/MVSidebarFiles.js
  21. +8 −4 src/core/sidebars/MVSidebarJCoup.js
  22. +28 −5 src/core/sidebars/MVSidebarLoad.js
  23. +24 −3 src/core/sidebars/MVSidebarMS.js
  24. +21 −4 src/core/sidebars/MVSidebarPlots.js
  25. +15 −1 src/core/sidebars/MVSidebarSelect.js
  26. +6 −0 src/core/sidebars/MagresViewSidebar.css
  27. +34 −0 src/core/sidebars/tooltip_messages.js
  28. +38 −3 src/core/store/interfaces/AppInterface.js
  29. +36 −1 src/core/store/interfaces/CScaleInterface.js
  30. +29 −3 src/core/store/interfaces/DipInterface.js
  31. +28 −1 src/core/store/interfaces/EFGInterface.js
  32. +1 −1 src/core/store/interfaces/EulerInterface.js
  33. +263 −14 src/core/store/interfaces/FilesInterface.js
  34. +29 −3 src/core/store/interfaces/JCoupInterface.js
  35. +26 −1 src/core/store/interfaces/MSInterface.js
  36. +65 −3 src/core/store/interfaces/PlotsInterface.js
  37. +15 −8 src/core/store/interfaces/SelInterface.js
  38. +15 −2 src/core/store/listeners/cscales.js
  39. +2 −2 src/core/store/listeners/display.js
  40. +17 −3 src/core/store/listeners/labels.js
  41. +3 −2 src/core/store/listeners/links.js
  42. +20 −4 src/core/store/listeners/plots.js
  43. +2 −2 src/core/store/listeners/views.js
  44. +50 −5 src/core/store/utils.js
  45. +5 −0 src/core/themes.css
  46. +1 −1 src/icons/MVIcon.js
  47. +13 −159 src/icons/logo.svg
  48. +159 −0 src/icons/logo_original.svg
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
31 changes: 31 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build --if-present
- run: npm test
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:16-alpine as base

FROM base as prod

WORKDIR /app
COPY package*.json .
RUN npm install
COPY . .

# -- either --- #
# use npm start a developement server (slower to start up, but quicker to build the docker image...)
EXPOSE 3000
CMD ["npm", "start"]


# -- or --- #
# # or build optimised version of app and serve that
# # (this takes about 90s on my machine)
# RUN npm run build
# RUN npm install -g serve

# EXPOSE 3000
# CMD ["serve", "-s", "build"]
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# magresview-2
MagresView 2.0 - NMR crystallography visualisation app

### Running a local copy

If you want to run MagresView 2.0 (offline) on your local machine, you need to get the `gh-pages` branch of the code as this contains the pre-built app.

You can get the current version here:

https://github.com/CCP-NC/magresview-2/archive/refs/heads/gh-pages.zip

Once downloaded, you no longer need an internet connection. You simply unzip the file, which will create a directory called `magresview-2-gh-pages`; in that you'll find an `index.html` file. Opening this in the browser of your choice starts the app.

**Alternatively**, if you prefer, you can instead use [git](https://github.com/git-guides/install-git) to download the `gh-pages` branch:

`git clone -b gh-pages https://github.com/CCP-NC/magresview-2.git`

This will create a directory called `magresview-2` within which you'll find the `index.html` file.



### Developers

Check out `docs/DevArchitecture.md` for an explanation of the structure of the software and conventions to adopt.
Check out `docs/DevArchitecture.md` for an explanation of the structure of the software and conventions to adopt.
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.9'
services:
app:
build:
context: "./"
target: "base"
command: sh -c "npm install && npm start"
environment:
- NODE_ENV=development
- PORT=3000
ports:
- "3000:3000"
working_dir: /app
volumes:
- .:/app
Loading