-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
269 additions
and
46 deletions.
There are no files selected for viewing
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
56 changes: 56 additions & 0 deletions
56
projects/atft/src/lib/actor/data-center/layout/dagre-composition.component.ts
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,56 @@ | ||
import {Component, EventEmitter, Input, Output} from '@angular/core'; | ||
import {provideParent} from '../../../util'; | ||
import {EmptyComponent} from '../../../object'; | ||
|
||
@Component({ | ||
selector: 'atft-dagre-composition', | ||
providers: [provideParent(DagreCompositionComponent)], | ||
template: ` | ||
<atft-plane-mesh atft-raycaster-group [width]="width" [height]="height" [materialColor]="color" (mouseEnter)="onSelected()" | ||
(mouseExit)="onDeselected()"> | ||
<atft-text-mesh [centered]="true" [text]="name" size="3" [translateY]="translateLabelY" | ||
materialColor="0xE0E0E0"> | ||
</atft-text-mesh> | ||
</atft-plane-mesh> | ||
` | ||
}) | ||
export class DagreCompositionComponent extends EmptyComponent { | ||
|
||
@Input() name: string; | ||
|
||
private _height: number; | ||
@Input() | ||
set height(hight: number) { | ||
this._height = hight; | ||
this.translateLabelY = this._height / 2 - 5; | ||
} | ||
|
||
get height(): number { | ||
return this._height; | ||
} | ||
|
||
@Input() width: number; | ||
|
||
|
||
|
||
@Output() render = new EventEmitter<void>(); | ||
@Output() selected = new EventEmitter<void>(); | ||
@Output() deselected = new EventEmitter<void>(); | ||
|
||
color = 0xA0A0A0; | ||
|
||
translateLabelY: number; | ||
|
||
public onSelected() { | ||
this.color = 0xA4A4A4; | ||
} | ||
|
||
public onDeselected() { | ||
this.color = 0xA0A0A0; | ||
} | ||
|
||
public onClick() { | ||
this.color = 0xA0A0A0; | ||
} | ||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
projects/atft/src/lib/actor/data-center/layout/dagre-node.component.ts
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,15 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {AbstractObject3D, EmptyComponent} from '../../../object'; | ||
import {provideParent} from '../../../util'; | ||
|
||
@Component({ | ||
selector: 'atft-dagre-node', | ||
providers: [provideParent(DagreNodeComponent)], | ||
template: '<ng-content></ng-content>' | ||
}) | ||
export class DagreNodeComponent extends EmptyComponent { | ||
|
||
@Input() composition: AbstractObject3D<any>; | ||
|
||
@Input() translateZ = 1; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from './dagre-layout.component'; | ||
export * from './dagre-node.component'; | ||
export * from './dagre-edge.component'; | ||
export * from './dagre-composition.component'; | ||
|
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.