-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
using dataforge in angular #3
Comments
Hi, I haven't used AngularJS since version 1, so please be aware that any instructions I have for you might be out of date. For a start, Data-Forge is TypeScript so you might just be able to install it via npm then import it into your AngularJS app as you would any other TypeScript module. I've used Data-Forge when I've made apps using AngularJS v1+ and I do have some instructions that will work for that. Browser installation: https://github.com/data-forge/data-forge-ts/blob/master/docs/guide.md#browser-installation-and-setup AngularJS v1+ usage: https://github.com/data-forge/data-forge-ts/blob/master/docs/guide.md#working-with-http-in-angularjs Hope this helps. Please let me know how it goes. Maybe you could help me update the instructions noce you figure it out? |
This worked perfectly to me, this lib can be "the" de-facto standard of dataframe in Angular! Thank you @ashleydavis so much, I will try to spread this library within my team:-)
|
Thanks mate! I'll add that to the docs. Don't forget to star the repo. You might also be interested to know that I'm writing a book on working with data in JavaScript. Please help spread the word! |
nah, I'm not super lucky :-(
and did some search seems it's normal for angular to not support fs... how did you solve this problem? |
Hi, @capaneus |
Yeah you can't load files from the file system when running in the browser (whether you are using AngularJS, React, etc doesn't matter). You can only use the readFile/writeFile functions under Node.js. Don't use those functions in your code and it should work under AngularJS for you. |
hi Ashley, |
That's odd. Can you please give me more information about how you are compiling it? |
Please give me more information about how you are trying to use Data-Forge with AngularJS. Otherwise I'll close this issue. |
I have de same problem! I don't know what I do, I need this library. Has anyone managed to solve it? |
Please share the broken code with me on github so I can run it and debug. |
The project repository |
@maykon-oliveira I got your code, installed dependencies and then ran it using I see a bunch of errors in the console, but I don't think any of them relate to Data-Forge. Can you give me more information about the problem you are experiencing? |
I was trying to fix it, I changed dependency to continue with the project. This code is a new commit, the error was in the previous one. I gave up to use data-forge. |
Hi, @maykon-oliveira and @ashleydavis . When I tried to add |
Thank @yiu31802 please let me know what you come up with. If anyone else finds a problem please submit working code for me to troubleshoot. I used to use Angular version 1, but I've switched to React since then and I don't have time at the moment to learn the latest version of Angular. So I'll appreciate anyone who can submit code that demonstrates an issue. |
Hi, @ashleydavis, @capaneus @maykon-oliveira I think I understood what happened; it is simply a version issue. With Angular 5.x, it works, but something is getting wrong with Angular 6.x versions. Here's the sample code, which is built on top of pure Angular 5 and adding data-forge. |
Thanks @yiu31802 , hoping to look into it this week! |
@yiu31802 I've got your project, installed dependencies, run It says 'app works!'. Does this have to be upgraded to Angular 6 to cause the problem? How do I do that? Is it just a matter of doing an |
So I've done a migration of that project to Angular 6 using this guide. I've reproduced the issue with Data-Forge. Thanks for submitting the code. |
So it seems you can't use 'fs' any more in Angular 6. There's an open issue about it (related to Electron): angular/angular-cli#10681 Other libraries are experiencing this problem, not just Data-Forge. I'm going to sit on this for a bit. Angular might fix the problem. Otherwise I'm may have to deliver a separate version of Data-Forge without 'fs'. |
Got it, @ashleydavis. Thanks! I as a user of both Angular and Data-Forge, I stay with the combination of Angular5 and Data-Forge. Data-Forge simply works perfectly on Angular5. |
I may have a solution to this problem for AngularJS v6! While looking at the code and considering what I was going to do about this issue I spotted a global include of 'fs'. It's possible that this is what is causing your problem! Please update to using Data-Forge 1.2.6 and let me know if it fixes your problem for Angularjs v6. |
Thanks, I just tried
Here's the UNIX command list:
The previous commit link: https://github.com/yiu31802/sample-angular5-with-data-forge/blob/bff58198d62937f63960c136a5d5c8e7229da8bb/src/app/components/one-test-view/app.component.ts |
Thanks for trying it out. I'm moving forward with plans to fully extract 'fs' to a separate module. |
I've started the process of removing 'fs' from Data-Forge. This will take some time to complete, but already I have published a 'beta' version of Data-Forge with 'fs' removed. Can you please try using the beta package of Data-Forge with your project instead of the regular package: http://npmjs.com/package/data-forge-beta Please let me know how that goes. If that works for you then I'll know it's worth completing the change. |
Thanks, I tried it out. The situation was changed, but still not working correctly.
I have no clue about this message at all. |
Thanks for trying it. Do you have updated example code for me to look at? I'd like to get this working! |
I'm using data-forge-beta |
The 'fs' code has been extracted from Data-Forge, so it should be close to working. Please submit example code so that I can debug, otherwise let me know what I have to change to get it working. I don't use Angularjs (sorry React only) so I'm not sure how to reproduce the problem. |
Hello, @ashleydavis . Do you have any update on this? I just re-tried it with |
Have you tried the beta version with the 'fs' dependency extracted? |
In a week or two I'll be publishing the beta version. |
As commented later (#3 (comment)), I already tried and failed with |
Can you please submit code that demonstrates the problem. Also please submit any error messages you are receiving that might be relevant. |
You first build a plain Angular app without installing any in your system. It will take approx. 10 minutes to reproduce the error from scratch:
Then one more local installation of packages and serve the page
Make sure Angular is up at localhost:4200
Use this code in
|
Please put it in Gist or repo and give me instructions on how to boot it up. I don't work with AngularJS and I don't have much time to test the problem for you. |
I understand that you are a busy person, but putting it in Git is not a reasonable choice as you are not using Angular. I am sure this way is much faster than (1) Installation of Angular in your system (2) Git cloning of the test code. The instruction above is a way to bypass the system installation of Angular, and putting every files in Git is meaningless cause it mostly deals with package management. |
I'd just like to be able to |
I do not have clue now other than that unless your system has
|
I'm happy to look at this problem. You just need to provide code in a GitHub repo. I should be able to clone the repo, then type Sorry I should have had a guide for people that submit issues to say the requirements and make it clear what I need from you. |
Please have a try with this:
Sorry that I was too lazy to put things in Git repository. |
The git clone doesn't work for me. I'm getting a 'permission denied' error. Do you have a link to the repo so that I can check it from the browser? |
Weird, it is a public repository at GitHub as you see, can you recheck the repository page? https://github.com/yiu31802/sample-angular-data-forge |
Got it thanks. |
This seems to be a problem with using the Sugar library that Data-Forge is depending on. Trying to track it down. |
I believe this is the same problem: |
Here is a workaround for you: Add this line of code to your polyfills.ts:
|
I'll leave this issue open until the problem has been resolved with Sugar, then I'll update Sugar in Data-Forge and do a new release. |
@yiu31802 thanks so much for your help to reproduce this problem. |
Thanks @ashleydavis and I also confirmed it works with your workaround fix. I am happy that this package starts to work again in the latest versions of Angular:-) |
Data-Forge 1.3.0 is officially released. The file system functions have been extracted from the core API to the new file system module: https://github.com/data-forge/data-forge-fs This should help Data-Forge be more usable in the browser and specifically with the latest AngularJS. If you were using "data-forge-beta" please change over to the regular "data-forge". |
Closing this issue now. I believe the issue was addressed and has not been discussed since. |
hi Ashley,
I'm building an angular 6 application recently and was looking for some data processing lib. So happy to find data-forge as I used pandas and it's a great lib on python.
Would you mind put some instruction on how to import data-forge into angular to be used there?
The text was updated successfully, but these errors were encountered: