Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 19 05:41
    sinanyaman95 opened #897
  • Oct 18 16:29
    danielbarion commented #891
  • Oct 18 15:37
    aaron-michaux commented #360
  • Oct 18 15:36
    aaron-michaux commented #360
  • Oct 18 00:28
    LeifAndersen commented #38
  • Oct 15 09:13
    dberardo-com commented #375
  • Oct 14 17:55
    aaron-michaux opened #896
  • Oct 14 16:06
    DaSilvaRemi opened #895
  • Oct 14 12:53
    jbflow commented #232
  • Oct 14 12:50
    jbflow edited #894
  • Oct 14 12:50
    jbflow opened #894
  • Oct 12 03:28
    LLOUIS03 opened #893
  • Oct 09 00:14
    bold881 commented #678
  • Oct 08 12:56
    sudha53633 edited #892
  • Oct 08 12:48
    sudha53633 edited #892
  • Oct 08 09:59
    sudha53633 edited #892
  • Oct 08 08:21
    sudha53633 opened #892
  • Oct 08 01:18
    aaron-michaux commented #617
  • Oct 07 18:41
    aaron-michaux commented #879
  • Oct 07 18:40
    aaron-michaux commented #889
Andrej-jigx
@Andrej-jigx
@all @dylanvorster @renato-bohler @m-brantheim @imaGuru Hi guys....I have a quick question. I just start work with projectstorm/react-diagrams but problem is when I install everything from the documentation a I have this error:
error.png
Could you please help me with that?
damn-at
@damn-at
@Andrej-jigx check projectstorm/react-diagrams#598
@SQLGate already open sourced?
ygrossm
@ygrossm
Hello, i want to create editable chart for editing questions and answers. somehow i find it not simple. maybe someone can assist. my code is here - https://github.com/urgent/jolene/tree/master/src. the target editable chart i am trying yo create described at this pic - https://drive.google.com/file/d/1KEtZtTvVfL5BwHQTWbzKLVFPvbiWIZNF/view?usp=sharing . is there anyone that can assist to get to this goal ?
Anders Jürisoo
@ajthinking

Hi @ygrossm, cool idea! Not sure I will be able to assist very well as Im new to TS.

Anyways, I did implement a similar dynamic port thing, where ports are created from an array. Maybe you can find some inspiration there (even though its not perfect)

Also shouldn't you be using your own models? In the factory and a few other places you refer to the default models?

Good luck :)

Renato Böhler
@renato-bohler

Huh, just discovered that PostgreSQL pgAdmin4 project uses react-diagrams hehe

postgres/pgadmin4@0c8226f

Good stuff
Vamshi Krishna Chippa
@iamvamshi
Hey All,
Where can we set allowLooseLinks={false}
2 replies
Vitchenko Vladislav
@Oladik123
image.png
Hello! Does anyone know why when we call generateModel here we do not pass initial config like we do when we generate layer or node? NodeModel.ts from react-diagrams-core on screenshot
Hemant Ranvir
@hr-ing:matrix.org
[m]
did anyone find solution for this?
projectstorm/react-diagrams#726
Vishal Diyora
@vishal87_gitlab
Hey Guys, This is awesome library. I'm creating custom node and custom link using the demo in the demo https://github.com/projectstorm/react-diagrams/tree/446cc8cdffc506adb9a7a2b9466dfe6b6bcd42e3/demos/demo-custom-link1 and https://github.com/projectstorm/react-diagrams/tree/master/diagrams-demo-project .
I have couple of questions.
Can I create a link without creating port between nodes?
Can I have N number of links at different location in the nodes?
Attached design above
Sinan Yaman
@sinanyaman95
The smart routing example on the storybook doesn't show any links? Is it getting updated?
Dylan Vorster
@dylanvorster
Probably a regression after the updates i did a few days ago
Ill look later today
Big Bad Waffle
@BigBadWaffle_gitlab

Hi all! Quick (fairly common I bet) question...

  • I have a custom node with a function on the model to update a property
  • I'd like the widget to be redrawn afterwards
  • What is the correct pattern to do this?
  • Calling repaintCanvas isn't doing anything but manually dragging the node DOES cause the changed option value (it's displayed in the widget) to appear
  • Calling repaintCanvas in a setTimeout also doesn't work
  • The node I'm modifying is currently selected
  • Deselecting the node performs the redraw
  • Overriding performanceTune to return false on the model doesn't work
  • Calling model.clearSelection() DOES work

