Giter VIP home page Giter VIP logo

Comments (6)

b4rtaz avatar b4rtaz commented on June 12, 2024 1

the local stored json look like this:

Yes, and this JSON should be set to the startDefinition variable.

If you use React you can implement it in this way:

const [definition, setDefinition] = useState(() => {
    const ls = localStorage['lastState'];
    return wrapDefinition(ls ? JSON.parse(ls) : { properties: {}, sequence: [] });
});

from sequential-workflow-designer.

b4rtaz avatar b4rtaz commented on June 12, 2024

Hello @kaleem-uet! I think you should save somewhere the definition before you navigate to a next page. It could be localStorage for example.

from sequential-workflow-designer.

kaleem-uet avatar kaleem-uet commented on June 12, 2024

I have stored it already in the local storage but how i can load the json to canvas (flow-diagram), starting from an empty page ?

from sequential-workflow-designer.

b4rtaz avatar b4rtaz commented on June 12, 2024
const definition = { /* ... */ }; // < here you set your JSON
Designer.create(placeholder, definition, { /* configuration */ });

We have a lot examples how to load the definition at start:

from sequential-workflow-designer.

kaleem-uet avatar kaleem-uet commented on June 12, 2024

I am using this libray with react js where the definition is:

const startDefinition: WorkflowDefinition = { type: "root", properties: { }, sequence: [] }

There is no doubt that when some one place createWrite() function "that is created already" in the sequence it will create the createWrite node when the canvas open but in my case,
the local stored json look like this:
{ "type": "root", "properties": {}, "sequence": [ { "id": "4a461004e0b7b9b164d007f784eec730", "componentType": "switch", "name": "if", "properties": {}, "branches": { "true": [], "false": [] } } ] }
and i want to make the flow from this json.

from sequential-workflow-designer.

kaleem-uet avatar kaleem-uet commented on June 12, 2024

@b4rtaz
Thanks 🙏 for the speedy responses and great support – your dedication has made using NoCodeJS a breeze!

from sequential-workflow-designer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.