Coder Social home page Coder Social logo

Comments (4)

WalterNorthwoods avatar WalterNorthwoods commented on May 21, 2024
  1. Yes, the nodeDataArray is required.
  2. No, the modelData is not required -- it is only the shared data for the whole model, which may be used even if there are no nodes at all. However, it is infrequently used. https://gojs.net/latest/api/symbols/Model.html#modelData
  3. Your initDiagram function should not be assigning Diagram.model, since passing the nodeDataArray will update the Model.nodeDataArray both initially as well as whenever that @input is changed. However, there shouldn't be any penalty for doing so other than wasted time and space.

https://gojs.net/latest/intro/angular.html

By the way, I was unable to run your stackblitz sample, even using two different browsers.

from gojs-angular.

anuj9196 avatar anuj9196 commented on May 21, 2024

@WalterNorthwoods may be I'm doing it wrong.

I tried again and I'm attaching the screenshot of each scenario.

  1. By removing dia.model = new go.TreeModel(this.familyData);
    https://ibb.co/sjtH6Qn

  2. By removing [modelData]="familyData"
    https://ibb.co/vVR281t

  3. By removing [nodeDataArray]="familyData"
    https://ibb.co/xCfJ6Z2

You can see in all the screenshots the diagram is not as expected and in the 3rd one, it's working even without nodeDataArray although diagram is not rendered but legend is there.

with modelData removed, its giving error in the console.

from gojs-angular.

WalterNorthwoods avatar WalterNorthwoods commented on May 21, 2024
  1. Yes, because the default model is a GraphLinksModel, but your app wants to use a TreeModel, you do need to set dia.model = new go.TreeModel();. But you shouldn't need to pass the node data array at that time.
  2. That looks like a bug. Thanks for reporting it. For now you can just pass an empty object.
  3. We'll investigate this tomorrow.

from gojs-angular.

rjohnson465 avatar rjohnson465 commented on May 21, 2024

Re: 2) I just released gojs-angular 1.0.1, which makes the "modelData" @input property for Diagram / Palette Components truly optional. You can now install it via npm or download it from the repo here

Re: 3) Yes, your Diagram will still render if you do not provide a nodeDataArray property (or linkDataArray property), but of course, it has no Nodes to render, so it appears blank.

from gojs-angular.

Related Issues (13)

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.