Thanks in advance!

9 replies
Vamshi Krishna Chippa
@iammrvkc_gitlab
Hey @renato-bohler,
Could you pls help me out to built right click options on node. I guess you made it in your project for copy, paste, zoom etc
Andrej-jigx
@Andrej-jigx
Hi guys can some1 help me? How can I create my custom node with name, inputs and outputs. I check every demo but I’m still litle confused. Can some1 make tutorial or documentation abou thath?
wxrl
@wxrl
Is there a close-to-step-by-step setup instruction for beginners? Sorry but current doc is just not clear enough... Having same problems when trying the demos as @EbiPenMan mentioned above... Thanks!
chakripy
@chakripy
Hi Everyone, Could someone please tell how to access the connected ports in the format of json. The user connects different ports. At the end of the task, how can I know the connections between the ports.
3 replies
nsabhani14
@narendra-sabhani

Hi Everyone,

is there a way to drag node on link and auto-connect to that link?

Let's say i have a two nodes Node1 and Node2, and both the node are connected with default link (link1). Now i also have another node named as Node3, which is not connected to any link.

When dragging Node3 and drop on link1, Node3 should placed between Node1 and Node2 and connected to link1.

How to achieve this. Please help me.

snufkin877
@snufkin877
Hello! Is it possible to selects a link and then presses the keyboard delete \ backspace key in order to delete it? How can I implement it?
2 replies
gima35
@gima35
Hi everyone! Is it possible to change the font of a single port in a node?
1 reply
Anders Jürisoo
@ajthinking

Problems migrating to TS

Im migrating my react-diagram app to TS but have issues when inheriting from react-diagrams classes. Here is my PortModel.js:

import { DefaultPortModel } from '@projectstorm/react-diagrams';

export default class PortModel extends DefaultPortModel {
    constructor(options) {
        super({
            ...options,
            // Make id easier on humans
            id: `Port_${options.name}_on_${options.parent.options.id}}`
        });
    }
}

After renaming it to PortModel.ts I get this message

Class constructor DefaultPortModel cannot be invoked without 'new'

It seems I have some transpilation/versioning issue. Though I have lots of TS other files migrated already and it works fine...

Configs:

tsconfig.json

{
    "compilerOptions": {
      "module": "commonjs",
      "removeComments": true,
      "preserveConstEnums": true,
      "sourceMap": true,
      "lib": [
        "es2019",
        "dom"
      ],
    }
}

.babelrc

{
    "plugins": [
        ["@babel/plugin-proposal-decorators", { "legacy": true }],
        "@babel/plugin-proposal-class-properties"
    ]
}

Any remedy for my situation?

2 replies
ratnajeetshyamkunwar
@ratnajeetshyamkunwar
Hi everyone, I am working on a diagram with 700+ nodes. It seems during deserialization, the performance drops significantly. It takes more than 40 seconds to load the graph. Anybody else facing the same problem? How can I enhance the performance?
1 reply
SamuelOsborne
@samuelOsborne

Hello! I picked up the lib today and doing quite well. I'm trying to see if it is possible to only export nodes + their links to .json. Using serialization makes a massive file and i'm having a hard time reading through if theres anything like I want in it.

If anyone knows or could point me in the direction to export only nodes and their links to .json, it would be a great help.

Cheers.

ps: using custom nodes if that makes a difference

5 replies
Anders Jürisoo
@ajthinking
carbon (6).png
Sara Quispe
@sarastef
Hello, I'm trying to make a project which have multiples CanvasWidget, but the performace for the others was too bad, there some ways to render multiples engines ?
cmarshall10450
@cmarshall10450
Hi. I'm trying to create an insepctor form where I can edit data within a node. I can store the selected node in a Redux store but I was wondering what the best way of updating the diagram is after editing data in the form.
1 reply
Anders Jürisoo
@ajthinking
How can I extend the setLocked method to also prevent zoom/drag? Pseudo of what I want: image.png
Aymen Marouani
@AymenMarouani
Hi all,
Thanks for the awsome library and the sharing on that chat room.
I'd like to ask a question
I want to delete a link in a given diagram
The combination SHIFT + LEFT CLICK + DELETE works very well
but I'd like to use only DELETE when the link is highlighted
is there any possibility to override this behaviour (no SHIT + LEFT CLICK keys combination) ?
2 replies
Thanks
Fikett
@Fikett
hi! How can i add feature to delete link on double mouse click?
Sinan Yaman
@sinanyaman95
It looks like DiagramEngine.recalculatePortsVisually is obsolete. What is the alternative for that? When I delete a port, previous links still point to the old port destination
Vadim Shvetsov
@vadimshvetsov

