Comments (4)
- Yes, the
nodeDataArray
is required. - 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 - Your
initDiagram
function should not be assigning Diagram.model, since passing thenodeDataArray
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.
@WalterNorthwoods may be I'm doing it wrong.
I tried again and I'm attaching the screenshot of each scenario.
-
By removing
dia.model = new go.TreeModel(this.familyData);
https://ibb.co/sjtH6Qn -
By removing
[modelData]="familyData"
https://ibb.co/vVR281t -
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.
- 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. - That looks like a bug. Thanks for reporting it. For now you can just pass an empty object.
- We'll investigate this tomorrow.
from gojs-angular.
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)
- DiagramComponent - Stuck in an infinite recursive loop HOT 2
- Support for component method as callback to diagram events HOT 8
- (modelChange) not being triggered when the link object is custom and `data` prop modified HOT 4
- Gojs angular synclinkdata issue HOT 8
- GoJS with Angular 14.x works locally but not on Stackblitz HOT 8
- Cannot add property __gohashid, object is not extensible HOT 5
- Cannot add property __gohashid, object is not extensible HOT 14
- Cannot add property __gohashid, object is not extensible
- Compatibility Issue with Angular 16 Ivy Compilation HOT 1
- (Feature Request) support GoJS 3.0 and immer js 10 HOT 1
- No app.component file found in the solution HOT 2
- DataSyncService not getting custom linkKeyProperty or nodeCategoryProperty HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gojs-angular.