|
1 |
| -# Flow |
| 1 | +# Minimap |
2 | 2 |
|
3 | 3 | **Selector:** f-minimap
|
4 | 4 |
|
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. |
6 | 6 |
|
7 | 7 | ## Inputs
|
8 | 8 |
|
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`. |
30 | 10 |
|
31 | 11 | ## Styles
|
32 | 12 |
|
33 | 13 | - `.f-component` A general class applied to all F components for shared styling.
|
34 | 14 |
|
35 |
| - - `.f-flow` Specifically targets the **FFlowComponent**, allowing for unique styling. |
| 15 | + - `.f-minimap` Specifically targets the **FMinimapComponent**, allowing for unique styling. |
36 | 16 |
|
37 | 17 | ## Usage
|
38 | 18 |
|
39 | 19 | ```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> |
41 | 24 | ```
|
42 | 25 |
|
43 | 26 | ## Examples
|
44 | 27 |
|
45 | 28 | #### 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. |
48 | 31 |
|
49 | 32 | ::: ng-component <simple-flow></simple-flow>
|
50 | 33 | [component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/simple-flow/simple-flow.component.html
|
51 | 34 | [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/simple-flow/simple-flow.component.ts
|
52 | 35 | [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/simple-flow/simple-flow.component.scss
|
53 | 36 | :::
|
54 | 37 |
|
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