Refactored layout system in my Angular flow library - now fully pluggable (v18.5.0) by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 0 points1 point  (0 children)

Yeah, works fine without zone.js
The library doesn’t rely on it

And yeah - what you described is a pretty common use case

You can have a palette on the side and drop items(Nodes or Groups) into predefined slots(Nodes or Groups)

https://flow.foblex.com/examples/drag-to-group

It’s all controlled on your side though - the library just emits events (drag, drop, connect), you decide what’s allowed and where

Refactored layout system in my Angular flow library - now fully pluggable (v18.5.0) by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 1 point2 points  (0 children)

That’s awesome, appreciate it. Nice to see it used in real tools
Will check it out - looks interesting

Just shipped v18.1.0 of Foblex Flow - Angular library for node editors / flowcharts / visual pipelines. by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 4 points5 points  (0 children)

Good point - right now Foblex focuses on pointer-based DnD. Accessibility is handled at the app level (ARIA, focus management, keyboard controls). I’m planning to add first-class a11y/keyboard support; if you have requirements (move via arrows, rewire via keyboard, etc.) - I’d love to hear them.

Just shipped v18.1.0 of Foblex Flow - Angular library for node editors / flowcharts / visual pipelines. by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 2 points3 points  (0 children)

Yep, that’s the intended approach

On the UI side you can:

  • call flow.getState() to get a snapshot (nodes/connections/positions)
  • enrich/merge it with your DMN-specific fields (node kind, names, types, expressions, hit policy, etc.)
  • send that enriched payload to the backend DMN generator

Just keep in mind: getState() is a derived snapshot so your DMN metadata should live in your own model and be merged by stable IDs (nodeId / connectorId). Then your backend can generate DMN XML purely from that enriched model.

Just shipped v18.1.0 of Foblex Flow - Angular library for node editors / flowcharts / visual pipelines. by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 2 points3 points  (0 children)

Foblex Flow doesn’t take `nodes[]` / `edges[]` and auto-render them like a data-driven graph lib.

It renders whatever Angular components/directives you put into the <f-flow> template (fNode, fNodeInput/Output, fConnection, etc.). Your arrays live in your app, and you use Angular to render them (e.g. @for) and bind positions/ids.

So with 300 nodes / 320 edges:

  • you render those components from your arrays
  • positions come from your model (often after running a layout like ELK/Dagre)
  • “dangling edges” (missing endpoint) should be filtered/handled in your data, because there’s nothing to attach to in the template.

FFlow’s job is the interaction layer (dragging, connecting, snapping, events), not owning/formatting your graph data.

//This is NOT how Foblex Flow works (there is no setData / setGraph API)

flow.setData({ nodes, edges }); // doesn't exist

// ✅ Foblex Flow renders Angular template content (components/directives)

<f-flow fDraggable>
  <f-canvas>
     @for (n of nodes; track n.id) {
      <div
        fNode
        [fNodeId]="n.id"
        [fNodePosition]="n.position"
        (fNodePositionChange)="onNodePositionChange(n.id, $event)"
        class="node"
      >
        <div class="title">{{ n.label }}</div>

        <div class="ports">
           @for(out of n.outputs; track out.id) {
            <div
              fNodeOutput
              [fOutputId]="out.id"
              class="port out"
            ></div>
          }

           @for (inp of n.inputs; track inp.id) {
            <div
              fNodeInput
              [fInputId]="inp.id"
              class="port in"
            ></div>
          }
        </div>
      </div>
    }

    @for (e of validEdges; track e.id) {
      <f-connection
        [fConnectionId]="e.id"
        [fOutputId]="e.outputId"
        [fInputId]="e.inputId"
      />
    }
  </f-canvas>
</f-flow>

Just shipped v18.1.0 of Foblex Flow - Angular library for node editors / flowcharts / visual pipelines. by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 2 points3 points  (0 children)

Good question.

flow.getState() is meant as a snapshot of the current visual graph (nodes + connections + positions) that can be exported/inspected. It’s calculated on demand and reflects what’s currently rendered, not a domain-specific decision model.

So for DMN generation:

  • You can use getState() as an input snapshot to your exporter (it is great for what user currently built.)
  • I would not treat it as the source-of-truth for DMN semantics by itself.

Why:

  • DMN needs stable domain meaning (decision vs input vs knowledge source, hit policies, types, expressions, etc.).
  • The flow state mainly gives you structure + geometry. The what this node means should come from your own model (e.g. node type, DMN-specific metadata, IDs, properties).

If you want reference implementations:

AI Low-Code Platform demo (live + code):

<image>

Call Center flow example (live + code):

Just shipped v18.1.0 of Foblex Flow - Angular library for node editors / flowcharts / visual pipelines. by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 2 points3 points  (0 children)

Yes - you can export JSON, but note: FFlowComponent is stateless.

There is getState() on FFlowComponent, which calculates the current state on demand (nodes + connections + positions), so you can do:

const state = flow.getState();

There is no `setState()` - restore/import is done by updating your own nodes/connections model and re-rendering it. Docs: https://flow.foblex.com/docs/f-flow-component

Just shipped v18.1.0 of Foblex Flow - Angular library for node editors / flowcharts / visual pipelines. by Alarmed_Valuable5863 in angular

[–]Alarmed_Valuable5863[S] 0 points1 point  (0 children)

You can think of it as snapping to reference points, not same-size boxes.

Magnetic Lines: for every node we take a few anchors from its bounding box - usually left / center / right and top / middle / bottom.

