From 0b94d207e3f405087a8502448acd1a637874a3a4 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Jan 2020 15:55:17 +0100 Subject: [PATCH 01/60] replace _karma.conf.js_ with _jest.config.js_ --- jest.config.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ karma.conf.js | 52 -------------------------------------------------- 2 files changed, 50 insertions(+), 52 deletions(-) create mode 100644 jest.config.js delete mode 100644 karma.conf.js diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..c546a8e --- /dev/null +++ b/jest.config.js @@ -0,0 +1,50 @@ +// test dependencies that require transformation +const pluginsToTransform = [ + 'tdp_comments', + 'tdp_ui', + 'tdp_core', + 'bootstrap-sass', // required to transform for phovea_ui + 'phovea_ui', + 'phovea_clue', + 'phovea_core', + 'phovea_security_flask', + 'sandbox', + 'tdp_marvinjs' +].join('|'); + +/** + * TODO check if we can process inline webpack loaders (e.g. as found in https://github.com/phovea/phovea_ui/blob/master/src/_bootstrap.ts) + * see also https://jestjs.io/docs/en/webpack#mocking-css-modules + */ +module.exports = { + transform: { + "^.+\\.tsx?$": "ts-jest" + }, + testRegex: "(.*(test|spec))\\.(tsx?)$", + testURL: "http://localhost/", + moduleFileExtensions: [ + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ], + modulePaths: [ + "src", + "../node_modules", + "../" + ], + transformIgnorePatterns: [`../node_modules/(?!${pluginsToTransform})`], + globals: { + "__VERSION__": "TEST_VERSION", + "__APP_CONTEXT__": "TEST_CONTEXT" + }, + moduleNameMapper: { + "^.+\\.(css|less|scss|sass)$": "identity-obj-proxy", + "imports-loader?.*": "imports-loader", + "raw-loader?.*": "raw-loader", + "file-loader?.*": "file-loader", + "script-loader?.*": "script-loader" + } +} diff --git a/karma.conf.js b/karma.conf.js deleted file mode 100644 index eb434ab..0000000 --- a/karma.conf.js +++ /dev/null @@ -1,52 +0,0 @@ -/* ***************************************************************************** - * Caleydo - Visualization for Molecular Biology - http://caleydo.org - * Copyright (c) The Caleydo Team. All rights reserved. - * Licensed under the new BSD license, available at http://caleydo.org/license - **************************************************************************** */ - -const webpack = require('./webpack.config.js'); - -module.exports = (config) => { - config.set({ - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jasmine'], - - // list of files / patterns to load in the browser - files: [ - 'tests.webpack.js' // just load this file - ], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - // add webpack as preprocessor - 'tests.webpack.js': ['webpack', 'sourcemap'] - }, - - webpack: webpack('test'), - - failOnEmptyTestSuite: false, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - // middleware: ['polyfill'], - // BUG that install everything "karma-polyfill-service": "github:sgratzl/karma-polyfill-service", - polyfill: { - // features: '', // feature set, see polyfill-service docs for details, defaults to `{default: {}}` - // path: '' // path to serve the polyfill script under, defaults to '/polyfill.js' - }, - - browsers: [process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome'], - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true - }); -}; From e7b19dd7d80c4c93c0faaa1b33f6fbaf39fddaac Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Jan 2020 15:55:37 +0100 Subject: [PATCH 02/60] update scripts for testing with jest --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ecf1655..a8a067f 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,16 @@ "node": ">= 12.13" }, "scripts": { + "clean": "rimraf build dist && npm run clean:compile", + "clean:compile": "rimraf src/**/*.map src/**/*.js src/**/*.d.ts tests/**/*.js tests/**/*.map tests/**/*.d.ts demo/**/*.js demo/**/*.map demo/**/*.d.ts", "compile": "tsc", "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", - "docs": "typedoc --options typedoc.json src/", + "docs": "typedoc --options typedoc.json src/**.ts", "prebuild": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test", - "pretest": "npm run compile", - "test": "test ! -d tests || karma start", + "pretest": "npm run clean && npm run compile", + "test": "jest --passWithNoTests", + "test:watch": "jest --watch", "posttest": "npm run lint", - "test:watch": "karma start --autoWatch=true --singleRun=false", "build:dev": "webpack", "build": "webpack --env prod", "start": "webpack-dev-server --inline", @@ -46,8 +48,6 @@ "release:minor": "npm version minor && npm publish && git push --follow-tags", "release:patch": "npm version patch && npm publish && git push --follow-tags", "predist": "npm run build && npm run docs", - "dist": "mkdirp dist && cd build && tar cvzf ../dist/gapminder.tar.gz *", - "predocker": "npm run build", "docker": "docker build -t gapminder -f deploy/Dockerfile ." }, "devDependencies": { From b7fbb2a24e5b0f22724cc7d6f47275ffc2745dcd Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Jan 2020 15:55:52 +0100 Subject: [PATCH 03/60] switch branches in _package.json_ --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a8a067f..5a997e5 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "ts-loader": "4.0.1" }, "dependencies": { - "phovea_vis": "github:phovea/phovea_vis#develop", - "phovea_clue": "github:phovea/phovea_clue#develop" + "phovea_vis": "github:phovea/phovea_vis#stoiber/testing_with_jest", + "phovea_clue": "github:phovea/phovea_clue#stoiber/testing_with_jest" } } From d984b599da8c000e5bc3579add456751dfa8687f Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Jan 2020 15:56:01 +0100 Subject: [PATCH 04/60] update dependencies for testing with jest --- package.json | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 5a997e5..0c7a71e 100644 --- a/package.json +++ b/package.json @@ -51,29 +51,24 @@ "docker": "docker build -t gapminder -f deploy/Dockerfile ." }, "devDependencies": { - "@types/jasmine": "2.5.47", + "@types/jest": "23.3.13", "awesome-typescript-loader": "3.1.2", "css-loader": "0.28.0", "extract-text-webpack-plugin": "2.1.0", "file-loader": "0.11.1", "html-loader": "0.4.5", "imports-loader": "0.7.1", - "jasmine": "2.5.3", + "jest": "^22.4.0", "json-loader": "0.5.4", - "karma": "1.5.0", - "karma-chrome-launcher": "2.0.0", - "karma-firefox-launcher": "1.0.1", - "karma-jasmine": "1.1.0", - "karma-junit-reporter": "2.0.0", - "karma-sourcemap-loader": "0.3.7", - "karma-webpack": "2.0.3", "mkdirp": "0.5.1", "node-sass": "^4.12.0", "null-loader": "0.1.1", "raw-loader": "0.5.1", + "rimraf": "^3.0.0", "sass-loader": "6.0.7", "style-loader": "0.16.1", "tslint": "5.9.1", + "ts-jest": "22.4.4", "typedoc": "0.11.1", "typescript": "2.8.1", "url-loader": "0.5.8", From 3ce2ba2d8a76ef6f6a3221fed629e6a356271164 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Jan 2020 15:59:47 +0100 Subject: [PATCH 05/60] fix commands in _package.json_ --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c7a71e..25d517f 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,9 @@ "release:minor": "npm version minor && npm publish && git push --follow-tags", "release:patch": "npm version patch && npm publish && git push --follow-tags", "predist": "npm run build && npm run docs", - "docker": "docker build -t gapminder -f deploy/Dockerfile ." + "dist": "mkdirp dist && cd build && tar cvzf ../dist/gapminder.tar.gz *", + "docker": "docker build -t gapminder -f deploy/Dockerfile .", + "predocker": "npm run build" }, "devDependencies": { "@types/jest": "23.3.13", From 531f0611d2a1a88104ac512d255d0bf7d9d72e5e Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Wed, 5 Feb 2020 13:13:06 +0100 Subject: [PATCH 06/60] handle xml files with `jest-raw-loader` --- jest.config.js | 3 ++- package.json | 3 ++- tsd.d.ts | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/jest.config.js b/jest.config.js index c546a8e..c1b22a1 100644 --- a/jest.config.js +++ b/jest.config.js @@ -18,7 +18,8 @@ const pluginsToTransform = [ */ module.exports = { transform: { - "^.+\\.tsx?$": "ts-jest" + "^.+\\.tsx?$": "ts-jest", + "\\.xml$": "jest-raw-loader" }, testRegex: "(.*(test|spec))\\.(tsx?)$", testURL: "http://localhost/", diff --git a/package.json b/package.json index 25d517f..365198d 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,8 @@ "ifdef-loader": "2.0.0", "fork-ts-checker-webpack-plugin": "0.4.1", "thread-loader": "1.1.2", - "ts-loader": "4.0.1" + "ts-loader": "4.0.1", + "jest-raw-loader": "1.0.1" }, "dependencies": { "phovea_vis": "github:phovea/phovea_vis#stoiber/testing_with_jest", diff --git a/tsd.d.ts b/tsd.d.ts index 9e343ca..619393b 100644 --- a/tsd.d.ts +++ b/tsd.d.ts @@ -20,6 +20,10 @@ declare module "*.html" { const content:string; export default content; } +declare module "*.xml" { + const content:string; + export default content; +} //allow json dependencies declare module "*.json"; //allow file dependencies From afd1e81e14013ee9ce1994367cb09236b6aba95f Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Wed, 5 Feb 2020 13:13:53 +0100 Subject: [PATCH 07/60] run `yo phovea:update` --- tsd.d.ts | 4 ++++ webpack.config.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tsd.d.ts b/tsd.d.ts index 619393b..8a28b34 100644 --- a/tsd.d.ts +++ b/tsd.d.ts @@ -13,8 +13,12 @@ declare module "*.css" { const content:string; export default content; } +// allow image dependencies declare module "*.png"; declare module "*.jpg"; +declare module "*.gif"; +declare module "*.webp"; +declare module "*.svg"; //allow html dependencies declare module "*.html" { const content:string; diff --git a/webpack.config.js b/webpack.config.js index 95542e3..b4e63ac 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -74,7 +74,7 @@ const webpackloaders = [ }, {test: /\.json$/, use: 'json-loader'}, { - test: /\.(png|jpg)$/, + test: /\.(png|jpg|gif|webp)$/, loader: 'url-loader', options: { limit: 10000 // inline <= 10kb From b7b4ccec35b79099e517d3fe7e6c61c361c645c2 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Wed, 5 Feb 2020 15:49:57 +0100 Subject: [PATCH 08/60] add dependency for "identity-obj-proxy" --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 365198d..70b1814 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "extract-loader": "0.1.0", "tslib": "1.9.0", "cache-loader": "1.2.0", + "identity-obj-proxy": "^3.0.0", "ifdef-loader": "2.0.0", "fork-ts-checker-webpack-plugin": "0.4.1", "thread-loader": "1.1.2", From 30b5ae316e4263e3957c315fc2348aea479b1403 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 7 Feb 2020 12:02:15 +0100 Subject: [PATCH 09/60] fix jest config remove node modules from testing and use correct plugins for `pluginsToTransform` --- jest.config.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/jest.config.js b/jest.config.js index c1b22a1..28f2d13 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,15 +1,7 @@ // test dependencies that require transformation const pluginsToTransform = [ - 'tdp_comments', - 'tdp_ui', - 'tdp_core', - 'bootstrap-sass', // required to transform for phovea_ui - 'phovea_ui', 'phovea_clue', - 'phovea_core', - 'phovea_security_flask', - 'sandbox', - 'tdp_marvinjs' + 'phovea_vis' ].join('|'); /** @@ -33,7 +25,6 @@ module.exports = { ], modulePaths: [ "src", - "../node_modules", "../" ], transformIgnorePatterns: [`../node_modules/(?!${pluginsToTransform})`], From 7b99d27ace04420e5cfb3ef96705f9fe90801a48 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Wed, 18 Mar 2020 16:26:46 +0100 Subject: [PATCH 10/60] prepare next dev version --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ef0f805..fce887e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gapminder", "description": "", - "version": "3.0.0", + "version": "3.0.1-SNAPSHOT", "author": { "name": "The Caleydo Team", "email": "contact@caleydo.org", @@ -87,7 +87,7 @@ "ts-loader": "4.0.1" }, "dependencies": { - "phovea_vis": "^4.0.0", - "phovea_clue": "^5.0.0" + "phovea_vis": "github:phovea/phovea_vis#develop", + "phovea_clue": "github:phovea/phovea_clue#develop" } } From cd7f93fff96670e9a89372c9b448ebb374a4b00f Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 23 Mar 2020 07:04:55 +0100 Subject: [PATCH 11/60] update jest to latest version --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0c4eeba..3086089 100644 --- a/package.json +++ b/package.json @@ -53,14 +53,14 @@ "docker": "docker build -t gapminder -f deploy/Dockerfile ." }, "devDependencies": { - "@types/jest": "23.3.13", + "@types/jest": "25.1.4", "awesome-typescript-loader": "3.1.2", "css-loader": "0.28.0", "extract-text-webpack-plugin": "2.1.0", "file-loader": "0.11.1", "html-loader": "0.4.5", "imports-loader": "0.7.1", - "jest": "^22.4.0", + "jest": "^25.1.0", "json-loader": "0.5.4", "node-sass": "^4.13.1", "null-loader": "0.1.1", @@ -69,7 +69,7 @@ "sass-loader": "6.0.7", "style-loader": "0.16.1", "tslint": "5.9.1", - "ts-jest": "22.4.4", + "ts-jest": "^25.2.1", "tslib": "~1.11.0", "typedoc": "~0.16.10", "typescript": "~3.8.2", From 180602f3482d1ebe9a64f872136812c8e8bbcfc0 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 23 Mar 2020 07:05:00 +0100 Subject: [PATCH 12/60] unify jest config --- jest.config.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/jest.config.js b/jest.config.js index 28f2d13..2ace085 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,9 +1,16 @@ // test dependencies that require transformation -const pluginsToTransform = [ - 'phovea_clue', - 'phovea_vis' +let pluginsToTransform = [ + 'tdp_*', + 'phovea_*', + 'lineupjs' ].join('|'); +if(pluginsToTransform.length > 0) { + /** Attention: Negative Lookahead! This regex adds the specified repos to a whitelist that holds plugins that are excluded from the transformIgnorePatterns. + * This means that pluginsToTransform should contain all repos that export ts files. They can only be handled by the transformation. */ + pluginsToTransform = `(?!${pluginsToTransform})`; +} + /** * TODO check if we can process inline webpack loaders (e.g. as found in https://github.com/phovea/phovea_ui/blob/master/src/_bootstrap.ts) * see also https://jestjs.io/docs/en/webpack#mocking-css-modules @@ -14,7 +21,6 @@ module.exports = { "\\.xml$": "jest-raw-loader" }, testRegex: "(.*(test|spec))\\.(tsx?)$", - testURL: "http://localhost/", moduleFileExtensions: [ "ts", "tsx", @@ -25,12 +31,19 @@ module.exports = { ], modulePaths: [ "src", + "../node_modules", "../" ], - transformIgnorePatterns: [`../node_modules/(?!${pluginsToTransform})`], + transformIgnorePatterns: [`../node_modules/${pluginsToTransform}`, `node_modules/${pluginsToTransform}`], globals: { "__VERSION__": "TEST_VERSION", - "__APP_CONTEXT__": "TEST_CONTEXT" + "__APP_CONTEXT__": "TEST_CONTEXT", + 'ts-jest': { + // has to be set to true, otherwise i18n import fails + "tsConfig": { + "esModuleInterop": true, + } + } }, moduleNameMapper: { "^.+\\.(css|less|scss|sass)$": "identity-obj-proxy", From a8eff8b197e3b9b895ad01be860bac65d509737e Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 23 Mar 2020 10:02:04 +0100 Subject: [PATCH 13/60] use pinned version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3086089..040a2fb 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "sass-loader": "6.0.7", "style-loader": "0.16.1", "tslint": "5.9.1", - "ts-jest": "^25.2.1", + "ts-jest": "25.2.1", "tslib": "~1.11.0", "typedoc": "~0.16.10", "typescript": "~3.8.2", From 9ff03463a9144d0449e5fcbb2a020edb067b9a1e Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Tue, 24 Mar 2020 07:10:28 +0100 Subject: [PATCH 14/60] use pinned jest version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 040a2fb..1c7d2a0 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "file-loader": "0.11.1", "html-loader": "0.4.5", "imports-loader": "0.7.1", - "jest": "^25.1.0", + "jest": "25.1.0", "json-loader": "0.5.4", "node-sass": "^4.13.1", "null-loader": "0.1.1", From aa5a2d520e1b1652826b2f9a58905777eabb3fd4 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Tue, 24 Mar 2020 07:10:39 +0100 Subject: [PATCH 15/60] add mapping for png, jpg and gif --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 2ace085..65bbf39 100644 --- a/jest.config.js +++ b/jest.config.js @@ -46,7 +46,7 @@ module.exports = { } }, moduleNameMapper: { - "^.+\\.(css|less|scss|sass)$": "identity-obj-proxy", + "^.+\\.(css|less|scss|sass|png|jpg|gif)$": "identity-obj-proxy", "imports-loader?.*": "imports-loader", "raw-loader?.*": "raw-loader", "file-loader?.*": "file-loader", From b1cdf7e6439f87c6e50676224e413bbfc3f5ff84 Mon Sep 17 00:00:00 2001 From: Anita Steiner Date: Fri, 27 Mar 2020 13:37:36 +0100 Subject: [PATCH 16/60] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1c7d2a0..1ee301f 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "jest-raw-loader": "1.0.1" }, "dependencies": { - "phovea_vis": "github:phovea/phovea_vis#stoiber/testing_with_jest", - "phovea_clue": "github:phovea/phovea_clue#stoiber/testing_with_jest" + "phovea_vis": "github:phovea/phovea_vis#develop", + "phovea_clue": "github:phovea/phovea_clue#develop" } } From 1efdf51a2fb359f405156565c0fc8d90e484006c Mon Sep 17 00:00:00 2001 From: rumersdorfer <45141967+rumersdorfer@users.noreply.github.com> Date: Fri, 24 Apr 2020 14:15:28 +0200 Subject: [PATCH 17/60] Update README.md circleci links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a7af19..031246f 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform [phovea-url]: https://phovea.caleydo.org [npm-image]: https://badge.fury.io/js/gapminder.svg [npm-url]: https://npmjs.org/package/gapminder -[travis-image]: https://travis-ci.org/caleydo/gapminder.svg?branch=master -[travis-url]: https://travis-ci.org/caleydo/gapminder +[circleci-image]: https://circleci.com/gh/Caleydo/gapminder.svg?style=shield +[circleci-url]: https://circleci.com/gh/Caleydo/gapminder [daviddm-image]: https://david-dm.org/caleydo/gapminder/status.svg [daviddm-url]: https://david-dm.org/caleydo/gapminder From a99f9688dd8077e7c3a93924ff7784d3209b3bed Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Apr 2020 07:40:50 +0200 Subject: [PATCH 18/60] split webpack config --- config/webpack.common.js | 152 +++++++++++++++ config/webpack.dev.js | 71 +++++++ config/webpack.prod.js | 136 ++++++++++++++ webpack.config.js | 393 --------------------------------------- 4 files changed, 359 insertions(+), 393 deletions(-) create mode 100644 config/webpack.common.js create mode 100644 config/webpack.dev.js create mode 100644 config/webpack.prod.js delete mode 100644 webpack.config.js diff --git a/config/webpack.common.js b/config/webpack.common.js new file mode 100644 index 0000000..020223d --- /dev/null +++ b/config/webpack.common.js @@ -0,0 +1,152 @@ +const path = require('path'); +const pkg = require('./../package.json'); +const webpack = require('webpack'); +const {CleanWebpackPlugin} = require('clean-webpack-plugin'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +const ManifestPlugin = require('webpack-manifest-plugin'); +const buildInfo = require('./../buildInfo.js'); +const { entries, modules, libraryExternals } = require('./../.yo-rc.json')['generator-phovea']; +const resolve = require('path').resolve; + +const year = (new Date()).getFullYear(); +const banner = '/*! ' + (pkg.title || pkg.name) + ' - v' + pkg.version + ' - ' + year + '\n' + + (pkg.homepage ? '* ' + pkg.homepage + '\n' : '') + + '* Copyright (c) ' + year + ' ' + pkg.author.name + ';' + + ' Licensed ' + pkg.license + '*/\n'; + +const registryFile = './phovea_registry.js'; +const actMetaData = `file-loader?name=phoveaMetaData.json!${buildInfo.metaDataTmpFile(pkg)}`; +const actBuildInfoFile = `file-loader?name=buildInfo.json!${buildInfo.tmpFile()}`; + +/** + * inject the registry to be included + * @param entry + * @returns {*} + */ +function injectRegistry(entry) { + const extraFiles = [registryFile, actMetaData, actBuildInfoFile]; + // build also the registry + if (typeof entry === 'string') { + return extraFiles.concat(entry); + } + const transformed = {}; + Object.keys(entry).forEach((key) => { + transformed[key] = extraFiles.concat(entry[key]); + // font-awesome does not have a JavaScript component and cannot be included at this point + transformed['vendor'] = libraryExternals.filter(name => (name != 'font-awesome')); + transformed['phovea'] = modules; + }); + console.log(transformed); + return transformed; +} + +const config = { + entry: injectRegistry(entries), + resolve: { + extensions: ['.ts', '.tsx', '.js'], + }, + devServer: { + contentBase: resolve(__dirname, './../bundles/'), + open: true, + proxy: { + '/api/*': { + target: 'http://localhost:9000', + secure: false, + ws: true + }, + '/login': { + target: 'http://localhost:9000', + secure: false + }, + '/logout': { + target: 'http://localhost:9000', + secure: false + }, + '/loggedinas': { + target: 'http://localhost:9000', + secure: false + }, + watchOptions: { + aggregateTimeout: 500, + ignored: /node_modules/ + } + }, + watchOptions: { + aggregateTimeout: 500, + ignored: /node_modules/ + } + }, + module: { + rules: [ + { + test: /\.(ts)x?$/, + use: [ + { + loader: 'thread-loader', + options: { + // there should be 1 cpu for the fork-ts-checker-webpack-plugin + workers: require('os').cpus().length - 1, + }, + }, + { + loader: 'ts-loader', + options: { + transpileOnly: true, + happyPackMode: true + }, + } + ], + exclude: /node_modules/ + }, + { test: /\.(xml)$/, use: 'xml-loader' }, + { + test: /\.(png|jpg|gif|webp)$/, + use: [ 'file-loader', `url-loader` ] + }, + { + test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, + loader: 'url-loader', + options: { + limit: 10000, // inline <= 10kb + mimetype: 'application/font-woff' + } + }, + { + test: /\.svg(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, + loader: 'url-loader', + options: { + limit: 10000, // inline <= 10kb + mimetype: 'image/svg+xml', + esModule: false + } + }, + { test: /\.(ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }, + // { test: /bootstrap-sass\/assets\/javascripts\//, loader: 'imports?jQuery=jquery' }, + ], + }, + plugins: [ + new ForkTsCheckerWebpackPlugin({ + checkSyntacticErrors: true + }), + new CleanWebpackPlugin({ + cleanOnceBeforeBuildPatterns: [ + '**/*', + path.join(process.cwd(), './../bundles/**/*') + ] + }), + new BundleAnalyzerPlugin({ + // set to 'server' to start analyzer during build + analyzerMode: 'disabled', + generateStatsFile: true, + statsOptions: { source: false } + }), + new ManifestPlugin(), + new webpack.BannerPlugin({ + banner: banner, + raw: true + }) + ], +}; + +module.exports = config; diff --git a/config/webpack.dev.js b/config/webpack.dev.js new file mode 100644 index 0000000..32e87d6 --- /dev/null +++ b/config/webpack.dev.js @@ -0,0 +1,71 @@ +const merge = require('webpack-merge'); +const path = require('path'); +const webpack = require('webpack'); +const common = require('./webpack.common'); +const pkg = require('./../package.json'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); + +const libName = pkg.name; +const libDesc = pkg.description; + +const now = new Date(); +const prefix = (n) => n < 10 ? ('0' + n) : n.toString(); +const buildId = `${now.getUTCFullYear()}${prefix(now.getUTCMonth() + 1)}${prefix(now.getUTCDate())}-${prefix(now.getUTCHours())}${prefix(now.getUTCMinutes())}${prefix(now.getUTCSeconds())}`; +pkg.version = pkg.version.replace('SNAPSHOT', buildId); + +const config = { + mode: 'development', + devtool: 'inline-source-map', + output: { + path: path.join(__dirname, './../bundles'), + filename: '[name].js', + publicPath: '', + library: libName, + libraryTarget: 'umd', + umdNamedDefine: false + }, + module: { + rules: [ + { + test: /\.css$/i, + use: [ + { + loader: 'style-loader', + }, + { + loader: 'css-loader', + options: { + modules: true, + }, + }, + ], + }, + { + test: /\.(scss)$/, + use: [ + 'style-loader', 'css-loader', 'sass-loader' + ] + } + ] + }, + plugins: [ + new HtmlWebpackPlugin({ + filename: 'index.html', + title: libName, + template: 'index.template.ejs', + inject: true, + meta: { + description: libDesc + } + }), + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('development'), + __VERSION__: JSON.stringify(pkg.version), + __LICENSE__: JSON.stringify(pkg.license), + __BUILD_ID__: JSON.stringify(buildId), + __APP_CONTEXT__: JSON.stringify('/') + }) + ] +}; + +module.exports = merge(common, config); diff --git a/config/webpack.prod.js b/config/webpack.prod.js new file mode 100644 index 0000000..58fda4b --- /dev/null +++ b/config/webpack.prod.js @@ -0,0 +1,136 @@ +const merge = require('webpack-merge'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const {CleanWebpackPlugin} = require('clean-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const path = require('path'); +const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); +const common = require('./webpack.common'); +const pkg = require('./../package.json'); +const webpack = require('webpack'); + + +const libName = pkg.name; +const libDesc = pkg.description; + +const now = new Date(); +const prefix = (n) => n < 10 ? ('0' + n) : n.toString(); +const buildId = `${now.getUTCFullYear()}${prefix(now.getUTCMonth() + 1)}${prefix(now.getUTCDate())}-${prefix(now.getUTCHours())}${prefix(now.getUTCMinutes())}${prefix(now.getUTCSeconds())}`; +pkg.version = pkg.version.replace('SNAPSHOT', buildId); + +const config = { + mode: 'production', + devtool: 'source-map', + output: { + filename: '[name].js', + chunkFilename: '[name].js', + path: path.resolve(__dirname, './../bundles'), + pathinfo: false, + publicPath: '', + library: libName, + libraryTarget: 'umd', + umdNamedDefine: false + }, + optimization: { + splitChunks: { + automaticNameDelimiter: '~', + maxInitialRequests: Infinity, + minSize: 0, + cacheGroups: { + vendor: { + test: /[\\/]node_modules[\\/]((?!(phovea_.*|tdp_.*)).*)[\\/]/, + chunks: 'all', + name(module) { + const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; + return `vendor.${packageName.replace('@', '')}`; + }, + }, + phovea: { + test: /[\\/]node_modules[\\/]((phovea_.*).*)[\\/]/, + chunks: 'all', + name(module) { + const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; + return `phovea.${packageName.replace('@', '')}`; + }, + }, + tdp: { + test: /[\\/]node_modules[\\/]((tdp_.*).*)[\\/]/, + chunks: 'all', + name(module) { + const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; + return `tdp.${packageName.replace('@', '')}`; + }, + }, + } + }, + // minimizer: [ + // (compiler) => { + // const TerserPlugin = require('terser-webpack-plugin'); + // new TerserPlugin({ + // cache: true, + // parallel: true, + // sourceMap: true + // }).apply(compiler); + // } + // ], + }, + module: { + rules: [ + { + test: require.resolve('jquery'), + use: [{ + loader: 'expose-loader', + options: 'jQuery' + },{ + loader: 'expose-loader', + options: '$' + }] + }, + { + test: /\.(css)$/, + use: [ + MiniCssExtractPlugin.loader, 'css-loader' + ] + }, + { + test: /\.(scss)$/, + use: [ + MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader' + ] + } + ] + }, + // TerserPlugin is added by default in production mode + plugins: [ + new MomentLocalesPlugin({ + localesToKeep: ['de-at', 'de', 'en-gb','en'], + }), + // extracts css in separate file + new MiniCssExtractPlugin({ + filename: 'styles.[name].css' + }), + new HtmlWebpackPlugin({ + filename: 'index.html', + title: libName, + template: 'index.template.ejs', + inject: true, + chunksSortMode: 'manual', + chunks: ['vendor', 'phovea', 'app'], + minify: { + removeComments: true, + collapseWhitespace: true + }, + meta: { + description: libDesc + } + }), + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production'), + __VERSION__: JSON.stringify(pkg.version), + __LICENSE__: JSON.stringify(pkg.license), + __BUILD_ID__: JSON.stringify(buildId), + __APP_CONTEXT__: JSON.stringify('/') + }) + ] +}; + +module.exports = merge(common, config); diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 0088ec6..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,393 +0,0 @@ -/* ***************************************************************************** - * Caleydo - Visualization for Molecular Biology - http://caleydo.org - * Copyright (c) The Caleydo Team. All rights reserved. - * Licensed under the new BSD license, available at http://caleydo.org/license - **************************************************************************** */ - -const {libraryAliases, libraryExternals, modules, entries, ignores, type, registry, vendor} = require('./.yo-rc.json')['generator-phovea']; -const resolve = require('path').resolve; -const pkg = require('./package.json'); -const webpack = require('webpack'); -const fs = require('fs'); -const ExtractTextPlugin = require('extract-text-webpack-plugin'); -const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); -const buildInfo = require('./buildInfo.js'); - -const now = new Date(); -const prefix = (n) => n < 10 ? ('0' + n) : n.toString(); -const buildId = `${now.getUTCFullYear()}${prefix(now.getUTCMonth() + 1)}${prefix(now.getUTCDate())}-${prefix(now.getUTCHours())}${prefix(now.getUTCMinutes())}${prefix(now.getUTCSeconds())}`; -pkg.version = pkg.version.replace('SNAPSHOT', buildId); - -const year = (new Date()).getFullYear(); -const banner = '/*! ' + (pkg.title || pkg.name) + ' - v' + pkg.version + ' - ' + year + '\n' + - (pkg.homepage ? '* ' + pkg.homepage + '\n' : '') + - '* Copyright (c) ' + year + ' ' + pkg.author.name + ';' + - ' Licensed ' + pkg.license + '*/\n'; - -const preCompilerFlags = {flags: (registry || {}).flags || {}}; -const includeFeature = registry ? (extension, id) => { - const exclude = registry.exclude || []; - const include = registry.include || []; - if (!exclude && !include) { - return true; - } - const test = (f) => Array.isArray(f) ? extension.match(f[0]) && (id || '').match(f[1]) : extension.match(f); - return include.every(test) && !exclude.some(test); -} : () => true; - -const tsLoader = [ - { - loader: 'awesome-typescript-loader' - } -]; - -const tsLoaderDev = [ - {loader: 'cache-loader'}, - { - loader: 'thread-loader', - options: { - // there should be 1 cpu for the fork-ts-checker-webpack-plugin - workers: require('os').cpus().length - 1 - } - }, - { - loader: 'ts-loader', - options: { - happyPackMode: true, // IMPORTANT! use happyPackMode mode to speed-up compilation and reduce errors reported to webpack, - compilerOptions: { - target: 'es6' - } - } - } -]; - -// list of loaders and their mappings -const webpackloaders = [ - {test: /\.scss$/, use: 'style-loader!css-loader!sass-loader'}, - {test: /\.css$/, use: 'style-loader!css-loader'}, - {test: /\.tsx?$/, use: tsLoader}, - { - test: /phovea(_registry)?\.js$/, use: [{ - loader: 'ifdef-loader', - options: Object.assign({include: includeFeature}, preCompilerFlags) - }] - }, - {test: /\.json$/, use: 'json-loader'}, - { - test: /\.(png|jpg|gif|webp)$/, - loader: 'url-loader', - options: { - limit: 10000 // inline <= 10kb - } - }, - { - test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, - loader: 'url-loader', - options: { - limit: 10000, // inline <= 10kb - mimetype: 'application/font-woff' - } - }, - { - test: /\.svg(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, - loader: 'url-loader', - options: { - limit: 10000, // inline <= 10kb - mimetype: 'image/svg+xml' - } - }, - {test: /\.(ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader'} -]; - -/** - * tests whether the given phovea module name is matching the requested file and if so convert it to an external lookup - * depending on the loading type - */ -function testPhoveaModule(moduleName, request) { - if (!(new RegExp('^' + moduleName + '/src.*')).test(request)) { - return false; - } - const subModule = request.match(/.*\/src\/?(.*)/)[1]; - // skip empty modules = root - const path = subModule === '' ? [moduleName] : [moduleName, subModule]; - // phovea_ ... phovea.name - const rootPath = /phovea_.*/.test(moduleName) ? ['phovea', moduleName.slice(7)].concat(path.slice(1)) : path; - return { - root: rootPath, - commonjs2: path, - commonjs: path, - amd: request + (subModule === '' ? '/main' : '') - }; -} - -function testPhoveaModules(modules) { - return (context, request, callback) => { - for (let i = 0; i < modules.length; ++i) { - const r = testPhoveaModule(modules[i], request); - if (r) { - return callback(null, r); - } - } - callback(); - }; -} - -// use workspace registry file if available -const isWorkspaceContext = fs.existsSync(resolve(__dirname, '..', 'phovea_registry.js')); -const registryFile = isWorkspaceContext ? '../phovea_registry.js' : './phovea_registry.js'; -const actMetaData = `file-loader?name=phoveaMetaData.json!${buildInfo.metaDataTmpFile(pkg)}`; -const actBuildInfoFile = `file-loader?name=buildInfo.json!${buildInfo.tmpFile()}`; - -/** - * inject the registry to be included - * @param entry - * @returns {*} - */ -function injectRegistry(entry) { - const extraFiles = [registryFile, actBuildInfoFile, actMetaData]; - // build also the registry - if (typeof entry === 'string') { - return extraFiles.concat(entry); - } - const transformed = {}; - Object.keys(entry).forEach((eentry) => { - transformed[eentry] = extraFiles.concat(entry[eentry]); - }); - return transformed; -} - -/** - * generate a webpack configuration - */ -function generateWebpack(options) { - let base = { - entry: injectRegistry(options.entries), - output: { - path: resolve(__dirname, 'build'), - filename: (options.name || (pkg.name + (options.bundle ? '_bundle' : ''))) + (options.min && !options.nosuffix ? '.min' : '') + '.js', - chunkFilename: '[chunkhash].js', - publicPath: '' // no public path = relative - }, - resolve: { - // add `.ts` and `.tsx` as a resolvable extension. - extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'], - alias: Object.assign({}, options.libs || {}), - symlinks: false, - // fallback to the directory above if they are siblings just in the workspace context - modules: isWorkspaceContext ? [ - resolve(__dirname, '../'), - 'node_modules' - ] : ['node_modules'] - }, - plugins: [ - // define magic constants that are replaced - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(options.isProduction ? 'production' : 'development'), - __VERSION__: JSON.stringify(pkg.version), - __LICENSE__: JSON.stringify(pkg.license), - __BUILD_ID__: JSON.stringify(buildId), - __DEBUG__: options.isDev || options.isTest, - __TEST__: options.isTest, - __PRODUCTION__: options.isProduction, - __APP_CONTEXT__: JSON.stringify('/') - }) - // rest depends on type - ], - externals: [], - module: { - loaders: webpackloaders.slice() - }, - devServer: { - proxy: { - '/api/*': { - target: 'http://localhost:9000', - secure: false, - ws: true - }, - '/login': { - target: 'http://localhost:9000', - secure: false - }, - '/logout': { - target: 'http://localhost:9000', - secure: false - }, - '/loggedinas': { - target: 'http://localhost:9000', - secure: false - } - }, - contentBase: resolve(__dirname, 'build'), - watchOptions: { - aggregateTimeout: 500, - ignored: /node_modules/ - } - }, - watchOptions: { - aggregateTimeout: 500, - ignored: /node_modules/ - } - }; - - if (options.isProduction) { - base.plugins.unshift(new webpack.BannerPlugin({ - banner: banner, - raw: true - })); - base.plugins.push(new webpack.optimize.MinChunkSizePlugin({ - minChunkSize: 10000 // at least 10.000 characters - })); - // base.plugins.push(new webpack.optimize.ModuleConcatenationPlugin()); - } else if (options.isDev) { - // switch to def settings - base.module.loaders.find((d) => d.use === tsLoader).use = tsLoaderDev; - base.plugins.push(new ForkTsCheckerWebpackPlugin({checkSyntacticErrors: true, tsconfig: './tsconfig_dev.json'})); - } - - if (options.library) { - let libName = /phovea_.*/.test(pkg.name) ? ['phovea', pkg.name.slice(7)] : pkg.name; - // generate a library, i.e. output the last entry element - // create library name - if (options.moduleBundle) { - libName = 'phovea'; - } - base.output.library = libName; - base.output.libraryTarget = 'umd'; - base.output.umdNamedDefine = false; // anonymous require module - } - - if (!options.bundle) { - // if we don't bundle don't include external libraries and other phovea modules - base.externals.push(...(options.externals || Object.keys(options.libs || {}))); - - // ignore all phovea modules - if (options.modules) { - base.externals.push(testPhoveaModules(options.modules)); - } - - // ignore extra modules - (options.ignore || []).forEach(function (d) { - base.module.loaders.push({test: new RegExp(d), loader: 'null-loader'}); // use null loader - }); - // ingore phovea module registry calls - (options.modules || []).forEach(function (m) { - base.module.loaders.push({ - test: new RegExp('.*[\\\\/]' + m + '[\\\\/]phovea_registry.js'), - loader: 'null-loader' - }); // use null loader - }); - } - if (!options.bundle || options.isApp) { - // extract the included css file to own file - const p = new ExtractTextPlugin({ - filename: (options.isApp || options.moduleBundle ? 'style' : pkg.name) + (options.min && !options.nosuffix ? '.min' : '') + '.css', - allChunks: true // there seems to be a bug in dynamically loaded chunk styles are not loaded, workaround: extract all styles from all chunks - }); - base.plugins.push(p); - base.module.loaders[0] = { - test: /\.scss$/, - loader: p.extract(['css-loader', 'sass-loader']) - }; - base.module.loaders[1] = { - test: /\.css$/, - loader: p.extract(['css-loader']) - }; - } - if (options.isApp) { - // create manifest - // base.plugins.push(new webpack.optimize.AppCachePlugin()); - } - if (options.commons) { - // build a commons plugin - base.plugins.push(new webpack.optimize.CommonsChunkPlugin({ - // The order of this array matters - name: 'common', - filename: 'common.js', - minChunks: 2 - })); - } - if (options.vendor) { - (Array.isArray(options.vendor) ? options.vendor : [options.vendor]).forEach((reg) => { - base.plugins.push(new webpack.optimize.CommonsChunkPlugin({ - async: true, - children: true, - deepChildren: true, - minChunks: (module, count) => new RegExp(reg, 'i').test(module.resource) && count >= 2 - })); - }); - } - if (options.min) { - // use a minifier - base.plugins.push( - new webpack.LoaderOptionsPlugin({ - minimize: true, - debug: false - }), - new webpack.optimize.UglifyJsPlugin()); - } else { - // generate source maps - base.devtool = 'inline-source-map'; - } - return base; -} - -function generateWebpackConfig(env) { - const isTest = env === 'test'; - const isProduction = env === 'prod'; - const isDev = !isProduction && !isTest; - - const base = { - entries: entries, - libs: libraryAliases, - externals: libraryExternals, - modules: modules, - vendor: vendor, - ignore: ignores, - isProduction: isProduction, - isDev: isDev, - isTest: isTest - }; - - if (isTest) { - return generateWebpack(Object.assign({}, base, { - bundle: true - })); - } - - if (type.startsWith('app')) { - base.isApp = true; - base.bundle = true; // bundle everything together - base.name = '[name]'; // multiple entries case - base.commons = true; // extract commons module - } else if (type === 'bundle') { - base.library = true; // expose as library - base.moduleBundle = true; // expose as library 'phovea' - base.name = pkg.name; // to avoid adding _bundle - base.bundle = true; - } else { // type === 'lib' - base.library = true; - } - - // single generation - if (isDev) { - return generateWebpack(base); - } - if (type.startsWith('app')) { // isProduction app - return generateWebpack(Object.assign({}, base, { - min: true, - nosuffix: true - })); - } - // isProduction - return [ - // plain - generateWebpack(base), - // minified - generateWebpack(Object.assign({}, base, { - min: true - })) - ]; -} - -module.exports = generateWebpackConfig; -module.exports.generateWebpack = generateWebpack; From 739b312acfe18aab4c262af3feb8e395cd017eef Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Apr 2020 07:41:03 +0200 Subject: [PATCH 19/60] update npm scripts --- package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1ee301f..f885a8e 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,11 @@ "test": "jest --passWithNoTests", "test:watch": "jest --watch", "posttest": "npm run lint", - "build:dev": "webpack", - "build": "webpack --env prod", - "start": "webpack-dev-server --inline", + "build:dev": "webpack --mode development --config config/webpack.dev.js", + "build": "webpack --mode production --config config/webpack.prod.js", + "bundle-report": "webpack-bundle-analyzer --port 4200 bundles/stats.json", + "start:dev": "webpack-dev-server --inline --config config/webpack.dev.js", + "start": "webpack-dev-server --config config/webpack.prod.js", "start:hot": "webpack-dev-server --inline --hot", "watch": "webpack --watch", "release:major": "npm version major && npm publish && git push --follow-tags", From 3cba5c9fa39e5efe56d131d649d94b2346bc3c6a Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Apr 2020 07:41:18 +0200 Subject: [PATCH 20/60] update dependencies accordingly --- package.json | 53 ++++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index f885a8e..7c7020c 100644 --- a/package.json +++ b/package.json @@ -56,39 +56,44 @@ }, "devDependencies": { "@types/jest": "25.1.4", - "awesome-typescript-loader": "3.1.2", - "css-loader": "0.28.0", + "cache-loader": "^4.1.0", + "clean-webpack-plugin": "^3.0.0", + "css-loader": "^3.5.3", + "expose-loader": "^0.7.5", + "extract-loader": "^5.0.1", "extract-text-webpack-plugin": "2.1.0", - "file-loader": "0.11.1", - "html-loader": "0.4.5", - "imports-loader": "0.7.1", + "file-loader": "^6.0.0", + "fork-ts-checker-webpack-plugin": "^4.1.3", + "html-loader": "^1.0.0", + "html-webpack-plugin": "^4.2.0", + "identity-obj-proxy": "^3.0.0", + "ifdef-loader": "2.1.5", + "imports-loader": "^0.8.0", "jest": "25.1.0", - "json-loader": "0.5.4", + "jest-raw-loader": "1.0.1", + "mini-css-extract-plugin": "^0.9.0", + "moment-locales-webpack-plugin": "^1.2.0", "node-sass": "^4.13.1", - "null-loader": "0.1.1", - "raw-loader": "0.5.1", + "null-loader": "^3.0.0", + "raw-loader": "^4.0.0", "rimraf": "^3.0.0", - "sass-loader": "6.0.7", - "style-loader": "0.16.1", - "tslint": "5.9.1", + "sass-loader": "^8.0.2", + "style-loader": "^0.23.1", + "thread-loader": "2.1.3", "ts-jest": "25.2.1", + "ts-loader": "^6.2.2", "tslib": "~1.11.0", + "tslint": "5.9.1", "typedoc": "~0.16.10", "typescript": "~3.8.2", - "url-loader": "0.5.8", - "webpack": "2.3.3", - "webpack-dev-server": "2.4.2", - "extract-loader": "0.1.0", - "cache-loader": "1.2.0", - "identity-obj-proxy": "^3.0.0", - "ifdef-loader": "2.0.0", - "fork-ts-checker-webpack-plugin": "0.4.4", - "thread-loader": "1.1.2", - "ts-loader": "4.0.1", - "jest-raw-loader": "1.0.1" + "url-loader": "^4.1.0", + "webpack": "^4.43.0", + "webpack-bundle-analyzer": "^3.6.1", + "webpack-cli": "3.3.2", + "webpack-dev-server": "^3.10.3", + "webpack-manifest-plugin": "^2.2.0", + "webpack-merge": "^4.2.2" }, "dependencies": { - "phovea_vis": "github:phovea/phovea_vis#develop", - "phovea_clue": "github:phovea/phovea_clue#develop" } } From c80ee0b7979c327361317743a7d07b4531e41987 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Apr 2020 07:43:08 +0200 Subject: [PATCH 21/60] update import statements --- phovea_registry.js | 2 +- src/gapminder.ts | 22 +++++++++++----------- src/index.ts | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/phovea_registry.js b/phovea_registry.js index 6aa4ff6..f3d4dc9 100644 --- a/phovea_registry.js +++ b/phovea_registry.js @@ -4,7 +4,7 @@ * Licensed under the new BSD license, available at http://caleydo.org/license **************************************************************************** */ -import {register} from 'phovea_core/src/plugin'; +import {register} from 'phovea_core/dist/plugin'; /** * build a registry by registering all phovea modules diff --git a/src/gapminder.ts b/src/gapminder.ts index 8a67202..c4505ce 100644 --- a/src/gapminder.ts +++ b/src/gapminder.ts @@ -2,17 +2,17 @@ * Created by Samuel Gratzl on 15.12.2014. */ -import * as C from 'phovea_core/src/index'; -import * as datas from 'phovea_core/src/data'; -import * as datatypes from 'phovea_core/src/datatype'; -import * as matrix from 'phovea_core/src/matrix'; -import * as stratification from 'phovea_core/src/stratification'; -import * as prov from 'phovea_core/src/provenance'; -import * as idtypes from 'phovea_core/src/idtype'; -import * as views from 'phovea_core/src/layout_view'; -import * as ranges from 'phovea_core/src/range'; -import {Rect} from 'phovea_core/src/geom'; -import tooltipBind from 'phovea_d3/src/tooltip'; +import * as C from 'phovea_core/dist/index'; +import * as datas from 'phovea_core/dist/data'; +import * as datatypes from 'phovea_core/dist/datatype'; +import * as matrix from 'phovea_core/dist/matrix'; +import * as stratification from 'phovea_core/dist/stratification'; +import * as prov from 'phovea_core/dist/provenance'; +import * as idtypes from 'phovea_core/dist/idtype'; +import * as views from 'phovea_core/dist/layout_view'; +import * as ranges from 'phovea_core/dist/range'; +import {Rect} from 'phovea_core/dist/geom'; +import tooltipBind from 'phovea_d3/dist/tooltip'; import * as d3 from 'd3'; const filteredSelectionType = 'filtered'; diff --git a/src/index.ts b/src/index.ts index 449bf2e..c467ef2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,11 +12,11 @@ import 'phovea_ui/src/_font-awesome'; import './style.scss'; -import * as C from 'phovea_core/src/index'; -import * as template from 'phovea_clue/src/template'; -import * as cmode from 'phovea_clue/src/mode'; +import * as C from 'phovea_core/dist/index'; +import * as template from 'phovea_clue/dist/template'; +import * as cmode from 'phovea_clue/dist/mode'; import * as gapminder from './gapminder'; -import {initI18n} from 'phovea_core/src/i18n'; +import {initI18n} from 'phovea_core/dist/i18n'; //scoping let --> function level scope in js vs java global, local const helper = document.querySelector('div.gapminder'); From 948a3726911863c2a53d93c4caa246ea4b917940 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Apr 2020 07:44:31 +0200 Subject: [PATCH 22/60] remove System.import() --- phovea.js | 12 ++++++------ tsd.d.ts | 7 +------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/phovea.js b/phovea.js index 78dfb43..8856116 100644 --- a/phovea.js +++ b/phovea.js @@ -6,28 +6,28 @@ //register all extensions in the registry following the given pattern module.exports = function(registry) { - //registry.push('extension-type', 'extension-id', function() { return System.import('./src/extension_impl'); }, {}); + //registry.push('extension-type', 'extension-id', function() { return import('./src/extension_impl'); }, {}); // generator-phovea:begin - registry.push('view', 'gapminder', function() { return System.import('./src/gapminder'); }, { + registry.push('view', 'gapminder', function() { return import('./src/gapminder'); }, { 'location': 'gapminder' }); - registry.push('actionFactory', 'gapminder', function() { return System.import('./src/gapminder'); }, { + registry.push('actionFactory', 'gapminder', function() { return import('./src/gapminder'); }, { 'factory': 'createCmd', 'creates': '(setGapMinderAttribute|setGapMinderAttributeScale|toggleGapMinderTrails)' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return System.import('./src/gapminder'); }, { + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./src/gapminder'); }, { 'factory': 'compressSetAttribute', 'matches': 'setGapMinderAttribute' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return System.import('./src/gapminder'); }, { + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./src/gapminder'); }, { 'factory': 'compressToggleGapMinderTrails', 'matches': 'toggleGapMinderTrails' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return System.import('./src/gapminder'); }, { + registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return import('./src/gapminder'); }, { 'factory': 'compressSetAttributeScale', 'matches': 'setGapMinderAttributeScale' }); diff --git a/tsd.d.ts b/tsd.d.ts index 8a28b34..bfe3ff8 100644 --- a/tsd.d.ts +++ b/tsd.d.ts @@ -38,10 +38,5 @@ declare module "raw-loader!*"; declare module "url-loader!*"; //allow html dependencies declare module "imports-loader!*"; +declare module "imports-loader?*"; - -//define System.import as understood by webpack2 -interface ISystem { - import(module: string): Promise; -} -declare const System: ISystem; From bcf3aa4e92882d7c299df13a79b1fb40c84a95ee Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Apr 2020 07:44:38 +0200 Subject: [PATCH 23/60] update tsconfig.json --- tsconfig.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 3a54054..6fc452d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "es6", - "target": "es5", + "module": "ES2020", + "target": "ES2019", "importHelpers": true, "sourceMap": true, "moduleResolution": "node", @@ -14,7 +14,6 @@ "es2016.array.include", "es2017.object" ], - "baseUrl": "../", "noImplicitAny": false, "skipLibCheck": true, "esModuleInterop": false, From ee97ec7c1ffb8029cb6de8d45ae6d6f9afbfcf3e Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 4 May 2020 08:31:13 +0200 Subject: [PATCH 24/60] add template for index file --- index.template.ejs | 97 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 index.template.ejs diff --git a/index.template.ejs b/index.template.ejs new file mode 100644 index 0000000..efbc611 --- /dev/null +++ b/index.template.ejs @@ -0,0 +1,97 @@ + + + + + + Phovea GapMinder + + + + + + + + + + + + From 0045093b9000d3e0fbd4c7902ccce88c182fd269 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 4 May 2020 08:31:55 +0200 Subject: [PATCH 25/60] remove static bundle names from index.html --- src/index.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/index.html b/src/index.html index 584fac9..9d2bdcf 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,6 @@ - @@ -93,8 +92,5 @@ } })(); - - - From b67d39fda0c5f8ef1109635edea1d88a68150cf2 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 4 May 2020 08:32:21 +0200 Subject: [PATCH 26/60] make jquery globally available --- config/webpack.common.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/webpack.common.js b/config/webpack.common.js index 020223d..f2e60a4 100644 --- a/config/webpack.common.js +++ b/config/webpack.common.js @@ -122,6 +122,16 @@ const config = { } }, { test: /\.(ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }, + { + test: require.resolve('jquery'), + use: [{ + loader: 'expose-loader', + options: 'jQuery' + },{ + loader: 'expose-loader', + options: '$' + }] + } // { test: /bootstrap-sass\/assets\/javascripts\//, loader: 'imports?jQuery=jquery' }, ], }, From 6295168d59c1bb951106c3407654a0050c17d83b Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 4 May 2020 09:04:45 +0200 Subject: [PATCH 27/60] update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 69db746..c515a4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.tscache /.idea -/build/ +/bundles/ /dist/ node_modules/ /src/**/*.js From 829485246dff22bba6cc295a36d6fcc1e1fa37d1 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 4 May 2020 13:04:07 +0200 Subject: [PATCH 28/60] update path --- src/index.ts | 4 ++-- src/style.scss | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index c467ef2..d042745 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,8 +7,8 @@ import 'file-loader?name=index.html!extract-loader!html-loader!./index.html'; import 'file-loader?name=404.html!./404.html'; import 'file-loader?name=robots.txt!./robots.txt'; -import 'phovea_ui/src/_bootstrap'; -import 'phovea_ui/src/_font-awesome'; +import 'phovea_ui/dist/_bootstrap'; +import 'phovea_ui/dist/_font-awesome'; import './style.scss'; diff --git a/src/style.scss b/src/style.scss index a12a541..5140e94 100644 --- a/src/style.scss +++ b/src/style.scss @@ -3,7 +3,7 @@ */ // use original CLUE styles as foundation -@import "~phovea_clue/src/style.scss"; +@import "~phovea_clue/dist/style.scss"; body, html { padding: 0; From d2ee4ed3e75f9d261ef5dfe71f9d022897bdee95 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 4 May 2020 13:04:43 +0200 Subject: [PATCH 29/60] move to common config --- config/webpack.prod.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/config/webpack.prod.js b/config/webpack.prod.js index 58fda4b..17feed1 100644 --- a/config/webpack.prod.js +++ b/config/webpack.prod.js @@ -75,16 +75,6 @@ const config = { }, module: { rules: [ - { - test: require.resolve('jquery'), - use: [{ - loader: 'expose-loader', - options: 'jQuery' - },{ - loader: 'expose-loader', - options: '$' - }] - }, { test: /\.(css)$/, use: [ From 1a7a506e81914fafa56401efb521b8b1e47b6dee Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 4 May 2020 13:05:49 +0200 Subject: [PATCH 30/60] update package.json --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 7c7020c..e19c801 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "node-sass": "^4.13.1", "null-loader": "^3.0.0", "raw-loader": "^4.0.0", + "resolve-url-loader": "^3.1.1", "rimraf": "^3.0.0", "sass-loader": "^8.0.2", "style-loader": "^0.23.1", @@ -95,5 +96,10 @@ "webpack-merge": "^4.2.2" }, "dependencies": { + "@types/marked": "^0.7.2", + "jquery": "^3.4.1", + "marked": "^0.7.0", + "phovea_clue": "^5.0.1-SNAPSHOT", + "phovea_vis": "^4.0.1-SNAPSHOT" } } From cc89e2046892a41e0a44ad4ad72c51850a2ea778 Mon Sep 17 00:00:00 2001 From: rumersdorfer <45141967+rumersdorfer@users.noreply.github.com> Date: Tue, 12 May 2020 16:24:37 +0200 Subject: [PATCH 31/60] Update README.md --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 031246f..630e571 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -gapminder [![Phovea][phovea-image]][phovea-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] +gapminder ===================== - +[![Phovea][phovea-image]][phovea-url] [![NPM version][npm-image]][npm-url] [![Build Status][circleci-image]][circleci-url] + + [Gapminder](https://www.gapminder.org/) port for Phovea using the Caleydo CLUE framework for provenance tracking and story telling. ![screenshot](media/screenshot.png?raw=true "Screenshot") @@ -43,11 +45,12 @@ npm run build This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform for developing web-based visualization applications. For tutorials, API docs, and more information about the build and deployment process, see the [documentation page](http://phovea.caleydo.org). + + [phovea-image]: https://img.shields.io/badge/Phovea-Application-1BA64E.svg [phovea-url]: https://phovea.caleydo.org [npm-image]: https://badge.fury.io/js/gapminder.svg [npm-url]: https://npmjs.org/package/gapminder [circleci-image]: https://circleci.com/gh/Caleydo/gapminder.svg?style=shield [circleci-url]: https://circleci.com/gh/Caleydo/gapminder -[daviddm-image]: https://david-dm.org/caleydo/gapminder/status.svg -[daviddm-url]: https://david-dm.org/caleydo/gapminder + From 58418b17716bc5a2514b11a763cbcaef6dd95e63 Mon Sep 17 00:00:00 2001 From: Anita Steiner Date: Wed, 13 May 2020 08:13:20 +0200 Subject: [PATCH 32/60] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 630e571..572965c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ gapminder ===================== -[![Phovea][phovea-image]][phovea-url] [![NPM version][npm-image]][npm-url] [![Build Status][circleci-image]][circleci-url] +[![Phovea][phovea-image]][phovea-url] [![Build Status][circleci-image]][circleci-url] [Gapminder](https://www.gapminder.org/) port for Phovea using the Caleydo CLUE framework for provenance tracking and story telling. @@ -49,8 +49,6 @@ This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform [phovea-image]: https://img.shields.io/badge/Phovea-Application-1BA64E.svg [phovea-url]: https://phovea.caleydo.org -[npm-image]: https://badge.fury.io/js/gapminder.svg -[npm-url]: https://npmjs.org/package/gapminder [circleci-image]: https://circleci.com/gh/Caleydo/gapminder.svg?style=shield [circleci-url]: https://circleci.com/gh/Caleydo/gapminder From 9aa6392fcf907229ea591f04cc88c14b4413d666 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Mon, 1 Jun 2020 08:06:35 +0200 Subject: [PATCH 33/60] first refactoring --- .gitignore | 2 - buildInfo.js | 3 +- config/webpack.common.js | 2 +- config/webpack.prod.js | 46 +- dist/404.html | 157 ++++++ dist/app/gapminder.d.ts | 92 +++ dist/app/gapminder.js | 782 ++++++++++++++++++++++++++ dist/app/index.d.ts | 1 + dist/app/index.js | 2 + dist/index.d.ts | 2 + dist/index.html | 96 ++++ dist/index.js | 3 + dist/initialize/GapMinderApp.d.ts | 13 + dist/initialize/GapMinderApp.js | 56 ++ dist/initialize/index.d.ts | 1 + dist/initialize/index.js | 2 + dist/initialize/initialize.d.ts | 1 + dist/initialize/initialize.js | 3 + dist/robots.txt | 3 + src/style.scss => dist/scss/main.scss | 2 +- package.json | 19 +- src/{ => app}/gapminder.ts | 429 +++++++------- src/app/index.ts | 1 + src/index.ts | 71 +-- src/initialize/GapMinderApp.ts | 73 +++ src/initialize/index.ts | 1 + src/initialize/initialize.ts | 3 + src/scss/main.scss | 253 +++++++++ tsconfig.json | 11 +- tsconfig_dev.json | 6 - 30 files changed, 1783 insertions(+), 353 deletions(-) create mode 100644 dist/404.html create mode 100644 dist/app/gapminder.d.ts create mode 100644 dist/app/gapminder.js create mode 100644 dist/app/index.d.ts create mode 100644 dist/app/index.js create mode 100644 dist/index.d.ts create mode 100644 dist/index.html create mode 100644 dist/index.js create mode 100644 dist/initialize/GapMinderApp.d.ts create mode 100644 dist/initialize/GapMinderApp.js create mode 100644 dist/initialize/index.d.ts create mode 100644 dist/initialize/index.js create mode 100644 dist/initialize/initialize.d.ts create mode 100644 dist/initialize/initialize.js create mode 100644 dist/robots.txt rename src/style.scss => dist/scss/main.scss (98%) rename src/{ => app}/gapminder.ts (70%) create mode 100644 src/app/index.ts create mode 100644 src/initialize/GapMinderApp.ts create mode 100644 src/initialize/index.ts create mode 100644 src/initialize/initialize.ts create mode 100644 src/scss/main.scss delete mode 100644 tsconfig_dev.json diff --git a/.gitignore b/.gitignore index c515a4f..6a8787d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ /.tscache /.idea -/bundles/ -/dist/ node_modules/ /src/**/*.js /tests/**/*.js diff --git a/buildInfo.js b/buildInfo.js index 4e7bd68..14166c7 100644 --- a/buildInfo.js +++ b/buildInfo.js @@ -144,12 +144,13 @@ function resolveScreenshot() { } function metaData(pkg) { + console.log(pkg); pkg = pkg || require(`./package.json`); return { name: pkg.name, displayName: pkg.displayName, version: pkg.version, - repository: pkg.repository.url, + repository: pkg.repository, homepage: pkg.homepage, description: pkg.description, screenshot: resolveScreenshot() diff --git a/config/webpack.common.js b/config/webpack.common.js index f2e60a4..02ac050 100644 --- a/config/webpack.common.js +++ b/config/webpack.common.js @@ -44,7 +44,7 @@ function injectRegistry(entry) { const config = { entry: injectRegistry(entries), resolve: { - extensions: ['.ts', '.tsx', '.js'], + extensions: ['.js'], }, devServer: { contentBase: resolve(__dirname, './../bundles/'), diff --git a/config/webpack.prod.js b/config/webpack.prod.js index 17feed1..fe64a97 100644 --- a/config/webpack.prod.js +++ b/config/webpack.prod.js @@ -30,49 +30,6 @@ const config = { libraryTarget: 'umd', umdNamedDefine: false }, - optimization: { - splitChunks: { - automaticNameDelimiter: '~', - maxInitialRequests: Infinity, - minSize: 0, - cacheGroups: { - vendor: { - test: /[\\/]node_modules[\\/]((?!(phovea_.*|tdp_.*)).*)[\\/]/, - chunks: 'all', - name(module) { - const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; - return `vendor.${packageName.replace('@', '')}`; - }, - }, - phovea: { - test: /[\\/]node_modules[\\/]((phovea_.*).*)[\\/]/, - chunks: 'all', - name(module) { - const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; - return `phovea.${packageName.replace('@', '')}`; - }, - }, - tdp: { - test: /[\\/]node_modules[\\/]((tdp_.*).*)[\\/]/, - chunks: 'all', - name(module) { - const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; - return `tdp.${packageName.replace('@', '')}`; - }, - }, - } - }, - // minimizer: [ - // (compiler) => { - // const TerserPlugin = require('terser-webpack-plugin'); - // new TerserPlugin({ - // cache: true, - // parallel: true, - // sourceMap: true - // }).apply(compiler); - // } - // ], - }, module: { rules: [ { @@ -102,9 +59,8 @@ const config = { filename: 'index.html', title: libName, template: 'index.template.ejs', + path: path.resolve(__dirname, './../' + libName), inject: true, - chunksSortMode: 'manual', - chunks: ['vendor', 'phovea', 'app'], minify: { removeComments: true, collapseWhitespace: true diff --git a/dist/404.html b/dist/404.html new file mode 100644 index 0000000..fdace4a --- /dev/null +++ b/dist/404.html @@ -0,0 +1,157 @@ + + + + + Page Not Found :( + + + +
+

Not found :(

+

Sorry, but the page you were trying to view does not exist.

+

It looks like this was the result of either:

+
    +
  • a mistyped address
  • +
  • an out-of-date link
  • +
+ + +
+ + diff --git a/dist/app/gapminder.d.ts b/dist/app/gapminder.d.ts new file mode 100644 index 0000000..67b3c0d --- /dev/null +++ b/dist/app/gapminder.d.ts @@ -0,0 +1,92 @@ +/** + * Created by Samuel Gratzl on 15.12.2014. + */ +import { IObjectRef, IDataType, INumericalMatrix, Range, IDType, Rect, AView, IStratification, ProvenanceGraph } from 'phovea_core'; +declare class Attribute { + scale: string; + data: INumericalMatrix; + arr: number[][]; + constructor(scale?: string); + get label(): string; + get valid(): boolean; + get format(): (n: number) => string; + to_format(): any; +} +interface IItem { + id: number; + name: string; +} +export declare class GapMinder extends AView { + private elem; + private graph; + private static readonly filteredSelectionType; + private dim; + ref: IObjectRef; + noneRef: IObjectRef; + attrs: { + x: Attribute; + y: Attribute; + size: Attribute; + }; + private bounds; + private items; + private color; + private colorRange; + private $node; + private xaxis; + private yaxis; + private timelinescale; + private timelineaxis; + private initedListener; + private timeIds; + private showUseTrails; + private interactive; + private totooltip; + constructor(elem: Element, graph: ProvenanceGraph); + get data(): (INumericalMatrix | IStratification)[]; + get idtypes(): any[]; + private get refData(); + get node(): Element; + setInteractive(interactive: boolean): void; + private init; + private computeScales; + private computeData; + updateLegend(): void; + private selectTimePoint; + private createTooltip; + animationDuration(): number; + private updateChart; + private update; + showTrails(show: boolean): void; + showTrailsImpl(show: boolean): void; + private onYearSelect; + private onItemSelect; + private updateHoverLine; + private updateSelectionLines; + private updateSelectionTools; + private updatePopulationSlider; + private updateTimeLine; + reset(): void; + getBounds(): Rect; + setBounds(x: any, y: any, w: any, h: any): void; + relayout(): void; + setXAttribute(m: INumericalMatrix): Promise; + setYAttribute(m: INumericalMatrix): Promise; + setSizeAttribute(m: INumericalMatrix): Promise; + setColor(m: IStratification): Promise; + setColorImpl(attr: string, m: IStratification): IObjectRef; + setAttributeImpl(attr: string, m: IDataType): Promise>; + setAttributeScaleImpl(attr: string, scale: string): any; + setAttributeScale(attr: string, scale: string): Promise; + setAttribute(attr: string, m: IDataType): Promise; + createTimeIds(names: string[], ids: Range, idtype: IDType): { + idtype: IDType; + ids: number[]; + names: string[]; + ts: number[]; + minmax: [number, number]; + }; + createItems(names: string[], ids: Range, idtype: IDType): IItem[]; + static create(parent: Element, provGraph: ProvenanceGraph): GapMinder; +} +export {}; diff --git a/dist/app/gapminder.js b/dist/app/gapminder.js new file mode 100644 index 0000000..ab0f0f2 --- /dev/null +++ b/dist/app/gapminder.js @@ -0,0 +1,782 @@ +/** + * Created by Samuel Gratzl on 15.12.2014. + */ +import * as d3 from 'd3'; +import { DataCache, EventHandler, ObjectRefUtils, ActionMetaData, Range, Rect, AView, ArrayUtils, SelectionUtils, SelectOperation, ActionUtils } from 'phovea_core'; +import { ToolTip } from 'phovea_d3'; +class Attribute { + constructor(scale = 'linear') { + this.scale = scale; + this.data = null; + this.arr = null; + } + get label() { + return this.data ? this.data.desc.name : 'None'; + } + get valid() { + return this.data !== null; + } + get format() { + return d3.format(this.to_format()); + } + to_format() { + if (!this.valid) { + return ',d'; + } + return this.data.desc.formatter || ',d'; + } +} +class GapMinderCmds { + static setAttributeImpl(inputs, parameter, graph, within) { + const gapminder = inputs[0].value, name = parameter.name; + return inputs[1].v.then((data) => { + if (data === '') { + data = null; + } + return gapminder.setAttributeImpl(name, data).then((old) => { + return { + inverse: GapMinderCmds.setAttribute(name, inputs[0], old), + consumed: within + }; + }); + }); + } + static setAttributeScaleImpl(inputs, parameter, graph, within) { + const gapminder = inputs[0].value, name = parameter.name; + const old = gapminder.setAttributeScaleImpl(name, parameter.scale); + return { + inverse: GapMinderCmds.setAttributeScale(name, inputs[0], old), + consumed: within + }; + } + static toggleGapMinderTrailsImpl(inputs, parameter) { + const gapminder = inputs[0].value, show = parameter.show; + gapminder.showTrailsImpl(show); + return { + inverse: GapMinderCmds.createToggleTrails(inputs[0], !show) + }; + } + /** + * compresses the given path by removing redundant set gap minder attribute calls + * @param path + * @returns {ActionNode[]} + */ + static compressSetAttribute(path) { + const lastByAttribute = {}; + path.forEach((p) => { + if (p.f_id === 'setGapMinderAttribute') { + const para = p.parameter.name; + lastByAttribute[para] = p; + } + }); + return path.filter((p) => { + if (p.f_id !== 'setGapMinderAttribute') { + return true; + } + const para = p.parameter.name; + //last one remains + return lastByAttribute[para] === p; + }); + } + /** + * compresses the given path by removing redundant set gap minder attribute scale calls + * @param path + * @returns { ActionNode[]} + */ + static compressSetAttributeScale(path) { + const lastByAttribute = {}; + path.forEach((p) => { + if (p.f_id === 'setGapMinderAttributeScale') { + const para = p.parameter.name; + lastByAttribute[para] = p; + } + }); + return path.filter((p) => { + if (p.f_id !== 'setGapMinderAttributeScale') { + return true; + } + const para = p.parameter.name; + //last one remains + return lastByAttribute[para] === p; + }); + } + static compressToggleGapMinderTrails(path) { + const l = path.filter((p) => p.f_id === 'toggleGapMinderTrails'); + const good = l.length % 2 === 0 ? null : l[l.length - 1]; + //remove all except the last if uneven number of changes + return path.filter((p) => p.f_id !== 'toggleGapMinderTrails' || p === good); + } + // externally called to recall implementation for prov graph + // rebuild based on the --> createCmd --> maps name to a function + static createCmd(id) { + switch (id) { + case 'setGapMinderAttribute': + return GapMinderCmds.setAttributeImpl; + case 'setGapMinderAttributeScale': + return GapMinderCmds.setAttributeScaleImpl; + case 'toggleGapMinderTrails': + return GapMinderCmds.toggleGapMinderTrailsImpl; + } + return null; + } + static capitalize(s) { + return s.split(' ').map((d) => d[0].toUpperCase() + d.slice(1)).join(' '); + } + static createToggleTrails($mainRef, show) { + return ActionUtils.action(ActionMetaData.actionMeta((show ? 'Show' : 'Hide') + ' trails', ObjectRefUtils.category.layout, ObjectRefUtils.operation.update), 'toggleGapMinderTrails', GapMinderCmds.toggleGapMinderTrailsImpl, [$mainRef], { + show + }); + } + static setAttribute(name, $mainRef, data) { + return ActionUtils.action(ActionMetaData.actionMeta(GapMinderCmds.capitalize(name) + '=' + (data ? data.name : ''), ObjectRefUtils.category.data, ObjectRefUtils.operation.update), 'setGapMinderAttribute', GapMinderCmds.setAttributeImpl, [$mainRef, data], { + name + }); + } + static setAttributeScale(name, $mainRef, scale) { + return ActionUtils.action(ActionMetaData.actionMeta('scale(' + GapMinderCmds.capitalize(name) + ')=' + GapMinderCmds.capitalize(scale), ObjectRefUtils.category.visual, ObjectRefUtils.operation.update), 'setGapMinderAttributeScale', GapMinderCmds.setAttributeScaleImpl, [$mainRef], { + scale, + name + }); + } +} +export class GapMinder extends AView { + // for colorScale domain is continent groups mapped to the range which is colorPalette + constructor(elem, graph) { + super(); + this.elem = elem; + this.graph = graph; + this.dim = [100, 100]; + this.attrs = { + x: new Attribute(), + y: new Attribute(), + size: new Attribute('sqrt') + }; + this.bounds = new Rect(0, 0, 0, 0); + this.items = []; + this.color = null; + this.colorRange = null; + this.xaxis = d3.svg.axis().orient('bottom'); + this.yaxis = d3.svg.axis().orient('left'); + this.timelinescale = d3.scale.linear(); + this.timelineaxis = d3.svg.axis().orient('bottom').scale(this.timelinescale).tickFormat(d3.format('d')); + //private popRadial = d3.svg.line.radial(); + this.initedListener = false; + this.timeIds = null; + this.showUseTrails = false; + this.interactive = true; + this.totooltip = ToolTip.bind(this.createTooltip.bind(this), 0); + this.$node = d3.select(elem).datum(this); + this.ref = graph.findOrAddObject(this, 'GapMinder', 'visual'); + this.noneRef = graph.findOrAddObject('', 'None', 'data'); + this.init(this.$node); + } + get data() { + return [this.attrs.x.data, this.attrs.y.data, this.attrs.size.data, this.color].filter((d) => !!d); + } + get idtypes() { + return Array.from(new Set([].concat(...this.data.map((d) => d.idtypes)))); + } + /* ------------------ REF DATA ---------------------- */ + get refData() { + if (this.attrs.x.valid) { + return this.attrs.x.data; + } + if (this.attrs.y.valid) { + return this.attrs.y.data; + } + return this.attrs.size.data; + } + get node() { + return this.$node.node(); + } + /* ----------------------------------------- */ + setInteractive(interactive) { + this.interactive = interactive; + this.$node.selectAll('select').attr('disabled', interactive ? null : 'disabled'); + this.$node.selectAll('.slider, rect.clearer').style('pointer-events', interactive ? null : 'none'); + } + init($elem) { + const that = this; + //find all gapminder datasets + DataCache.getInstance().list((d) => /.*gapminder.*/.test(d.desc.fqname)).then((list) => { + const matrices = list.filter((d) => d.desc.type === 'matrix'); + ['x', 'y', 'size'].forEach((attr) => { + const $options = d3.select('select.attr-' + attr).selectAll('option').data(matrices); + $options.enter().append('option'); + $options.attr('value', (d) => d.desc.id).text((d) => d.desc.name); + $options.exit().remove(); + $elem.select('select.attr-' + attr).on('change', function () { + that.setAttribute(attr, matrices[this.selectedIndex]); + }); + $elem.select('select.attr-' + attr + '-scale').on('change', function () { + that.setAttributeScale(attr, this.value); + }); + }); + const stratifications = list.filter((d) => d.desc.type === 'stratification'); + { + const $options = d3.select('select.attr-color').selectAll('option').data(stratifications); + $options.enter().append('option'); + $options.attr('value', (d) => d.desc.id).text((d) => d.desc.name); + $options.exit().remove(); + $elem.select('select.attr-color').on('change', function () { + that.setAttribute('color', stratifications[this.selectedIndex]); + }); + } + //select default datasets + if (this.graph.states.length === 1) { //first one + this.setXAttribute(ArrayUtils.search(matrices, (d) => d.desc.id === 'gapminderGdp') || matrices[0]); + this.setYAttribute(ArrayUtils.search(matrices, (d) => d.desc.id === 'gapminderLifeExpectancy') || matrices[0]); + this.setSizeAttribute(ArrayUtils.search(matrices, (d) => d.desc.id === 'gapminderPopulation') || matrices[0]); + this.setColor(ArrayUtils.search(stratifications, (d) => d.desc.id === 'gapminderContinent') || stratifications[0]); + } + }); + $elem.select('rect.clearer').on('click', () => { + const ref = this.refData; + if (ref) { + //clear selection + ref.rowtype.clear(); + } + }); + this.update(); + } + computeScales() { + const margin = 25; + const dim = this.dim; + const maxShift = 1.1; + // need to have updateLabels() also for updating labels correctly + function to_scale(a) { + if (!a.valid) { + return d3.scale.linear().domain([0, 100]); + } + const valueRange = a.data.valuetype.range.slice(); + valueRange[1] *= maxShift; + if (a.scale === 'log') { + return d3.scale.log().domain([Math.max(1, valueRange[0]), valueRange[1]]).clamp(true); + // need to update Labels + } + else if (a.scale === 'sqrt') { + return d3.scale.sqrt().domain(valueRange).clamp(true); + } + return d3.scale.linear().domain(valueRange).clamp(true); + } + const x = to_scale(this.attrs.x).range([80, dim[0] - 35]); + const y = to_scale(this.attrs.y).range([dim[1] - margin, 35]); + const s = to_scale(this.attrs.size).range([2, 40]); + const color = this.color ? d3.scale.ordinal().domain(this.color.groups.map((g) => g.name)).range(this.color.groups.map((g) => g.color)) : () => 'gray'; + return Promise.resolve({ + x, + y, + size: s, + color + }); + } + computeData(selectedTimeId) { + if (this.items.length <= 0 || !this.timeIds || !this.refData) { + return []; + } + const xData = this.attrs.x.arr; + const yData = this.attrs.y.arr; + const sData = this.attrs.size.arr; + const cData = this.colorRange; + const rowSelection = this.refData.rowtype.selections(); + const rowFilter = this.refData.rowtype.selections(GapMinder.filteredSelectionType); + const selectecdTimeIndex = this.timeIds.ids.indexOf(selectedTimeId); + return this.items.map((item, i) => { + return { + id: item.id, + name: item.name, + selected: rowSelection.dim(0).contains(item.id), + filtered: rowFilter.dim(0).contains(item.id), + x: xData && selectecdTimeIndex >= 0 ? xData[i][selectecdTimeIndex] : 0, + y: yData && selectecdTimeIndex >= 0 ? yData[i][selectecdTimeIndex] : 0, + size: sData && selectecdTimeIndex >= 0 ? sData[i][selectecdTimeIndex] : 0, + //not the id ... local range + color: cData ? ArrayUtils.search(cData.groups, (g) => g.contains(item.id)).name : null + }; + }); + } + /* ------------------ Handling Dropdown Menu ------------- */ + /* -------- called in update() --------------------------- */ + updateLegend() { + Object.keys(this.attrs).forEach((attr) => { + const m = this.attrs[attr]; + const $optionns = this.$node.select('.attr-' + attr).selectAll('option'); + if (!$optionns.empty()) { + const choices = $optionns.data(); + this.$node.select('.attr-' + attr).property('selectedIndex', choices.indexOf(m.data)); + this.$node.select('.attr-' + attr + '-scale').property('value', m.scale); + this.$node.select('.attr-' + attr + '-label').text(m.valid ? m.data.desc.name : 'None'); + this.$node.select('.attr-' + attr + '-desc').text(m.valid ? m.data.desc.description : ''); + this.$node.select('.attr-' + attr + '-scale-label').text(m.scale); + } + }); + { + const $optionns = this.$node.select('.attr-color').selectAll('option'); + if (!$optionns.empty()) { + const choices = $optionns.data(); + this.$node.select('.attr-color').property('selectedIndex', choices.indexOf(this.color)); + this.$node.select('.attr-color-label').text(this.color != null ? this.color.desc.name : 'None'); + this.$node.select('.attr-color-desc').text(this.color != null ? this.color.desc.description : ''); + } + } + const that = this; + const $legends = d3.select('div.color_legend').selectAll('div.legend').data(this.colorRange ? this.colorRange.groups : []); + const $legendsEnter = $legends.enter().append('div').classed('legend', true) + .on('click', function (d) { + if (!that.interactive) { + return; + } + const isActive = d3.select(this).select('i').classed('fa-circle'); + d3.select(this).select('i').classed('fa-circle-o', isActive).classed('fa-circle', !isActive); + that.color.idtype.select(GapMinder.filteredSelectionType, Range.list(d), isActive ? SelectOperation.ADD : SelectOperation.REMOVE); + }); + $legendsEnter.append('i').attr('class', 'fa fa-circle'); + $legendsEnter.append('span'); + if (this.color != null) { + const filtered = this.color.idtype.selections(GapMinder.filteredSelectionType).dim(0); + $legends.select('i') + .style('color', (d) => d.color) + .classed('fa-circle', (d) => !filtered.contains(d.first)) + .classed('fa-circle-o', (d) => { + return filtered.contains(d.first); + }); + } + $legends.select('span').text((d) => d.name); + $legends.exit().remove(); + } + /* ---------------------- selectTimePoint() ------------------- */ + selectTimePoint() { + const refData = this.refData; + if (refData) { + const type = refData.coltype; + const hovered = type.selections(SelectionUtils.hoverSelectionType).first; + if (hovered != null) { + return hovered; + } + return type.selections().first; + } + return null; + } + createTooltip(d) { + let r = `${d.name}
`; + const f = d3.format(',.0f'); + if (this.color) { + r += this.color.desc.name + ':\t' + d.color + '
'; + } + Object.keys(this.attrs).forEach((attr) => { + const a = this.attrs[attr]; + if (a.valid) { + r += a.data.desc.name + ':\t' + f(d[attr]) + '
'; + } + }); + return r.slice(0, r.length - 1); + } + animationDuration() { + const guess = this.graph.executeCurrentActionWithin; + return guess < 0 ? 100 : guess; + } + /* --------------------------- updateChart() ----------------------- */ + updateChart() { + const $chart = this.$node.select('svg.chart'); + $chart.attr({ + width: this.dim[0], + height: this.dim[1] + }); + $chart.select('g.xaxis').attr('transform', `translate(0,${this.dim[1] - 25})`); + let selectedTimePoint = this.selectTimePoint(); + if (selectedTimePoint == null) { + //HACK just use the first one + selectedTimePoint = 0; + } + //$chart.select('text.act_year').attr({ + // x: this.dim[0] * 0.5, + // y: this.dim[1] * 0.5 + //}); + // setting year label based on the selectedTimePoint + if (this.timeIds && selectedTimePoint != null) { + $chart.select('text.act_year').text(this.timeIds.names[this.timeIds.ids.indexOf(selectedTimePoint)]); + } + /* ------ PROMISE using computeScales(), computeData() ------------- */ + Promise.all([this.computeScales(), this.computeData(selectedTimePoint == null ? -1 : selectedTimePoint)]).then((args) => { + const scales = args[0]; // x y size color resolved + const data = args[1]; + this.xaxis.scale(scales.x).tickFormat(this.attrs.x.format); + this.yaxis.scale(scales.y).tickFormat(this.attrs.y.format); + ['x', 'y'].forEach((attr) => { + let ticks = scales[attr].ticks(); + const axis = attr === 'x' ? this.xaxis : this.yaxis; + if (this.attrs[attr].scale === 'log' && ticks.length > 30) { + //remove every second one + ticks = ticks.slice(0, 11).concat(d3.range(11, 21, 2).map((i) => ticks[i]), d3.range(21, ticks.length, 3).map((i) => ticks[i])); + axis.tickValues(ticks); + } + else { + axis.tickValues(null); + } + }); + $chart.select('g.xaxis').call(this.xaxis); + $chart.select('g.yaxis').call(this.yaxis); + //trails idea: append a new id with the time point encoded + data.forEach((d) => { + d.xx = scales.x(d.x); + d.yy = scales.y(d.y); + d.ssize = scales.size(d.size); + }); + const $marks = $chart.select('g.marks').selectAll('.mark').data(data, (d) => d.id + (this.showUseTrails && d.selected ? '@' + selectedTimePoint : '')); + $marks.enter().append('circle').classed('mark', true) + .on('click', (d) => { + if (!this.interactive) { + return; + } + this.refData.rowtype.select([d.id], SelectionUtils.toSelectOperation(d3.event)); + }) + .on('mouseenter.select', (d) => this.refData.rowtype.select(SelectionUtils.hoverSelectionType, [d.id], SelectOperation.ADD)) + .on('mouseleave.select', (d) => this.refData.rowtype.select(SelectionUtils.hoverSelectionType, [d.id], SelectOperation.REMOVE)) + .call(this.totooltip) + .attr('data-anchor', (d) => d.id) + .attr('data-uid', (d) => d.id + (this.showUseTrails && d.selected ? '@' + selectedTimePoint : '')); + $marks + .classed('phovea-select-selected', (d) => d.selected) + .classed('phovea-select-filtered', (d) => d.filtered) + .attr('data-id', (d) => d.id); + $marks.interrupt().transition() + .duration(this.animationDuration()) + .attr({ + r: (d) => d.ssize, + cx: (d) => d.xx, + cy: (d) => d.yy + }) + .style('fill', (d) => d.ccolor = scales.color(d.color)); + this.updateSelectionTools(); + let $exit = $marks.exit(); + if (this.showUseTrails) { + $exit = $exit.filter((d) => { + return data.filter((d2) => d2.id === d.id && d2.selected).length <= 0; + }); + } + $exit + .style('opacity', 1) + .transition() + .style('opacity', 0) + .remove(); + this.updatePopulationSlider(scales.size); + }); + } + /*--------------- trail lines ------------- */ + /* + private updateTrail(){ + var trailine = d3.svg.line() + .interpolate('bundle') + .x(function (d) { + // return year --> i.e over time + }) + .y(function (d) { + // return positional coordinates + }); + + /!* path + .datum(this.refData) // + .transition() + .duration(450) + .attr('d',trailine);*!/ + } + */ + /* ------------------------------------------ */ + /* --------------- update() --------------------------------------------- */ + /* --- called in reset(), updateBounds(), setAttribute(), setAttributeImpScale() ------------- */ + update() { + //update labels + this.updateLegend(); + this.updateTimeLine(); + this.updateChart(); + const ref = this.refData; + if (!this.initedListener && ref) { + this.initedListener = true; + ref.coltype.on('select', this.onYearSelect.bind(this)); + ref.rowtype.on('select', this.onItemSelect.bind(this)); + } + } + showTrails(show) { + if (!this.interactive) { + return; + } + this.graph.push(GapMinderCmds.createToggleTrails(this.ref, show)); + } + showTrailsImpl(show) { + this.showUseTrails = show; + this.updateChart(); + } + onYearSelect(event, type, act) { + const id = act.first; + if (id !== null && this.timeIds) { + let $slider = this.$node.select('svg.timeline .slider'); + const selectedTimePoint = this.timeIds.ts[this.timeIds.ids.indexOf(id)]; + const x = this.timelinescale(selectedTimePoint); + if (type === SelectionUtils.defaultSelectionType) { //animate just for selections + $slider = $slider.transition().duration(this.animationDuration()); + } + $slider.attr('transform', 'translate(' + x + ',14)'); + this.updateChart(); + } + } + onItemSelect(event, type, act) { + const ids = act.dim(0).asList(); + this.$node.select('svg.chart g.marks').selectAll('.mark').classed('phovea-select-' + type, (d) => ids.indexOf(d.id) >= 0); + if (type === SelectionUtils.hoverSelectionType) { + this.updateHoverLine(ids); + } + else if (type === GapMinder.filteredSelectionType) { + this.updateLegend(); + } + else if (type === SelectionUtils.defaultSelectionType) { + this.updateSelectionLines(ids); + } + } + updateHoverLine(ids, animate = false) { + if (ids.length > 0) { + const first = ids[0]; + //direct access to d3 bound object + const d = this.node.querySelector('svg.chart g.marks .mark[data-id="' + first + '"]').__data__; + const x = d.xx; + const y = d.yy; + //hack from computeScale + const x0 = 80; + const y0 = this.dim[1] - 25; + let l = this.$node.select('polyline.hover_line'); + if (animate) { + l = l.interrupt().transition() + .duration(this.animationDuration()); + } + l.attr('points', `${x0},${y} ${x},${y} ${x},${y0}`).style('opacity', 1); + } + else { + this.$node.select('polyline.hover_line').interrupt().style('opacity', 0); + } + //show the hover line for this item + } + updateSelectionLines(ids, animate = false) { + const $lines = this.$node.select('g.select_lines').selectAll('polyline').data(ids, String); + $lines.enter().append('polyline').attr('class', 'select_line'); + let l = $lines; + if (animate) { + l = l.interrupt().transition() + .duration(this.animationDuration()); + } + l.attr('points', (id) => { + const d = this.node.querySelector('svg.chart g.marks .mark[data-id="' + id + '"]').__data__; + const x = d.xx; + const y = d.yy; + //hack from computeScale + const x0 = 80; + const y0 = this.dim[1] - 25; + return `${x0},${y} ${x},${y} ${x},${y0}`; + }).style('opacity', 1); + $lines.exit().remove(); + } + updateSelectionTools() { + const r = this.refData; + if (r) { + this.updateHoverLine(r.rowtype.selections(SelectionUtils.hoverSelectionType).dim(0).asList(), true); + this.updateSelectionLines(r.rowtype.selections().dim(0).asList(), true); + } + } + updatePopulationSlider(scale) { + const $popslider = this.$node.select('svg.size_legend'); + if (!this.attrs.size.valid) { + $popslider.selectAll('*').remove(); + return; + } + const t = scale.ticks(7); + const base = t.slice(1, t.length - 3).reverse(); + if (this.attrs.size.scale === 'sqrt') { + base.push(base[base.length - 1] / 2); + } + const data = base.map((v) => ({ v, s: scale(v) })); + const $circles = $popslider.selectAll('g.size').data(data); + $circles.enter().append('g').classed('size', true).html(''); + $circles.exit().remove(); + $circles.attr('transform', (d, i) => 'translate(0,' + (d3.sum(data.slice(0, i), (d2) => Math.max(d2.s * 2, 10) + 2)) + ')'); + $circles.select('circle') + .attr('r', (d) => d.s) + .attr('cx', data.length > 0 ? data[0].s : 0) + .attr('cy', (d) => d.s); + $circles.select('text').text((d) => this.attrs.size.format(d.v)) + .attr('x', data.length > 0 ? data[0].s * 2 + 5 : 0) + .attr('y', (d) => d.s + 5); + } + /* ------------------------- updateTimeLine() ------------------------------- */ + updateTimeLine() { + const $timeline = this.$node.select('svg.timeline'); + $timeline.attr({ + width: Math.max(this.dim[0], 0), + height: 40 + }); + // if theres data + if (!this.timeIds) { + return; + } + // slider + let $slider = $timeline.select('.slider'); + // returns true if no timeline and false if theres a timeline + const wasEmpty = $slider.empty(); + // timelinescale is linear + this.timelinescale.domain(this.timeIds.minmax).range([40, this.dim[0] - 40]).clamp(true); + $timeline.select('g.axis').attr('transform', 'translate(0,20)').call(this.timelineaxis); + /* ---------------- dragged() ------------------------- */ + const dragged = () => { + const xPos = d3.event.x; + const year = d3.round(this.timelinescale.invert(xPos), 0); + const j = this.timeIds.ts.indexOf(year); + this.timeIds.idtype.select(SelectionUtils.hoverSelectionType, [this.timeIds.ids[j]]); + }; + /* ---------------------------------------------------- */ + if (wasEmpty) { + $slider = $timeline.append('path').classed('slider', true) + .attr('d', d3.svg.symbol().type('triangle-down')(0)) + .attr('transform', 'translate(0,14)'); + // using ref Data + $slider.call(d3.behavior.drag() + .on('drag', dragged) + .on('dragend', () => { + //select the last entry + const s = this.timeIds.idtype.selections(SelectionUtils.hoverSelectionType); + this.timeIds.idtype.select(SelectionUtils.hoverSelectionType, Range.none()); + this.timeIds.idtype.select(s.clone()); + })); + } + //this.timelineaxis.ticks(20); //.tickValues(this.timeIds.range); + const s = this.timeIds.idtype.selections().dim(0); + let t; + if (s.isNone && this.graph.states.length <= 4) { //just the initial datasets + // set to 1800 + this.timeIds.idtype.select([this.timeIds.ids[0]]); + t = this.timeIds.ts[0]; + } + else { + t = this.timeIds.ts[s.first != null ? this.timeIds.ids.indexOf(s.first) : 0]; + } + const x = this.timelinescale(t); + // just visualizing where slider should be + $slider.attr('transform', 'translate(' + x + ',14)'); + } // end of updateTime() + /* ------------------- reset() ------------------------------------- */ + reset() { + this.attrs.x = null; + this.attrs.y = null; + this.attrs.size = null; + this.color = null; + this.update(); + } + getBounds() { + return this.bounds; + } + setBounds(x, y, w, h) { + this.bounds = new Rect(x, y, w, h); + this.dim = [w, h]; + this.relayout(); + this.update(); + } + relayout() { + //nothing to do + } + setXAttribute(m) { + // cleanData(m); + return this.setAttribute('x', m); + } + setYAttribute(m) { + return this.setAttribute('y', m); + } + setSizeAttribute(m) { + return this.setAttribute('size', m); + } + setColor(m) { + return this.setAttribute('color', m); + } + setColorImpl(attr, m) { + const old = this.color; + this.color = m; + this.update(); + return old === null ? this.noneRef : this.graph.findObject(old); + } + setAttributeImpl(attr, m) { + if (m == null) { + m = null; + } + const old = attr === 'color' ? this.color : this.attrs[attr].data; + if (attr === 'color') { + this.color = m; + return (this.color ? this.color.idRange() : Promise.resolve(null)).then((arr) => { + this.colorRange = arr; + EventHandler.getInstance().fire('ready'); + this.update(); + return old === null ? this.noneRef : this.graph.findObject(old); + }); + } + else { + const matrix = m; + const att = this.attrs[attr]; + att.data = matrix; + EventHandler.getInstance().fire('wait'); + if (this.refData === matrix && matrix != null) { + return Promise.all([matrix.data(), matrix.rows(), matrix.rowIds(), matrix.cols(), matrix.colIds()]).then((args) => { + att.arr = args[0]; + //prepare the items + this.items = this.createItems(args[1], args[2], matrix.rowtype); + //prepare time ids + this.timeIds = this.createTimeIds(args[3], args[4], matrix.coltype); + EventHandler.getInstance().fire('ready'); + this.update(); + return old === null ? this.noneRef : this.graph.findObject(old); + }); + } + else { + return (matrix ? matrix.data() : Promise.resolve(null)).then((arr) => { + this.attrs[attr].arr = arr; + EventHandler.getInstance().fire('ready'); + this.update(); + return old === null ? this.noneRef : this.graph.findObject(old); + }); + } + } + } + setAttributeScaleImpl(attr, scale) { + const old = this.attrs[attr].scale; + this.attrs[attr].scale = scale; + this.update(); + return old; + } + setAttributeScale(attr, scale) { + return this.graph.push(GapMinderCmds.setAttributeScale(attr, this.ref, scale)); + } + setAttribute(attr, m) { + const mref = this.graph.findOrAddObject(m, m.desc.name, 'data'); + return this.graph.push(GapMinderCmds.setAttribute(attr, this.ref, mref)); + } + createTimeIds(names, ids, idtype) { + const ts = names.map((d) => parseInt(d, 10)); + const idsAsList = ids.dim(0).asList(); + idtype.fillMapCache(idsAsList, names); + return { + idtype, + ids: idsAsList, + names, + ts, + minmax: d3.extent(ts) + }; + } + createItems(names, ids, idtype) { + const idAsList = ids.dim(0).asList(); + idtype.fillMapCache(idAsList, names); + return idAsList.map((id, i) => { + return { + id, + name: names[i] + }; + }); + } + static create(parent, provGraph) { + return new GapMinder(parent, provGraph); + } +} +GapMinder.filteredSelectionType = 'filtered'; +//# sourceMappingURL=gapminder.js.map \ No newline at end of file diff --git a/dist/app/index.d.ts b/dist/app/index.d.ts new file mode 100644 index 0000000..693bdcb --- /dev/null +++ b/dist/app/index.d.ts @@ -0,0 +1 @@ +export * from './gapminder'; diff --git a/dist/app/index.js b/dist/app/index.js new file mode 100644 index 0000000..7f087d7 --- /dev/null +++ b/dist/app/index.js @@ -0,0 +1,2 @@ +export * from './gapminder'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..cf92e76 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,2 @@ +export * from './app'; +export * from './initialize'; diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..9d2bdcf --- /dev/null +++ b/dist/index.html @@ -0,0 +1,96 @@ + + + + + + Phovea GapMinder + + + + + + + + + + + diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..c297981 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,3 @@ +export * from './app'; +export * from './initialize'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/initialize/GapMinderApp.d.ts b/dist/initialize/GapMinderApp.d.ts new file mode 100644 index 0000000..a435f6e --- /dev/null +++ b/dist/initialize/GapMinderApp.d.ts @@ -0,0 +1,13 @@ +/** + * Created by Samuel Gratzl on 15.12.2014. + */ +import 'file-loader?name=index.html!extract-loader!html-loader!./index.html'; +import 'file-loader?name=404.html!./404.html'; +import 'file-loader?name=robots.txt!./robots.txt'; +import 'phovea_ui/dist/_bootstrap'; +import 'phovea_ui/dist/_font-awesome'; +import '../scss/main.scss'; +export declare class GapMinderApp { + private helper; + constructor(); +} diff --git a/dist/initialize/GapMinderApp.js b/dist/initialize/GapMinderApp.js new file mode 100644 index 0000000..5604f1b --- /dev/null +++ b/dist/initialize/GapMinderApp.js @@ -0,0 +1,56 @@ +/** + * Created by Samuel Gratzl on 15.12.2014. + */ +// Determine the order of css files manually +import 'file-loader?name=index.html!extract-loader!html-loader!../index.html'; +import 'file-loader?name=404.html!../404.html'; +import 'file-loader?name=robots.txt!../robots.txt'; +import 'bootstrap-sass/assets/stylesheets/_bootstrap.scss'; +import 'phovea_ui/dist/webpack/_font-awesome'; +import '../scss/main.scss'; +import { CLUEWrapper, ModeWrapper } from 'phovea_clue'; +import { GapMinder } from '../app/gapminder'; +import { I18nextManager, BaseUtils, EventHandler } from 'phovea_core'; +export class GapMinderApp { + constructor() { + //scoping let --> function level scope in js vs java global, local + this.helper = document.querySelector('div.gapminder'); + I18nextManager.getInstance().initI18n().then(() => { + const elems = CLUEWrapper.createCLUEWrapper(document.body, { + app: 'GapMinder', + application: '/gapminder', + id: 'clue_gapminder', + recordSelectionTypes: 'selected,filtered', + animatedSelections: true, + thumbnails: false + }); + { + while (this.helper.firstChild) { + elems.$main.node().appendChild(this.helper.firstChild); + } + } + elems.graph.then((graph) => { + const app = GapMinder.create(elems.$main.node(), graph); + EventHandler.getInstance().on('wait', elems.header.wait.bind(elems.header)); + EventHandler.getInstance().on('ready', elems.header.ready.bind(elems.header)); + function updateBounds() { + const bounds = BaseUtils.bounds(document.querySelector('main')); + app.setBounds(bounds.x, bounds.y, bounds.w - 200, bounds.h - 80); + } + //d3.select(elems.header.options).append('label').html(`Show Trails`).select('input').on('change', function () { + // app.showTrails(this.checked); + // }); + elems.on('modeChanged', function (event, newMode) { + app.setInteractive(newMode.exploration >= 0.8); + //for the animations to end + setTimeout(updateBounds, 300); + }); + window.addEventListener('resize', updateBounds); + setTimeout(updateBounds, 500); + app.setInteractive(ModeWrapper.getInstance().getMode().exploration >= 0.8); + elems.jumpToStored(); + }); + }); + } +} +//# sourceMappingURL=GapMinderApp.js.map \ No newline at end of file diff --git a/dist/initialize/index.d.ts b/dist/initialize/index.d.ts new file mode 100644 index 0000000..43cb01f --- /dev/null +++ b/dist/initialize/index.d.ts @@ -0,0 +1 @@ +export * from './GapMinderApp'; diff --git a/dist/initialize/index.js b/dist/initialize/index.js new file mode 100644 index 0000000..360a959 --- /dev/null +++ b/dist/initialize/index.js @@ -0,0 +1,2 @@ +export * from './GapMinderApp'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/initialize/initialize.d.ts b/dist/initialize/initialize.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/initialize/initialize.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/initialize/initialize.js b/dist/initialize/initialize.js new file mode 100644 index 0000000..08a1b0f --- /dev/null +++ b/dist/initialize/initialize.js @@ -0,0 +1,3 @@ +import { GapMinderApp } from './GapMinderApp'; +const app = new GapMinderApp(); +//# sourceMappingURL=initialize.js.map \ No newline at end of file diff --git a/dist/robots.txt b/dist/robots.txt new file mode 100644 index 0000000..9417495 --- /dev/null +++ b/dist/robots.txt @@ -0,0 +1,3 @@ +# robotstxt.org + +User-agent: * diff --git a/src/style.scss b/dist/scss/main.scss similarity index 98% rename from src/style.scss rename to dist/scss/main.scss index 5140e94..052f9ff 100644 --- a/src/style.scss +++ b/dist/scss/main.scss @@ -3,7 +3,7 @@ */ // use original CLUE styles as foundation -@import "~phovea_clue/dist/style.scss"; +@import "~phovea_clue/dist/scss/main.scss"; body, html { padding: 0; diff --git a/package.json b/package.json index e19c801..cc43432 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,12 @@ "url": "https://github.com/caleydo/gapminder.git" }, "private": true, + "main": "dist/index.js", + "types": "dist/index.d.ts", "files": [ "src", - "index.js", - "phovea.js", "phovea_registry.js", - "build" + "dist" ], "engines": { "npm": ">= 6.12", @@ -39,9 +39,11 @@ "test": "jest --passWithNoTests", "test:watch": "jest --watch", "posttest": "npm run lint", - "build:dev": "webpack --mode development --config config/webpack.dev.js", - "build": "webpack --mode production --config config/webpack.prod.js", - "bundle-report": "webpack-bundle-analyzer --port 4200 bundles/stats.json", + "build:dev": "tsc", + "build": "npm run clean && npm run compile && npm run copy-assets && npm run copy-styles", + "copy-assets": "if [ -d src/assets ]; then cp -rv src/assets/ dist/assets/; fi", + "copy-styles": "cd src && find . -name '*.scss' -exec cp --parents '{}' ./../dist/ ';'", + "copy-app-assets": "cd src && cp -prv *.{txt,html} ./../dist/", "start:dev": "webpack-dev-server --inline --config config/webpack.dev.js", "start": "webpack-dev-server --config config/webpack.prod.js", "start:hot": "webpack-dev-server --inline --hot", @@ -99,7 +101,8 @@ "@types/marked": "^0.7.2", "jquery": "^3.4.1", "marked": "^0.7.0", - "phovea_clue": "^5.0.1-SNAPSHOT", - "phovea_vis": "^4.0.1-SNAPSHOT" + "phovea_vis": "github:phovea/phovea_vis#vstoiber/refactoring", + "phovea_clue": "github:phovea/phovea_ui#vstoiber/refactoring", + "phovea_core": "github:phovea/phovea_core#asteiner/refactoring" } } diff --git a/src/gapminder.ts b/src/app/gapminder.ts similarity index 70% rename from src/gapminder.ts rename to src/app/gapminder.ts index c4505ce..30bca7a 100644 --- a/src/gapminder.ts +++ b/src/app/gapminder.ts @@ -2,153 +2,13 @@ * Created by Samuel Gratzl on 15.12.2014. */ -import * as C from 'phovea_core/dist/index'; -import * as datas from 'phovea_core/dist/data'; -import * as datatypes from 'phovea_core/dist/datatype'; -import * as matrix from 'phovea_core/dist/matrix'; -import * as stratification from 'phovea_core/dist/stratification'; -import * as prov from 'phovea_core/dist/provenance'; -import * as idtypes from 'phovea_core/dist/idtype'; -import * as views from 'phovea_core/dist/layout_view'; -import * as ranges from 'phovea_core/dist/range'; -import {Rect} from 'phovea_core/dist/geom'; -import tooltipBind from 'phovea_d3/dist/tooltip'; import * as d3 from 'd3'; +import {ActionNode, IObjectRef, IDataType, DataCache, EventHandler, ObjectRefUtils, ActionMetaData, INumericalMatrix, Range, IDType, Rect, AView, IStratification, CompositeRange1D, ProvenanceGraph, ArrayUtils, SelectionUtils, SelectOperation, ActionUtils} from 'phovea_core'; +import {ToolTip} from 'phovea_d3'; -const filteredSelectionType = 'filtered'; - -function setAttributeImpl(inputs, parameter, graph, within) { - const gapminder:GapMinder = inputs[0].value, - name = parameter.name; - - return inputs[1].v.then((data) => { - if (data === '') { - data = null; - } - return gapminder.setAttributeImpl(name, data).then((old) => { - return { - inverse: setAttribute(name, inputs[0], old), - consumed: within - }; - }); - }); -} -function setAttributeScaleImpl(inputs, parameter, graph, within) { - const gapminder:GapMinder = inputs[0].value, - name = parameter.name; - - const old = gapminder.setAttributeScaleImpl(name, parameter.scale); - return { - inverse: setAttributeScale(name, inputs[0], old), - consumed: within - }; -} - -function toggleGapMinderTrailsImpl(inputs, parameter) { - const gapminder:GapMinder = inputs[0].value, - show = parameter.show; - - gapminder.showTrailsImpl(show); - return { - inverse: createToggleTrails(inputs[0], !show) - }; -} - - - -/** - * compresses the given path by removing redundant set gap minder attribute calls - * @param path - * @returns {prov.ActionNode[]} - */ -export function compressSetAttribute(path:prov.ActionNode[]) { - const lastByAttribute:any = {}; - path.forEach((p) => { - if (p.f_id === 'setGapMinderAttribute') { - const para = p.parameter.name; - lastByAttribute[para] = p; - } - }); - return path.filter((p) => { - if (p.f_id !== 'setGapMinderAttribute') { - return true; - } - const para = p.parameter.name; - //last one remains - return lastByAttribute[para] === p; - }); -} - -/** - * compresses the given path by removing redundant set gap minder attribute scale calls - * @param path - * @returns {prov.ActionNode[]} - */ -export function compressSetAttributeScale(path:prov.ActionNode[]) { - const lastByAttribute:any = {}; - path.forEach((p) => { - if (p.f_id === 'setGapMinderAttributeScale') { - const para = p.parameter.name; - lastByAttribute[para] = p; - } - }); - return path.filter((p) => { - if (p.f_id !== 'setGapMinderAttributeScale') { - return true; - } - const para = p.parameter.name; - //last one remains - return lastByAttribute[para] === p; - }); -} - -export function compressToggleGapMinderTrails(path:prov.ActionNode[]) { - const l = path.filter((p) => p.f_id === 'toggleGapMinderTrails'); - - const good = l.length %2 === 0 ? null : l[l.length-1]; - //remove all except the last if uneven number of changes - return path.filter((p) => p.f_id !== 'toggleGapMinderTrails' || p === good); -} - - -// externally called to recall implementation for prov graph -// rebuild based on the --> createCmd --> maps name to a function -export function createCmd(id) { - switch (id) { - case 'setGapMinderAttribute' : - return setAttributeImpl; - case 'setGapMinderAttributeScale': - return setAttributeScaleImpl; - case 'toggleGapMinderTrails': - return toggleGapMinderTrailsImpl; - } - return null; -} - -function capitalize(s: string) { - return s.split(' ').map((d) => d[0].toUpperCase()+d.slice(1)).join(' '); -} - -export function createToggleTrails($mainRef:prov.IObjectRef, show: boolean) { - return prov.action(prov.meta((show? 'Show' : 'Hide') + ' trails', prov.cat.layout, prov.op.update), 'toggleGapMinderTrails', toggleGapMinderTrailsImpl, [$mainRef], { - show - }); -} - -export function setAttribute(name:string, $mainRef:prov.IObjectRef, data:prov.IObjectRef) { - return prov.action(prov.meta(capitalize(name) + '=' + (data ? data.name : ''), prov.cat.data, prov.op.update), 'setGapMinderAttribute', setAttributeImpl, [$mainRef, data], { - name - }); -} -export function setAttributeScale(name:string, $mainRef:prov.IObjectRef, scale:string) { - return prov.action(prov.meta('scale('+capitalize(name) + ')=' + capitalize(scale), prov.cat.visual, prov.op.update), 'setGapMinderAttributeScale', setAttributeScaleImpl, [$mainRef], { - scale, - name - }); -} class Attribute { - data:matrix.INumericalMatrix = null; + data: INumericalMatrix = null; arr:number[][] = null; @@ -186,35 +46,148 @@ interface IItem { name: string; } -function createTimeIds(names:string[], ids:ranges.Range, idtype:idtypes.IDType) { - const ts = names.map((d) => parseInt(d, 10)); - const idsAsList = ids.dim(0).asList(); - idtype.fillMapCache(idsAsList, names); - return { - idtype, - ids: idsAsList, - names, - ts, - minmax: d3.extent(ts) - }; -} -function createItems(names:string[], ids:ranges.Range, idtype:idtypes.IDType):IItem[] { - const idAsList = ids.dim(0).asList(); - idtype.fillMapCache(idAsList, names); - return idAsList.map((id, i) => { +class GapMinderCmds { + + private static setAttributeImpl(inputs, parameter, graph, within) { + const gapminder:GapMinder = inputs[0].value, + name = parameter.name; + + return inputs[1].v.then((data) => { + if (data === '') { + data = null; + } + return gapminder.setAttributeImpl(name, data).then((old) => { + return { + inverse: GapMinderCmds.setAttribute(name, inputs[0], old), + consumed: within + }; + }); + }); + } + + private static setAttributeScaleImpl(inputs, parameter, graph, within) { + const gapminder:GapMinder = inputs[0].value, + name = parameter.name; + + const old = gapminder.setAttributeScaleImpl(name, parameter.scale); return { - id, - name: names[i] + inverse: GapMinderCmds.setAttributeScale(name, inputs[0], old), + consumed: within }; - }); + } + + private static toggleGapMinderTrailsImpl(inputs, parameter) { + const gapminder:GapMinder = inputs[0].value, + show = parameter.show; + + gapminder.showTrailsImpl(show); + return { + inverse: GapMinderCmds.createToggleTrails(inputs[0], !show) + }; + } + + + + /** + * compresses the given path by removing redundant set gap minder attribute calls + * @param path + * @returns {ActionNode[]} + */ + static compressSetAttribute(path: ActionNode[]) { + const lastByAttribute:any = {}; + path.forEach((p) => { + if (p.f_id === 'setGapMinderAttribute') { + const para = p.parameter.name; + lastByAttribute[para] = p; + } + }); + return path.filter((p) => { + if (p.f_id !== 'setGapMinderAttribute') { + return true; + } + const para = p.parameter.name; + //last one remains + return lastByAttribute[para] === p; + }); + } + + /** + * compresses the given path by removing redundant set gap minder attribute scale calls + * @param path + * @returns { ActionNode[]} + */ + static compressSetAttributeScale(path: ActionNode[]) { + const lastByAttribute:any = {}; + path.forEach((p) => { + if (p.f_id === 'setGapMinderAttributeScale') { + const para = p.parameter.name; + lastByAttribute[para] = p; + } + }); + return path.filter((p) => { + if (p.f_id !== 'setGapMinderAttributeScale') { + return true; + } + const para = p.parameter.name; + //last one remains + return lastByAttribute[para] === p; + }); + } + + static compressToggleGapMinderTrails(path:ActionNode[]) { + const l = path.filter((p) => p.f_id === 'toggleGapMinderTrails'); + + const good = l.length %2 === 0 ? null : l[l.length-1]; + //remove all except the last if uneven number of changes + return path.filter((p) => p.f_id !== 'toggleGapMinderTrails' || p === good); + } + + + // externally called to recall implementation for prov graph + // rebuild based on the --> createCmd --> maps name to a function + static createCmd(id) { + switch (id) { + case 'setGapMinderAttribute' : + return GapMinderCmds.setAttributeImpl; + case 'setGapMinderAttributeScale': + return GapMinderCmds.setAttributeScaleImpl; + case 'toggleGapMinderTrails': + return GapMinderCmds.toggleGapMinderTrailsImpl; + } + return null; + } + + static capitalize(s: string) { + return s.split(' ').map((d) => d[0].toUpperCase()+d.slice(1)).join(' '); + } + + public static createToggleTrails($mainRef:IObjectRef, show: boolean) { + return ActionUtils.action(ActionMetaData.actionMeta((show? 'Show' : 'Hide') + ' trails', ObjectRefUtils.category.layout, ObjectRefUtils.operation.update), 'toggleGapMinderTrails', GapMinderCmds.toggleGapMinderTrailsImpl, [$mainRef], { + show + }); + } + + public static setAttribute(name:string, $mainRef:IObjectRef, data:IObjectRef) { + return ActionUtils.action(ActionMetaData.actionMeta(GapMinderCmds.capitalize(name) + '=' + (data ? data.name : ''), ObjectRefUtils.category.data, ObjectRefUtils.operation.update), 'setGapMinderAttribute', GapMinderCmds.setAttributeImpl, [$mainRef, data], { + name + }); + } + static setAttributeScale(name:string, $mainRef:IObjectRef, scale:string) { + return ActionUtils.action(ActionMetaData.actionMeta('scale('+GapMinderCmds.capitalize(name) + ')=' + GapMinderCmds.capitalize(scale), ObjectRefUtils.category.visual, ObjectRefUtils.operation.update), 'setGapMinderAttributeScale', GapMinderCmds.setAttributeScaleImpl, [$mainRef], { + scale, + name + }); + } } -class GapMinder extends views.AView { +export class GapMinder extends AView { + + private static readonly filteredSelectionType = 'filtered'; private dim:[number, number] = [100, 100]; - ref:prov.IObjectRef; - noneRef:prov.IObjectRef; + ref:IObjectRef; + noneRef:IObjectRef; attrs = { x: new Attribute(), @@ -226,8 +199,8 @@ class GapMinder extends views.AView { private items:IItem[] = []; - private color:stratification.IStratification = null; - private colorRange:ranges.CompositeRange1D = null; + private color:IStratification = null; + private colorRange:CompositeRange1D = null; private $node:d3.Selection; private xaxis = d3.svg.axis().orient('bottom'); @@ -243,10 +216,10 @@ class GapMinder extends views.AView { private interactive = true; - private totooltip = tooltipBind(this.createTooltip.bind(this), 0); + private totooltip = ToolTip.bind(this.createTooltip.bind(this), 0); // for colorScale domain is continent groups mapped to the range which is colorPalette - constructor(private elem:Element, private graph:prov.ProvenanceGraph) { + constructor(private elem:Element, private graph:ProvenanceGraph) { super(); this.$node = d3.select(elem).datum(this); this.ref = graph.findOrAddObject(this, 'GapMinder', 'visual'); @@ -265,7 +238,7 @@ class GapMinder extends views.AView { } /* ------------------ REF DATA ---------------------- */ - private get refData():matrix.INumericalMatrix { + private get refData():INumericalMatrix { if (this.attrs.x.valid) { return this.attrs.x.data; } @@ -291,8 +264,8 @@ class GapMinder extends views.AView { const that = this; //find all gapminder datasets - datas.list((d) => /.*gapminder.*/.test(d.desc.fqname)).then((list) => { - const matrices = list.filter((d) => d.desc.type === 'matrix'); + DataCache.getInstance().list((d) => /.*gapminder.*/.test(d.desc.fqname)).then((list) => { + const matrices = list.filter((d) => d.desc.type === 'matrix'); ['x', 'y','size'].forEach((attr) => { const $options = d3.select('select.attr-' + attr).selectAll('option').data(matrices); $options.enter().append('option'); @@ -307,7 +280,7 @@ class GapMinder extends views.AView { }); }); - const stratifications = list.filter((d) => d.desc.type === 'stratification'); + const stratifications = list.filter((d) => d.desc.type === 'stratification'); { const $options = d3.select('select.attr-color').selectAll('option').data(stratifications); $options.enter().append('option'); @@ -321,11 +294,11 @@ class GapMinder extends views.AView { //select default datasets if (this.graph.states.length === 1) { //first one - this.setXAttribute(C.search(matrices, (d) => d.desc.id === 'gapminderGdp') || matrices[0]); - this.setYAttribute(C.search(matrices, (d) => d.desc.id === 'gapminderLifeExpectancy') || matrices[0]); - this.setSizeAttribute(C.search(matrices, (d) => d.desc.id === 'gapminderPopulation') || matrices[0]); + this.setXAttribute(ArrayUtils.search(matrices, (d) => d.desc.id === 'gapminderGdp') || matrices[0]); + this.setYAttribute(ArrayUtils.search(matrices, (d) => d.desc.id === 'gapminderLifeExpectancy') || matrices[0]); + this.setSizeAttribute(ArrayUtils.search(matrices, (d) => d.desc.id === 'gapminderPopulation') || matrices[0]); - this.setColor(C.search(stratifications, (d) => d.desc.id === 'gapminderContinent') || stratifications[0]); + this.setColor(ArrayUtils.search(stratifications, (d) => d.desc.id === 'gapminderContinent') || stratifications[0]); } }); @@ -386,7 +359,7 @@ class GapMinder extends views.AView { const cData = this.colorRange; const rowSelection = this.refData.rowtype.selections(); - const rowFilter = this.refData.rowtype.selections(filteredSelectionType); + const rowFilter = this.refData.rowtype.selections(GapMinder.filteredSelectionType); const selectecdTimeIndex = this.timeIds.ids.indexOf(selectedTimeId); @@ -400,7 +373,7 @@ class GapMinder extends views.AView { y: yData && selectecdTimeIndex >= 0 ? yData[i][selectecdTimeIndex] : 0, size: sData && selectecdTimeIndex >= 0 ? sData[i][selectecdTimeIndex] : 0, //not the id ... local range - color: cData ? C.search(cData.groups, (g) => g.contains(item.id)).name : null + color: cData ? ArrayUtils.search(cData.groups, (g) => g.contains(item.id)).name : null }; }); } @@ -441,13 +414,13 @@ class GapMinder extends views.AView { } const isActive = d3.select(this).select('i').classed('fa-circle'); d3.select(this).select('i').classed('fa-circle-o', isActive).classed('fa-circle', !isActive); - that.color.idtype.select(filteredSelectionType,ranges.list(d), isActive ? idtypes.SelectOperation.ADD : idtypes.SelectOperation.REMOVE); + that.color.idtype.select(GapMinder.filteredSelectionType,Range.list(d), isActive ? SelectOperation.ADD : SelectOperation.REMOVE); }); $legendsEnter.append('i').attr('class', 'fa fa-circle'); $legendsEnter.append('span'); if (this.color != null) { - const filtered = this.color.idtype.selections(filteredSelectionType).dim(0); + const filtered = this.color.idtype.selections(GapMinder.filteredSelectionType).dim(0); $legends.select('i') .style('color', (d) => d.color) .classed('fa-circle', (d) => !filtered.contains(d.first)) @@ -464,7 +437,7 @@ class GapMinder extends views.AView { const refData = this.refData; if (refData) { const type = refData.coltype; - const hovered = type.selections(idtypes.hoverSelectionType).first; + const hovered = type.selections(SelectionUtils.hoverSelectionType).first; if (hovered != null) { return hovered; } @@ -557,10 +530,10 @@ class GapMinder extends views.AView { if (!this.interactive) { return; } - this.refData.rowtype.select([d.id], idtypes.toSelectOperation(d3.event)); + this.refData.rowtype.select([d.id], SelectionUtils.toSelectOperation(d3.event)); }) - .on('mouseenter.select', (d) => this.refData.rowtype.select(idtypes.hoverSelectionType, [d.id], idtypes.SelectOperation.ADD)) - .on('mouseleave.select', (d) => this.refData.rowtype.select(idtypes.hoverSelectionType, [d.id], idtypes.SelectOperation.REMOVE)) + .on('mouseenter.select', (d) => this.refData.rowtype.select(SelectionUtils.hoverSelectionType, [d.id], SelectOperation.ADD)) + .on('mouseleave.select', (d) => this.refData.rowtype.select(SelectionUtils.hoverSelectionType, [d.id], SelectOperation.REMOVE)) .call(this.totooltip) .attr('data-anchor', (d) => d.id) .attr('data-uid',(d) =>d.id + (this.showUseTrails && d.selected ? '@'+selectedTimePoint : '')); @@ -644,7 +617,7 @@ class GapMinder extends views.AView { if (!this.interactive) { return; } - this.graph.push(createToggleTrails(this.ref, show)); + this.graph.push(GapMinderCmds.createToggleTrails(this.ref, show)); } showTrailsImpl(show: boolean) { @@ -652,14 +625,14 @@ class GapMinder extends views.AView { this.updateChart(); } - private onYearSelect(event:any, type:string, act:ranges.Range) { + private onYearSelect(event:any, type:string, act:Range) { const id = act.first; if (id !== null && this.timeIds) { let $slider: any = this.$node.select('svg.timeline .slider'); const selectedTimePoint = this.timeIds.ts[this.timeIds.ids.indexOf(id)]; const x = this.timelinescale(selectedTimePoint); - if (type === idtypes.defaultSelectionType) { //animate just for selections + if (type === SelectionUtils.defaultSelectionType) { //animate just for selections $slider = $slider.transition().duration(this.animationDuration()); } $slider.attr('transform', 'translate(' + x + ',14)'); @@ -667,15 +640,15 @@ class GapMinder extends views.AView { } } - private onItemSelect(event:any, type:string, act:ranges.Range) { + private onItemSelect(event:any, type:string, act:Range) { const ids = act.dim(0).asList(); this.$node.select('svg.chart g.marks').selectAll('.mark').classed('phovea-select-' + type, (d) => ids.indexOf(d.id) >= 0); - if (type === idtypes.hoverSelectionType) { + if (type === SelectionUtils.hoverSelectionType) { this.updateHoverLine(ids); - } else if (type === filteredSelectionType) { + } else if (type === GapMinder.filteredSelectionType) { this.updateLegend(); - } else if (type === idtypes.defaultSelectionType) { + } else if (type === SelectionUtils.defaultSelectionType) { this.updateSelectionLines(ids); } } @@ -727,7 +700,7 @@ class GapMinder extends views.AView { private updateSelectionTools() { const r = this.refData; if (r) { - this.updateHoverLine(r.rowtype.selections(idtypes.hoverSelectionType).dim(0).asList(), true); + this.updateHoverLine(r.rowtype.selections(SelectionUtils.hoverSelectionType).dim(0).asList(), true); this.updateSelectionLines(r.rowtype.selections().dim(0).asList(), true); } } @@ -790,7 +763,7 @@ class GapMinder extends views.AView { const xPos = (d3.event).x; const year = d3.round(this.timelinescale.invert(xPos), 0); const j = this.timeIds.ts.indexOf(year); - this.timeIds.idtype.select(idtypes.hoverSelectionType, [this.timeIds.ids[j]]); + this.timeIds.idtype.select(SelectionUtils.hoverSelectionType, [this.timeIds.ids[j]]); }; /* ---------------------------------------------------- */ @@ -804,8 +777,8 @@ class GapMinder extends views.AView { .on('drag', dragged) .on('dragend', () => { //select the last entry - const s = this.timeIds.idtype.selections(idtypes.hoverSelectionType); - this.timeIds.idtype.select(idtypes.hoverSelectionType, ranges.none()); + const s = this.timeIds.idtype.selections(SelectionUtils.hoverSelectionType); + this.timeIds.idtype.select(SelectionUtils.hoverSelectionType, Range.none()); this.timeIds.idtype.select(s.clone()); })); } @@ -853,24 +826,24 @@ class GapMinder extends views.AView { } - setXAttribute(m:matrix.INumericalMatrix) { + setXAttribute(m:INumericalMatrix) { // cleanData(m); return this.setAttribute('x', m); } - setYAttribute(m:matrix.INumericalMatrix) { + setYAttribute(m:INumericalMatrix) { return this.setAttribute('y', m); } - setSizeAttribute(m:matrix.INumericalMatrix) { + setSizeAttribute(m:INumericalMatrix) { return this.setAttribute('size', m); } - setColor(m:stratification.IStratification) { + setColor(m:IStratification) { return this.setAttribute('color', m); } - setColorImpl(attr:string, m:stratification.IStratification) { + setColorImpl(attr:string, m:IStratification) { const old = this.color; this.color = m; @@ -879,39 +852,39 @@ class GapMinder extends views.AView { return old === null ? this.noneRef : this.graph.findObject(old); } - setAttributeImpl(attr:string, m:datatypes.IDataType) { + setAttributeImpl(attr:string, m: IDataType) { if (m == null) { m = null; } const old = attr === 'color' ? this.color : this.attrs[attr].data; if (attr === 'color') { - this.color = m; + this.color = m; return (this.color ? this.color.idRange() : Promise.resolve(null)).then((arr) => { this.colorRange = arr; - this.fire('ready'); + EventHandler.getInstance().fire('ready'); this.update(); return old === null ? this.noneRef : this.graph.findObject(old); }); } else { - const matrix = m; + const matrix = m; const att = this.attrs[attr]; att.data = matrix; - this.fire('wait'); + EventHandler.getInstance().fire('wait'); if (this.refData === matrix && matrix != null) { return Promise.all([matrix.data(), matrix.rows(), matrix.rowIds(), matrix.cols(), matrix.colIds()]).then((args) => { att.arr = args[0]; //prepare the items - this.items = createItems(args[1], args[2], matrix.rowtype); + this.items = this.createItems(args[1], args[2], matrix.rowtype); //prepare time ids - this.timeIds = createTimeIds(args[3], args[4], matrix.coltype); + this.timeIds = this.createTimeIds(args[3], args[4], matrix.coltype); - this.fire('ready'); + EventHandler.getInstance().fire('ready'); this.update(); @@ -920,7 +893,7 @@ class GapMinder extends views.AView { } else { return (matrix ? matrix.data(): Promise.resolve(null)).then((arr) => { this.attrs[attr].arr = arr; - this.fire('ready'); + EventHandler.getInstance().fire('ready'); this.update(); @@ -940,15 +913,39 @@ class GapMinder extends views.AView { } setAttributeScale(attr:string, scale:string) { - return this.graph.push(setAttributeScale(attr, this.ref, scale)); + return this.graph.push(GapMinderCmds.setAttributeScale(attr, this.ref, scale)); } - setAttribute(attr:string, m:datatypes.IDataType) { + setAttribute(attr:string, m:IDataType) { const mref = this.graph.findOrAddObject(m, m.desc.name, 'data'); - return this.graph.push(setAttribute(attr, this.ref, mref)); + return this.graph.push(GapMinderCmds.setAttribute(attr, this.ref, mref)); + } + + createTimeIds(names:string[], ids:Range, idtype:IDType) { + const ts = names.map((d) => parseInt(d, 10)); + const idsAsList = ids.dim(0).asList(); + idtype.fillMapCache(idsAsList, names); + return { + idtype, + ids: idsAsList, + names, + ts, + minmax: d3.extent(ts) + }; } -} -export function create(parent:Element, provGraph:prov.ProvenanceGraph) { - return new GapMinder(parent, provGraph); + createItems(names:string[], ids:Range, idtype:IDType):IItem[] { + const idAsList = ids.dim(0).asList(); + idtype.fillMapCache(idAsList, names); + return idAsList.map((id, i) => { + return { + id, + name: names[i] + }; + }); + } + + static create(parent:Element, provGraph:ProvenanceGraph) { + return new GapMinder(parent, provGraph); + } } diff --git a/src/app/index.ts b/src/app/index.ts new file mode 100644 index 0000000..693bdcb --- /dev/null +++ b/src/app/index.ts @@ -0,0 +1 @@ +export * from './gapminder'; diff --git a/src/index.ts b/src/index.ts index d042745..cf92e76 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,69 +1,2 @@ -/** - * Created by Samuel Gratzl on 15.12.2014. - */ - -// Determine the order of css files manually - -import 'file-loader?name=index.html!extract-loader!html-loader!./index.html'; -import 'file-loader?name=404.html!./404.html'; -import 'file-loader?name=robots.txt!./robots.txt'; -import 'phovea_ui/dist/_bootstrap'; -import 'phovea_ui/dist/_font-awesome'; -import './style.scss'; - - -import * as C from 'phovea_core/dist/index'; -import * as template from 'phovea_clue/dist/template'; -import * as cmode from 'phovea_clue/dist/mode'; -import * as gapminder from './gapminder'; -import {initI18n} from 'phovea_core/dist/i18n'; - -//scoping let --> function level scope in js vs java global, local -const helper = document.querySelector('div.gapminder'); - -initI18n().then(() => { - const elems = template.create(document.body, { - app: 'GapMinder', - application: '/gapminder', - id: 'clue_gapminder', - recordSelectionTypes: 'selected,filtered', - animatedSelections: true, - thumbnails: false - }); - - { - while(helper.firstChild) { - (elems.$main.node()).appendChild(helper.firstChild); - } - } - - elems.graph.then((graph) => { - const app = gapminder.create(elems.$main.node(), graph); - - app.on('wait', elems.header.wait.bind(elems.header)); - app.on('ready', elems.header.ready.bind(elems.header)); - - function updateBounds() { - const bounds = C.bounds(document.querySelector('main')); - app.setBounds(bounds.x, bounds.y, bounds.w - 200, bounds.h - 80); - } - - //d3.select(elems.header.options).append('label').html(`Show Trails`).select('input').on('change', function () { - // app.showTrails(this.checked); - // }); - - elems.on('modeChanged', function (event, newMode) { - app.setInteractive(newMode.exploration >= 0.8); - //for the animations to end - setTimeout(updateBounds, 300); - }); - - window.addEventListener('resize', updateBounds); - setTimeout(updateBounds, 500); - - app.setInteractive(cmode.getMode().exploration >= 0.8); - - elems.jumpToStored(); - }); - -}); +export * from './app'; +export * from './initialize'; diff --git a/src/initialize/GapMinderApp.ts b/src/initialize/GapMinderApp.ts new file mode 100644 index 0000000..806aacc --- /dev/null +++ b/src/initialize/GapMinderApp.ts @@ -0,0 +1,73 @@ +/** + * Created by Samuel Gratzl on 15.12.2014. + */ + +// Determine the order of css files manually + +import 'file-loader?name=index.html!extract-loader!html-loader!./index.html'; +import 'file-loader?name=404.html!./404.html'; +import 'file-loader?name=robots.txt!./robots.txt'; +import 'phovea_ui/dist/webpack/_bootstrap'; +import 'phovea_ui/dist/webpack/_font-awesome'; +import '../scss/main.scss'; + + +import {CLUEWrapper, ModeWrapper} from 'phovea_clue'; +import {GapMinder} from '../app/gapminder'; +import {I18nextManager, BaseUtils, EventHandler} from 'phovea_core'; + +export class GapMinderApp { + + //scoping let --> function level scope in js vs java global, local + private helper = document.querySelector('div.gapminder'); + + constructor() { + + I18nextManager.getInstance().initI18n().then(() => { + const elems = CLUEWrapper.createCLUEWrapper(document.body, { + app: 'GapMinder', + application: '/gapminder', + id: 'clue_gapminder', + recordSelectionTypes: 'selected,filtered', + animatedSelections: true, + thumbnails: false + }); + + { + while(this.helper.firstChild) { + (elems.$main.node()).appendChild(this.helper.firstChild); + } + } + + elems.graph.then((graph) => { + const app = GapMinder.create(elems.$main.node(), graph); + + EventHandler.getInstance().on('wait', elems.header.wait.bind(elems.header)); + EventHandler.getInstance().on('ready', elems.header.ready.bind(elems.header)); + + function updateBounds() { + const bounds = BaseUtils.bounds(document.querySelector('main')); + app.setBounds(bounds.x, bounds.y, bounds.w - 200, bounds.h - 80); + } + + //d3.select(elems.header.options).append('label').html(`Show Trails`).select('input').on('change', function () { + // app.showTrails(this.checked); + // }); + + EventHandler.getInstance().on('modeChanged', function (event, newMode) { + app.setInteractive(newMode.exploration >= 0.8); + //for the animations to end + setTimeout(updateBounds, 300); + }); + + window.addEventListener('resize', updateBounds); + setTimeout(updateBounds, 500); + + app.setInteractive(ModeWrapper.getInstance().getMode().exploration >= 0.8); + + elems.jumpToStored(); + }); + + }); + } +} diff --git a/src/initialize/index.ts b/src/initialize/index.ts new file mode 100644 index 0000000..43cb01f --- /dev/null +++ b/src/initialize/index.ts @@ -0,0 +1 @@ +export * from './GapMinderApp'; diff --git a/src/initialize/initialize.ts b/src/initialize/initialize.ts new file mode 100644 index 0000000..bfc6134 --- /dev/null +++ b/src/initialize/initialize.ts @@ -0,0 +1,3 @@ +import {GapMinderApp} from './GapMinderApp'; + +const app = new GapMinderApp(); diff --git a/src/scss/main.scss b/src/scss/main.scss new file mode 100644 index 0000000..052f9ff --- /dev/null +++ b/src/scss/main.scss @@ -0,0 +1,253 @@ +/** + * Created by Samuel Gratzl on 15.12.2014. + */ + +// use original CLUE styles as foundation +@import "~phovea_clue/dist/scss/main.scss"; + +body, html { + padding: 0; + margin: 0; + width: 100%; + height: 100%; + + background-color: #fafafa; + + -webkit-font-smoothing: subpixel-antialiased; +} + +// tooltip styling +.tooltip{} + +/* mouse over mark and ref lines*/ +.active { + stroke: black; + stroke-width: 5px; + line { + stroke: magenta; + stroke-width: 3px; + } +} + +svg { + vector-effect: non-scaling-stroke; + shape-rendering: geometricPrecision; +} + +svg.chart .xaxis, svg.chart .yaxis, svg.timeline { + path, line { + stroke-width: 1; + stroke: black; + fill: none; + } + +} + +div.xaxis_outer { + +} + +svg.chart { + rect.clearer { + fill: transparent; + } + polyline.hover_line { + fill: none; + stroke: $hover-color; + stroke-width: 1px; + } + polyline.select_line { + fill: none; + stroke: $select-color; + stroke-width: 1px; + } + + text.act_year { + font-size: 150pt; + font-weight: bold; + fill: #f2f2f2; + text-anchor: start; + } + .mark { + stroke: none; + opacity:0.5; + + &.phovea-select-selected { + //svg variant + stroke: $select-color; + stroke-width: 2px; + opacity: 1; + } + &.phovea-select-hovered { + //svg variant + opacity: 1; + stroke: $hover-color; + stroke-width: 2px; + } + + &.phovea-select-filtered { + opacity: 0.1; + } + } + + select .yaxis, .xaxis { + background-color: #a2a3a3; + } + +} + +div.legends { + margin: 2px 2px 0 0; + position: absolute; + left: 42px; + top: 0; + bottom: 0; + display: inline; + //background-color: green; + width: 140px; + + padding-top: 30px; + padding-left: 4px; + + span.title { + font-weight: bold; + position: absolute; + left: -40px; + } + + > div > * { + display: block; + } + select { + width: 100%; + } + div.color_legend { + i { + margin-right: 3px; + padding: 3px; + opacity: 0.5; + } + } + div.population_scaler { + margin-top: 1em; + + svg { + margin-top: 5px; + } + } +} + + +svg.timeline { + + fill:grey; + + path.slider { + stroke: #ffab00; + cursor: ew-resize; + fill: #ffab00; + } + + font-size: small; + +} + +main { + position: relative; + + svg.size_legend { + circle { + fill: #cecece; + } + } + + + div.gapminder_i { + display: block; + position: absolute; + width: 40em; + z-index: 2; + left: 200px; + + div.yaxis { + -webkit-transform: rotate(-90deg) translateX(-60vh); + -webkit-transform-origin: 0% 0%; + transform: rotate(-90deg) translateX(-60vh); + transform-origin: 0% 0%; + } + } + + div.xaxis_outer { + text-align: center; + position: absolute; + bottom: 50px; + left: 50px; + right: 0; + + > div { + margin-left: auto; + margin-right: auto; + } + } + + div.chart { + margin-left: 190px; + position: absolute; + //top: 0; + //left: 0; + + } + + + svg.pop_slider{ + position:absolute; + } + + svg.timeline { + fill:grey; + align-items: flex-start; + position: absolute; + left: 200px; + bottom: 5px; + } + + .over { + font-weight: bold; + } +} + +body { + &[data-clue='E'] { + span.attr-x-label, span.attr-x-scale-label, + span.attr-y-label, span.attr-y-scale-label, + span.attr-size-label, span.attr-size-scale-label, + span.attr-color-label, span.attr-color-scale-label { + display: none; + } + } + + &[data-clue='A'], &[data-clue='P'] { + select.attr-x, select.attr-x-scale, + select.attr-y, select.attr-y-scale, + select.attr-size, select.attr-size-scale, + select.attr-color, select.attr-x-scale { + display: none; + } + + svg.timeline .slider { + pointer-events: none; + fill: #a3a3a3; + stroke: #a3a3a3; + } + + svg.chart { + + polyline.hover_line { + stroke: $hover-color !important; + } + .mark.phovea-select-hovered { + stroke: $hover-color !important; + } + } + } +} diff --git a/tsconfig.json b/tsconfig.json index 6fc452d..76e563e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,10 +4,13 @@ "target": "ES2019", "importHelpers": true, "sourceMap": true, + "declaration": true, "moduleResolution": "node", "jsx": "react", + "allowJs": true, + "declarationDir": "dist", + "outDir": "dist", "experimentalDecorators": true, - "downlevelIteration": true, // required as long as target is `es5` "lib": [ "dom", "es2015", @@ -17,13 +20,13 @@ "noImplicitAny": false, "skipLibCheck": true, "esModuleInterop": false, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true // required for i18next, }, "include": [ + "dist/index.d.ts", "src/**/*.ts", "src/**/*.tsx", - "tests/**/*.ts", "index.ts", "tsd.d.ts" ] -} +} \ No newline at end of file diff --git a/tsconfig_dev.json b/tsconfig_dev.json deleted file mode 100644 index 807b9bf..0000000 --- a/tsconfig_dev.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "target": "es6" - } -} From 447ef1f5ef02b9bd815002633a2554694d27f873 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Mon, 1 Jun 2020 13:23:51 +0200 Subject: [PATCH 34/60] change registry entries, entries for webpack --- .yo-rc.json | 2 +- buildInfo.js | 2 +- deploy/Dockerfile | 1 - dist/404.html | 157 -------------------------- dist/index.html | 96 ---------------- dist/index.js | 1 - dist/{initialize => }/initialize.d.ts | 0 dist/{initialize => }/initialize.js | 2 +- dist/initialize/GapMinderApp.d.ts | 10 +- dist/initialize/GapMinderApp.js | 4 +- dist/robots.txt | 3 - package.json | 6 +- phovea.js | 18 +-- phovea_registry.js | 4 +- src/initialize.ts | 3 + src/initialize/GapMinderApp.ts | 6 +- src/initialize/initialize.ts | 3 - 17 files changed, 31 insertions(+), 287 deletions(-) delete mode 100644 dist/404.html delete mode 100644 dist/index.html rename dist/{initialize => }/initialize.d.ts (100%) rename dist/{initialize => }/initialize.js (54%) delete mode 100644 dist/robots.txt create mode 100644 src/initialize.ts delete mode 100644 src/initialize/initialize.ts diff --git a/.yo-rc.json b/.yo-rc.json index ccf2663..204c8b2 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -74,7 +74,7 @@ }, "app": "gapminder", "entries": { - "app": "./src/index.ts" + "app": "./gapminder/dist/initialize.js" }, "libraryAliases": { "d3": "d3/d3" diff --git a/buildInfo.js b/buildInfo.js index 14166c7..17b67fb 100644 --- a/buildInfo.js +++ b/buildInfo.js @@ -34,7 +34,7 @@ function gitHead(cwd) { } function resolveModules() { - const reg = fs.readFileSync('../phovea_registry.js').toString(); + const reg = fs.readFileSync('./phovea_registry.js').toString(); const regex = /^import '(.*)\/phovea_registry.js'/gm; const modules = []; let r; diff --git a/deploy/Dockerfile b/deploy/Dockerfile index af2902a..62fbf41 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -6,4 +6,3 @@ ENV PHOVEA_API_SERVER=api ENV PHOVEA_NGINX_PORT=80 COPY ./deploy/nginx-default.conf /etc/nginx/conf.d/default.conf CMD sed -i -e "s/PHOVEA_API_SERVER/${PHOVEA_API_SERVER-api}/g" /etc/nginx/conf.d/default.conf && sed -i -e "s/PHOVEA_NGINX_PORT/${PHOVEA_NGINX_PORT-api}/g" /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;' -COPY ./build /usr/share/nginx/html diff --git a/dist/404.html b/dist/404.html deleted file mode 100644 index fdace4a..0000000 --- a/dist/404.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - Page Not Found :( - - - -
-

Not found :(

-

Sorry, but the page you were trying to view does not exist.

-

It looks like this was the result of either:

-
    -
  • a mistyped address
  • -
  • an out-of-date link
  • -
- - -
- - diff --git a/dist/index.html b/dist/index.html deleted file mode 100644 index 9d2bdcf..0000000 --- a/dist/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Phovea GapMinder - - - - - - - - - - - diff --git a/dist/index.js b/dist/index.js index c297981..655a762 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,3 +1,2 @@ export * from './app'; -export * from './initialize'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/initialize/initialize.d.ts b/dist/initialize.d.ts similarity index 100% rename from dist/initialize/initialize.d.ts rename to dist/initialize.d.ts diff --git a/dist/initialize/initialize.js b/dist/initialize.js similarity index 54% rename from dist/initialize/initialize.js rename to dist/initialize.js index 08a1b0f..42ed7b8 100644 --- a/dist/initialize/initialize.js +++ b/dist/initialize.js @@ -1,3 +1,3 @@ -import { GapMinderApp } from './GapMinderApp'; +import { GapMinderApp } from './initialize/GapMinderApp'; const app = new GapMinderApp(); //# sourceMappingURL=initialize.js.map \ No newline at end of file diff --git a/dist/initialize/GapMinderApp.d.ts b/dist/initialize/GapMinderApp.d.ts index a435f6e..6e3194c 100644 --- a/dist/initialize/GapMinderApp.d.ts +++ b/dist/initialize/GapMinderApp.d.ts @@ -1,11 +1,11 @@ /** * Created by Samuel Gratzl on 15.12.2014. */ -import 'file-loader?name=index.html!extract-loader!html-loader!./index.html'; -import 'file-loader?name=404.html!./404.html'; -import 'file-loader?name=robots.txt!./robots.txt'; -import 'phovea_ui/dist/_bootstrap'; -import 'phovea_ui/dist/_font-awesome'; +import 'file-loader?name=index.html!extract-loader!html-loader!../index.html'; +import 'file-loader?name=404.html!../404.html'; +import 'file-loader?name=robots.txt!../robots.txt'; +import 'phovea_ui/dist/webpack/_bootstrap'; +import 'phovea_ui/dist/webpack/_font-awesome'; import '../scss/main.scss'; export declare class GapMinderApp { private helper; diff --git a/dist/initialize/GapMinderApp.js b/dist/initialize/GapMinderApp.js index 5604f1b..2fbba80 100644 --- a/dist/initialize/GapMinderApp.js +++ b/dist/initialize/GapMinderApp.js @@ -5,7 +5,7 @@ import 'file-loader?name=index.html!extract-loader!html-loader!../index.html'; import 'file-loader?name=404.html!../404.html'; import 'file-loader?name=robots.txt!../robots.txt'; -import 'bootstrap-sass/assets/stylesheets/_bootstrap.scss'; +import 'phovea_ui/dist/webpack/_bootstrap'; import 'phovea_ui/dist/webpack/_font-awesome'; import '../scss/main.scss'; import { CLUEWrapper, ModeWrapper } from 'phovea_clue'; @@ -40,7 +40,7 @@ export class GapMinderApp { //d3.select(elems.header.options).append('label').html(`Show Trails`).select('input').on('change', function () { // app.showTrails(this.checked); // }); - elems.on('modeChanged', function (event, newMode) { + EventHandler.getInstance().on('modeChanged', function (event, newMode) { app.setInteractive(newMode.exploration >= 0.8); //for the animations to end setTimeout(updateBounds, 300); diff --git a/dist/robots.txt b/dist/robots.txt deleted file mode 100644 index 9417495..0000000 --- a/dist/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# robotstxt.org - -User-agent: * diff --git a/package.json b/package.json index cc43432..a4bc9c8 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,9 @@ "jquery": "^3.4.1", "marked": "^0.7.0", "phovea_vis": "github:phovea/phovea_vis#vstoiber/refactoring", - "phovea_clue": "github:phovea/phovea_ui#vstoiber/refactoring", - "phovea_core": "github:phovea/phovea_core#asteiner/refactoring" + "phovea_clue": "file:../phovea_clue", + "phovea_core": "github:phovea/phovea_core#asteiner/refactoring", + "phovea_d3": "github:phovea/phovea_d3#vstoiber/refactoring", + "phovea_ui": "github:phovea/phovea_ui#vstoiber/refactoring" } } diff --git a/phovea.js b/phovea.js index 8856116..7245b51 100644 --- a/phovea.js +++ b/phovea.js @@ -8,27 +8,27 @@ module.exports = function(registry) { //registry.push('extension-type', 'extension-id', function() { return import('./src/extension_impl'); }, {}); // generator-phovea:begin - registry.push('view', 'gapminder', function() { return import('./src/gapminder'); }, { + registry.push('view', 'gapminder', function() { return import('./dist/app/gapminder'); }, { 'location': 'gapminder' }); - registry.push('actionFactory', 'gapminder', function() { return import('./src/gapminder'); }, { - 'factory': 'createCmd', + registry.push('actionFactory', 'gapminder', function() { return import('./dist/app/gapminder'); }, { + 'factory': 'GapMinderCmds.createCmd', 'creates': '(setGapMinderAttribute|setGapMinderAttributeScale|toggleGapMinderTrails)' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./src/gapminder'); }, { - 'factory': 'compressSetAttribute', + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder'); }, { + 'factory': 'GapMinderCmds.compressSetAttribute', 'matches': 'setGapMinderAttribute' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./src/gapminder'); }, { - 'factory': 'compressToggleGapMinderTrails', + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder'); }, { + 'factory': 'GapMinderCmds.compressToggleGapMinderTrails', 'matches': 'toggleGapMinderTrails' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return import('./src/gapminder'); }, { - 'factory': 'compressSetAttributeScale', + registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return import('./dist/app/gapminder'); }, { + 'factory': 'GapMinderCmds.compressSetAttributeScale', 'matches': 'setGapMinderAttributeScale' }); diff --git a/phovea_registry.js b/phovea_registry.js index f3d4dc9..380084c 100644 --- a/phovea_registry.js +++ b/phovea_registry.js @@ -4,7 +4,7 @@ * Licensed under the new BSD license, available at http://caleydo.org/license **************************************************************************** */ -import {register} from 'phovea_core/dist/plugin'; +import {PluginRegistry} from 'phovea_core'; /** * build a registry by registering all phovea modules @@ -16,4 +16,4 @@ import 'phovea_vis/phovea_registry.js'; import 'phovea_ui/phovea_registry.js'; import 'phovea_clue/phovea_registry.js'; //self -register('gapminder',require('./phovea.js')); +PluginRegistry.getInstance().register('gapminder',require('./phovea.js')); diff --git a/src/initialize.ts b/src/initialize.ts new file mode 100644 index 0000000..3e54571 --- /dev/null +++ b/src/initialize.ts @@ -0,0 +1,3 @@ +import {GapMinderApp} from './initialize/GapMinderApp'; + +const app = new GapMinderApp(); diff --git a/src/initialize/GapMinderApp.ts b/src/initialize/GapMinderApp.ts index 806aacc..6cef892 100644 --- a/src/initialize/GapMinderApp.ts +++ b/src/initialize/GapMinderApp.ts @@ -4,9 +4,9 @@ // Determine the order of css files manually -import 'file-loader?name=index.html!extract-loader!html-loader!./index.html'; -import 'file-loader?name=404.html!./404.html'; -import 'file-loader?name=robots.txt!./robots.txt'; +import 'file-loader?name=index.html!extract-loader!html-loader!../index.html'; +import 'file-loader?name=404.html!../404.html'; +import 'file-loader?name=robots.txt!../robots.txt'; import 'phovea_ui/dist/webpack/_bootstrap'; import 'phovea_ui/dist/webpack/_font-awesome'; import '../scss/main.scss'; diff --git a/src/initialize/initialize.ts b/src/initialize/initialize.ts deleted file mode 100644 index bfc6134..0000000 --- a/src/initialize/initialize.ts +++ /dev/null @@ -1,3 +0,0 @@ -import {GapMinderApp} from './GapMinderApp'; - -const app = new GapMinderApp(); From 5c96b84d46e53b1a8d95cef5d5409952e3f2e07f Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Wed, 3 Jun 2020 10:58:31 +0200 Subject: [PATCH 35/60] change to globalEventHandler --- dist/404.html | 157 ++++++++++++++++++++++++++++++++ dist/app/gapminder.js | 10 +- dist/index.html | 96 +++++++++++++++++++ dist/initialize/GapMinderApp.js | 8 +- dist/robots.txt | 3 + package.json | 4 +- src/app/gapminder.ts | 8 +- src/initialize/GapMinderApp.ts | 6 +- 8 files changed, 274 insertions(+), 18 deletions(-) create mode 100644 dist/404.html create mode 100644 dist/index.html create mode 100644 dist/robots.txt diff --git a/dist/404.html b/dist/404.html new file mode 100644 index 0000000..fdace4a --- /dev/null +++ b/dist/404.html @@ -0,0 +1,157 @@ + + + + + Page Not Found :( + + + +
+

Not found :(

+

Sorry, but the page you were trying to view does not exist.

+

It looks like this was the result of either:

+
    +
  • a mistyped address
  • +
  • an out-of-date link
  • +
+ + +
+ + diff --git a/dist/app/gapminder.js b/dist/app/gapminder.js index ab0f0f2..fa17e81 100644 --- a/dist/app/gapminder.js +++ b/dist/app/gapminder.js @@ -2,7 +2,7 @@ * Created by Samuel Gratzl on 15.12.2014. */ import * as d3 from 'd3'; -import { DataCache, EventHandler, ObjectRefUtils, ActionMetaData, Range, Rect, AView, ArrayUtils, SelectionUtils, SelectOperation, ActionUtils } from 'phovea_core'; +import { DataCache, ObjectRefUtils, ActionMetaData, Range, Rect, AView, ArrayUtils, SelectionUtils, SelectOperation, ActionUtils } from 'phovea_core'; import { ToolTip } from 'phovea_d3'; class Attribute { constructor(scale = 'linear') { @@ -707,7 +707,7 @@ export class GapMinder extends AView { this.color = m; return (this.color ? this.color.idRange() : Promise.resolve(null)).then((arr) => { this.colorRange = arr; - EventHandler.getInstance().fire('ready'); + this.fire('ready'); this.update(); return old === null ? this.noneRef : this.graph.findObject(old); }); @@ -716,7 +716,7 @@ export class GapMinder extends AView { const matrix = m; const att = this.attrs[attr]; att.data = matrix; - EventHandler.getInstance().fire('wait'); + this.fire('wait'); if (this.refData === matrix && matrix != null) { return Promise.all([matrix.data(), matrix.rows(), matrix.rowIds(), matrix.cols(), matrix.colIds()]).then((args) => { att.arr = args[0]; @@ -724,7 +724,7 @@ export class GapMinder extends AView { this.items = this.createItems(args[1], args[2], matrix.rowtype); //prepare time ids this.timeIds = this.createTimeIds(args[3], args[4], matrix.coltype); - EventHandler.getInstance().fire('ready'); + this.fire('ready'); this.update(); return old === null ? this.noneRef : this.graph.findObject(old); }); @@ -732,7 +732,7 @@ export class GapMinder extends AView { else { return (matrix ? matrix.data() : Promise.resolve(null)).then((arr) => { this.attrs[attr].arr = arr; - EventHandler.getInstance().fire('ready'); + this.fire('ready'); this.update(); return old === null ? this.noneRef : this.graph.findObject(old); }); diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..9d2bdcf --- /dev/null +++ b/dist/index.html @@ -0,0 +1,96 @@ + + + + + + Phovea GapMinder + + + + + + + + + + + diff --git a/dist/initialize/GapMinderApp.js b/dist/initialize/GapMinderApp.js index 2fbba80..312d385 100644 --- a/dist/initialize/GapMinderApp.js +++ b/dist/initialize/GapMinderApp.js @@ -10,7 +10,7 @@ import 'phovea_ui/dist/webpack/_font-awesome'; import '../scss/main.scss'; import { CLUEWrapper, ModeWrapper } from 'phovea_clue'; import { GapMinder } from '../app/gapminder'; -import { I18nextManager, BaseUtils, EventHandler } from 'phovea_core'; +import { I18nextManager, BaseUtils } from 'phovea_core'; export class GapMinderApp { constructor() { //scoping let --> function level scope in js vs java global, local @@ -31,8 +31,8 @@ export class GapMinderApp { } elems.graph.then((graph) => { const app = GapMinder.create(elems.$main.node(), graph); - EventHandler.getInstance().on('wait', elems.header.wait.bind(elems.header)); - EventHandler.getInstance().on('ready', elems.header.ready.bind(elems.header)); + app.on('wait', elems.header.wait.bind(elems.header)); + app.on('ready', elems.header.ready.bind(elems.header)); function updateBounds() { const bounds = BaseUtils.bounds(document.querySelector('main')); app.setBounds(bounds.x, bounds.y, bounds.w - 200, bounds.h - 80); @@ -40,7 +40,7 @@ export class GapMinderApp { //d3.select(elems.header.options).append('label').html(`Show Trails`).select('input').on('change', function () { // app.showTrails(this.checked); // }); - EventHandler.getInstance().on('modeChanged', function (event, newMode) { + elems.on('modeChanged', function (event, newMode) { app.setInteractive(newMode.exploration >= 0.8); //for the animations to end setTimeout(updateBounds, 300); diff --git a/dist/robots.txt b/dist/robots.txt new file mode 100644 index 0000000..9417495 --- /dev/null +++ b/dist/robots.txt @@ -0,0 +1,3 @@ +# robotstxt.org + +User-agent: * diff --git a/package.json b/package.json index a4bc9c8..4edb0cd 100644 --- a/package.json +++ b/package.json @@ -40,10 +40,10 @@ "test:watch": "jest --watch", "posttest": "npm run lint", "build:dev": "tsc", - "build": "npm run clean && npm run compile && npm run copy-assets && npm run copy-styles", + "build": "npm run clean && npm run compile && npm run copy-assets && npm run copy-styles && npm run copy-app-assets", "copy-assets": "if [ -d src/assets ]; then cp -rv src/assets/ dist/assets/; fi", "copy-styles": "cd src && find . -name '*.scss' -exec cp --parents '{}' ./../dist/ ';'", - "copy-app-assets": "cd src && cp -prv *.{txt,html} ./../dist/", + "copy-app-assets": "cp src/*.txt dist/ && cp src/*.html dist/ ", "start:dev": "webpack-dev-server --inline --config config/webpack.dev.js", "start": "webpack-dev-server --config config/webpack.prod.js", "start:hot": "webpack-dev-server --inline --hot", diff --git a/src/app/gapminder.ts b/src/app/gapminder.ts index 30bca7a..cc0e970 100644 --- a/src/app/gapminder.ts +++ b/src/app/gapminder.ts @@ -862,7 +862,7 @@ export class GapMinder extends AView { return (this.color ? this.color.idRange() : Promise.resolve(null)).then((arr) => { this.colorRange = arr; - EventHandler.getInstance().fire('ready'); + this.fire('ready'); this.update(); @@ -873,7 +873,7 @@ export class GapMinder extends AView { const att = this.attrs[attr]; att.data = matrix; - EventHandler.getInstance().fire('wait'); + this.fire('wait'); if (this.refData === matrix && matrix != null) { return Promise.all([matrix.data(), matrix.rows(), matrix.rowIds(), matrix.cols(), matrix.colIds()]).then((args) => { att.arr = args[0]; @@ -884,7 +884,7 @@ export class GapMinder extends AView { //prepare time ids this.timeIds = this.createTimeIds(args[3], args[4], matrix.coltype); - EventHandler.getInstance().fire('ready'); + this.fire('ready'); this.update(); @@ -893,7 +893,7 @@ export class GapMinder extends AView { } else { return (matrix ? matrix.data(): Promise.resolve(null)).then((arr) => { this.attrs[attr].arr = arr; - EventHandler.getInstance().fire('ready'); + this.fire('ready'); this.update(); diff --git a/src/initialize/GapMinderApp.ts b/src/initialize/GapMinderApp.ts index 6cef892..63a44f3 100644 --- a/src/initialize/GapMinderApp.ts +++ b/src/initialize/GapMinderApp.ts @@ -42,8 +42,8 @@ export class GapMinderApp { elems.graph.then((graph) => { const app = GapMinder.create(elems.$main.node(), graph); - EventHandler.getInstance().on('wait', elems.header.wait.bind(elems.header)); - EventHandler.getInstance().on('ready', elems.header.ready.bind(elems.header)); + app.on('wait', elems.header.wait.bind(elems.header)); + app.on('ready', elems.header.ready.bind(elems.header)); function updateBounds() { const bounds = BaseUtils.bounds(document.querySelector('main')); @@ -54,7 +54,7 @@ export class GapMinderApp { // app.showTrails(this.checked); // }); - EventHandler.getInstance().on('modeChanged', function (event, newMode) { + elems.on('modeChanged', function (event, newMode) { app.setInteractive(newMode.exploration >= 0.8); //for the animations to end setTimeout(updateBounds, 300); From f76e0df4d4e27ecc359822a29ef81045368f8031 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Fri, 5 Jun 2020 06:21:04 +0200 Subject: [PATCH 36/60] change phovea_clue dependency --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4edb0cd..a3a6d2a 100644 --- a/package.json +++ b/package.json @@ -98,13 +98,13 @@ "webpack-merge": "^4.2.2" }, "dependencies": { - "@types/marked": "^0.7.2", + "@types/marked": "^0.7.4", "jquery": "^3.4.1", "marked": "^0.7.0", - "phovea_vis": "github:phovea/phovea_vis#vstoiber/refactoring", - "phovea_clue": "file:../phovea_clue", + "phovea_clue": "github:phovea/phovea_core#vstoiber/refactoring", "phovea_core": "github:phovea/phovea_core#asteiner/refactoring", "phovea_d3": "github:phovea/phovea_d3#vstoiber/refactoring", - "phovea_ui": "github:phovea/phovea_ui#vstoiber/refactoring" + "phovea_ui": "github:phovea/phovea_ui#vstoiber/refactoring", + "phovea_vis": "github:phovea/phovea_vis#vstoiber/refactoring" } } From 81d5e573fe57738dfaca70ff0fb49732d1513ec1 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Fri, 5 Jun 2020 07:43:18 +0200 Subject: [PATCH 37/60] change to phovea_clue --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3a6d2a..4e4c6f8 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "@types/marked": "^0.7.4", "jquery": "^3.4.1", "marked": "^0.7.0", - "phovea_clue": "github:phovea/phovea_core#vstoiber/refactoring", + "phovea_clue": "github:phovea/phovea_clue#asteiner/refactoring", "phovea_core": "github:phovea/phovea_core#asteiner/refactoring", "phovea_d3": "github:phovea/phovea_d3#vstoiber/refactoring", "phovea_ui": "github:phovea/phovea_ui#vstoiber/refactoring", From 13d87f368aa8939b41fd0444198000db64529d0e Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Fri, 5 Jun 2020 07:46:33 +0200 Subject: [PATCH 38/60] vstoiber branch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e4c6f8..3df93b3 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "@types/marked": "^0.7.4", "jquery": "^3.4.1", "marked": "^0.7.0", - "phovea_clue": "github:phovea/phovea_clue#asteiner/refactoring", + "phovea_clue": "github:phovea/phovea_clue#vstoiber/refactoring", "phovea_core": "github:phovea/phovea_core#asteiner/refactoring", "phovea_d3": "github:phovea/phovea_d3#vstoiber/refactoring", "phovea_ui": "github:phovea/phovea_ui#vstoiber/refactoring", From fe8072668fd8f1c50774747a69fd9305806a36d3 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 5 Jun 2020 08:01:08 +0200 Subject: [PATCH 39/60] update folder names --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3df93b3..d320358 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "node": ">= 12.13" }, "scripts": { - "clean": "rimraf build dist && npm run clean:compile", + "clean": "rimraf lib dist && npm run clean:compile", "clean:compile": "rimraf src/**/*.map src/**/*.js src/**/*.d.ts tests/**/*.js tests/**/*.map tests/**/*.d.ts demo/**/*.js demo/**/*.map demo/**/*.d.ts", "compile": "tsc", "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", @@ -52,7 +52,7 @@ "release:minor": "npm version minor && npm publish && git push --follow-tags", "release:patch": "npm version patch && npm publish && git push --follow-tags", "predist": "npm run build && npm run docs", - "dist": "mkdir dist && cd build && tar cvzf ../dist/gapminder.tar.gz *", + "dist": "mkdir lib && cd dist && tar cvzf ../lib/gapminder.tar.gz *", "predocker": "npm run build", "docker": "docker build -t gapminder -f deploy/Dockerfile ." }, From ca5e35f2f8820410f26b65b89a348e446d218866 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 8 Jun 2020 13:50:29 +0200 Subject: [PATCH 40/60] remove webpack config --- config/webpack.common.js | 162 --------------------------------------- config/webpack.dev.js | 71 ----------------- config/webpack.prod.js | 82 -------------------- 3 files changed, 315 deletions(-) delete mode 100644 config/webpack.common.js delete mode 100644 config/webpack.dev.js delete mode 100644 config/webpack.prod.js diff --git a/config/webpack.common.js b/config/webpack.common.js deleted file mode 100644 index 02ac050..0000000 --- a/config/webpack.common.js +++ /dev/null @@ -1,162 +0,0 @@ -const path = require('path'); -const pkg = require('./../package.json'); -const webpack = require('webpack'); -const {CleanWebpackPlugin} = require('clean-webpack-plugin'); -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; -const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); -const ManifestPlugin = require('webpack-manifest-plugin'); -const buildInfo = require('./../buildInfo.js'); -const { entries, modules, libraryExternals } = require('./../.yo-rc.json')['generator-phovea']; -const resolve = require('path').resolve; - -const year = (new Date()).getFullYear(); -const banner = '/*! ' + (pkg.title || pkg.name) + ' - v' + pkg.version + ' - ' + year + '\n' + - (pkg.homepage ? '* ' + pkg.homepage + '\n' : '') + - '* Copyright (c) ' + year + ' ' + pkg.author.name + ';' + - ' Licensed ' + pkg.license + '*/\n'; - -const registryFile = './phovea_registry.js'; -const actMetaData = `file-loader?name=phoveaMetaData.json!${buildInfo.metaDataTmpFile(pkg)}`; -const actBuildInfoFile = `file-loader?name=buildInfo.json!${buildInfo.tmpFile()}`; - -/** - * inject the registry to be included - * @param entry - * @returns {*} - */ -function injectRegistry(entry) { - const extraFiles = [registryFile, actMetaData, actBuildInfoFile]; - // build also the registry - if (typeof entry === 'string') { - return extraFiles.concat(entry); - } - const transformed = {}; - Object.keys(entry).forEach((key) => { - transformed[key] = extraFiles.concat(entry[key]); - // font-awesome does not have a JavaScript component and cannot be included at this point - transformed['vendor'] = libraryExternals.filter(name => (name != 'font-awesome')); - transformed['phovea'] = modules; - }); - console.log(transformed); - return transformed; -} - -const config = { - entry: injectRegistry(entries), - resolve: { - extensions: ['.js'], - }, - devServer: { - contentBase: resolve(__dirname, './../bundles/'), - open: true, - proxy: { - '/api/*': { - target: 'http://localhost:9000', - secure: false, - ws: true - }, - '/login': { - target: 'http://localhost:9000', - secure: false - }, - '/logout': { - target: 'http://localhost:9000', - secure: false - }, - '/loggedinas': { - target: 'http://localhost:9000', - secure: false - }, - watchOptions: { - aggregateTimeout: 500, - ignored: /node_modules/ - } - }, - watchOptions: { - aggregateTimeout: 500, - ignored: /node_modules/ - } - }, - module: { - rules: [ - { - test: /\.(ts)x?$/, - use: [ - { - loader: 'thread-loader', - options: { - // there should be 1 cpu for the fork-ts-checker-webpack-plugin - workers: require('os').cpus().length - 1, - }, - }, - { - loader: 'ts-loader', - options: { - transpileOnly: true, - happyPackMode: true - }, - } - ], - exclude: /node_modules/ - }, - { test: /\.(xml)$/, use: 'xml-loader' }, - { - test: /\.(png|jpg|gif|webp)$/, - use: [ 'file-loader', `url-loader` ] - }, - { - test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, - loader: 'url-loader', - options: { - limit: 10000, // inline <= 10kb - mimetype: 'application/font-woff' - } - }, - { - test: /\.svg(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, - loader: 'url-loader', - options: { - limit: 10000, // inline <= 10kb - mimetype: 'image/svg+xml', - esModule: false - } - }, - { test: /\.(ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }, - { - test: require.resolve('jquery'), - use: [{ - loader: 'expose-loader', - options: 'jQuery' - },{ - loader: 'expose-loader', - options: '$' - }] - } - // { test: /bootstrap-sass\/assets\/javascripts\//, loader: 'imports?jQuery=jquery' }, - ], - }, - plugins: [ - new ForkTsCheckerWebpackPlugin({ - checkSyntacticErrors: true - }), - new CleanWebpackPlugin({ - cleanOnceBeforeBuildPatterns: [ - '**/*', - path.join(process.cwd(), './../bundles/**/*') - ] - }), - new BundleAnalyzerPlugin({ - // set to 'server' to start analyzer during build - analyzerMode: 'disabled', - generateStatsFile: true, - statsOptions: { source: false } - }), - new ManifestPlugin(), - new webpack.BannerPlugin({ - banner: banner, - raw: true - }) - ], -}; - -module.exports = config; diff --git a/config/webpack.dev.js b/config/webpack.dev.js deleted file mode 100644 index 32e87d6..0000000 --- a/config/webpack.dev.js +++ /dev/null @@ -1,71 +0,0 @@ -const merge = require('webpack-merge'); -const path = require('path'); -const webpack = require('webpack'); -const common = require('./webpack.common'); -const pkg = require('./../package.json'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); - -const libName = pkg.name; -const libDesc = pkg.description; - -const now = new Date(); -const prefix = (n) => n < 10 ? ('0' + n) : n.toString(); -const buildId = `${now.getUTCFullYear()}${prefix(now.getUTCMonth() + 1)}${prefix(now.getUTCDate())}-${prefix(now.getUTCHours())}${prefix(now.getUTCMinutes())}${prefix(now.getUTCSeconds())}`; -pkg.version = pkg.version.replace('SNAPSHOT', buildId); - -const config = { - mode: 'development', - devtool: 'inline-source-map', - output: { - path: path.join(__dirname, './../bundles'), - filename: '[name].js', - publicPath: '', - library: libName, - libraryTarget: 'umd', - umdNamedDefine: false - }, - module: { - rules: [ - { - test: /\.css$/i, - use: [ - { - loader: 'style-loader', - }, - { - loader: 'css-loader', - options: { - modules: true, - }, - }, - ], - }, - { - test: /\.(scss)$/, - use: [ - 'style-loader', 'css-loader', 'sass-loader' - ] - } - ] - }, - plugins: [ - new HtmlWebpackPlugin({ - filename: 'index.html', - title: libName, - template: 'index.template.ejs', - inject: true, - meta: { - description: libDesc - } - }), - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('development'), - __VERSION__: JSON.stringify(pkg.version), - __LICENSE__: JSON.stringify(pkg.license), - __BUILD_ID__: JSON.stringify(buildId), - __APP_CONTEXT__: JSON.stringify('/') - }) - ] -}; - -module.exports = merge(common, config); diff --git a/config/webpack.prod.js b/config/webpack.prod.js deleted file mode 100644 index fe64a97..0000000 --- a/config/webpack.prod.js +++ /dev/null @@ -1,82 +0,0 @@ -const merge = require('webpack-merge'); -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const {CleanWebpackPlugin} = require('clean-webpack-plugin'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const path = require('path'); -const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); -const common = require('./webpack.common'); -const pkg = require('./../package.json'); -const webpack = require('webpack'); - - -const libName = pkg.name; -const libDesc = pkg.description; - -const now = new Date(); -const prefix = (n) => n < 10 ? ('0' + n) : n.toString(); -const buildId = `${now.getUTCFullYear()}${prefix(now.getUTCMonth() + 1)}${prefix(now.getUTCDate())}-${prefix(now.getUTCHours())}${prefix(now.getUTCMinutes())}${prefix(now.getUTCSeconds())}`; -pkg.version = pkg.version.replace('SNAPSHOT', buildId); - -const config = { - mode: 'production', - devtool: 'source-map', - output: { - filename: '[name].js', - chunkFilename: '[name].js', - path: path.resolve(__dirname, './../bundles'), - pathinfo: false, - publicPath: '', - library: libName, - libraryTarget: 'umd', - umdNamedDefine: false - }, - module: { - rules: [ - { - test: /\.(css)$/, - use: [ - MiniCssExtractPlugin.loader, 'css-loader' - ] - }, - { - test: /\.(scss)$/, - use: [ - MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader' - ] - } - ] - }, - // TerserPlugin is added by default in production mode - plugins: [ - new MomentLocalesPlugin({ - localesToKeep: ['de-at', 'de', 'en-gb','en'], - }), - // extracts css in separate file - new MiniCssExtractPlugin({ - filename: 'styles.[name].css' - }), - new HtmlWebpackPlugin({ - filename: 'index.html', - title: libName, - template: 'index.template.ejs', - path: path.resolve(__dirname, './../' + libName), - inject: true, - minify: { - removeComments: true, - collapseWhitespace: true - }, - meta: { - description: libDesc - } - }), - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('production'), - __VERSION__: JSON.stringify(pkg.version), - __LICENSE__: JSON.stringify(pkg.license), - __BUILD_ID__: JSON.stringify(buildId), - __APP_CONTEXT__: JSON.stringify('/') - }) - ] -}; - -module.exports = merge(common, config); From ff43f79d410a9a44555dd4c796645f1da8a2280e Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 8 Jun 2020 13:50:51 +0200 Subject: [PATCH 41/60] fix dynamic imports in phovea.ts --- phovea.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/phovea.js b/phovea.js index 7245b51..093bad5 100644 --- a/phovea.js +++ b/phovea.js @@ -8,27 +8,27 @@ module.exports = function(registry) { //registry.push('extension-type', 'extension-id', function() { return import('./src/extension_impl'); }, {}); // generator-phovea:begin - registry.push('view', 'gapminder', function() { return import('./dist/app/gapminder'); }, { + registry.push('view', 'gapminder', function() { return import('./dist/app/gapminder').then((g) => g.GapMinder); }, { 'location': 'gapminder' }); - registry.push('actionFactory', 'gapminder', function() { return import('./dist/app/gapminder'); }, { - 'factory': 'GapMinderCmds.createCmd', + registry.push('actionFactory', 'gapminder', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'createCmd', 'creates': '(setGapMinderAttribute|setGapMinderAttributeScale|toggleGapMinderTrails)' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder'); }, { - 'factory': 'GapMinderCmds.compressSetAttribute', + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'compressSetAttribute', 'matches': 'setGapMinderAttribute' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder'); }, { - 'factory': 'GapMinderCmds.compressToggleGapMinderTrails', + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'compressToggleGapMinderTrails', 'matches': 'toggleGapMinderTrails' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return import('./dist/app/gapminder'); }, { - 'factory': 'GapMinderCmds.compressSetAttributeScale', + registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'compressSetAttributeScale', 'matches': 'setGapMinderAttributeScale' }); From 9b5adcf16696ee0a90b71bd11c33082d7f8d20ab Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 8 Jun 2020 13:51:18 +0200 Subject: [PATCH 42/60] export class GapMinderCmds --- dist/app/gapminder.d.ts | 25 ++++++++++++++++++++++++- dist/app/gapminder.js | 2 +- src/app/gapminder.ts | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dist/app/gapminder.d.ts b/dist/app/gapminder.d.ts index 67b3c0d..027fb62 100644 --- a/dist/app/gapminder.d.ts +++ b/dist/app/gapminder.d.ts @@ -1,7 +1,7 @@ /** * Created by Samuel Gratzl on 15.12.2014. */ -import { IObjectRef, IDataType, INumericalMatrix, Range, IDType, Rect, AView, IStratification, ProvenanceGraph } from 'phovea_core'; +import { ActionNode, IObjectRef, IDataType, INumericalMatrix, Range, IDType, Rect, AView, IStratification, ProvenanceGraph } from 'phovea_core'; declare class Attribute { scale: string; data: INumericalMatrix; @@ -16,6 +16,29 @@ interface IItem { id: number; name: string; } +export declare class GapMinderCmds { + private static setAttributeImpl; + private static setAttributeScaleImpl; + private static toggleGapMinderTrailsImpl; + /** + * compresses the given path by removing redundant set gap minder attribute calls + * @param path + * @returns {ActionNode[]} + */ + static compressSetAttribute(path: ActionNode[]): ActionNode[]; + /** + * compresses the given path by removing redundant set gap minder attribute scale calls + * @param path + * @returns { ActionNode[]} + */ + static compressSetAttributeScale(path: ActionNode[]): ActionNode[]; + static compressToggleGapMinderTrails(path: ActionNode[]): ActionNode[]; + static createCmd(id: any): typeof GapMinderCmds.toggleGapMinderTrailsImpl | typeof GapMinderCmds.setAttributeImpl; + static capitalize(s: string): string; + static createToggleTrails($mainRef: IObjectRef, show: boolean): import("phovea_core").IAction; + static setAttribute(name: string, $mainRef: IObjectRef, data: IObjectRef): import("phovea_core").IAction; + static setAttributeScale(name: string, $mainRef: IObjectRef, scale: string): import("phovea_core").IAction; +} export declare class GapMinder extends AView { private elem; private graph; diff --git a/dist/app/gapminder.js b/dist/app/gapminder.js index fa17e81..837f9ea 100644 --- a/dist/app/gapminder.js +++ b/dist/app/gapminder.js @@ -26,7 +26,7 @@ class Attribute { return this.data.desc.formatter || ',d'; } } -class GapMinderCmds { +export class GapMinderCmds { static setAttributeImpl(inputs, parameter, graph, within) { const gapminder = inputs[0].value, name = parameter.name; return inputs[1].v.then((data) => { diff --git a/src/app/gapminder.ts b/src/app/gapminder.ts index cc0e970..3cf1949 100644 --- a/src/app/gapminder.ts +++ b/src/app/gapminder.ts @@ -47,7 +47,7 @@ interface IItem { } -class GapMinderCmds { +export class GapMinderCmds { private static setAttributeImpl(inputs, parameter, graph, within) { const gapminder:GapMinder = inputs[0].value, From eb1d039a899606ccf33733ca7fac7256126a5fc5 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Wed, 10 Jun 2020 13:45:19 +0200 Subject: [PATCH 43/60] move index.html template to src; update npm script --- index.template.ejs => dist/index.template.ejs | 0 package.json | 2 +- src/index.template.ejs | 97 +++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) rename index.template.ejs => dist/index.template.ejs (100%) create mode 100644 src/index.template.ejs diff --git a/index.template.ejs b/dist/index.template.ejs similarity index 100% rename from index.template.ejs rename to dist/index.template.ejs diff --git a/package.json b/package.json index d320358..fae45ea 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "build": "npm run clean && npm run compile && npm run copy-assets && npm run copy-styles && npm run copy-app-assets", "copy-assets": "if [ -d src/assets ]; then cp -rv src/assets/ dist/assets/; fi", "copy-styles": "cd src && find . -name '*.scss' -exec cp --parents '{}' ./../dist/ ';'", - "copy-app-assets": "cp src/*.txt dist/ && cp src/*.html dist/ ", + "copy-app-assets": "cp src/*.txt dist/ && cp src/*.html dist/ && cp src/*.ejs dist/", "start:dev": "webpack-dev-server --inline --config config/webpack.dev.js", "start": "webpack-dev-server --config config/webpack.prod.js", "start:hot": "webpack-dev-server --inline --hot", diff --git a/src/index.template.ejs b/src/index.template.ejs new file mode 100644 index 0000000..efbc611 --- /dev/null +++ b/src/index.template.ejs @@ -0,0 +1,97 @@ + + + + + + Phovea GapMinder + + + + + + + + + + + + From 54d0aaa015fb427465fe80721e62974cd3977df4 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Wed, 10 Jun 2020 13:45:39 +0200 Subject: [PATCH 44/60] remove static index.html --- dist/index.html | 96 ------------------------------- dist/initialize/GapMinderApp.d.ts | 1 - dist/initialize/GapMinderApp.js | 1 - src/index.html | 96 ------------------------------- src/initialize/GapMinderApp.ts | 1 - 5 files changed, 195 deletions(-) delete mode 100644 dist/index.html delete mode 100644 src/index.html diff --git a/dist/index.html b/dist/index.html deleted file mode 100644 index 9d2bdcf..0000000 --- a/dist/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Phovea GapMinder - - - - - - - - - - - diff --git a/dist/initialize/GapMinderApp.d.ts b/dist/initialize/GapMinderApp.d.ts index 6e3194c..ab50124 100644 --- a/dist/initialize/GapMinderApp.d.ts +++ b/dist/initialize/GapMinderApp.d.ts @@ -1,7 +1,6 @@ /** * Created by Samuel Gratzl on 15.12.2014. */ -import 'file-loader?name=index.html!extract-loader!html-loader!../index.html'; import 'file-loader?name=404.html!../404.html'; import 'file-loader?name=robots.txt!../robots.txt'; import 'phovea_ui/dist/webpack/_bootstrap'; diff --git a/dist/initialize/GapMinderApp.js b/dist/initialize/GapMinderApp.js index 312d385..7ff1a2e 100644 --- a/dist/initialize/GapMinderApp.js +++ b/dist/initialize/GapMinderApp.js @@ -2,7 +2,6 @@ * Created by Samuel Gratzl on 15.12.2014. */ // Determine the order of css files manually -import 'file-loader?name=index.html!extract-loader!html-loader!../index.html'; import 'file-loader?name=404.html!../404.html'; import 'file-loader?name=robots.txt!../robots.txt'; import 'phovea_ui/dist/webpack/_bootstrap'; diff --git a/src/index.html b/src/index.html deleted file mode 100644 index 9d2bdcf..0000000 --- a/src/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Phovea GapMinder - - - - - - - - - - - diff --git a/src/initialize/GapMinderApp.ts b/src/initialize/GapMinderApp.ts index 63a44f3..4b7169e 100644 --- a/src/initialize/GapMinderApp.ts +++ b/src/initialize/GapMinderApp.ts @@ -4,7 +4,6 @@ // Determine the order of css files manually -import 'file-loader?name=index.html!extract-loader!html-loader!../index.html'; import 'file-loader?name=404.html!../404.html'; import 'file-loader?name=robots.txt!../robots.txt'; import 'phovea_ui/dist/webpack/_bootstrap'; From 44e9a6e6fbf3bb5206b1f1d184fa78e29263606b Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 12 Jun 2020 10:10:05 +0200 Subject: [PATCH 45/60] add property registry to .yo-rc.json --- .yo-rc.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.yo-rc.json b/.yo-rc.json index 204c8b2..df7f904 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -6,11 +6,15 @@ "githubAccount": "caleydo", "modules": [ "phovea_core", - "phovea_d3", - "phovea_vis", - "phovea_ui", "phovea_clue" ], + "registry": { + "exclude": [ + "ordino", + "snpology", + "dTiles" + ] + }, "extensions": [ { "type": "view", From af892ef75c77aa04283c4a85c91945d899324144 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 12 Jun 2020 11:31:05 +0200 Subject: [PATCH 46/60] remove inline loader --- dist/initialize/GapMinderApp.d.ts | 4 ++-- dist/initialize/GapMinderApp.js | 4 ++-- src/initialize/GapMinderApp.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/initialize/GapMinderApp.d.ts b/dist/initialize/GapMinderApp.d.ts index ab50124..d2260a3 100644 --- a/dist/initialize/GapMinderApp.d.ts +++ b/dist/initialize/GapMinderApp.d.ts @@ -1,8 +1,8 @@ /** * Created by Samuel Gratzl on 15.12.2014. */ -import 'file-loader?name=404.html!../404.html'; -import 'file-loader?name=robots.txt!../robots.txt'; +import '../404.html'; +import '../robots.txt'; import 'phovea_ui/dist/webpack/_bootstrap'; import 'phovea_ui/dist/webpack/_font-awesome'; import '../scss/main.scss'; diff --git a/dist/initialize/GapMinderApp.js b/dist/initialize/GapMinderApp.js index 7ff1a2e..a1ea7c2 100644 --- a/dist/initialize/GapMinderApp.js +++ b/dist/initialize/GapMinderApp.js @@ -2,8 +2,8 @@ * Created by Samuel Gratzl on 15.12.2014. */ // Determine the order of css files manually -import 'file-loader?name=404.html!../404.html'; -import 'file-loader?name=robots.txt!../robots.txt'; +import '../404.html'; +import '../robots.txt'; import 'phovea_ui/dist/webpack/_bootstrap'; import 'phovea_ui/dist/webpack/_font-awesome'; import '../scss/main.scss'; diff --git a/src/initialize/GapMinderApp.ts b/src/initialize/GapMinderApp.ts index 4b7169e..0b4e567 100644 --- a/src/initialize/GapMinderApp.ts +++ b/src/initialize/GapMinderApp.ts @@ -4,8 +4,8 @@ // Determine the order of css files manually -import 'file-loader?name=404.html!../404.html'; -import 'file-loader?name=robots.txt!../robots.txt'; +import '../404.html'; +import '../robots.txt'; import 'phovea_ui/dist/webpack/_bootstrap'; import 'phovea_ui/dist/webpack/_font-awesome'; import '../scss/main.scss'; From 3d1da7834e057db2f9f77e6c0328e972bf23ced8 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Mon, 15 Jun 2020 05:34:07 +0200 Subject: [PATCH 47/60] config update --- dist/phovea.d.ts | 0 dist/phovea.js | 34 ++++++++++++++++++++++++++++ jest.config.js | 28 +++++++++--------------- package.json | 45 ++++++-------------------------------- phovea_registry.js | 3 ++- phovea.js => src/phovea.ts | 10 ++++----- tests.webpack.js | 14 ------------ tsconfig.json | 13 +++-------- tsd.d.ts | 26 ++++------------------ 9 files changed, 65 insertions(+), 108 deletions(-) create mode 100644 dist/phovea.d.ts create mode 100644 dist/phovea.js rename phovea.js => src/phovea.ts (79%) delete mode 100644 tests.webpack.js diff --git a/dist/phovea.d.ts b/dist/phovea.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/dist/phovea.js b/dist/phovea.js new file mode 100644 index 0000000..81eaccd --- /dev/null +++ b/dist/phovea.js @@ -0,0 +1,34 @@ +/* ***************************************************************************** + * Caleydo - Visualization for Molecular Biology - http://caleydo.org + * Copyright (c) The Caleydo Team. All rights reserved. + * Licensed under the new BSD license, available at http://caleydo.org/license + **************************************************************************** */ +//register all extensions in the registry following the given pattern +module.exports = function (registry) { + //registry.push('extension-type', 'extension-id', function() { return import('./src/extension_impl'); }, {}); + // generator-phovea:begin + registry.push('view', 'gapminder', function () { return import('./app/gapminder').then((g) => g.GapMinder); }, { + 'location': 'gapminder' + }); + registry.push('actionFactory', 'gapminder', function () { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'createCmd', + 'creates': '(setGapMinderAttribute|setGapMinderAttributeScale|toggleGapMinderTrails)' + }); + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function () { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'compressSetAttribute', + 'matches': 'setGapMinderAttribute' + }); + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function () { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'compressToggleGapMinderTrails', + 'matches': 'toggleGapMinderTrails' + }); + registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function () { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { + 'factory': 'compressSetAttributeScale', + 'matches': 'setGapMinderAttributeScale' + }); + registry.push('app', 'gapminder', null, { + 'name': 'GapMinder' + }); + // generator-phovea:end +}; +//# sourceMappingURL=phovea.js.map \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 65bbf39..34fa4df 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,10 +5,10 @@ let pluginsToTransform = [ 'lineupjs' ].join('|'); -if(pluginsToTransform.length > 0) { - /** Attention: Negative Lookahead! This regex adds the specified repos to a whitelist that holds plugins that are excluded from the transformIgnorePatterns. - * This means that pluginsToTransform should contain all repos that export ts files. They can only be handled by the transformation. */ - pluginsToTransform = `(?!${pluginsToTransform})`; +if (pluginsToTransform.length > 0) { + /** Attention: Negative Lookahead! This regex adds the specified repos to a whitelist that holds plugins that are excluded from the transformIgnorePatterns. + * This means that pluginsToTransform should contain all repos that export ts files. They can only be handled by the transformation. */ + pluginsToTransform = `(?!${pluginsToTransform})`; } /** @@ -17,7 +17,7 @@ if(pluginsToTransform.length > 0) { */ module.exports = { transform: { - "^.+\\.tsx?$": "ts-jest", + "^.+\\.(js|ts|tsx)$": "ts-jest", "\\.xml$": "jest-raw-loader" }, testRegex: "(.*(test|spec))\\.(tsx?)$", @@ -30,26 +30,18 @@ module.exports = { "node" ], modulePaths: [ - "src", - "../node_modules", - "../" + "src" ], transformIgnorePatterns: [`../node_modules/${pluginsToTransform}`, `node_modules/${pluginsToTransform}`], globals: { "__VERSION__": "TEST_VERSION", "__APP_CONTEXT__": "TEST_CONTEXT", - 'ts-jest': { - // has to be set to true, otherwise i18n import fails - "tsConfig": { - "esModuleInterop": true, - } + // has to be set to true, otherwise i18n import fails + "tsConfig": { + "esModuleInterop": true } }, moduleNameMapper: { - "^.+\\.(css|less|scss|sass|png|jpg|gif)$": "identity-obj-proxy", - "imports-loader?.*": "imports-loader", - "raw-loader?.*": "raw-loader", - "file-loader?.*": "file-loader", - "script-loader?.*": "script-loader" + "^.+\\.(css|less|scss|sass|png|jpg|gif)$": "identity-obj-proxy" } } diff --git a/package.json b/package.json index fae45ea..87b2de3 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "clean": "rimraf lib dist && npm run clean:compile", "clean:compile": "rimraf src/**/*.map src/**/*.js src/**/*.d.ts tests/**/*.js tests/**/*.map tests/**/*.d.ts demo/**/*.js demo/**/*.map demo/**/*.d.ts", "compile": "tsc", + "compile:watch": "tsc -w", "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", "docs": "typedoc --options typedoc.json src/**.ts", "prebuild": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test", @@ -41,13 +42,9 @@ "posttest": "npm run lint", "build:dev": "tsc", "build": "npm run clean && npm run compile && npm run copy-assets && npm run copy-styles && npm run copy-app-assets", - "copy-assets": "if [ -d src/assets ]; then cp -rv src/assets/ dist/assets/; fi", - "copy-styles": "cd src && find . -name '*.scss' -exec cp --parents '{}' ./../dist/ ';'", - "copy-app-assets": "cp src/*.txt dist/ && cp src/*.html dist/ && cp src/*.ejs dist/", - "start:dev": "webpack-dev-server --inline --config config/webpack.dev.js", - "start": "webpack-dev-server --config config/webpack.prod.js", - "start:hot": "webpack-dev-server --inline --hot", - "watch": "webpack --watch", + "copy-assets": "if [ -d src/assets ]; then cp -rv src/assets/. dist/assets/; fi", + "copy-styles": "if [ -d src/scss ]; then shx --verbose cp -R src/scss/. dist/scss/; fi", + "copy-app-assets": "shx --verbose cp src/*.txt dist/ && shx --verbose cp src/*.html dist/ && shx --verbose cp src/*.ejs dist/", "release:major": "npm version major && npm publish && git push --follow-tags", "release:minor": "npm version minor && npm publish && git push --follow-tags", "release:patch": "npm version patch && npm publish && git push --follow-tags", @@ -57,48 +54,20 @@ "docker": "docker build -t gapminder -f deploy/Dockerfile ." }, "devDependencies": { + "@types/marked": "^0.7.4", "@types/jest": "25.1.4", - "cache-loader": "^4.1.0", - "clean-webpack-plugin": "^3.0.0", - "css-loader": "^3.5.3", - "expose-loader": "^0.7.5", - "extract-loader": "^5.0.1", - "extract-text-webpack-plugin": "2.1.0", - "file-loader": "^6.0.0", - "fork-ts-checker-webpack-plugin": "^4.1.3", - "html-loader": "^1.0.0", - "html-webpack-plugin": "^4.2.0", "identity-obj-proxy": "^3.0.0", - "ifdef-loader": "2.1.5", - "imports-loader": "^0.8.0", "jest": "25.1.0", "jest-raw-loader": "1.0.1", - "mini-css-extract-plugin": "^0.9.0", - "moment-locales-webpack-plugin": "^1.2.0", - "node-sass": "^4.13.1", - "null-loader": "^3.0.0", - "raw-loader": "^4.0.0", - "resolve-url-loader": "^3.1.1", "rimraf": "^3.0.0", - "sass-loader": "^8.0.2", - "style-loader": "^0.23.1", - "thread-loader": "2.1.3", + "shx": "^0.3.2", "ts-jest": "25.2.1", - "ts-loader": "^6.2.2", "tslib": "~1.11.0", "tslint": "5.9.1", "typedoc": "~0.16.10", - "typescript": "~3.8.2", - "url-loader": "^4.1.0", - "webpack": "^4.43.0", - "webpack-bundle-analyzer": "^3.6.1", - "webpack-cli": "3.3.2", - "webpack-dev-server": "^3.10.3", - "webpack-manifest-plugin": "^2.2.0", - "webpack-merge": "^4.2.2" + "typescript": "~3.8.2" }, "dependencies": { - "@types/marked": "^0.7.4", "jquery": "^3.4.1", "marked": "^0.7.0", "phovea_clue": "github:phovea/phovea_clue#vstoiber/refactoring", diff --git a/phovea_registry.js b/phovea_registry.js index 380084c..47a1b67 100644 --- a/phovea_registry.js +++ b/phovea_registry.js @@ -5,6 +5,7 @@ **************************************************************************** */ import {PluginRegistry} from 'phovea_core'; +import reg from './dist/phovea'; /** * build a registry by registering all phovea modules @@ -16,4 +17,4 @@ import 'phovea_vis/phovea_registry.js'; import 'phovea_ui/phovea_registry.js'; import 'phovea_clue/phovea_registry.js'; //self -PluginRegistry.getInstance().register('gapminder',require('./phovea.js')); +PluginRegistry.getInstance().register('gapminder',reg); diff --git a/phovea.js b/src/phovea.ts similarity index 79% rename from phovea.js rename to src/phovea.ts index 093bad5..5be9cf0 100644 --- a/phovea.js +++ b/src/phovea.ts @@ -8,26 +8,26 @@ module.exports = function(registry) { //registry.push('extension-type', 'extension-id', function() { return import('./src/extension_impl'); }, {}); // generator-phovea:begin - registry.push('view', 'gapminder', function() { return import('./dist/app/gapminder').then((g) => g.GapMinder); }, { + registry.push('view', 'gapminder', function() { return import('./app/gapminder').then((g) => g.GapMinder); }, { 'location': 'gapminder' }); - registry.push('actionFactory', 'gapminder', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + registry.push('actionFactory', 'gapminder', function() { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { 'factory': 'createCmd', 'creates': '(setGapMinderAttribute|setGapMinderAttributeScale|toggleGapMinderTrails)' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { 'factory': 'compressSetAttribute', 'matches': 'setGapMinderAttribute' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + registry.push('actionCompressor', 'gapminder-setGapMinderAttribute', function() { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { 'factory': 'compressToggleGapMinderTrails', 'matches': 'toggleGapMinderTrails' }); - registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return import('./dist/app/gapminder').then((g) => g.GapMinderCmds); }, { + registry.push('actionCompressor', 'gapminder-setGapMinderAttributeScale', function() { return import('./app/gapminder').then((g) => g.GapMinderCmds); }, { 'factory': 'compressSetAttributeScale', 'matches': 'setGapMinderAttributeScale' }); diff --git a/tests.webpack.js b/tests.webpack.js deleted file mode 100644 index 9438ac4..0000000 --- a/tests.webpack.js +++ /dev/null @@ -1,14 +0,0 @@ -/* ***************************************************************************** - * Caleydo - Visualization for Molecular Biology - http://caleydo.org - * Copyright (c) The Caleydo Team. All rights reserved. - * Licensed under the new BSD license, available at http://caleydo.org/license - **************************************************************************** */ - -// build registry -require('./phovea_registry.js'); - -/** - * find all tests in the spec directory and load them - */ -var context = require.context('./tests', true, /\.test\.ts$/); // make sure you have your directory and regex test set correctly! -context.keys().forEach(context); diff --git a/tsconfig.json b/tsconfig.json index 76e563e..32f2f74 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,22 +11,15 @@ "declarationDir": "dist", "outDir": "dist", "experimentalDecorators": true, - "lib": [ - "dom", - "es2015", - "es2016.array.include", - "es2017.object" - ], "noImplicitAny": false, "skipLibCheck": true, "esModuleInterop": false, - "allowSyntheticDefaultImports": true // required for i18next, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true }, "include": [ - "dist/index.d.ts", "src/**/*.ts", "src/**/*.tsx", - "index.ts", "tsd.d.ts" ] -} \ No newline at end of file +} diff --git a/tsd.d.ts b/tsd.d.ts index bfe3ff8..b88cd95 100644 --- a/tsd.d.ts +++ b/tsd.d.ts @@ -1,16 +1,10 @@ -/* ***************************************************************************** - * Caleydo - Visualization for Molecular Biology - http://caleydo.org - * Copyright (c) The Caleydo Team. All rights reserved. - * Licensed under the new BSD license, available at http://caleydo.org/license - **************************************************************************** */ - //allow sass modules declare module "*.scss" { - const content:string; + const content: string; export default content; } declare module "*.css" { - const content:string; + const content: string; export default content; } // allow image dependencies @@ -21,22 +15,10 @@ declare module "*.webp"; declare module "*.svg"; //allow html dependencies declare module "*.html" { - const content:string; + const content: string; export default content; } declare module "*.xml" { - const content:string; + const content: string; export default content; } -//allow json dependencies -declare module "*.json"; -//allow file dependencies -declare module "file-loader!*"; -//allow file dependencies -declare module "raw-loader!*"; -//allow url dependencies -declare module "url-loader!*"; -//allow html dependencies -declare module "imports-loader!*"; -declare module "imports-loader?*"; - From 99909fd49fd18d75f57ea52ceb8a587e0158792d Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Mon, 15 Jun 2020 10:09:09 +0200 Subject: [PATCH 48/60] update jest config --- jest.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index 34fa4df..fe8656b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -36,9 +36,11 @@ module.exports = { globals: { "__VERSION__": "TEST_VERSION", "__APP_CONTEXT__": "TEST_CONTEXT", - // has to be set to true, otherwise i18n import fails - "tsConfig": { - "esModuleInterop": true + 'ts-jest': { + // has to be set to true, otherwise i18n import fails + "tsConfig": { + "esModuleInterop": true, + } } }, moduleNameMapper: { From 448c2db4e3b250c3b602199bf6a7b68c889bf7b5 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Thu, 18 Jun 2020 10:42:17 +0200 Subject: [PATCH 49/60] change config files --- dist/app/gapminder.d.ts | 4 ++-- dist/phovea.d.ts | 2 ++ dist/phovea.js | 9 ++------- package.json | 5 ++--- src/phovea.ts | 6 +++--- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/dist/app/gapminder.d.ts b/dist/app/gapminder.d.ts index 027fb62..26b02a0 100644 --- a/dist/app/gapminder.d.ts +++ b/dist/app/gapminder.d.ts @@ -9,7 +9,7 @@ declare class Attribute { constructor(scale?: string); get label(): string; get valid(): boolean; - get format(): (n: number) => string; + get format(): any; to_format(): any; } interface IItem { @@ -107,7 +107,7 @@ export declare class GapMinder extends AView { ids: number[]; names: string[]; ts: number[]; - minmax: [number, number]; + minmax: any; }; createItems(names: string[], ids: Range, idtype: IDType): IItem[]; static create(parent: Element, provGraph: ProvenanceGraph): GapMinder; diff --git a/dist/phovea.d.ts b/dist/phovea.d.ts index e69de29..8f747c9 100644 --- a/dist/phovea.d.ts +++ b/dist/phovea.d.ts @@ -0,0 +1,2 @@ +import { IRegistry } from 'phovea_core'; +export default function (registry: IRegistry): void; diff --git a/dist/phovea.js b/dist/phovea.js index 81eaccd..1ed9202 100644 --- a/dist/phovea.js +++ b/dist/phovea.js @@ -1,10 +1,5 @@ -/* ***************************************************************************** - * Caleydo - Visualization for Molecular Biology - http://caleydo.org - * Copyright (c) The Caleydo Team. All rights reserved. - * Licensed under the new BSD license, available at http://caleydo.org/license - **************************************************************************** */ //register all extensions in the registry following the given pattern -module.exports = function (registry) { +export default function (registry) { //registry.push('extension-type', 'extension-id', function() { return import('./src/extension_impl'); }, {}); // generator-phovea:begin registry.push('view', 'gapminder', function () { return import('./app/gapminder').then((g) => g.GapMinder); }, { @@ -30,5 +25,5 @@ module.exports = function (registry) { 'name': 'GapMinder' }); // generator-phovea:end -}; +} //# sourceMappingURL=phovea.js.map \ No newline at end of file diff --git a/package.json b/package.json index 87b2de3..017e053 100644 --- a/package.json +++ b/package.json @@ -36,15 +36,14 @@ "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", "docs": "typedoc --options typedoc.json src/**.ts", "prebuild": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test", - "pretest": "npm run clean && npm run compile", "test": "jest --passWithNoTests", "test:watch": "jest --watch", "posttest": "npm run lint", "build:dev": "tsc", "build": "npm run clean && npm run compile && npm run copy-assets && npm run copy-styles && npm run copy-app-assets", - "copy-assets": "if [ -d src/assets ]; then cp -rv src/assets/. dist/assets/; fi", + "copy-assets": "if [ -d src/assets ]; then shx --verbose cp -R src/assets/. dist/assets/; fi", "copy-styles": "if [ -d src/scss ]; then shx --verbose cp -R src/scss/. dist/scss/; fi", - "copy-app-assets": "shx --verbose cp src/*.txt dist/ && shx --verbose cp src/*.html dist/ && shx --verbose cp src/*.ejs dist/", + "copy-app-assets": "shx --verbose cp src/*.txt dist/ | true && shx --verbose cp src/*.html dist/ | true && shx --verbose cp src/*.ejs dist/ | true", "release:major": "npm version major && npm publish && git push --follow-tags", "release:minor": "npm version minor && npm publish && git push --follow-tags", "release:patch": "npm version patch && npm publish && git push --follow-tags", diff --git a/src/phovea.ts b/src/phovea.ts index 5be9cf0..2732052 100644 --- a/src/phovea.ts +++ b/src/phovea.ts @@ -3,9 +3,10 @@ * Copyright (c) The Caleydo Team. All rights reserved. * Licensed under the new BSD license, available at http://caleydo.org/license **************************************************************************** */ +import {IRegistry} from 'phovea_core'; //register all extensions in the registry following the given pattern -module.exports = function(registry) { +export default function (registry: IRegistry) { //registry.push('extension-type', 'extension-id', function() { return import('./src/extension_impl'); }, {}); // generator-phovea:begin registry.push('view', 'gapminder', function() { return import('./app/gapminder').then((g) => g.GapMinder); }, { @@ -36,5 +37,4 @@ module.exports = function(registry) { 'name': 'GapMinder' }); // generator-phovea:end -}; - +} From cbbdab55fad3d24f3c6ba93c3d8aa42790c9a770 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 2 Jul 2020 13:24:53 +0200 Subject: [PATCH 50/60] update .yo-rc.json --- .yo-rc.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.yo-rc.json b/.yo-rc.json index df7f904..b4b6e6c 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -15,6 +15,15 @@ "dTiles" ] }, + "vendors": { + "others": "phovea_.*|tdp_.*", + "phovea": "phovea_.*", + "tdp": "tdp_.*", + "dv": "datavisyn.*|ordino.*|dTiles.*|festival.*" + }, + "filesToLoad": { + "file-loader": "404|search|index|robots" + }, "extensions": [ { "type": "view", @@ -81,7 +90,10 @@ "app": "./gapminder/dist/initialize.js" }, "libraryAliases": { - "d3": "d3/d3" + "d3": "d3/d3", + "phovea_clue": "phovea_clue", + "phovea_core": "phovea_core", + "phovea_security_store_generated": "phovea_security_store_generated" }, "libraryExternals": [ "d3", From ab1f3f0fce72d65e635f9bea86ea1c019638bf4a Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 3 Jul 2020 15:53:59 +0200 Subject: [PATCH 51/60] revert Dockerfile changes --- deploy/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 62fbf41..af2902a 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -6,3 +6,4 @@ ENV PHOVEA_API_SERVER=api ENV PHOVEA_NGINX_PORT=80 COPY ./deploy/nginx-default.conf /etc/nginx/conf.d/default.conf CMD sed -i -e "s/PHOVEA_API_SERVER/${PHOVEA_API_SERVER-api}/g" /etc/nginx/conf.d/default.conf && sed -i -e "s/PHOVEA_NGINX_PORT/${PHOVEA_NGINX_PORT-api}/g" /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;' +COPY ./build /usr/share/nginx/html From df795f7ad4530651ba123a5444f4ddd5e3d2db6d Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 3 Jul 2020 16:36:01 +0200 Subject: [PATCH 52/60] update d3 alias --- .yo-rc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yo-rc.json b/.yo-rc.json index b4b6e6c..626e878 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -90,7 +90,7 @@ "app": "./gapminder/dist/initialize.js" }, "libraryAliases": { - "d3": "d3/d3", + "d3": "node_modules/d3/d3.js", "phovea_clue": "phovea_clue", "phovea_core": "phovea_core", "phovea_security_store_generated": "phovea_security_store_generated" From cb12661f7c19ca269e118985bb8b5eafdcfe9274 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Mon, 6 Jul 2020 08:25:12 +0200 Subject: [PATCH 53/60] gapminder changes --- .yo-rc.json | 12 ++---------- dist/app/gapminder.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.yo-rc.json b/.yo-rc.json index 626e878..953f8ab 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -90,17 +90,9 @@ "app": "./gapminder/dist/initialize.js" }, "libraryAliases": { - "d3": "node_modules/d3/d3.js", - "phovea_clue": "phovea_clue", - "phovea_core": "phovea_core", - "phovea_security_store_generated": "phovea_security_store_generated" + "d3": "d3/d3.js" }, - "libraryExternals": [ - "d3", - "jquery", - "font-awesome", - "marked" - ], + "libraryExternals": [], "ignores": [], "today": "Tue, 08 Nov 2016 09:41:26 GMT", "clientOnly": false, diff --git a/dist/app/gapminder.d.ts b/dist/app/gapminder.d.ts index 26b02a0..027fb62 100644 --- a/dist/app/gapminder.d.ts +++ b/dist/app/gapminder.d.ts @@ -9,7 +9,7 @@ declare class Attribute { constructor(scale?: string); get label(): string; get valid(): boolean; - get format(): any; + get format(): (n: number) => string; to_format(): any; } interface IItem { @@ -107,7 +107,7 @@ export declare class GapMinder extends AView { ids: number[]; names: string[]; ts: number[]; - minmax: any; + minmax: [number, number]; }; createItems(names: string[], ids: Range, idtype: IDType): IItem[]; static create(parent: Element, provGraph: ProvenanceGraph): GapMinder; From 19d936183976ad29a2e2fcf97c25d26e6b3f2077 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Tue, 14 Jul 2020 13:01:49 +0200 Subject: [PATCH 54/60] add mappings --- .gitignore | 5 +++-- dist/app/gapminder.js.map | 1 + dist/app/index.js.map | 1 + dist/index.js.map | 1 + dist/initialize.js.map | 1 + dist/initialize/GapMinderApp.js.map | 1 + dist/initialize/index.js.map | 1 + dist/phovea.js.map | 1 + package.json | 3 +-- 9 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 dist/app/gapminder.js.map create mode 100644 dist/app/index.js.map create mode 100644 dist/index.js.map create mode 100644 dist/initialize.js.map create mode 100644 dist/initialize/GapMinderApp.js.map create mode 100644 dist/initialize/index.js.map create mode 100644 dist/phovea.js.map diff --git a/.gitignore b/.gitignore index 6a8787d..bc72255 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,11 @@ /.tscache /.idea +/lib/ node_modules/ /src/**/*.js /tests/**/*.js -*.map +/src/**/*.map +/tests/**/*.map *.css *.log -/.cache-loader package-lock.json diff --git a/dist/app/gapminder.js.map b/dist/app/gapminder.js.map new file mode 100644 index 0000000..5349d98 --- /dev/null +++ b/dist/app/gapminder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gapminder.js","sourceRoot":"","sources":["../../src/app/gapminder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAoC,SAAS,EAAgB,cAAc,EAAE,cAAc,EAAoB,KAAK,EAAU,IAAI,EAAE,KAAK,EAAsD,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AACnR,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAGlC,MAAM,SAAS;IAKb,YAAmB,QAAQ,QAAQ;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C,CAAC;;AA5vBuB,+BAAqB,GAAG,UAAU,CAAC"} \ No newline at end of file diff --git a/dist/app/index.js.map b/dist/app/index.js.map new file mode 100644 index 0000000..34e79e6 --- /dev/null +++ b/dist/app/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..d7617a4 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/dist/initialize.js.map b/dist/initialize.js.map new file mode 100644 index 0000000..601aca2 --- /dev/null +++ b/dist/initialize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAEvD,MAAM,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC"} \ No newline at end of file diff --git a/dist/initialize/GapMinderApp.js.map b/dist/initialize/GapMinderApp.js.map new file mode 100644 index 0000000..ce02833 --- /dev/null +++ b/dist/initialize/GapMinderApp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GapMinderApp.js","sourceRoot":"","sources":["../../src/initialize/GapMinderApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4CAA4C;AAE5C,OAAO,aAAa,CAAC;AACrB,OAAO,eAAe,CAAC;AACvB,OAAO,mCAAmC,CAAC;AAC3C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,mBAAmB,CAAC;AAG3B,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAE,SAAS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CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;gBACnE,CAAC;gBAED,uIAAuI;gBACvI,mCAAmC;gBACnC,OAAO;gBAEP,KAAK,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,KAAK,EAAE,OAAO;oBAC9C,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,IAAI,GAAG,CAAC,CAAC;oBAC/C,2BAA2B;oBAC3B,UAAU,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;gBAChC,CAAC,CAAC,CAAC;gBAEH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;gBAChD,UAAU,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;gBAE9B,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,CAAC,WAAW,IAAI,GAAG,CAAC,CAAC;gBAE3E,KAAK,CAAC,YAAY,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;QAEL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/dist/initialize/index.js.map b/dist/initialize/index.js.map new file mode 100644 index 0000000..c3affb8 --- /dev/null +++ b/dist/initialize/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/dist/phovea.js.map b/dist/phovea.js.map new file mode 100644 index 0000000..23cce1f --- /dev/null +++ b/dist/phovea.js.map @@ -0,0 +1 @@ +{"version":3,"file":"phovea.js","sourceRoot":"","sources":["../src/phovea.ts"],"names":[],"mappings":"AAOA,qEAAqE;AACrE,MAAM,CAAC,OAAO,WAAW,QAAmB;IAC1C,6GAA6G;IAC7G,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,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EAAE,4BAA4B;KACvC,CAAC,CAAC;IAEF,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE;QACxC,MAAM,EAAE,WAAW;KACnB,CAAC,CAAC;IACF,uBAAuB;AACzB,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 017e053..8547739 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,7 @@ "node": ">= 12.13" }, "scripts": { - "clean": "rimraf lib dist && npm run clean:compile", - "clean:compile": "rimraf src/**/*.map src/**/*.js src/**/*.d.ts tests/**/*.js tests/**/*.map tests/**/*.d.ts demo/**/*.js demo/**/*.map demo/**/*.d.ts", + "clean": "rimraf lib dist", "compile": "tsc", "compile:watch": "tsc -w", "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", From 7062c6b5a1635f244d1194e63ccebc3aa3a1069e Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Tue, 14 Jul 2020 13:23:12 +0200 Subject: [PATCH 55/60] change typing --- dist/app/gapminder.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/app/gapminder.d.ts b/dist/app/gapminder.d.ts index 027fb62..26b02a0 100644 --- a/dist/app/gapminder.d.ts +++ b/dist/app/gapminder.d.ts @@ -9,7 +9,7 @@ declare class Attribute { constructor(scale?: string); get label(): string; get valid(): boolean; - get format(): (n: number) => string; + get format(): any; to_format(): any; } interface IItem { @@ -107,7 +107,7 @@ export declare class GapMinder extends AView { ids: number[]; names: string[]; ts: number[]; - minmax: [number, number]; + minmax: any; }; createItems(names: string[], ids: Range, idtype: IDType): IItem[]; static create(parent: Element, provGraph: ProvenanceGraph): GapMinder; From 16fc82fdb567c656f74c091af60ab0d7730ca392 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Wed, 22 Jul 2020 09:54:36 +0200 Subject: [PATCH 56/60] last update --- dist/index.js | 1 + dist/index.js.map | 2 +- package.json | 28 +++++++++++++++------------- tsconfig.json | 3 ++- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/dist/index.js b/dist/index.js index 655a762..c297981 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,3 @@ export * from './app'; +export * from './initialize'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map index d7617a4..dedb8ee 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 8547739..cf670b0 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "clean": "rimraf lib dist", "compile": "tsc", "compile:watch": "tsc -w", + "postcompile": "npm run copy", "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", "docs": "typedoc --options typedoc.json src/**.ts", "prebuild": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test", @@ -39,7 +40,8 @@ "test:watch": "jest --watch", "posttest": "npm run lint", "build:dev": "tsc", - "build": "npm run clean && npm run compile && npm run copy-assets && npm run copy-styles && npm run copy-app-assets", + "build": "npm run clean && npm run compile", + "copy": "npm run copy-assets && npm run copy-styles && npm run copy-app-assets", "copy-assets": "if [ -d src/assets ]; then shx --verbose cp -R src/assets/. dist/assets/; fi", "copy-styles": "if [ -d src/scss ]; then shx --verbose cp -R src/scss/. dist/scss/; fi", "copy-app-assets": "shx --verbose cp src/*.txt dist/ | true && shx --verbose cp src/*.html dist/ | true && shx --verbose cp src/*.ejs dist/ | true", @@ -53,20 +55,20 @@ }, "devDependencies": { "@types/marked": "^0.7.4", - "@types/jest": "25.1.4", - "identity-obj-proxy": "^3.0.0", - "jest": "25.1.0", - "jest-raw-loader": "1.0.1", - "rimraf": "^3.0.0", - "shx": "^0.3.2", - "ts-jest": "25.2.1", - "tslib": "~1.11.0", - "tslint": "5.9.1", - "typedoc": "~0.16.10", - "typescript": "~3.8.2" + "@types/jest": "~26.0.5", + "identity-obj-proxy": "~3.0.0", + "jest": "~26.1.0", + "jest-raw-loader": "~1.0.1", + "rimraf": "~3.0.2", + "shx": "~0.3.2", + "ts-jest": "~26.1.3", + "tslib": "~2.0.0", + "tslint": "~5.20.1", + "typedoc": "~0.17.8", + "typescript": "~3.9.7" }, "dependencies": { - "jquery": "^3.4.1", + "jquery": "~3.5.1", "marked": "^0.7.0", "phovea_clue": "github:phovea/phovea_clue#vstoiber/refactoring", "phovea_core": "github:phovea/phovea_core#asteiner/refactoring", diff --git a/tsconfig.json b/tsconfig.json index 32f2f74..e7bc9b2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,8 @@ "skipLibCheck": true, "esModuleInterop": false, "resolveJsonModule": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "preserveWatchOutput": true }, "include": [ "src/**/*.ts", From 289069a3f28e75189de2254f6e11dd3fb61559ac Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 24 Jul 2020 06:57:34 +0200 Subject: [PATCH 57/60] .yo-rc.json final update --- .yo-rc.json | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.yo-rc.json b/.yo-rc.json index 953f8ab..42c36dc 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -16,13 +16,13 @@ ] }, "vendors": { - "others": "phovea_.*|tdp_.*", - "phovea": "phovea_.*", - "tdp": "tdp_.*", - "dv": "datavisyn.*|ordino.*|dTiles.*|festival.*" + "others": "phovea.*|tdp_.*|tdp-.*|datavisyn.*", + "phovea": "phovea.*", + "tdp": "tdp_.|tdp-.*", + "dv": "datavisyn.*" }, "filesToLoad": { - "file-loader": "404|search|index|robots" + "file-loader": "404|robots" }, "extensions": [ { @@ -87,7 +87,12 @@ }, "app": "gapminder", "entries": { - "app": "./gapminder/dist/initialize.js" + "app": { + "js": "dist/initialize.js", + "template": "dist/index.template.ejs", + "html": "index.html", + "chunkName": "app" + } }, "libraryAliases": { "d3": "d3/d3.js" From d6eca33f80d4b4097d1f96d45784e27bb1fd2e0f Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Mon, 27 Jul 2020 01:18:54 +0200 Subject: [PATCH 58/60] update dependencies --- buildInfo.js | 177 --------------------------------------------------- package.json | 11 ++-- 2 files changed, 6 insertions(+), 182 deletions(-) delete mode 100644 buildInfo.js diff --git a/buildInfo.js b/buildInfo.js deleted file mode 100644 index 17b67fb..0000000 --- a/buildInfo.js +++ /dev/null @@ -1,177 +0,0 @@ -/** - * Created by sam on 13.11.2016. - */ - -const spawnSync = require('child_process').spawnSync; -const path = require('path'); -const resolve = path.resolve; -const fs = require('fs'); - -function dependencyGraph(cwd) { - const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; - const r = spawnSync(npm, ['ls', '--prod', '--json'], { - cwd: cwd - }); - if (!r.stdout) { - console.error(cwd, r.error); - return {}; - } - return JSON.parse(r.stdout.toString()); -} - -function gitHead(cwd) { - if (!fs.existsSync(cwd + '/.git')) { - return null; - } - const r = spawnSync('git', ['rev-parse', '--verify', 'HEAD'], { - cwd: cwd - }); - if (!r.stdout) { - console.error(cwd, r.error); - return {}; - } - return r.stdout.toString().trim(); -} - -function resolveModules() { - const reg = fs.readFileSync('./phovea_registry.js').toString(); - const regex = /^import '(.*)\/phovea_registry.js'/gm; - const modules = []; - let r; - while ((r = regex.exec(reg)) !== null) { - modules.push(r[1]); - } - return modules; -} - -function cleanupDependency(d) { - return d; -} - -function resolveWorkspace() { - console.log('resolve parent'); - const workspaceDeps = dependencyGraph('..').dependencies; - const modules = new Set(resolveModules()); - - let deps = null; - const resolveModule = (m) => { - console.log('resolve', m); - const pkg = JSON.parse(fs.readFileSync(`../${m}/package.json`).toString()); - const head = gitHead('../' + m); - const repo = pkg.repository.url; - return { - name: pkg.name, - version: pkg.version, - resolved: head ? `${repo.endsWith('.git') ? repo.slice(0, repo.length - 4) : repo}/commit/${head}` : pkg.version, - dependencies: deps(pkg.dependencies) - }; - }; - deps = (deps) => { - const r = {}; - Object.keys(deps).forEach((d) => { - if (d in workspaceDeps) { - r[d] = cleanupDependency(workspaceDeps[d]); - delete workspaceDeps[d]; - } else if (modules.has(d)) { - modules.delete(d); - r[d] = resolveModule(d); - } else { - r[d] = '-> link'; - } - }); - return r; - }; - - // self = - const root = path.basename(process.cwd()); - console.log(root); - - modules.delete(root); - const base = resolveModule(root); - base.extraDependencies = {}; - while (modules.size > 0) { - let m = Array.from(modules.keys())[0]; - modules.delete(m); - base.extraDependencies[m] = resolveModule(m); - } - return base; -} - -function resolveSingle() { - console.log('resolve self'); - const self = dependencyGraph('.'); - const pkg = require(`./package.json`); - const head = gitHead('.'); - const deps = {}; - Object.keys(self.dependencies || {}).forEach((d) => { - deps[d] = cleanupDependency(self.dependencies[d]); - }); - return { - name: self.name, - version: pkg.version, - resolved: head ? `${pkg.repository.url}#${head}` : pkg.version, - dependencies: deps, - extraDependencies: {} - }; -} - -function generate() { - console.log('building buildInfo'); - const isWorkspaceContext = fs.existsSync('../phovea_registry.js'); - if (isWorkspaceContext) { - return resolveWorkspace(); - } - return resolveSingle(); -} - -const IS_WINDOWS = process.platform === 'win32'; - -function tmpdir() { - if (IS_WINDOWS) { - return process.env.TEMP || process.env.TMP || - (process.env.SystemRoot || process.env.windir) + '\\temp'; - } - return process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp'; -} - -function resolveScreenshot() { - const f = resolve(__dirname, 'media/screenshot.png'); - if (!fs.existsSync(f)) { - return null; - } - const buffer = Buffer.from(fs.readFileSync(f)).toString('base64'); - return `data:image/png;base64,${buffer}`; -} - -function metaData(pkg) { - console.log(pkg); - pkg = pkg || require(`./package.json`); - return { - name: pkg.name, - displayName: pkg.displayName, - version: pkg.version, - repository: pkg.repository, - homepage: pkg.homepage, - description: pkg.description, - screenshot: resolveScreenshot() - }; -} - -module.exports.metaData = metaData; -module.exports.metaDataTmpFile = function (pkg) { - const s = metaData(pkg); - const file = `${tmpdir()}/metaData${Math.random().toString(36).slice(-8)}.txt`; - fs.writeFileSync(file, JSON.stringify(s, null, ' ')); - return file; -}; -module.exports.generate = generate; -module.exports.tmpFile = function () { - const s = generate(); - const file = `${tmpdir()}/buildInfo${Math.random().toString(36).slice(-8)}.txt`; - fs.writeFileSync(file, JSON.stringify(s, null, ' ')); - return file; -}; - -if (require.main === module) { - fs.writeFile('deps.json', JSON.stringify(generate(), null, ' ')); -} diff --git a/package.json b/package.json index cf670b0..4fe69ad 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ }, "scripts": { "clean": "rimraf lib dist", + "delete-dependencies": "rimraf node_modules", "compile": "tsc", "compile:watch": "tsc -w", "postcompile": "npm run copy", @@ -70,10 +71,10 @@ "dependencies": { "jquery": "~3.5.1", "marked": "^0.7.0", - "phovea_clue": "github:phovea/phovea_clue#vstoiber/refactoring", - "phovea_core": "github:phovea/phovea_core#asteiner/refactoring", - "phovea_d3": "github:phovea/phovea_d3#vstoiber/refactoring", - "phovea_ui": "github:phovea/phovea_ui#vstoiber/refactoring", - "phovea_vis": "github:phovea/phovea_vis#vstoiber/refactoring" + "phovea_clue": "github:phovea/phovea_clue#develop", + "phovea_core": "github:phovea/phovea_core#develop", + "phovea_d3": "github:phovea/phovea_d3#develop", + "phovea_ui": "github:phovea/phovea_ui#develop", + "phovea_vis": "github:phovea/phovea_vis#develop" } } From 34b1c8f19ccfb0a9b178a2782c5be26b888a9c39 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 30 Jul 2020 11:24:00 +0200 Subject: [PATCH 59/60] remove docker files --- deploy/Dockerfile | 9 ----- deploy/nginx-default.conf | 69 --------------------------------------- 2 files changed, 78 deletions(-) delete mode 100644 deploy/Dockerfile delete mode 100644 deploy/nginx-default.conf diff --git a/deploy/Dockerfile b/deploy/Dockerfile deleted file mode 100644 index af2902a..0000000 --- a/deploy/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM nginx:alpine - -LABEL maintainer="contact@caleydo.org" - -ENV PHOVEA_API_SERVER=api -ENV PHOVEA_NGINX_PORT=80 -COPY ./deploy/nginx-default.conf /etc/nginx/conf.d/default.conf -CMD sed -i -e "s/PHOVEA_API_SERVER/${PHOVEA_API_SERVER-api}/g" /etc/nginx/conf.d/default.conf && sed -i -e "s/PHOVEA_NGINX_PORT/${PHOVEA_NGINX_PORT-api}/g" /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;' -COPY ./build /usr/share/nginx/html diff --git a/deploy/nginx-default.conf b/deploy/nginx-default.conf deleted file mode 100644 index 3c73ea0..0000000 --- a/deploy/nginx-default.conf +++ /dev/null @@ -1,69 +0,0 @@ -# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the -# scheme used to connect to this server -map $http_x_forwarded_proto $proxy_x_forwarded_proto { -default $http_x_forwarded_proto; -'' $scheme; -} - -# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any -# Connection header that may have been passed to this server -map $http_upgrade $proxy_connection { -default upgrade; -'' close; -} - -map "${sent_http_etag}${sent_http_last_modified}${sent_http_cache_control}${request_method}${status}" $expires { -default off; -'GET200' 6h; -} - -server { - listen PHOVEA_NGINX_PORT; - server_name localhost; - - location / { - expires modified +12h; - add_header Cache-Control public; - - root /usr/share/nginx/html; - index index.html index.htm; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - - location ~ ^/(api|login|logout|loggedinas) { - - proxy_pass http://PHOVEA_API_SERVER; - # HTTP 1.1 support - proxy_http_version 1.1; - proxy_buffering off; - proxy_set_header Host $http_host; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $proxy_connection; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; - - # Mitigate httpoxy attack (see README for details) - proxy_set_header Proxy ""; - - # timeout in 600sec = 10min - proxy_connect_timeout 600; - proxy_send_timeout 600; - proxy_read_timeout 600; - send_timeout 600; - client_max_body_size 64m; - - add_header Cache-Control private; - expires $expires; - } -} - -gzip on; -gzip_proxied no_etag; -gzip_types text/plain text/comma-separated-values image/svg+xml text/xml text/css application/x-javascript application/javascript application/xml application/xml+rss text/csv application/json text/javascript application/xhtml+xml; -gzip_vary on; -gzip_disable "MSIE [1-6]\.(?!.*SV1)"; From daafea5a55fc1d43bea24ddced3d38805a7583a5 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Fri, 31 Jul 2020 13:25:44 +0200 Subject: [PATCH 60/60] prepare release_4.0.0 --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4fe69ad..b7e658e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gapminder", "description": "", - "version": "3.0.1-SNAPSHOT", + "version": "4.0.0", "author": { "name": "The Caleydo Team", "email": "contact@caleydo.org", @@ -71,10 +71,10 @@ "dependencies": { "jquery": "~3.5.1", "marked": "^0.7.0", - "phovea_clue": "github:phovea/phovea_clue#develop", - "phovea_core": "github:phovea/phovea_core#develop", - "phovea_d3": "github:phovea/phovea_d3#develop", - "phovea_ui": "github:phovea/phovea_ui#develop", - "phovea_vis": "github:phovea/phovea_vis#develop" + "phovea_clue": "^6.0.0", + "phovea_core": "^5.0.0", + "phovea_d3": "^5.0.0", + "phovea_ui": "^5.0.0", + "phovea_vis": "^5.0.0" } }