-
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
base: taggle-fusion
Are you sure you want to change the base?
Conversation
a636edd
to
56c676a
Compare
# Conflicts: # src/model/index.ts
I get a runtime error when switching to the overview mode:
It seems that the |
@@ -888,6 +996,14 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
this.fire(ADataProvider.EVENT_SELECTION_CHANGED, [], false); | |||
} | |||
|
|||
clearDetail() { |
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.
Please add function comment
@@ -877,6 +981,10 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
return Array.from(this.selection); | |||
} | |||
|
|||
getDetail() { |
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.
Please add function comment
@@ -869,6 +966,13 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
return this.view(this.getSelection()); | |||
} | |||
|
|||
detailRows(): Promise<any[]> | any[] { |
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.
Please add function comment
@@ -858,6 +945,16 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
this.fire(ADataProvider.EVENT_SELECTION_CHANGED, this.getSelection()); | |||
} | |||
|
|||
removeDetailAll(indices: number[]) { |
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.
Please add function comment
@@ -832,6 +894,23 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
return true; | |||
} | |||
|
|||
toggleDetail(index: number, additional = false) { |
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.
Please add function comment
@@ -844,6 +923,14 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
this.fire(ADataProvider.EVENT_SELECTION_CHANGED, this.getSelection()); | |||
} | |||
|
|||
removeDetail(index: number) { |
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.
Please add function comment
@@ -809,6 +860,17 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
this.selectAll(indices); | |||
} | |||
|
|||
setDetail(indices: number[]) { |
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.
Please add function comment
@@ -790,10 +827,24 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
this.fire(ADataProvider.EVENT_SELECTION_CHANGED, this.getSelection()); | |||
} | |||
|
|||
addDetailAll(indices: number[]) { |
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.
Please add function comment
@@ -758,6 +787,14 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
this.fire(ADataProvider.EVENT_SELECTION_CHANGED, this.getSelection()); | |||
} | |||
|
|||
addDetail(index: number) { |
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.
Please add function comment
@@ -743,6 +768,10 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
return this.selection.has(index); | |||
} | |||
|
|||
isDetail(index: number) { |
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.
Please add function comment
@@ -160,6 +172,8 @@ abstract class ADataProvider extends AEventDispatcher implements IDataProvider { | |||
*/ | |||
private readonly selection = new OrderedSet<number>(); | |||
|
|||
private readonly detail = new OrderedSet<number>(); |
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.
Add property comment
@import './threshold'; | ||
@import './upset'; | ||
@import './verticalbar'; | ||
.#{$lu_css_prefix} { |
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.
Why is this necessary?
src/ui/EngineRanking.ts
Outdated
@@ -163,7 +163,7 @@ export default class EngineRanking extends ACellTableSection<RenderColumn> imple | |||
} | |||
}; | |||
|
|||
constructor(public readonly ranking: Ranking, header: HTMLElement, body: HTMLElement, tableId: string, style: GridStyleManager, private readonly ctx: IEngineRankingContext, roptions: Partial<IEngineRankingOptions> = {}) { | |||
constructor(public readonly ranking: Ranking, header: HTMLElement, body: HTMLElement, tableId: string, style: GridStyleManager, private readonly ctx: IEngineRankingContext, roptions: Partial<IEngineRankingOptions> = {}, readonly noEvents: boolean = false) { |
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.
Invert semantic of noEvents = false
for easier reading. Because in line 188 the counter part is used if(!noEvents)
. Rename to addEventListener = true
.
src/ui/EngineRanking.ts
Outdated
if (newValue) { | ||
// become visible | ||
const index = ranking.children.indexOf(col); | ||
if (!noEvents) { |
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.
Please add a comment why and when no event listner is added? Otherwise nobody understands why this flag exists.
src/ui/EngineRenderer.ts
Outdated
d3.select(this.node).select('main').style('display', 'none'); | ||
} | ||
|
||
s2d() { |
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.
Do not use abbreviations in this case.
src/ui/EngineRenderer.ts
Outdated
this.textureRenderer.s2d(); | ||
} | ||
|
||
d2s() { |
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.
Do not use abbreviations in this case.
src/ui/CanvasTextureRenderer.ts
Outdated
this.node.style.display = 'none'; | ||
} | ||
|
||
s2d() { |
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.
Do not use abbreviations in this case.
src/ui/CanvasTextureRenderer.ts
Outdated
this.engineRenderer.ctx.provider.setDetail(this.engineRenderer.ctx.provider.getSelection()); | ||
} | ||
|
||
d2s() { |
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.
Do not use abbreviations in this case.
src/ui/CanvasTextureRenderer.ts
Outdated
|
||
for (let i = fromIndex; i <= toIndex; i++) { | ||
if (this.engineRenderer.ctx.provider.isSelected(this.currentLocalData[0][i].i)) { | ||
ctx.fillStyle = '#ffa809'; |
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.
Use class color constant
src/ui/CanvasTextureRenderer.ts
Outdated
if (this.engineRenderer.ctx.provider.isSelected(this.currentLocalData[0][i].i)) { | ||
ctx.fillStyle = '#ffa809'; | ||
} else { | ||
ctx.fillStyle = '#ffffff'; |
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.
Use class color constant
src/ui/taggle/TaggleRenderer.ts
Outdated
@@ -179,4 +188,12 @@ export default class TaggleRenderer extends AEventDispatcher { | |||
enableHighlightListening(enable: boolean) { | |||
this.renderer.enableHighlightListening(enable); | |||
} | |||
|
|||
d2s() { |
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.
Do not use abbreviations in this case.
src/ui/taggle/TaggleRenderer.ts
Outdated
this.renderer.d2s(); | ||
} | ||
|
||
s2d() { |
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.
Do not use abbreviations in this case.
src/ui/toolbar.ts
Outdated
@@ -305,6 +305,16 @@ export const toolbarActions: { [key: string]: IToolbarAction | IToolbarDialogAdd | |||
const ss = new Set(s); | |||
const others = order.filter((d) => !ss.has(d)); | |||
ctx.provider.setSelection(others); | |||
}), | |||
selectionToOverviewDetail: ui('S2D', (_col, _evt, ctx, level) => { |
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.
Use more explainable label
src/ui/toolbar.ts
Outdated
const s = ctx.provider.getSelection(); | ||
ctx.provider.setDetail(s); | ||
}), | ||
overviewDetailToSelection: ui('D2S', (_col, _evt, ctx, level) => { |
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.
Use more explainable label
src/model/OverviewDetailColumn.ts
Outdated
|
||
group(row: IDataRow) { | ||
const isSelected = this.getValue(row); | ||
return isSelected ? OverviewDetailColumn.DETAILED_GROUP : OverviewDetailColumn.NOT_DETAILED_GROUP; } |
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
src/ui/CanvasTextureRenderer.ts
Outdated
private alreadyExpanded: boolean = false; | ||
private expandLaterRows: any[] = []; | ||
private readonly options: Readonly<ILineUpOptions>; | ||
private readonly idPrefix = 'testprefix'; |
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.
Why testprefix
?
src/ui/CanvasTextureRenderer.ts
Outdated
totalWidth += rankingWidth; | ||
}); | ||
if (totalWidth > this.node.clientWidth) { | ||
this.currentNodeHeight -= 20; |
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.
Where does this 20 px are coming from? Is there an existing constant that you can use?
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.
I couldn't test this functionality with the lineupjs demos, as there is a bug (as described above). Afterwards I can test it again.
Please fix the mentioned comments, before I'll merge the PR.
Related PR: Caleydo/lineup_app#19
Summary
Introduces a new overview renderer.
In order to display big datasets the columns are rendered onto a canvas. With this approach it is possible to give an overview over very large datasets.
The user is also able to define an expand area. This can be done bei holding down the ALT-key and draging a selection area:
The expand selection is displayed in a seperate column:
The user can expand the selected area to see the row details: