-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default demo does not work, DataSet is undefined. #396
Comments
I got something similar. Same versions:
After removing |
strange, seems to not correctly re-exporting the constructor |
I have the same error with version 3.0.4. Any update on this? |
Until this get solved, just import DataSet from vis-data. |
I still get an error "Array or DataSet expected" at t.value (vis-network.min.js:84) |
Try this:
|
can you please , more in detail explain where to try this code? |
OK, I think I understand, what you mean. But I suppose I face with the problem, that you mentioned earlier:
|
Just had a quick look at this, and there is quite a lot wrong with it. In the network directive it's been updated to look for the properties visData and visOptions Yet the demo Template still uses the original repo's properties Another Example And the DataSet constructors now looks like this. So the Demo is using the first constructor and effectively stuffing the data in the options parameter. |
Not sure this is a good fix, but it solves the issue for me. See this StackOverflow answer In the case of this project, just use:
|
After migrating from ngx-vis from version 2 to version 3 and changing VisEdges to DataSet I got the same error:
importing DataSet from vis-data was the solution for now:
Do you plan to fix it? What dependencies should I have? Now I installed all:
|
after upgrading to:
Problem is back: Noting in code has changed. |
Hi, I got the same error as digit81 had. Is there any due date for a fix? Please provide a valid instructions on how to use the package with new versions of Angular.
Thx, |
you give [email protected] a try |
Hi, Thanks for the quick reply, I updated my npm install with: "ngx-vis": "^3.1.0-build1590696393", but the I cannot find the right way to import the components to the example: import { Only one component from this list (VisNetworkService) is OK, the others are rejected by the compiler. what is the right way to import? Thx, |
thank you @hypery2k . it worked |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
Running the provided network demo using demo/network/network-example.component.ts does not create nor display the graph.
Expected Behavior
The graph should be created and displayed.
Failure Information
When trying to create the DataSet using the new DataSet(...) constructor the program fails. The constructor in the compiled code is being run as:
this.nodes = new ngx_vis_1.DataSet([...])
Breakpointing at this location shows the ngx_vis_1.DataSet is undefined.
If you remove the wrapping constructor and simply run:
this.nodes = [...]
then the graph will display.
Steps to Reproduce
This issue can be seen in the following Stackblitz, in particular test.component.ts:
https://stackblitz.com/edit/angular-9-custom-elements-ffxu2j?file=src%2Fapp%2Ftest%2Ftest.component.ts
Reproduce code snippet
See code in stackblitz above.
Context
Angular Version: 9.0.7
ngx-vis: 3.0.4
All other dependency versions can be found in the stackblitz.
The text was updated successfully, but these errors were encountered: