Skip to content

Commit

Permalink
Merge pull request #199 from Caleydo/release_v5.0.0
Browse files Browse the repository at this point in the history
Release v5.0.0
  • Loading branch information
Holger Stitz authored Nov 30, 2018
2 parents a505f52 + b2319ea commit 43b3fa3
Show file tree
Hide file tree
Showing 22 changed files with 252 additions and 212 deletions.
25 changes: 20 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ jobs:
build:
working_directory: ~/phovea
docker:
- image: circleci/node:6-browsers
tags:
- /v\d+.\d+.\d+.*/
- image: circleci/node:8-browsers
steps:
- checkout
- restore_cache:
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
key: deps1-{{ checksum "package.json" }}
- run:
name: install-npm-wee
command: npm install
Expand All @@ -18,7 +16,7 @@ jobs:
command: |
(grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf
- save_cache:
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
key: deps1-{{ checksum "package.json" }}
paths:
- ./node_modules
- run: #install all dependencies
Expand All @@ -29,3 +27,20 @@ jobs:
command: npm run dist
- store_artifacts:
path: dist

workflows:
version: 2
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
File renamed without changes.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
language: node_js

node_js:
- 6
- 8

addons:
firefox: 49.0.1

before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi

script: npm run dist
script: npm run dist
9 changes: 8 additions & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@
"node_modules.*(d3|bootstrap|jquery|select2)",
"((node_modules.*popper)|lineupjs|lineupengine|tdp_core)"
],
"extensions": [],
"extensions": [
{
"type": "ordinoWelcomeView",
"id": "ordinoWelcomeView",
"module": "WelcomeView",
"extras": {}
}
],
"sextensions": [],
"libraries": [
"scrollTo",
Expand Down
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ordino",
"description": "Target discovery platform for exploring rankings of genes, disease models, and other entities.",
"homepage": "https://phovea.caleydo.org",
"version": "4.0.1",
"version": "5.0.0",
"author": {
"name": "The Caleydo Team",
"email": "[email protected]",
Expand All @@ -29,7 +29,7 @@
"predocker": "npm run build",
"docker": "docker build -t ordino -f deploy/Dockerfile .",
"compile": "tsc",
"lint": "tslint -c tslint.json src/**.ts tests/**.ts",
"lint": "tslint -c tslint.json -p .",
"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",
Expand All @@ -47,47 +47,47 @@
"dist": "mkdirp dist && cd build && tar cvzf ../dist/ordino.tar.gz *"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
"awesome-typescript-loader": "3.0.3",
"cache-loader": "1.2.0",
"css-loader": "0.26.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"@types/jasmine": "2.5.47",
"awesome-typescript-loader": "3.1.2",
"css-loader": "0.28.0",
"extract-loader": "0.1.0",
"file-loader": "0.10.0",
"fork-ts-checker-webpack-plugin": "0.2.9",
"html-loader": "0.4.4",
"imports-loader": "0.7.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",
"json-loader": "0.5.4",
"karma": "1.4.0",
"karma": "1.5.0",
"karma-chrome-launcher": "2.0.0",
"karma-firefox-launcher": "1.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.2",
"karma-webpack": "2.0.3",
"mkdirp": "0.5.1",
"node-sass": "4.5.0",
"node-sass": "4.7.2",
"null-loader": "0.1.1",
"raw-loader": "0.5.1",
"sass-loader": "5.0.0",
"style-loader": "0.13.1",
"thread-loader": "1.1.2",
"ts-loader": "3.1.1",
"tslib": "1.5.0",
"tslint": "4.4.2",
"typedoc": "0.5.5",
"typescript": "2.2.0",
"url-loader": "0.5.7",
"webpack": "2.2.1",
"sass-loader": "6.0.7",
"style-loader": "0.16.1",
"tslib": "1.9.0",
"tslint": "5.9.1",
"typedoc": "0.11.1",
"typescript": "2.7.2",
"url-loader": "0.5.8",
"webpack": "2.3.3",
"webpack-dev-server": "2.4.2",
"ifdef-loader": "2.0.0"
"cache-loader": "1.2.0",
"ifdef-loader": "2.0.0",
"fork-ts-checker-webpack-plugin": "0.4.1",
"thread-loader": "1.1.2",
"ts-loader": "4.0.1"
},
"dependencies": {
"@types/jquery.scrollto": "1.4.27",
"jquery.scrollto": "2.1.2",
"@types/jquery": "2.0.33",
"jquery": "3.1.1",
"tdp_core": "github:datavisyn/tdp_core#v4.0.1"
"tdp_core": "github:datavisyn/tdp_core#semver:^5.0.0"
}
}
3 changes: 3 additions & 0 deletions phovea.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ module.exports = function (registry) {
priority: 95
});

