forked from lineupjs/lineupjs
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Taggle Fusion Canvas Texture Renderer #561
Open
domdir
wants to merge
19
commits into
taggle-fusion
Choose a base branch
from
taggle-fusion-issue-3-4
base: taggle-fusion
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,332
−136
Open
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
581e36b
implementation of a canvas texture renderer, for Caleydo/lineup_app#3…
domdir ca0dcaa
implementation of the canvas texture renderer, for Caleydo/lineup_app…
domdir 957530f
added OverviewDetail column, for Caleydo/lineup_app#3 Caleydo/lineup…
domdir 267cc37
Merge branch 'taggle-fusion' into taggle-fusion-issue-3-4
domdir 391fd54
added overviewDetail to SidePanel, for Caleydo/lineup_app#3 Caleydo/…
domdir 80fc751
splitting big canvas into chunks and minor fixes, for Caleydo/lineup_…
domdir 56c676a
bug fixes, for Caleydo/lineup_app#20 Caleydo/lineup_app#21 Caleydo/li…
domdir f1a760d
code clean up
domdir ca0a8fa
Merge branch 'taggle-fusion' into taggle-fusion-issue-3-4
domdir 2fd3e96
Merge branch 'taggle-fusion' into taggle-fusion-issue-3-4
43c240f
Fix typo
7aa6ec4
Fix compile error
14ea9ca
Add d3-select and d3-drag packages
053a2b9
Fix possible null references for ownerDocument
bc75d66
Fix scsslint
e1e7152
Fix scsslint
4e18a36
Make SelectionManager private again
20c38f7
fix issues for pr
domdir 9e58a46
fix display issue
domdir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import {Category, SupportType, toolbar} from './annotations'; | ||
import {IDataRow, IGroup} from './interfaces'; | ||
import ValueColumn, {IValueColumnDesc} from './ValueColumn'; | ||
|
||
/** | ||
* factory for creating a description creating a rank column | ||
* @param label | ||
* @returns {{type: string, label: string}} | ||
*/ | ||
export function createDetailDesc(label: string = 'Detail Checkboxes') { | ||
return {type: 'detail', label, fixed: true}; | ||
} | ||
|
||
export interface IDetailColumnDesc extends IValueColumnDesc<boolean> { | ||
/** | ||
* setter for selecting/deselecting the given row | ||
*/ | ||
setter(row: IDataRow, value: boolean): void; | ||
|
||
/** | ||
* setter for selecting/deselecting the given row | ||
*/ | ||
setterAll(rows: IDataRow[], value: boolean): void; | ||
} | ||
|
||
/** | ||
* a checkbox column for selections | ||
*/ | ||
@SupportType() | ||
@toolbar('sort', 'sortBy', 'group', 'groupBy', 'selectionToOverviewDetail', 'overviewDetailToSelection') | ||
@Category('support') | ||
export default class OverviewDetailColumn extends ValueColumn<boolean> { | ||
private static DETAILED_GROUP: IGroup = { | ||
name: 'Detailed', | ||
color: 'blue' | ||
}; | ||
private static NOT_DETAILED_GROUP: IGroup = { | ||
name: 'Undetailed', | ||
color: 'gray' | ||
}; | ||
static readonly EVENT_DETAIL = 'detail'; | ||
|
||
constructor(id: string, desc: Readonly<IDetailColumnDesc>) { | ||
super(id, desc); | ||
this.setDefaultWidth(20); | ||
} | ||
|
||
get frozen() { | ||
return this.desc.frozen !== false; | ||
} | ||
|
||
protected createEventList() { | ||
return super.createEventList().concat([OverviewDetailColumn.EVENT_DETAIL]); | ||
} | ||
|
||
setValue(row: IDataRow, value: boolean) { | ||
const old = this.getValue(row); | ||
if (old === value) { | ||
return true; | ||
} | ||
return this.setImpl(row, value); | ||
} | ||
|
||
setValues(rows: IDataRow[], value: boolean) { | ||
if (rows.length === 0) { | ||
return; | ||
} | ||
if ((<IDetailColumnDesc>this.desc).setterAll) { | ||
(<IDetailColumnDesc>this.desc).setterAll(rows, value); | ||
} | ||
this.fire(OverviewDetailColumn.EVENT_DETAIL, rows[0], value, rows); | ||
return true; | ||
} | ||
|
||
private setImpl(row: IDataRow, value: boolean) { | ||
if ((<IDetailColumnDesc>this.desc).setter) { | ||
(<IDetailColumnDesc>this.desc).setter(row, value); | ||
} | ||
this.fire(OverviewDetailColumn.EVENT_DETAIL, row, value); | ||
return true; | ||
} | ||
|
||
toggleValue(row: IDataRow) { | ||
const old = this.getValue(row); | ||
this.setImpl(row, !old); | ||
return !old; | ||
} | ||
|
||
compare(a: IDataRow, b: IDataRow) { | ||
const va = this.getValue(a) === true; | ||
const vb = this.getValue(b) === true; | ||
return va === vb ? 0 : (va < vb ? -1 : +1); | ||
} | ||
|
||
group(row: IDataRow) { | ||
const isSelected = this.getValue(row); | ||
return isSelected ? OverviewDetailColumn.DETAILED_GROUP : OverviewDetailColumn.NOT_DETAILED_GROUP; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check formatting