Yes, as of v3.0, the extensions are no longer part of the “gojs” npm package. Instead, you can install them where you want by executing npm create gojs-kit.Then you can copy the files that you want into your project, or I suppose you could refer to them directly.
I assume you have some typos in what you wrote that are not in your code.
What is the value of “this” in ‘this.isGroupForNodeData is not a function’?
Certainly the GraphLinksModel.isGroupForNodeData method has been present forever. And I don’t think the CommandHandler.archetypeGroupData property setter has changed in a long time either.
The format/schema used by Model.toJson and Model.fromJson has not changed between 2.3 and 3.1.
Something seems very wrong in your environment. Are you sure that the only change you made was to update the version of GoJS? You didn’t also make changes to other libraries or to your code?
I have started from scratch, ran npm install goj, comment out all extentionsm such as port shifting too and Tablelayout and tried to use native gojs 3.1. Once again, i got when adding a node
Something is very wrong with your configuration. Looking at the code, I do not see how it is possible to get that error.
isGroupForNodeData is a public method on GraphLinksModel. If you are getting that error, clearly the object on which that method is being called is not an instance of GraphLinksModel.
It is called from GraphLinksModel.isGroupForData, which is an internal method for deciding whether or not some node data should be treated as if it were a group. The code is:
That _isGroupModel predicate is an internal method that returns true only if the model is a GraphLinksModel. Because the name starts with an underscore, the name will be minified in the library.
So unless your environment has somehow modified the prototypes of the GoJS classes or the instances of those classes, I do not see how you could be getting that error.
Some possibilities are:
The GoJS library is being loaded more than once, especially if you are loading different versions of the GoJS library – say both the 2.3 and the 3.1 versions
The public Model and GraphLinksModel classes, and the internal PartManager and GraphLinksPartManager classes, are being modified
Incorrect minification has messed up the classes. The GoJS libraries are already minified, so if your build process is minifying them again, maybe there’s some bug being introduced.
Your code is depending on undocumented functionality, especially minified names, so of course that code won’t work any more with a newer library.
Maybe there are other reasons for this error.
If you replace the GoJS 3.1 library with a 2.3 library, and make no other changes, does everything work again? What if you try with a 3.0 library? I hope you have reviewed the 3.0 change log so that you can see whether any of the incompatibilities apply to your code.
I have started from scratch, ran npm install goj, comment out all extentionsm such as port shifting too and Tablelayout and tried to use native gojs 3.1. Once again, i got when adding a node
Which module system are you using? In other words, which library file are you loading? And how are you referring to it?
I’m wondering if there is a module mismatch.
Check all places where you load models and where you set Diagram.model. Maybe what is being assigned isn’t really a GraphLinksModel. Grab the value in the console and evaluate whether it is an instanceof go.GraphLinksModel.