registry.push('ordinoWelcomeView', 'ordinoWelcomeView', function() { return import('./src/WelcomeView'); }, {
priority: 10
});
// generator-phovea:end
};

16 changes: 16 additions & 0 deletions src/WelcomeView.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import WelcomeViewTemplate from 'html-loader!./welcome_view.html';

export interface IWelcomeView {
build();
}

export default class WelcomeView implements IWelcomeView {

constructor(private parent: HTMLElement) {
//
}

build() {
this.parent.innerHTML = WelcomeViewTemplate;
}
}
Binary file removed src/assets/welcome-view-step1.png
Binary file not shown.
Binary file removed src/assets/welcome-view-step2.png
Binary file not shown.
Binary file removed src/assets/welcome-view-step3.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import './style.scss';

import Ordino from './Ordino';

new Ordino();
const _ = new Ordino();
28 changes: 26 additions & 2 deletions src/internal/OrdinoApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ import {createView, removeView, replaceView, setAndUpdateSelection, setSelection
import Range from 'phovea_core/src/range/Range';
import {SESSION_KEY_NEW_ENTRY_POINT} from './constants';
import * as session from 'phovea_core/src/session';
import {list as listPlugins} from 'phovea_core/src/plugin';
import {IWelcomeView} from '../WelcomeView';

import WelcomeViewTemplate from 'html-loader!../welcome_view.html';
export const EXTENSION_POINT_WELCOME_PAGE = 'ordinoWelcomeView';


/**
Expand Down Expand Up @@ -62,7 +64,29 @@ export default class OrdinoApp extends EventHandler {

const $wrapper = d3.select(parent).append('div').classed('wrapper', true);
this.$node = $wrapper.append('div').classed('targid', true).datum(this);
this.$node.html(WelcomeViewTemplate);
this.buildWelcomeView(<HTMLElement>this.$node.node());
}

/**
* Loads registered welcome pages from the extension points.
* The welcome page with the highest priority is loaded and shown.
*
* @param {HTMLElement} parent
*/
private buildWelcomeView(parent: HTMLElement) {
const welcomeViews = listPlugins(EXTENSION_POINT_WELCOME_PAGE)
.sort((a: any, b: any) => ((b.priority || 10) - (a.priority || 10))); // descending

if(welcomeViews.length === 0) {
console.warn('No registered welcome page found!');
return;
}

welcomeViews[0].load()
.then((p) => {
const welcomeView: IWelcomeView = p.factory(parent);
welcomeView.build();
});
}

private buildHistory(parent: HTMLElement) {
Expand Down
49 changes: 38 additions & 11 deletions src/internal/ViewWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import {
isSameSelection,
IView,
IViewContext,
IViewPluginDesc,
matchLength,
showAsSmallMultiple,
toViewPluginDesc
} from 'tdp_core/src/views';
import {resolveImmediately} from 'phovea_core/src/internal/promise';
import {groupByCategory} from 'tdp_core/src/views/findViews';
import {MODE_ANIMATION_TIME} from './constants';

function generate_hash(desc: IPluginDesc, selection: ISelection) {
const s = (selection.idtype ? selection.idtype.id : '') + 'r' + (selection.range.toString());
Expand Down Expand Up @@ -97,11 +97,12 @@ export default class ViewWrapper extends EventHandler {
* Initialize this view, create the root node and the (inner) view
* @param graph
* @param selection
* @param itemSelection
* @param parent
* @param plugin
* @param options
*/
constructor(private readonly graph: ProvenanceGraph, public selection: ISelection, parent: Element, private plugin: IPlugin, public options?) {
constructor(private readonly graph: ProvenanceGraph, public selection: ISelection, itemSelection: ISelection|null, parent: Element, private plugin: IPlugin, private firstTime: boolean, public options?) {
super();

// create provenance reference
Expand All @@ -112,7 +113,7 @@ export default class ViewWrapper extends EventHandler {
// create ViewWrapper root node
this.$viewWrapper = d3.select(parent).append('div').classed('viewWrapper', true);

this.built = resolveImmediately(this.createView(selection, plugin, options));
this.built = resolveImmediately(this.createView(selection, itemSelection, plugin, options));
}

/**
Expand All @@ -136,7 +137,7 @@ export default class ViewWrapper extends EventHandler {
* @param plugin
* @param options
*/
private createView(selection: ISelection, plugin: IPlugin, options?) {
private createView(selection: ISelection, itemSelection: ISelection|null, plugin: IPlugin, options?) {
this.$node = this.$viewWrapper.append('div')
.classed('view', true)
.datum(this);
Expand Down Expand Up @@ -164,6 +165,10 @@ export default class ViewWrapper extends EventHandler {

this.instance = plugin.factory(this.context, selection, <Element>$inner.node(), options, plugin.desc);
return resolveImmediately(this.instance.init(<HTMLElement>$params.node(), this.onParameterChange.bind(this))).then(() => {
if (itemSelection) {
return this.instance.setItemSelection(itemSelection);
}
}).then(() => {
this.instance.on(AView.EVENT_ITEM_SELECT, this.listenerItemSelect);
this.instance.on(AView.EVENT_UPDATE_ENTRY_POINT, this.listenerUpdateEntryPoint);

Expand All @@ -178,15 +183,16 @@ export default class ViewWrapper extends EventHandler {
* @param plugin
* @param options
*/
replaceView(selection: ISelection, plugin: IPlugin, options?) {
replaceView(selection: ISelection, itemSelection: ISelection|null, plugin: IPlugin, firstTime: boolean, options?) {
this.destroyView();

this.selection = selection;
this.plugin = plugin;
this.options = options;
this.firstTime = firstTime;

this.init(this.graph, selection, plugin, options);
return this.built = this.createView(selection, plugin, options);
return this.built = this.createView(selection, itemSelection, plugin, options);
}

/**
Expand Down Expand Up @@ -216,7 +222,15 @@ export default class ViewWrapper extends EventHandler {
}


private onParameterChange(name: string, value: any, previousValue: any) {
private onParameterChange(name: string, value: any, previousValue: any, isInitializion: boolean) {
if (isInitializion) {
if (this.firstTime) {
return this.context.graph.pushWithResult(setParameter(this.ref, name, value, previousValue), {
inverse: setParameter(this.ref, name, previousValue, value)
});
}
return; // dummy;
}
return this.context.graph.push(setParameter(this.ref, name, value, previousValue));
}

Expand Down Expand Up @@ -282,12 +296,25 @@ export default class ViewWrapper extends EventHandler {
// trigger modeChanged
this.instance.modeChanged(mode);

this.updateAfterAnimation();

// on focus view scroll into view
if (mode === EViewMode.FOCUS) {
this.scrollIntoView();
}
}

private updateAfterAnimation() {
if (!this.instance || typeof (<any>this.instance).update !== 'function') {
return;
}
setTimeout(() => {
if ((<any>this.instance) && typeof (<any>this.instance).update === 'function') {
(<any>this.instance).update();
}
}, MODE_ANIMATION_TIME);
}

private scrollIntoView() {
const prev = (<any>this.$viewWrapper.node()).previousSibling;
const scrollToPos = prev ? prev.offsetLeft || 0 : 0;
Expand Down Expand Up @@ -371,10 +398,10 @@ export default class ViewWrapper extends EventHandler {
}
}

export function createViewWrapper(graph: ProvenanceGraph, selection: ISelection, parent: Element, plugin: IPluginDesc, options?) {
return plugin.load().then((p) => new ViewWrapper(graph, selection, parent, p, options));
export function createViewWrapper(graph: ProvenanceGraph, selection: ISelection, itemSelection: ISelection|null, parent: Element, plugin: IPluginDesc, firstTime: boolean, options?) {
return plugin.load().then((p) => new ViewWrapper(graph, selection, itemSelection, parent, p, firstTime, options));
}

export function replaceViewWrapper(existingView: ViewWrapper, selection: ISelection, plugin: IPluginDesc, options?) {
return plugin.load().then((p) => existingView.replaceView(selection, p, options));
export function replaceViewWrapper(existingView: ViewWrapper, selection: ISelection, itemSelection: ISelection|null, plugin: IPluginDesc, firstTime: boolean, options?) {
return plugin.load().then((p) => existingView.replaceView(selection, itemSelection, p, firstTime, options));
}
Loading

0 comments on commit 43b3fa3

Please sign in to comment.