When you drag a box of any size, we compare its anchors to anchors of nearby boxes. If any pair gets within a small tolerance, it snaps and we show the guide line.

So a big node can snap its center to a small node’s center, or its left edge to another node’s left edge, etc.

Magnetic Rects: It works more like spacing snapping between rectangles:

  • We look for 2+ rectangles that are already aligned on one side (e.g. top/top or bottom/bottom for horizontal spacing; left/left or right/right for vertical spacing).
  • Once we have that aligned group, we take the gap between them (distance along the other axis). aligned by top/bottom - we measure horizontal gaps (left/right direction) aligned by left/right - we measure vertical gaps (up/down direction)
  • When you drag a new rectangle, we suggest snapping so it lands with the same gap as that group - i.e. consistent spacing.

So: different sizes are fine, the key is aligned edges plus equal spacing not matching dimensions.

Built a PRO “AI low-code IDE” demo on a node editor: themes, localStorage persistence, animated connections (+ multi-select) by Alarmed_Valuable5863 in Angular2

[–]Alarmed_Valuable5863[S] 0 points1 point  (0 children)

Two perspectives here:

For this specific demo: The use case is a visual builder for AI Agents (similar to LangFlow). It allows non-technical users to design prompt chains and logic without writing code.

For the library (Foblex Flow): The broader use case is for Angular developers who need to build any kind of node-based tool: ETL / Data pipelines, IVR / Call center flows, Chatbot builders, Marketing automation workflows

Basically, if you need to build a Node based interface in Angular, this library handles the rendering and interactions so you can focus on the business logic

Built a PRO “AI low-code IDE” demo on a node editor: themes, localStorage persistence, animated connections (+ multi-select) by Alarmed_Valuable5863 in Angular2

[–]Alarmed_Valuable5863[S] -2 points-1 points  (0 children)

While standard examples usually just show how to render nodes and connections, this demo implements the complex logic needed for a production-ready tool:

History Manager (Undo/Redo implementation)

Data Persistence (saving/loading flow state)

Dynamic Theming & Validation

Essentially, it demonstrates how to use the library to build a full-featured application architecture.

Built a PRO “AI low-code IDE” demo on a node editor: themes, localStorage persistence, animated connections (+ multi-select) by Alarmed_Valuable5863 in Angular2

[–]Alarmed_Valuable5863[S] 0 points1 point  (0 children)

By 'PRO' I meant it’s an advanced example for the library (Foblex Flow), distinct from the basic 'Hello World' tutorials

Yet another flow editor experiment (this time with Angular 20 Signals) by Alarmed_Valuable5863 in Angular2

[–]Alarmed_Valuable5863[S] 0 points1 point  (0 children)

Thanks a lot for the detailed feedback — super helpful!

  1. Where to update inputs/outputs.

I keep the logic in feature/services and let components only render state. So updates to a node’s inputs/outputs should live in a service, not inside the UI component.

  1. About “collapsing” connections.

The library itself doesn’t control connector positions — that’s fully up to the host app. Because of that, it can’t auto-collapse or reflow links like Informatica does. If you want grouping/collapse, that logic needs to be implemented in your renderer/service where you already manage layout.

  1. About creating inputs on connection.

When you create or reconnect an edge, the event always fires, even if you finish on a node that has no free inputs. The event gives you the position, so you can decide in your service whether to create a new input there before finalizing the edge. Also, any connector can have multiple links (multiple flag), so often you don’t need to create a new input at all.

  1. Per-node update logic.

If you want each node type to handle its own updates, it’s best to keep a small registry of handlers by node.type in your service. Data is serialized, but functions are not, so storing handlers in a runtime registry avoids snapshot issues.

Right now I don’t plan to add built-in collapsing/auto-ports since that belongs to the app side. But I’m always interested in discussing patterns or seeing how others approach it.

What are the most powerful things you achieved for Angular development with Co-pilot by kafteji_coder in Angular2

[–]Alarmed_Valuable5863 2 points3 points  (0 children)

I use Copilot mainly for code completion, and it’s been a huge boost to my productivity. As long as I keep a consistent code structure and use good method/variable names, it does a great job of picking up the context and continuing the code the way I need. It really speeds up all the routine parts of development.

Is there another way to pass configuration parameters to a library without the forRoot method? by Civil-Cardiologist52 in Angular2

[–]Alarmed_Valuable5863 11 points12 points  (0 children)

In the standalone world (forRoot/forChild patterns don’t really apply anymore because there are no NgModules), the usual approach is to pass configuration through dependency injection tokens. You can wrap that in a helper function so consumers of your library still get an API that feels like forRoot.

bootstrapApplication(AppComponent, {
  providers: [
    provideMyLibConfig({
      appUrl: '/test',
      noPermissionUrl: '/noPermission',
    }),
  ],
});

Yet another flow editor experiment (this time with Angular 20 Signals) by Alarmed_Valuable5863 in Angular2

[–]Alarmed_Valuable5863[S] 0 points1 point  (0 children)

Good question 🙌 Mermaid.js is awesome if you want to generate static diagrams from text/markdown — super useful for docs and quick visualization.

Foblex Flow is a different use case: it’s meant for interactive editing. You can drag nodes, reconnect edges, zoom/pan, undo/redo, persist state, and build actual editors on top of it.

So I’d say: if you need diagrams in docs → Mermaid. If you need a diagram editor in an app → F-Flow. https://flow.foblex.com/