Skip to content

Commit 3585774

Browse files
authored
Merge pull request #96 from opensource9ja/danfojs-browser
Seperate Danfo browser code base and fix cdn issue
2 parents d6fa3de + 518d9b2 commit 3585774

56 files changed

Lines changed: 37099 additions & 27375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
}
99
}
1010
]
11-
]
11+
],
12+
"plugins": ["@babel/plugin-transform-runtime"]
1213
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ coverage
55
danfojs/data
66
.DS_Store
77
.idea/
8+
9+
dist/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ easy and intuitive. It is heavily inspired by [Pandas](https://pandas.pydata.org
5252
To use Danfo.js via script tags, copy and paste the CDN below to your HTML file
5353

5454
```html
55-
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.1.5/dist/index.min.js"></script>
55+
<script src="https://cdn.jsdelivr.net/gh/opensource9ja/danfojs@0.2.1/lib/bundle.js"></script>
5656
```
5757

5858
### Example Usage in the Browser
@@ -64,7 +64,7 @@ To use Danfo.js via script tags, copy and paste the CDN below to your HTML file
6464
<head>
6565
<meta charset="UTF-8">
6666
<meta name="viewport" content="width=device-width, initial-scale=1.0">
67-
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.1.5/dist/index.min.js"></script>
67+
<script src="https://cdn.jsdelivr.net/gh/opensource9ja/danfojs@0.2.1/lib/bundle.js"></script>
6868
<title>Document</title>
6969
</head>
7070

danfojs/src/core/concat.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { DataFrame } from './frame';
2-
// import { Series } from "../../src/core/series";
32
import { Utils } from "./utils";
43
import { Series } from './series';
54

danfojs/src/core/frame.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
16-
// import * as tf from "@tensorflow/tfjs"; //Use this import when building optimized version for danfojs browser side
15+
import * as tf from "@tensorflow/tfjs";
1716
import Ndframe from "./generic";
1817
import { Series } from "./series";
1918
import { Utils } from "./utils";

danfojs/src/core/generic.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
*
1414
*/
1515

16-
import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
17-
// import * as tf from "@tensorflow/tfjs"; //Use this import when building optimized version for danfojs browser side
16+
import * as tf from "@tensorflow/tfjs";
1817
import { table } from "table";
1918
import { Utils } from "./utils";
2019
import { Configs } from "../config/config";
2120

21+
2222
const utils = new Utils();
2323
const config = new Configs(); //package wide configuration object
24-
24+
const _VERSION = "0.1.5";
2525
export default class NDframe {
2626
/**
2727
* N-Dimensiona data structure. Stores multi-dimensional
@@ -264,6 +264,14 @@ export default class NDframe {
264264
return this.index_arr;
265265
}
266266

267+
/**
268+
* Returns current version
269+
* @return {String} version of danfojs
270+
*/
271+
get __version() {
272+
return _VERSION;
273+
}
274+
267275
/**
268276
* Sets index of the NDFrame
269277
*/

danfojs/src/core/get_dummies.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// import { Series } from "./series"
21
import { DataFrame } from "./frame";
32
import { Utils } from "./utils";
43

danfojs/src/core/series.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
*/
1515

1616

17-
import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
18-
// import * as tf from '@tensorflow/tfjs'; //Use this import when building optimized version for danfojs browser sideimport { std, variance } from 'mathjs'
17+
import * as tf from "@tensorflow/tfjs";
1918
import { variance, std } from 'mathjs';
2019
import { Utils } from "./utils";
2120
import { Str } from "./strings";

danfojs/src/core/strings.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
//handled string columns in Series and DataFrame
21
import { Series } from "./series";
3-
// import {Utils} from "./utils"
4-
5-
// const utils = new Utils()
62

73
/**
84
* String methods applied on Series and DataFrames

danfojs/src/core/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as tf from '@tensorflow/tfjs-node';
2-
// import * as tf from "@tensorflow/tfjs";
1+
import * as tf from "@tensorflow/tfjs";
2+
import '@tensorflow/tfjs-backend-cpu';
33
import { Configs } from "../config/config";
44

55
const config = new Configs();

0 commit comments

Comments
 (0)