Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 6.1.0 #252

Merged
34 commits merged into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4067076
Add comments to ISelection and IViewContext
keckelt Jul 25, 2019
19f6bde
ARankingView comments, make onParameterChange optional
keckelt Jul 26, 2019
8e95fb0
Add documentation for section marked with TODO
keckelt Oct 24, 2019
b96c28d
Add check and comment for optional paramsChangeListener
keckelt Oct 24, 2019
7c1fc44
Merge develop
keckelt Oct 24, 2019
c6fb132
fixed column title in exportxlsx
oltionchampari Oct 28, 2019
01eab84
small fix
oltionchampari Oct 29, 2019
144087c
minor refactoring
oltionchampari Oct 29, 2019
ab66365
Rename `getColName` to `getColumnName`
thinkh Oct 29, 2019
9fcc19f
formatted column name for exportToJSON()
oltionchampari Oct 30, 2019
acfbc71
adapted typings and added custom CSS classes to showProveanceGraphNot…
Oct 30, 2019
8190f65
Update datavisyn URLs in package.json
thinkh Nov 7, 2019
2a5d5c3
Prepare next dev release
thinkh Nov 7, 2019
c62ff6e
Revert making onParameterChange optional
keckelt Nov 7, 2019
dcfe103
Add more comments
keckelt Nov 7, 2019
4bdad7c
Merge branch 'develop' into keckelt/comments
keckelt Nov 7, 2019
4ed0e7e
Revert AView.ts
keckelt Nov 7, 2019
61c18f8
Add extended header to Excel files (#237)
thinkh Nov 8, 2019
7998c6b
Merge pull request #235 from datavisyn/keckelt/comments
Nov 8, 2019
7e3e678
Fix typo in research disclaimer
thinkh Nov 8, 2019
1c915ae
Refactor: Avoid negative conditions
thinkh Nov 8, 2019
e0808cc
Allow selection of sessions if user has permission
thinkh Nov 8, 2019
b2ae800
Merge pull request #244 from datavisyn/thinkh/fix-typo
Nov 11, 2019
620ef89
Allow custom CSS classes in `showProveanceGraphNotFoundDialog` (#238)
thinkh Nov 12, 2019
562086d
Fix write access for public sessions (#245)
thinkh Nov 15, 2019
50f0060
Update node-sass to ^4.12.0
rumersdorfer Nov 15, 2019
fb805cb
Update node-sass to ^4.12.0 (#247)
thinkh Nov 15, 2019
a11a2b9
Use LineUp v3 develop branch in tdp_core develop
thinkh Nov 18, 2019
58bb58c
Merge pull request #248 from datavisyn/thinkh/243_use-lineup-develop-…
Nov 19, 2019
39905c0
Added options to LineUpPanelAction to make it more configurable
puehringer Nov 20, 2019
e3d6f1e
Added options to LineUpPanelAction to make it more configurable (#250)
thinkh Nov 21, 2019
30c5845
Update to v6.1.0
thinkh Nov 22, 2019
fa45d93
Merge remote-tracking branch 'origin/master' into release-6.1.0
thinkh Nov 22, 2019
566f521
Set correct version in requirements.txt
thinkh Nov 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
304 changes: 35 additions & 269 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "tdp_core",
"description": "Target discovery platform for exploring rankings of genes, disease models, and other entities.",
"version": "6.0.0",
"version": "6.1.0",
"author": {
"name": "datavisyn",
"email": "contact@datavisyn.io",
"url": "https://datavisyn.io/"
"url": "https://www.datavisyn.io"
},
"license": "BSD-3-Clause",
"homepage": "https://phovea.caleydo.org",
"homepage": "https://www.datavisyn.io",
"bugs": {
"url": "https://github.com/datavisyn/tdp_core/issues"
},
Expand Down Expand Up @@ -105,7 +105,7 @@
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.3",
"mkdirp": "0.5.1",
"node-sass": "4.7.2",
"node-sass": "^4.12.0",
"null-loader": "0.1.1",
"raw-loader": "0.5.1",
"sass-loader": "6.0.7",
Expand Down
2 changes: 1 addition & 1 deletion src/ATDPApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export abstract class ATDPApplication<T> extends ACLUEWrapper {
if (typeof this.options.showResearchDisclaimer === 'function') {
this.options.showResearchDisclaimer(aboutDialogBody);
} else {
aboutDialogBody.insertAdjacentHTML('afterbegin', '<div class="alert alert-warning" role="alert"><strong>Disclaimer</strong> This software is <strong>for research purpose only</strong>.</span></div>');
aboutDialogBody.insertAdjacentHTML('afterbegin', '<div class="alert alert-warning" role="alert"><strong>Disclaimer</strong> This software is <strong>for research purposes only</strong>.</span></div>');
}
}

Expand Down
36 changes: 26 additions & 10 deletions src/SessionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ abstract class ASessionList {
});
$enter.select('a[data-action="select"]').on('click', (d) => {
stopEvent();
if (!canWrite(d)) {
manager.cloneLocal(d);
} else {
if (canWrite(d)) {
manager.loadGraph(d);
} else {
manager.cloneLocal(d);
}
return false;
});
Expand Down Expand Up @@ -308,11 +308,19 @@ export class PersistentSessionList extends ASessionList {
{
const $tr = $parent.select('#session_others tbody').selectAll('tr').data(otherworkspaces);

const $trEnter = $tr.enter().append('tr').html(`
<td></td>
<td></td>
<td></td>
<td>${ASessionList.createButton('clone')}</td>`);
const $trEnter = $tr.enter().append('tr').html((d) => {
let actions = '';
if(canWrite(d)) {
actions += ASessionList.createButton('select');
}
actions += ASessionList.createButton('clone');

return `
<td></td>
<td></td>
<td></td>
<td>${actions}</td>`;
});

this.registerActionListener(manager, $trEnter);
$tr.select('td').text((d) => d.name);
Expand Down Expand Up @@ -345,11 +353,19 @@ export class PersistentSessionList extends ASessionList {
{
const $tr = $parent.select('#session_others').selectAll('div').data(otherworkspaces);

const $trEnter = $tr.enter().append('div').classed('sessionEntry', true).html(`
const $trEnter = $tr.enter().append('div').classed('sessionEntry', true).html((d) => {
let actions = '';
if(canWrite(d)) {
actions += ASessionList.createButton('select');
}
actions += ASessionList.createButton('clone');

return `
<span></span>
<span></span>
<span></span>
<span>${ASessionList.createButton('clone')}</span>`);
<span>${actions}</span>`;
});

this.registerActionListener(manager, $trEnter);
$tr.select('span').text((d) => d.name);
Expand Down
8 changes: 4 additions & 4 deletions src/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export {setGlobalErrorTemplate} from 'phovea_ui/src/errors';
export {errorAlert as showErrorModalDialog} from './notifications';

export interface IDialogModule {
generateDialog(title: string, primaryBtnText?: string): Dialog;
generateDialog(title: string, primaryBtnText?: string, additionalCSSClasses?: string): Dialog;

areyousure(msg?: string, options?: IAreYouSureOptions | string): Promise<boolean>;

FormDialog: {new(title: string, primaryBtnText?: string, formId?: string): FormDialog};
FormDialog: {new(title: string, primaryBtnText?: string, formId?: string, additionalCSSClasses?: string): FormDialog};
}

export function lazyDialogModule(): Promise<IDialogModule> {
Expand All @@ -26,9 +26,9 @@ export function lazyDialogModule(): Promise<IDialogModule> {
* @param {CLUEGraphManager} manager
* @param {string} id session id
*/
export function showProveanceGraphNotFoundDialog(manager: CLUEGraphManager, id: string) {
export function showProveanceGraphNotFoundDialog(manager: CLUEGraphManager, id: string, additionalCSSClasses: string = '') {
lazyDialogModule().then(({generateDialog}) => {
const dialog = generateDialog('Session Not Found!', 'Create New Temporary Session');
const dialog = generateDialog('Session Not Found!', 'Create New Temporary Session', additionalCSSClasses);
// append bg-danger to the dialog parent element
dialog.body.parentElement.parentElement.parentElement.classList.add('bg-danger');
dialog.body.innerHTML = `
Expand Down
4 changes: 2 additions & 2 deletions src/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export interface IViewGroupExtensionDesc extends IPluginDesc {


export interface ISelection {
readonly idtype: IDType;
readonly idtype: IDType; // see phovea_core/src/idtype/manager#resolve
readonly range: Range;

/**
Expand All @@ -175,7 +175,7 @@ export interface ISelection {

export interface IViewContext {
readonly graph: ProvenanceGraph;
readonly desc: IViewPluginDesc;
readonly desc: IViewPluginDesc; // see tdp_core/src/views/interfaces#toViewPluginDesc and phovea_core/src/plugin#get
readonly ref: IObjectRef<any>;
}

Expand Down
88 changes: 88 additions & 0 deletions src/lineup/ARankingView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,79 @@ export interface IARankingViewOptions {
* @default true
*/
enableOverviewMode: boolean | 'active';

/**
* enable zoom button
* @default true
*/
enableZoom: boolean;

/**
* enable download data button
* @default true
*/
enableDownload: boolean;

/**
* enable save list of entities button
* @default true
*/
enableSaveRanking: boolean;

/**
* enable collapsing button of side panel
* @default true
*/
enableSidePanelCollapsing: boolean;

/**
* enable side panel
* @default 'collapsed'
*/
enableSidePanel: boolean | 'collapsed' | 'top';

/**
* enable add columns button
* @default true
*/
enableAddingColumns: boolean;

/**
* enable support columns in the add column dialog
* @default true
*/
enableAddingSupportColumns: boolean;

/**
* enable combining columns in the add column dialog
* @default true
*/
enableAddingCombiningColumns: boolean;

/**
* enable score columns in the add column dialog
* @default true
*/
enableAddingScoreColumns: boolean;

/**
* enable previously created columns in the add column dialog
* @default true
*/
enableAddingPreviousColumns: boolean;

/**
* enable database columns in the add column dialog
* @default true
*/
enableAddingDatabaseColumns: boolean;

/**
* enable meta data score columns in the add column dialog
* @default true
*/
enableAddingMetaDataColumns: boolean;

enableHeaderSummary: boolean;

enableHeaderRotation: boolean;
Expand All @@ -91,6 +154,7 @@ export interface IARankingViewOptions {

/**
* base class for views based on LineUp
* There is also AEmbeddedRanking to display simple rankings with LineUp.
*/
export abstract class ARankingView extends AView {

Expand Down Expand Up @@ -142,8 +206,17 @@ export abstract class ARankingView extends AView {
subType: {key: '', value: ''},
enableOverviewMode: true,
enableZoom: true,
enableDownload: true,
enableSaveRanking: true,
enableAddingColumns: true,
enableAddingColumnGrouping: false,
enableAddingSupportColumns: true,
enableAddingCombiningColumns: true,
enableAddingScoreColumns: true,
enableAddingPreviousColumns: true,
enableAddingDatabaseColumns: true,
enableAddingMetaDataColumns: true,
enableSidePanelCollapsing: true,
enableSidePanel: 'collapsed',
enableHeaderSummary: true,
enableStripedBackground: false,
Expand All @@ -158,6 +231,17 @@ export abstract class ARankingView extends AView {

private readonly selectionAdapter: ISelectionAdapter | null;

/**
* Creates a RankingView with the given selection.
* Can be wrapped with a ViewWrapper.
*
* @remarks You need to call init() to actually display the Ranking View.
*
* @param context with provenance graph to store the executed operations
* @param selection The Ids and IdType of the selection
* @param parent where to put the ranking view
* @param options to configure the ranking view
*/
constructor(context: IViewContext, selection: ISelection, parent: HTMLElement, options: Partial<IARankingViewOptions> = {}) {
super(context, selection, parent);

Expand Down Expand Up @@ -247,6 +331,10 @@ export abstract class ARankingView extends AView {
this.selectionAdapter = this.createSelectionAdapter();
}

/**
* @param params Seperate element that displays the "Showing x of y ..." message
* @param onParameterChange eventlistener for content changes
*/
init(params: HTMLElement, onParameterChange: (name: string, value: any, previousValue: any) => Promise<any>) {
return super.init(params, onParameterChange).then(() => {
// inject stats
Expand Down
79 changes: 49 additions & 30 deletions src/lineup/internal/LineUpPanelActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class LineUpPanelActions extends EventHandler {
<div class="lu-adder">${this.search ? '<button class="fa fa-plus" title="Add Column"></button>' : ''}
</div>`);

if (!this.isTopMode) { // top mode doesn't need collapse feature
if (!this.isTopMode && this.options.enableSidePanelCollapsing) { // top mode doesn't need collapse feature
this.node.insertAdjacentHTML('afterbegin', `<a href="#" title="(Un)Collapse"></a>`);
this.node.querySelector('a')!.addEventListener('click', (evt) => {
evt.preventDefault();
Expand All @@ -148,8 +148,12 @@ export default class LineUpPanelActions extends EventHandler {

const buttons = this.node.querySelector('section');
this.appendExtraButtons().forEach((b) => buttons.appendChild(b));
buttons.appendChild(this.appendSaveRanking());
buttons.appendChild(this.appendDownload());
if(this.options.enableSaveRanking) {
buttons.appendChild(this.appendSaveRanking());
}
if(this.options.enableDownload) {
buttons.appendChild(this.appendDownload());
}
if (this.options.enableZoom) {
buttons.appendChild(this.createMarkup('Zoom In', 'fa fa-search-plus gap', () => this.fire(LineUpPanelActions.EVENT_ZOOM_IN)));
buttons.appendChild(this.createMarkup('Zoom Out', 'fa fa-search-minus', () => this.fire(LineUpPanelActions.EVENT_ZOOM_OUT)));
Expand Down Expand Up @@ -330,11 +334,13 @@ export default class LineUpPanelActions extends EventHandler {
}
const {metaDataOptions, loadedScorePlugins} = await this.resolveScores(this.idType);

const items: (ISearchOption | IGroupSearchItem<ISearchOption>)[] = [
this.groupedDialog('Database Columns', this.getColumnDescription(descs, false))
];
const items: (ISearchOption | IGroupSearchItem<ISearchOption>)[] = [];

if (loadedScorePlugins.length > 0) {
if(this.options.enableAddingDatabaseColumns) {
items.push(this.groupedDialog('Database Columns', this.getColumnDescription(descs, false)));
}

if (this.options.enableAddingScoreColumns && loadedScorePlugins.length > 0) {
items.push({
text: 'Parameterized Scores',
children: loadedScorePlugins.map((score) => {
Expand All @@ -353,36 +359,49 @@ export default class LineUpPanelActions extends EventHandler {
});
}

const scoreDescs = this.getColumnDescription(descs, true);
if (scoreDescs.length > 0) {
items.push({
text: 'Previously Added Columns',
children: scoreDescs
});
if(this.options.enableAddingPreviousColumns) {
const scoreDescs = this.getColumnDescription(descs, true);
if (scoreDescs.length > 0) {
items.push({
text: 'Previously Added Columns',
children: scoreDescs
});
}
}

const combiningColumns = this.groupedDialog('Combining Columns', [
{ text: 'Weighted Sum', id: 'weightedSum', action: () => this.addColumn(createStackDesc('Weighted Sum')) },
{ text: 'Scripted Combination', id: 'scriptedCombination', action: () => this.addColumn(createScriptDesc('Scripted Combination')) },
{ text: 'Nested', id: 'nested', action: () => this.addColumn(createNestedDesc('Nested')) },
{ text: 'Min/Max/Mean Combination', id: 'reduce', action: () => this.addColumn(createReduceDesc()) },
{ text: 'Imposition', id: 'imposition', action: () => this.addColumn(createImpositionDesc()) }
]);
const specialColumnsOption = {
text: 'Special Columns',
children: []
};

if(this.options.enableAddingCombiningColumns) {
const combiningColumns = this.groupedDialog('Combining Columns', [
{ text: 'Weighted Sum', id: 'weightedSum', action: () => this.addColumn(createStackDesc('Weighted Sum')) },
{ text: 'Scripted Combination', id: 'scriptedCombination', action: () => this.addColumn(createScriptDesc('Scripted Combination')) },
{ text: 'Nested', id: 'nested', action: () => this.addColumn(createNestedDesc('Nested')) },
{ text: 'Min/Max/Mean Combination', id: 'reduce', action: () => this.addColumn(createReduceDesc()) },
{ text: 'Imposition', id: 'imposition', action: () => this.addColumn(createImpositionDesc()) }
]);
specialColumnsOption.children.push(combiningColumns);
}

const supportColumns = this.groupedDialog('Support Columns', [
if(this.options.enableAddingSupportColumns) {
const supportColumns = this.groupedDialog('Support Columns', [
{text: 'Group Information', id: 'group', action: () => this.addColumn(createGroupDesc('Group'))},
{text: 'Selection Checkbox', id: 'selection', action: () => this.addColumn(createSelectionDesc())},
{text: 'Aggregate Group', id: 'aggregate', action: () => this.addColumn(createAggregateDesc())}
]);
]);
specialColumnsOption.children.push(supportColumns);
}

items.push({
text: 'Special Columns',
children: [
combiningColumns,
supportColumns,
...metaDataOptions
]
});
if(this.options.enableAddingMetaDataColumns) {
specialColumnsOption.children.push(...metaDataOptions);
}

// Only add special columns option if there are any items available
if(specialColumnsOption.children.length > 0) {
items.push(specialColumnsOption);
}

this.search.data = items;
}
Expand Down
Loading