-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
1 parent
109fd15
commit 134c099
Showing
18 changed files
with
182 additions
and
32 deletions.
There are no files selected for viewing
22 changes: 17 additions & 5 deletions
22
projects/f-examples/connections/auto-snap/auto-snap.component.html
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
41 changes: 41 additions & 0 deletions
41
projects/f-examples/connections/connection-text/connection-text.component.html
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,41 @@ | ||
<f-flow fDraggable (fLoaded)="onLoaded()"> | ||
<f-canvas> | ||
<f-connection [fReassignDisabled]="true" | ||
fOutputId="1" fInputId="2" fBehavior="fixed" fType="segment" [fTextStartOffset]="fTextStartOffset" fText="Text 1"> | ||
</f-connection> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 0, y: 0 }" fNodeOutput fOutputId="1" fOutputConnectableSide="bottom"> | ||
I'm a node | ||
</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 300, y: 0 }" fNodeInput fInputId="2" fInputConnectableSide="top"> | ||
I'm a node | ||
</div> | ||
|
||
<f-connection [fReassignDisabled]="true" fOutputId="3" fInputId="4" fBehavior="floating" fText="Text 2" [fTextStartOffset]="fTextStartOffset"> | ||
</f-connection> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 0, y: 150 }" fNodeOutput fOutputId="3" fOutputConnectableSide="right"> | ||
I'm a node | ||
</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 300, y: 150 }" fNodeInput fInputId="4" fInputConnectableSide="left"> | ||
I'm a node | ||
</div> | ||
|
||
<f-connection [fReassignDisabled]="true" fOffset="10" fOutputId="5" fInputId="6" fType="bezier" fBehavior="fixed" fText="Text 3" [fTextStartOffset]="fTextStartOffset"> | ||
</f-connection> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 0, y: 300 }" fNodeOutput fOutputId="5" fOutputConnectableSide="bottom"> | ||
I'm a node | ||
</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 300, y: 300 }" fNodeInput fInputId="6" fInputConnectableSide="top"> | ||
I'm a node | ||
</div> | ||
</f-canvas> | ||
</f-flow> | ||
<div class="toolbar"> | ||
<mat-form-field appearance="fill" class="f-form-field"> | ||
<mat-label>Text Offset</mat-label> | ||
<mat-select panelClass="f-select-panel" [(value)]="fTextStartOffset"> | ||
@for (option of offsetOptions; track option) { | ||
<mat-option [value]="option">{{ option }}</mat-option> | ||
} | ||
</mat-select> | ||
</mat-form-field> | ||
</div> |
13 changes: 13 additions & 0 deletions
13
projects/f-examples/connections/connection-text/connection-text.component.scss
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,13 @@ | ||
@use "../../flow-common"; | ||
|
||
::ng-deep connection-text { | ||
@include flow-common.connection; | ||
} | ||
|
||
.f-node { | ||
@include flow-common.node; | ||
} | ||
|
||
.toolbar { | ||
@include flow-common.toolbar; | ||
} |
36 changes: 36 additions & 0 deletions
36
projects/f-examples/connections/connection-text/connection-text.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,36 @@ | ||
import { ChangeDetectionStrategy, Component, ViewChild } from '@angular/core'; | ||
import { FCanvasComponent, FFlowModule } from '@foblex/flow'; | ||
import { MatFormField, MatLabel } from '@angular/material/form-field'; | ||
import { MatOption } from '@angular/material/core'; | ||
import { MatSelect } from '@angular/material/select'; | ||
|
||
@Component({ | ||
selector: 'connection-text', | ||
styleUrls: [ | ||
'../../_mdc-controls.scss', | ||
'./connection-text.component.scss' | ||
], | ||
templateUrl: './connection-text.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [ | ||
FFlowModule, | ||
MatFormField, | ||
MatLabel, | ||
MatOption, | ||
MatSelect | ||
] | ||
}) | ||
export class ConnectionTextComponent { | ||
|
||
protected offsetOptions: string[] = [ '10', '25%', '30', '50%', '75', '100%' ]; | ||
|
||
protected fTextStartOffset: string = '50%'; | ||
|
||
@ViewChild(FCanvasComponent, { static: true }) | ||
protected fCanvas!: FCanvasComponent; | ||
|
||
protected onLoaded(): void { | ||
this.fCanvas.resetScaleAndCenter(false); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -23,6 +23,12 @@ | |
} | ||
} | ||
|
||
.f-node-output { | ||
&:not(.f-node) { | ||
border-radius: 4px; | ||
} | ||
} | ||
|
||
.toolbar { | ||
@include flow-common.toolbar; | ||
} |
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
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
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,19 @@ | ||
# Connection Text | ||
|
||
## Description | ||
|
||
This guide demonstrates how to add text to connections in Foblex Flow for Angular. To add text to a connection, you need to set the `fText` property of the connection component. The text will be displayed in the middle of the connection line. Also, you can set `fTextStartOffset` parameter to adjust the text position along the connection line. | ||
You can customize the text appearance using css styles. | ||
|
||
## Example | ||
|
||
::: ng-component <connection-text></connection-text> [height]="600" | ||
[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connections/connection-text/connection-text.component.html | ||
[component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connections/connection-text/connection-text.component.ts | ||
[component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connections/connection-text/connection-text.component.scss | ||
[common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss | ||
::: | ||
|
||
|
||
|
||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.