-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
TypeScript examples #135
Comments
Hi @Thomaash, I would like to contribute in this project, I have created a little Angular project with one example of custom nodes and custom edges, however, I have an error related with include vis-util, vis-data and moment. Should it be necessary to include those dependencies in my project? Those dependencies are included in the vis-network library, could you help me, please? |
Hi @jrodva, please, switch to standalone (CSS, Util and Data are bundled, TS declarations are not) or peer (CSS, Util and Data have to be loaded separately) build for examples. The legacy one is kept only for backwards compatibility, has issues and we don't want to encourage people to use it hence https://visjs.github.io/vis-network/examples/network/basic_usage/legacy.html saying: Please don't use this. Eventually it will be deprecated and removed entirely. Regarding the error it is always necessary to include the dependencies because the declarations reference them. My attempts to bundle the types into a neat single file so far always failed. |
PS: You can import like |
Thank you @Thomaash. I will try with those recommendations. |
@tomap I kept your instructions(my repository is updated) and I had another different error: |
Now I have the base ready, what are the next steps to include this project like a Typescript example? I can create more examples in this project and add tests if it's necessary. |
To be honest I have no idea. All examples so far were simple pages simply placed among examples. There were never any build steps etc. |
So after checking it out I found out it loads it's files from the root of the server it's started on not relatively. In other words as it is at the moment it can't be deployed on GH Pages at all not mentioning coexisting with other projects. Also clicking the add new node button more than once causes errors. And one last thing I wouldn't call this TypeScript example but rather Angular example. When I opened this I meant pure TypeScript without any framework. |
I have just fixed the error with the add new node button, thank you for your Q&A. Now, I got it what you wanted to say, in the future I will create a Typescript project without any framework. |
Thanks and just to note I'm not opposed to having Angular examples. As long as people use it's great to have some examples to have them started. It's just not what I meant when I opened this issue. I'll have to think of a way to include this in the examples. I'd like to do it in a way that people could simply open it without installing and building anything just like with the other examples. |
Ok, don't worry. I think that https://stackblitz.com/ is a good option, even it's possible to include easily it in any web https://stackblitz.com/docs#embedding. |
I created Typescript examples and raise a pull request: #617. I am using React + Typescript and created placeholder to add more examples. Please review and advise. |
I have managed to progress with this stuff in Angular 8 as described in #679. Unfortunately there is some problem with Canvas I can't solve without community help |
+1 |
I'm also a TypeScript developer trying to install with NPM:
when i try to compile it gave errors about vis-data not being found. So then I installed it:
I'm trying to import like this:
but I just keep getting compile errors like this:
anyone ever figured out how to get TypeScript actually working ? |
Hi @Clay-Ferguson, this is very offtopic, could you create a separate issue to track this, please? Thanks. |
This looked like the topic for why UPDATE: it's done. new issue created. In case you wanted to delete my posts in here. :) |
Since Vis Network has official TypeScript support now there should be examples in TypeScript to help people get started.
The text was updated successfully, but these errors were encountered: