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
Integrate with vue 3 #50
Comments
if you are using node. const dfd = require("danfojs") for the example you made above, you can use danfo like that |
Maybe my understanding of what node is is the issue here. Isn't node for a different purpose used in backend which is not what I want anything to do with here. I want to have it run in the browser which would only need js and browser not node. or am I incorrect in that assumption |
|
If you need this to run in the browser only, then you need to declare In our next build, dfd will be automatically added to the window object so its available globally. See this issue |
Hi @risenW I would like to import danfojs to Vue 3 through npm install danfojs. But, it seems it cannot do it currently
However, if I change to
It will successfully load Series. Is it possible to adjust module above, so I can use library more directly. Thank you Best Regards |
Hi @risenW, if I have found a solution for this for, it is Could we do something like this?
Kind regards |
Interesting. It seems the bundled browser file are not properly imported in UI libraries like Vue and React. I'm Investigating this. Direct import should work. |
Hi @leh08 I did install the client package and I've imported it in a vue component Anyway the system does not compile, it fails with the following error: Module parse failed: Unexpected token (17:9)
@ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/testFilterCSV.vue?vue&type=script&lang=js& 44:0-49 120:6-18 I'm running I was wondering ...which is your environment? |
Vue2 has same error. |
Stale issue message |
HI! I have an incomplete example using Danfojs, Vue 3, Typescript and Jest at https://github.com/kfern/my-vue-monorepo/tree/main/packages/ts-time-series It works :-D but I can´t convert a timestamp to datetime because to_datetime is not a function I tried:
and
Is it a bug? Can I do something to solve it? |
ping @risenW |
Hey @kfern The function doc is a bit outdated. The name of the function is toDateTime. see example here: https://danfo.jsdata.org/api-reference/general-functions/danfo.to_datetime |
@risenW Thanks. dfd.toDateTime throws a Typescript error: Property 'toDateTime' does not exist on type 'typeof import("my-vue-monorepo/node_modules/danfojs/types/index")'. Did you mean 'to_datetime'?
|
Ahh, I see we forgot to update the correct type in https://github.com/opensource9ja/danfojs/blob/dev/danfojs-browser/types/index.d.ts Would you be interested in updating this and sending a PR? A great simple issue to start contribution. |
This seems like a novice question and yet I don't understand it. How do I import and use a third party js library in vue 3? In this case I'm trying to use Danfo.js https://danfo.jsdata.org/getting-started by doing
npm install danfojs
(even though it only shows to use cdn for browser use I think this is the same thing but correct me if wrong). Then idk if this is something that I import in each file I want to use or if I do it in main.js and it works globally automatically or what. I tried making main.jsand then idk if that's correct but if so then how do I call dfd from inside the setup() of a component
Idk if this is a lack of vue 3 understanding or lack of Danfo.js understanding but either way would appreciate some help, thanks!
Also is is possible can is only option? When adding the
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.1.2/dist/index.min.js"></script>
tag to index.js it did work but I was getting errors in terminal about dfd not being defined although calling dfd did work. I assume because it loads the script later idk either way I think I want the npm install way and thenpm install danfojs-node
I believe is for a node version not the browser version which is why I didnpm install danfojs
Also side question is this a long-term supported project with tensor or more of a side project
The text was updated successfully, but these errors were encountered: