From 433a801e59ea3fe36882d93446e6be5ab65ac768 Mon Sep 17 00:00:00 2001 From: Konstantin Ladutenko Date: Wed, 31 Jan 2024 17:18:57 +0300 Subject: [PATCH 1/7] update git modules --- .gitmodules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitmodules b/.gitmodules index 303c3d6..0c5602e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,7 @@ +# git submodule update --init --recursive [submodule "guiapp/public/refractiveindex.info-database"] path = guiapp/public/refractiveindex.info-database url = git@github.com:kostyfisik/refractiveindex.info-database.git +[submodule "guiapp-vite/public/refractiveindex.info-database"] + path = guiapp-vite/public/refractiveindex.info-database + url = git@github.com:kostyfisik/refractiveindex.info-database.git From af76031eebf415c11fe6daee6fe17cbd009c53aa Mon Sep 17 00:00:00 2001 From: Konstantin Ladutenko Date: Wed, 31 Jan 2024 17:19:24 +0300 Subject: [PATCH 2/7] update Makefile --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b5f5bcd..739054c 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,17 @@ wasm: $(SRCDIR)/nmie-js-wrapper.cc $(CXX_NMIE_HEADERS) # emcc --bind -lm -Wall -O2 -std=c++11 -s WASM=1 -s NO_EXIT_RUNTIME=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['addOnPostRun']" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc # emcc --bind -lm -Wall -O2 -std=c++11 -s MODULARIZE=1 -s WASM=1 -o nmie.js $(SRCDIR)/nmie-js-wrapper.cc +# working as 2024-01-31 16:47:23 emcc --bind -lm -Wall -pedantic -O2 -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc + @cp -f nmiejs.js guiapp/src/ + @cp -f nmiejs.wasm guiapp/public/ + +# working with vite export + emcc --bind -lm -Wall -pedantic -O2 -std=c++11 -s EXPORT_ES6=1 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc + @cp -f nmiejs.js guiapp-vite/src/ + @cp -f nmiejs.wasm guiapp-vite/public/ + @cp -f nmiejs.wasm guiapp-vite/src/ + # emcc --bind -lm -Wall -pedantic -Oz -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc # emcc --bind -lm -Wall -pedantic -Oz -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s EXPORT_ES6=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc # emcc --bind -lm -Wall -pedantic -O2 -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s EXPORT_ES6=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc @@ -85,10 +95,6 @@ wasm: $(SRCDIR)/nmie-js-wrapper.cc $(CXX_NMIE_HEADERS) # -o lib/onigasm.js - @cp -f nmiejs.js vue-cli3-webapp/src/ - @cp -f nmiejs.js guiapp/src/ - @cp -f nmiejs.wasm vue-cli3-webapp/public/ - @cp -f nmiejs.wasm guiapp/public/ clean: $(PYTHON) setup.py clean From c0b876fe1734d7704e99c658a260606a42b8619d Mon Sep 17 00:00:00 2001 From: Konstantin Ladutenko Date: Wed, 14 Feb 2024 17:33:39 +0300 Subject: [PATCH 3/7] initial changes --- .gitmodules | 3 - guiapp/.gitignore | 4 + guiapp/README.md | 19 +- guiapp/package.json | 56 ++-- guiapp/quasar.conf.js | 250 ------------------ .../src/components/spectrum/PlotSelector.vue | 2 - guiapp/src/components/utils.ts | 4 +- guiapp/src/pages/Near-field.vue | 6 +- guiapp/src/router/index.ts | 4 +- guiapp/src/store/index.ts | 29 +- src/nmie-web.hpp | 51 ++++ 11 files changed, 118 insertions(+), 310 deletions(-) delete mode 100644 guiapp/quasar.conf.js diff --git a/.gitmodules b/.gitmodules index 0c5602e..fe4fc71 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,3 @@ [submodule "guiapp/public/refractiveindex.info-database"] path = guiapp/public/refractiveindex.info-database url = git@github.com:kostyfisik/refractiveindex.info-database.git -[submodule "guiapp-vite/public/refractiveindex.info-database"] - path = guiapp-vite/public/refractiveindex.info-database - url = git@github.com:kostyfisik/refractiveindex.info-database.git diff --git a/guiapp/.gitignore b/guiapp/.gitignore index 553e134..147199f 100644 --- a/guiapp/.gitignore +++ b/guiapp/.gitignore @@ -5,6 +5,7 @@ node_modules # Quasar core related directories .quasar /dist +/quasar.config.*.temporary.compiled* # Cordova related directories and files /src-cordova/node_modules @@ -31,3 +32,6 @@ yarn-error.log* *.ntvs* *.njsproj *.sln + +# local .env files +.env.local* diff --git a/guiapp/README.md b/guiapp/README.md index 017396f..93d1785 100644 --- a/guiapp/README.md +++ b/guiapp/README.md @@ -5,6 +5,8 @@ Mie scattering simulations ## Install the dependencies ```bash yarn +# or +npm install ``` ### Start the app in development mode (hot-code reloading, error reporting, etc.) @@ -12,15 +14,28 @@ yarn quasar dev ``` + ### Lint the files ```bash -yarn run lint +yarn lint +# or +npm run lint ``` + +### Format the files +```bash +yarn format +# or +npm run format +``` + + + ### Build the app for production ```bash quasar build ``` ### Customize the configuration -See [Configuring quasar.conf.js](https://v2.quasar.dev/quasar-cli/quasar-conf-js). +See [Configuring quasar.config.js](https://v2.quasar.dev/quasar-cli-vite/quasar-config-js). diff --git a/guiapp/package.json b/guiapp/package.json index 5287c50..ef052ef 100644 --- a/guiapp/package.json +++ b/guiapp/package.json @@ -1,16 +1,23 @@ { - "name": "guiapp", - "version": "0.0.1", + "name": "scattnlay-guiapp", + "version": "0.0.2", "description": "Mie scattering simulations", "productName": "Scattnlay", "author": "Konstantin Ladutenko ", "private": true, "scripts": { "lint": "eslint --ext .js,.ts,.vue ./", - "test": "echo \"No test specified\" && exit 0" + "format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore", + "test": "echo \"No test specified\" && exit 0", + "dev": "quasar dev", + "build": "quasar build" }, "dependencies": { - "@quasar/extras": "^1.12.1", + "@quasar/extras": "^1.16.4", + "pinia": "^2.0.11", + "quasar": "^2.8.0", + "vue": "^3.2.29", + "vue-router": "^4.0.12", "core-js": "^3.6.5", "cubic-spline-ts": "^3.0.8", "file-saver": "^2.0.5", @@ -18,45 +25,24 @@ "lodash.clonedeep": "^4.5.0", "mathjs": "^9.5.0", "plotly.js-dist-min": "^2.6.2", - "quasar": "^2.3.3", "uuid": "^8.3.2", "vuex": "^4.0.1" }, "devDependencies": { - "@babel/eslint-parser": "^7.13.14", - "@quasar/app": "^3.2.4", - "@types/emscripten": "^1.39.5", - "@types/file-saver": "^2.0.4", - "@types/js-yaml": "^4.0.5", - "@types/lodash": "^4.14.175", - "@types/node": "^12.20.21", - "@types/plotly.js-dist-min": "^2.3.0", - "@types/uuid": "^8.3.1", - "@typescript-eslint/eslint-plugin": "^4.16.1", - "@typescript-eslint/parser": "^4.16.1", - "electron": "^28.0.0", - "electron-packager": "^15.3.0", - "eslint": "^7.14.0", + "@typescript-eslint/eslint-plugin": "^5.10.0", + "@typescript-eslint/parser": "^5.10.0", + "eslint": "^8.11.0", + "eslint-plugin-vue": "^9.0.0", "eslint-config-prettier": "^8.1.0", - "eslint-plugin-vue": "^7.0.0", - "node-polyfill-webpack-plugin": "^1.1.4", "prettier": "^2.5.1", - "workbox-webpack-plugin": "^6.6.0" + "@types/node": "^12.20.21", + "@quasar/app-vite": "^1.4.3", + "autoprefixer": "^10.4.2", + "typescript": "^4.5.4" }, - "browserslist": [ - "last 10 Chrome versions", - "last 10 Firefox versions", - "last 4 Edge versions", - "last 7 Safari versions", - "last 8 Android versions", - "last 8 ChromeAndroid versions", - "last 8 FirefoxAndroid versions", - "last 10 iOS versions", - "last 5 Opera versions" - ], "engines": { - "node": ">= 12.22.1", + "node": "^20 || ^18 || ^16", "npm": ">= 6.13.4", "yarn": ">= 1.21.1" } -} +} \ No newline at end of file diff --git a/guiapp/quasar.conf.js b/guiapp/quasar.conf.js deleted file mode 100644 index d90ca94..0000000 --- a/guiapp/quasar.conf.js +++ /dev/null @@ -1,250 +0,0 @@ -/* - * This file runs in a Node context (it's NOT transpiled by Babel), so use only - * the ES6 features that are supported by your Node version. https://node.green/ - */ - -// Configuration for your app -// https://v2.quasar.dev/quasar-cli/quasar-conf-js - -/* eslint-env node */ -/* eslint-disable @typescript-eslint/no-var-requires */ -const { configure } = require('quasar/wrappers'); - -module.exports = configure(function (ctx) { - return { - // https://v2.quasar.dev/quasar-cli/supporting-ts - supportTS: { - tsCheckerConfig: { - eslint: { - enabled: true, - files: './src/**/*.{ts,tsx,js,jsx,vue}', - }, - }, - }, - - // https://v2.quasar.dev/quasar-cli/prefetch-feature - // preFetch: true, - - // app boot file (/src/boot) - // --> boot files are part of "main.js" - // https://v2.quasar.dev/quasar-cli/boot-files - boot: [], - - // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css - css: ['app.scss'], - - // https://github.com/quasarframework/quasar/tree/dev/extras - extras: [ - // 'ionicons-v4', - // 'mdi-v5', - // 'fontawesome-v5', - // 'eva-icons', - // 'themify', - // 'line-awesome', - // 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both! - - 'roboto-font', // optional, you are not bound to it - 'material-icons', // optional, you are not bound to it - 'material-icons-outlined', // optional, you are not bound to it - ], - - // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build - build: { - // publicPath: '/', - publicPath: - process.env.NODE_ENV === 'development' - ? '/' - : '/themes/custom/physics/mie/', // deploy path in Drupal setup at physics.ifmo.ru - // : '/themes/custom/physics/mie-next/', // deploy path in Drupal setup at physics.ifmo.ru - - env: { - // copy publicPath from above build.publicPath to make it available from inside of the app. - // publicPath: '/', - publicPath: ctx.dev ? '/' : '/themes/custom/physics/mie/', // deploy path in Drupal setup at physics.ifmo.ru - // publicPath: ctx.dev ? '/' : '/themes/custom/physics/mie-next/', // deploy path in Drupal setup at physics.ifmo.ru - }, - // extendWebpack (cfg, { isServer, isClient }) { - // cfg.module.rules.push({ - // enforce: 'pre', - // test: /\.wasm$/, - // loader: 'wasm-loader' - // }) - // }, - vueRouterMode: 'hash', // available values: 'hash', 'history' - // vueRouterMode: 'history', // available values: 'hash', 'history' - - // transpile: false, - - // Add dependencies for transpiling with Babel (Array of string/regex) - // (from node_modules, which are by default not transpiled). - // Applies only if "transpile" is set to true. - // transpileDependencies: [], - - // rtl: true, // https://v2.quasar.dev/options/rtl-support - // preloadChunks: true, - // showProgress: false, - // gzip: true, - // analyze: true, - - // Options below are automatically set depending on the env, set them if you want to override - // extractCSS: false, - - // https://v2.quasar.dev/quasar-cli/handling-webpack - // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain - chainWebpack(chain) { - const nodePolyfillWebpackPlugin = require('node-polyfill-webpack-plugin'); - chain.plugin('node-polyfill').use(nodePolyfillWebpackPlugin); - }, - }, - - // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer - devServer: { - https: false, - port: 8080, - open: true, // opens browser window automatically - }, - - // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework - framework: { - cssAddon: true, - - // iconSet: 'material-icons', // Quasar icon set - // lang: 'en-US', // Quasar language pack - - // For special cases outside of where the auto-import strategy can have an impact - // (like functional components as one of the examples), - // you can manually specify Quasar components/directives to be available everywhere: - // - // components: [], - // directives: [], - - // Quasar plugins - plugins: ['Loading', 'Notify'], - config: { - loading: { - /* look at QuasarConfOptions from the API card */ - }, - }, - }, - - // animations: 'all', // --- includes all animations - // https://v2.quasar.dev/options/animations - animations: [], - - // https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr - ssr: { - pwa: false, - - // manualStoreHydration: true, - // manualPostHydrationTrigger: true, - - prodPort: 3000, // The default port that the production server should use - // (gets superseded if process.env.PORT is specified at runtime) - - maxAge: 1000 * 60 * 60 * 24 * 30, - // Tell browser when a file from the server should expire from cache (in ms) - - chainWebpackWebserver(/* chain */) { - // - }, - - middlewares: [ - ctx.prod ? 'compression' : '', - 'render', // keep this as last one - ], - }, - - // https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa - pwa: { - workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest' - workboxOptions: {}, // only for GenerateSW - - // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts]) - // if using workbox in InjectManifest mode - chainWebpackCustomSW(/* chain */) { - // - }, - - manifest: { - name: `Scattnlay`, - short_name: `Scattnlay`, - description: `Mie scattering simulations`, - display: 'standalone', - orientation: 'portrait', - background_color: '#ffffff', - theme_color: '#027be3', - icons: [ - { - src: 'icons/icon-128x128.png', - sizes: '128x128', - type: 'image/png', - }, - { - src: 'icons/icon-192x192.png', - sizes: '192x192', - type: 'image/png', - }, - { - src: 'icons/icon-256x256.png', - sizes: '256x256', - type: 'image/png', - }, - { - src: 'icons/icon-384x384.png', - sizes: '384x384', - type: 'image/png', - }, - { - src: 'icons/icon-512x512.png', - sizes: '512x512', - type: 'image/png', - }, - ], - }, - }, - - // Full list of options: https://v2.quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova - cordova: { - // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing - }, - - // Full list of options: https://v2.quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor - capacitor: { - hideSplashscreen: true, - }, - - // Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron - electron: { - bundler: 'packager', // 'packager' or 'builder' - - packager: { - // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options - // OS X / Mac App Store - // appBundleId: '', - // appCategoryType: '', - // osxSign: '', - // protocol: 'myapp://path', - // Windows only - // win32metadata: { ... } - }, - - builder: { - // https://www.electron.build/configuration/configuration - - appId: 'guiapp', - }, - - // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain - chainWebpack(/* chain */) { - // do something with the Electron main process Webpack cfg - // extendWebpackMain also available besides this chainWebpackMain - }, - - // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain - chainWebpackPreload(/* chain */) { - // do something with the Electron main process Webpack cfg - // extendWebpackPreload also available besides this chainWebpackPreload - }, - }, - }; -}); diff --git a/guiapp/src/components/spectrum/PlotSelector.vue b/guiapp/src/components/spectrum/PlotSelector.vue index 39d83d7..c965359 100644 --- a/guiapp/src/components/spectrum/PlotSelector.vue +++ b/guiapp/src/components/spectrum/PlotSelector.vue @@ -31,7 +31,6 @@