Skip to content

Commit ccbdb99

Browse files
docs: Added minimap documentation
1 parent a8c5812 commit ccbdb99

File tree

5 files changed

+17
-38
lines changed

5 files changed

+17
-38
lines changed

projects/f-flow/src/f-minimap/f-minimap-flow.directive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class FMinimapFlowDirective {
1515
public model: FMinimapData;
1616

1717
@Input()
18-
public fMinSize: number = 3000;
18+
public fMinSize: number = 1000;
1919

2020
public get hostElement(): SVGSVGElement {
2121
return this.elementReference.nativeElement;

projects/f-flow/src/f-minimap/f-minimap.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class FMinimapComponent implements AfterViewInit, OnDestroy, IFDragAndDro
4040
public fMinimapView!: FMinimapViewDirective;
4141

4242
@Input()
43-
public fMinSize: number = 3000;
43+
public fMinSize: number = 1000;
4444

4545
constructor(
4646
private elementReference: ElementRef<HTMLElement>,

projects/f-flow/src/infrastructure/pipeline/pipeline.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class Pipeline<TRequest, TResponse>
88

99
private validator?: Type<IValidator<TRequest>>;
1010
private execution!: Type<IExecution<TRequest, TResponse>>;
11-
11+
1212
public handle(request: TRequest, injector: Injector): TResponse | void {
1313
let isValid: boolean = true;
1414
if (this.validator) {

public/docs/en/environment.ts

+4
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ function extendsGroup(): INavigationGroup {
181181
link: 'f-line-alignment-component',
182182
text: 'Line Alignment',
183183
},
184+
{
185+
link: 'f-minimap-component',
186+
text: 'Minimap',
187+
}
184188
],
185189
}
186190
}

public/docs/en/f-minimap-component.md

+10-35
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,37 @@
1-
# Flow
1+
# Minimap
22

33
**Selector:** f-minimap
44

5-
The **FFlowComponent** manages the flow of draggable and connectable elements within a visual canvas. It allows for dynamic creation, positioning, and interaction of elements, supporting features such as element connections, layout calculation, and event handling.
5+
The **FMinimapComponent** provides a miniature view of the larger flow, allowing users to navigate and interact with the flow efficiently. It supports features like zooming, panning, and visual representation of the flow layout. The minimap dynamically updates based on the changes in the main flow, ensuring an accurate representation.
66

77
## Inputs
88

9-
- `fFlowId: string;` The unique identifier for the component instance. Automatically generated. Default: `f-flow-${uniqueId++}`
10-
11-
## Outputs
12-
13-
- `fLoaded: EventEmitter<void>;` Emits an event when the flow has fully loaded and initialized.
14-
15-
## Methods
16-
17-
- `getNodesRect(): IRect;` Returns the bounding rectangle of all nodes in the flow.
18-
19-
- `getSelection(): FSelectionChangeEvent;` Returns the current selection state of the flow.
20-
21-
- `selectAll(): void;` Selects all items in the flow.
22-
23-
- `select(node: string[], connections:[]): void;` Selects the specified nodes and connections in the flow.
24-
25-
- `clearSelection(): void;` Clears the selection state of all nodes and connections in the flow.
26-
27-
- `redraw(): void;` Calls the redraw method on all nodes and connections in the flow.
28-
29-
- `getPositionInFlow(position: IPoint): void;` Returns the position of the point relative to the flow.
9+
- `fMinSize: number;` The minimum size of the bounding box that encloses all nodes in the minimap. It ensures that the minimap does not shrink below this size, even if the actual flow is smaller. This helps maintain the usability and visibility of the minimap. `Default: 1000`.
3010

3111
## Styles
3212

3313
- `.f-component` A general class applied to all F components for shared styling.
3414

35-
- `.f-flow` Specifically targets the **FFlowComponent**, allowing for unique styling.
15+
- `.f-minimap` Specifically targets the **FMinimapComponent**, allowing for unique styling.
3616

3717
## Usage
3818

3919
```html
40-
<f-flow [id]="customId" (fLoaded)="loaded()"></f-flow>
20+
<f-flow>
21+
...// Other components
22+
|:|<f-minimap [fMinSize]="customSize"></f-minimap>|:|
23+
</f-flow>
4124
```
4225

4326
## Examples
4427

4528
#### Basic Example
46-
47-
Example of two connected nodes without dragging functionality. The nodes are connected by a connection line from the output of the first node to the input of the second node.
29+
30+
This example shows a basic implementation of the minimap component within a larger flow, providing users with an overview and easy navigation capabilities.
4831

4932
::: ng-component <simple-flow></simple-flow>
5033
[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/simple-flow/simple-flow.component.html
5134
[component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/simple-flow/simple-flow.component.ts
5235
[component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/simple-flow/simple-flow.component.scss
5336
:::
5437

55-
#### Adding Dragging Functionality
56-
57-
Let's add the [fDraggable](f-draggable-directive) directive to the f-stream to enable dragging functionality. Also, we need to add the [fDragHandle](f-drag-handle-directive) directive inside [fNode](f-node-directive) to specify the handle for dragging.
58-
::: ng-component <draggable-flow></draggable-flow>
59-
[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/draggable-flow/draggable-flow.component.html
60-
[component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/draggable-flow/draggable-flow.component.ts
61-
[component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/draggable-flow/draggable-flow.component.scss
62-
:::

0 commit comments

Comments
 (0)