Hey all. Does anybody extended InputType with some sort of events, that CanvasWidget is not support from the box? I need to extend it with a drop event, but its impossible to be typesafe as I think. The main problem is that InputType enum can't be extended. Maybe someone has a solution I've can't imagine?

import { DragEvent } from 'react'
import {
  Action,
  CanvasEngine,
  ActionOptions,
  Mapping,
  ActionEvent,
} from '@projectstorm/react-canvas-core'

export enum MyInputType {
  MOUSE_DOWN = 'mouse-down',
  MOUSE_UP = 'mouse-up',
  MOUSE_MOVE = 'mouse-move',
  MOUSE_WHEEL = 'mouse-wheel',
  KEY_DOWN = 'key-down',
  KEY_UP = 'key-up',
  DROP = 'drop',
}

export interface MyInputTypeEventMapping extends Mapping {
  [MyInputType.DROP]: DragEvent
}

export interface MyActionOptions extends ActionOptions {
  type: MyInputType | any
  fire: (event: ActionEvent<MyInputTypeEventMapping[this['type']]>) => void
}

export class MyAction<
  T extends CanvasEngine = CanvasEngine
> extends Action<T> {
  constructor(options: MyActionOptions) {
    super(options)
  }
}

This is the only thing I've evolved but maybe there is a typesafe alternative?

wxrl
@wxrl
Hello all...This is a beautiful diagram pack, but anyone's got a demo with parameters (items and their values (values can be input by web users)) in each block for realizing a simple pipeline system UI? Input values need to be stored in a JSON file or so on the server for back-end program to do the calculation. New to JS/TS... Thanks!
Ben Szymkow
@simcof
I;m having some trouble getting the first basic demo working, getting: "TypeError: path is null"
Ben Szymkow
@simcof
Screen Shot 2021-07-08 at 11.47.06 am.png
Ben Szymkow
@simcof
I figured it out :) needed to force the height attribute of the CanvasWidget
Guidogl
@Guidogl

Is there a proper way to update state with useContext hook when creating a new node? Currently, it does update the sate but node doesn't show up on the screen.

const onNodeDrop = async (event: any) => {

        const nodeData = JSON.parse(event.dataTransfer.getData('storm-diagram-node'))

        const linkedTables = await getRelationships(nodeData.name, nodeData.source)

        const node = new MyNodeModel({
            activeColumns: nodeData.activeColumns,
            color: nodeData.tool ? '#2671B5' : "#e86c24",
            name: nodeData.name,
            source: nodeData.source,
            size: nodeData.size,
            keys: nodeData.keys,
            tool: nodeData.tool,
            items: nodeData.items,
            linkedTables: linkedTables,
        })

        const point = diagramEngine.getRelativeMousePoint(event)
        node.setPosition(point)

        diagramEngine.getModel().addNode(node)
        forceUpdate()

        triggerPreview(true)

        updatePreviewData({
             name: nodeData.name,
             source: nodeData.source,
             size: nodeData.size,
             keys: nodeData.keys,
             items: nodeData.items,
        })
    }

triggerPreview and updatePreviewData are set to update context. When I just use useState it seems to work ok.

Daniel McQuillen
@danielmcquillen_gitlab
Has anyone had a go at using ctrl-c ctrl-v to copy and paste nodes to and from clipboard? (Followed the 'clone' demo well enough but want to get keyboard-based operations going for multi-node select then copy and paste). BTW, thanks Dylan and all for a most excellent library...having such a good time working with it.
5 replies
Anders Jürisoo
@ajthinking

Hi @danielmcquillen_gitlab, saw you posted this the other day, could not find it in the history so reposting it:

When I shift-drag in my local experiments... SOME ERROR ...

Answer: YES. Also have this since I don't know when. I know that used to work at least a couple of months ago. Did you find a solution or workaround or reported it as an issue?

Daniel McQuillen
@danielmcquillen_gitlab