javascriptdata / danfojs

Danfo.js is an open source, JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.
https://danfo.jsdata.org/
MIT License
4.81k stars 209 forks source link

Next CDN Release? #88

Closed GantMan closed 3 years ago

GantMan commented 3 years ago

When will you be releasing the next CDN version of Danfo for web?

I am using 0.1.2 because that's the last released version. Are you interested in using upkg to automatically create CDN releases?

risenW commented 3 years ago

The latest version is actually 0.1.5, but it seems there’s a dependency bug in that. I’ll look over that this weekend and push a new version.

As for automatically creating release, that would be awesome 🙂

GantMan commented 3 years ago

Hrmmm, your 0.1.5 release doesn't seem to work. This isn't the whole file. Load the JS and look at how small it is. I don't think it got rolled up properly.

https://cdn.jsdelivr.net/npm/danfojs@0.1.5/dist/index.min.js

I guess I should put some time aside to come see if I can help automate and streamline your releases to CDNs

risenW commented 3 years ago

I just fixed this issue, anytime we merge to master, the latest version gets deployed and can be accessed via the CDN link <script src="https://cdn.jsdelivr.net/gh/opensource9ja/danfojs@latest/lib/bundle.js"></script>

The latest ensures the current release is loaded.

GantMan commented 3 years ago

I ran your sandbox code: https://codepen.io/risingodegua/pen/bGwPGMG which is awesome that it runs great in that demo!

The code points to that bundle. But if you copy and paste the HTML from that sandbox in a local server you get an error.

Screen Shot 2021-01-25 at 10 36 01 PM

Have you tested the script tag locally? I keep getting this error, I tested in two locally hosted projects.

risenW commented 3 years ago

I moved the script tag to the body, and it worked locally:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>
</head>

<body>
 <script src="https://cdn.jsdelivr.net/gh/opensource9ja/danfojs@latest/lib/bundle.js"></script>

    <div id="div1"></div>
    <div id="div2"></div>
    <div id="div3"></div>

    <script>

        dfd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv")
            .then(df => {

                df['AAPL.Open'].plot("div1").box() //makes a box plot

                df.plot("div2").table() //display csv as table

                new_df = df.set_index({ key: "Date" }) //resets the index to Date column
                new_df.plot("div3").line({ columns: ["AAPL.Open", "AAPL.High"] })  //makes a timeseries plot

            }).catch(err => {
                console.log(err);
            })

    </script>

</body>

</html>
risenW commented 3 years ago

Also a quick update that we now have two main branches for doing dev work: danfojs-browser and danfojs-node.

GantMan commented 3 years ago

OK, that works but I have new tickets to file :D

I'd love to be able to lock to a version, though. That way the code won't be broken by changes to @latest