jupyter-ijavascript-utils 1.0.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -0
- package/.screenrc +5 -2
- package/.vscode/launch.json +17 -0
- package/DOCS.md +132 -29
- package/README.md +122 -27
- package/TODO.md +33 -0
- package/docResources/docdash/layout.tmpl +99 -0
- package/docResources/docdash/tmpl/layout.tmpl +99 -0
- package/docResources/favicon.png +0 -0
- package/docResources/favicon.svg +5 -0
- package/docResources/ijs_logo.svg +4 -0
- package/docResources/img/BarleySimpleTable.png +0 -0
- package/docResources/img/IJS_awaitBarley.png +0 -0
- package/docResources/img/PrecipitationAvgChart.png +0 -0
- package/docResources/img/PrecipitationAvgTable.png +0 -0
- package/docResources/img/SourceMap_jsonExplore.png +0 -0
- package/docResources/img/TableGenerator_complex.png +0 -0
- package/docResources/img/TableGenerator_simple.png +0 -0
- package/docResources/img/aggregateReduceSeparateChart.png +0 -0
- package/docResources/img/aggregateReduceTable.png +0 -0
- package/docResources/img/gapMinderAfghanistanStyleTable.png +0 -0
- package/docResources/img/gapMinderAfghanistanTable.png +0 -0
- package/docResources/img/gapMinderIndiaPakistan.png +0 -0
- package/docResources/img/gapMinderLifeFertilityChart1.png +0 -0
- package/docResources/img/howToUse_cellsBuilding.png +0 -0
- package/docResources/img/howToUse_require.png +0 -0
- package/docResources/img/walkthrough_cellType.png +0 -0
- package/docResources/img/walkthrough_letError.png +0 -0
- package/docResources/img/walkthrough_librariesImported.png +0 -0
- package/docResources/img/walkthrough_scopeError.png +0 -0
- package/ijs_logo.pxm +0 -0
- package/jsdoc.json +35 -0
- package/package.json +8 -4
- package/src/SourceMap.js +479 -0
- package/src/TableGenerator.js +989 -0
- package/src/__mocks__/fs-extra.js +35 -0
- package/src/__mocks__/fs.js +10 -0
- package/src/__mocks__/pino.js +15 -0
- package/src/__tests__/SourceMap__spec.js +380 -0
- package/src/__tests__/TableGenerator__spec.js +815 -0
- package/src/__tests__/aggregate__spec.js +551 -0
- package/src/__tests__/array__spec.js +157 -0
- package/src/__tests__/base64__spec.js +16 -0
- package/src/__tests__/file__spec.js +261 -0
- package/src/__tests__/format__spec.js +278 -0
- package/src/__tests__/fs__spec.js +16 -0
- package/src/__tests__/group__spec.js +93 -0
- package/src/__tests__/ijs__spec.js +280 -0
- package/src/__tests__/logger__spec.js +68 -0
- package/src/__tests__/object__spec.js +751 -0
- package/src/__tests__/set__spec.js +115 -0
- package/src/_types/global.js +116 -0
- package/src/aggregate.js +617 -0
- package/src/array.js +245 -0
- package/src/base64.js +42 -0
- package/src/datasets.js +32 -32
- package/src/file.js +297 -0
- package/src/format.js +264 -0
- package/src/group.js +199 -0
- package/src/ijs.js +271 -0
- package/src/index.js +36 -2
- package/src/logger.js +51 -0
- package/src/object.js +443 -0
- package/src/set.js +107 -0
- package/src/vega.js +60 -45
- package/tutorials/exampleWalkthrough.markdown +691 -0
- package/tutorials/howToUse.markdown +71 -0
- package/tutorials/tutorials.json +11 -0
- package/tutorials/vegaLite1.markdown +179 -0
- package/src/IJSUtils.js +0 -161
- package/src/__tests__/ijsUtils__spec.js +0 -8
package/.eslintrc.js
CHANGED
package/.screenrc
CHANGED
|
@@ -19,8 +19,6 @@ screen -t "jsUtils"
|
|
|
19
19
|
screen -p jsUtils -X stuff "cd ../jupyterJsUtils^M"
|
|
20
20
|
screen -t "scratchpad"
|
|
21
21
|
screen -p scratchpad -X stuff "cd ../jupyterScratchpad^M"
|
|
22
|
-
screen -t "p4js"
|
|
23
|
-
screen -p p4js -X stuff "cd '../python-for-js-developers'^M"
|
|
24
22
|
|
|
25
23
|
screen -t lint
|
|
26
24
|
screen -p lint -X stuff "npm run lint:watch"
|
|
@@ -28,6 +26,11 @@ screen -t test
|
|
|
28
26
|
screen -p test -X stuff "npm run test:watch"
|
|
29
27
|
screen -t debug
|
|
30
28
|
|
|
29
|
+
screen -t "transfer"
|
|
30
|
+
screen -p transfer -X stuff "cd ../transfer"
|
|
31
|
+
screen -t "p4js"
|
|
32
|
+
screen -p p4js -X stuff "cd '../python-for-js-developers'^M"
|
|
33
|
+
|
|
31
34
|
screen -t "server" 10
|
|
32
35
|
screen -p server -X stuff "cd ../^Mjupyter lab"
|
|
33
36
|
screen -t plantuml 11
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Attach",
|
|
9
|
+
"port": 9229,
|
|
10
|
+
"request": "attach",
|
|
11
|
+
"skipFiles": [
|
|
12
|
+
"<node_internals>/**"
|
|
13
|
+
],
|
|
14
|
+
"type": "pwa-node"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
package/DOCS.md
CHANGED
|
@@ -4,62 +4,163 @@ This is a simple Library for using Jupyter with the IJavaScript kernel
|
|
|
4
4
|
|
|
5
5
|
See the [#Installation section for requirements and installation](#install)
|
|
6
6
|
|
|
7
|
-
| Export | Description
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
7
|
+
| Export | Description |
|
|
8
|
+
|-------------------------------|-----------------------------------------------------------------------------------------------------|
|
|
9
|
+
| {@link module:aggregate} | Aggregating formulas for reducing collections of records. |
|
|
10
|
+
| {@link module:array} | Utilities for massaging, sorting, reshaping and working with arrays. |
|
|
11
|
+
| {@link module:base64} | Utilities to convert to and from base64 encoding of strings |
|
|
12
|
+
| {@link module:datasets} | Utilities to facilitate working with example datasets provided by the vega team |
|
|
13
|
+
| {@link module:file} | Utilities reading and writing data and text to files. |
|
|
14
|
+
| {@link module:format} | Utilities for formatting and massaging data to be legible. |
|
|
15
|
+
| {@link module:group} | Library to group collections of objects - generating Maps of records ({@link SourceMap}) |
|
|
16
|
+
| {@link module:ijs} | Utility methods to support working within the iJavaScript kernel within Jupyter. |
|
|
17
|
+
| {@link module:object} | Utilities for massaging and managing JavaScript Objects or collections of Objects. |
|
|
18
|
+
| {@link module:set} | Functional Utilities for managing JavaScript Sets - allowing for chaining. |
|
|
19
|
+
| {@link module:vega} | Simple utility to streamline showing Vega-Lite charts within iJS Notebooks. |
|
|
20
|
+
| {@link SourceMap} | SubClass of Maps - generated by the {@link module:group} and reducible with {@link module:aggregate} |
|
|
21
|
+
| {@link TableGenerator} | Class that can filter, sorts, manage and then generate HTML, CSV, Markdown, etc. |
|
|
12
22
|
|
|
13
23
|
-------
|
|
14
24
|
|
|
15
|
-
|
|
25
|
+
# For Example
|
|
26
|
+
|
|
27
|
+
## Get Sample Data
|
|
28
|
+
|
|
29
|
+
({@link module:datasets|See the DataSets module for more on sample datasets})
|
|
30
|
+
|
|
31
|
+
({@link module:ijs.await|See the ijs module for helpers to use async/await})
|
|
16
32
|
|
|
17
33
|
```
|
|
18
34
|
//-- get the data
|
|
19
|
-
utils.
|
|
35
|
+
utils.ijs.await(async ($$, console) => {
|
|
36
|
+
barley = await utils.datasets.fetch('barley.json');
|
|
37
|
+
|
|
38
|
+
//-- continue to use the barley dataset, or wait to the next cell
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Group By
|
|
20
43
|
|
|
44
|
+
Then we can group using a process similar to d3js
|
|
45
|
+
|
|
46
|
+
({@link module:group|see the Group module for more on grouping})
|
|
47
|
+
|
|
48
|
+
```
|
|
21
49
|
//-- get the min max of the types of barley
|
|
22
|
-
barleyByVarietySite =
|
|
50
|
+
barleyByVarietySite = utils.group.by(barley, 'variety', 'site')
|
|
23
51
|
|
|
24
|
-
//
|
|
25
|
-
// 'Manchuria' =>
|
|
52
|
+
// SourceMap(10) [Map] {
|
|
53
|
+
// 'Manchuria' => SourceMap(6) [Map] {
|
|
54
|
+
// 'University Farm' => [ [Object], [Object] ],
|
|
55
|
+
// 'Waseca' => [ [Object], [Object] ],
|
|
56
|
+
// 'Morris' => [ [Object], [Object] ],
|
|
57
|
+
// 'Crookston' => [ [Object], [Object] ],
|
|
58
|
+
// 'Grand Rapids' => [ [Object], [Object] ],
|
|
59
|
+
// 'Duluth' => [ [Object], [Object] ],
|
|
60
|
+
// source: 'site'
|
|
61
|
+
// },
|
|
62
|
+
// 'Glabron' => SourceMap(6) [Map] {
|
|
26
63
|
// 'University Farm' => [ [Object], [Object] ],
|
|
27
64
|
// 'Waseca' => [ [Object], [Object] ],
|
|
28
|
-
//
|
|
29
|
-
//
|
|
65
|
+
// 'Morris' => [ [Object], [Object] ],
|
|
66
|
+
// 'Crookston' => [ [Object], [Object] ],
|
|
67
|
+
// 'Grand Rapids' => [ [Object], [Object] ],
|
|
68
|
+
// 'Duluth' => [ [Object], [Object] ],
|
|
69
|
+
// source: 'site'
|
|
70
|
+
// },
|
|
71
|
+
// ...
|
|
30
72
|
// }
|
|
31
73
|
|
|
32
74
|
//-- now group by variety and year
|
|
33
|
-
barleyByVarietyYear =
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
75
|
+
barleyByVarietyYear = utils.group.by(barley, 'variety', 'year')
|
|
76
|
+
|
|
77
|
+
// SourceMap(10) [Map] {
|
|
78
|
+
// 'Manchuria' => SourceMap(2) [Map] {
|
|
79
|
+
// 1931 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
80
|
+
// 1932 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
81
|
+
// source: 'year'
|
|
82
|
+
// },
|
|
83
|
+
// 'Glabron' => SourceMap(2) [Map] {
|
|
84
|
+
// 1931 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
85
|
+
// 1932 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
86
|
+
// source: 'year'
|
|
87
|
+
// },
|
|
88
|
+
// ...
|
|
89
|
+
// }
|
|
41
90
|
```
|
|
42
91
|
|
|
43
|
-
|
|
92
|
+
## Aggregating
|
|
44
93
|
|
|
45
|
-
|
|
94
|
+
({@link module:aggregate|See the Aggregation module for more})
|
|
46
95
|
|
|
47
96
|
```
|
|
48
|
-
utils.
|
|
49
|
-
|
|
97
|
+
utils.group.by(barley, 'variety', 'site')
|
|
98
|
+
.reduce((collection) => ({
|
|
99
|
+
years: utils.aggregate.extent(collection, 'year'),
|
|
100
|
+
numRecords: utils.aggregate.length(collection),
|
|
101
|
+
yield_sum: utils.aggregate.sum(collection, 'yield'),
|
|
102
|
+
yield_min: utils.aggregate.min(collection, 'yield'),
|
|
103
|
+
yield_max: utils.aggregate.max(collection, 'yield'),
|
|
104
|
+
yield_diff: utils.aggregate.difference(collection, 'yield')
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
returns
|
|
108
|
+
[
|
|
109
|
+
{
|
|
110
|
+
variety: 'Manchuria',
|
|
111
|
+
site: 'University Farm',
|
|
112
|
+
years: { min: 1931, max: 1932 },
|
|
113
|
+
numRecords: 2,
|
|
114
|
+
yield_sum: 53.9,
|
|
115
|
+
yield_min: 26.9,
|
|
116
|
+
yield_max: 27,
|
|
117
|
+
yield_diff: 0.100
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
variety: 'Manchuria',
|
|
121
|
+
site: 'Waseca',
|
|
122
|
+
years: { min: 1931, max: 1932 },
|
|
123
|
+
numRecords: 2,
|
|
124
|
+
yield_sum: 82.33333,
|
|
125
|
+
yield_min: 33.46667,
|
|
126
|
+
yield_max: 48.86667,
|
|
127
|
+
yield_diff: 15.39999
|
|
128
|
+
},
|
|
129
|
+
...
|
|
130
|
+
];
|
|
50
131
|
```
|
|
51
132
|
|
|
52
|
-
|
|
133
|
+
## Render as a Table
|
|
134
|
+
|
|
135
|
+
({@link TableGenerator|See the TableGenerator class for more})
|
|
53
136
|
|
|
54
137
|
```
|
|
55
|
-
|
|
138
|
+
new utils.TableGenerator(barley)
|
|
139
|
+
.sort('-yield')
|
|
140
|
+
.formatter({ year: (v) => `${v}`})
|
|
141
|
+
.limit(10)
|
|
142
|
+
.render()
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+

|
|
146
|
+
|
|
147
|
+
## Show a Graph
|
|
148
|
+
|
|
149
|
+
({@link module:vega|See the Aggregation module for more})
|
|
150
|
+
|
|
151
|
+
or
|
|
152
|
+
|
|
153
|
+
([See the Vega tutorial]{@tutorial vega1})
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
utils.vega.svg((vl) => vl.markPoint()
|
|
56
157
|
.data(barley)
|
|
57
158
|
.title('Barley Yield by Site')
|
|
58
159
|
.width(600)
|
|
59
160
|
.encode(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
161
|
+
vl.x().fieldN('site'),
|
|
162
|
+
vl.y().fieldQ('yield'),
|
|
163
|
+
vl.color().fieldN('year')
|
|
63
164
|
)
|
|
64
165
|
)
|
|
65
166
|
```
|
|
@@ -77,3 +178,5 @@ Depends on:
|
|
|
77
178
|
|
|
78
179
|
* [Jupyter Tools - such as Jupyter Lab](https://jupyter.org/)
|
|
79
180
|
* [n-riesco/ijavascript jupyter kernel](https://github.com/n-riesco/ijavascript#installation)
|
|
181
|
+
|
|
182
|
+
See the [How to Use]{@tutorial howToUse} section for more.
|
package/README.md
CHANGED
|
@@ -5,70 +5,156 @@
|
|
|
5
5
|
<a href="https://jupyter-ijavascript-utils.onrender.com/LICENSE" alt="License">
|
|
6
6
|
<img src="https://img.shields.io/badge/License-MIT-green" />
|
|
7
7
|
</a>
|
|
8
|
+
<img src="https://img.shields.io/badge/Coverage-98-green" />
|
|
8
9
|
</p>
|
|
9
10
|
|
|
10
11
|
# Overview
|
|
11
12
|
|
|
12
13
|
Simple library for working with Jupyter - through IJavaScript kernel.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
# Documentation
|
|
16
|
+
|
|
17
|
+
See documentation at: [https://jupyter-ijavascript-utils.onrender.com/](https://jupyter-ijavascript-utils.onrender.com/)
|
|
18
|
+
|
|
19
|
+
# For Example
|
|
20
|
+
|
|
21
|
+
## Get Sample Data
|
|
22
|
+
|
|
23
|
+
({@link module:datasets|See the DataSets module for more on sample datasets})
|
|
24
|
+
|
|
25
|
+
({@link module:ijs.await|See the ijs module for helpers to use async/await})
|
|
15
26
|
|
|
16
27
|
```
|
|
17
28
|
//-- get the data
|
|
18
|
-
utils.
|
|
29
|
+
utils.ijs.await(async ($$, console) => {
|
|
30
|
+
barley = await utils.datasets.fetch('barley.json');
|
|
19
31
|
|
|
32
|
+
//-- continue to use the barley dataset, or wait to the next cell
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Group By
|
|
37
|
+
|
|
38
|
+
Then we can group using a process similar to d3js
|
|
39
|
+
|
|
40
|
+
({@link module:group|see the Group module for more on grouping})
|
|
41
|
+
|
|
42
|
+
```
|
|
20
43
|
//-- get the min max of the types of barley
|
|
21
|
-
barleyByVarietySite =
|
|
44
|
+
barleyByVarietySite = utils.group.by(barley, 'variety', 'site')
|
|
22
45
|
|
|
23
|
-
//
|
|
24
|
-
// 'Manchuria' =>
|
|
46
|
+
// SourceMap(10) [Map] {
|
|
47
|
+
// 'Manchuria' => SourceMap(6) [Map] {
|
|
48
|
+
// 'University Farm' => [ [Object], [Object] ],
|
|
49
|
+
// 'Waseca' => [ [Object], [Object] ],
|
|
50
|
+
// 'Morris' => [ [Object], [Object] ],
|
|
51
|
+
// 'Crookston' => [ [Object], [Object] ],
|
|
52
|
+
// 'Grand Rapids' => [ [Object], [Object] ],
|
|
53
|
+
// 'Duluth' => [ [Object], [Object] ],
|
|
54
|
+
// source: 'site'
|
|
55
|
+
// },
|
|
56
|
+
// 'Glabron' => SourceMap(6) [Map] {
|
|
25
57
|
// 'University Farm' => [ [Object], [Object] ],
|
|
26
58
|
// 'Waseca' => [ [Object], [Object] ],
|
|
27
|
-
//
|
|
28
|
-
//
|
|
59
|
+
// 'Morris' => [ [Object], [Object] ],
|
|
60
|
+
// 'Crookston' => [ [Object], [Object] ],
|
|
61
|
+
// 'Grand Rapids' => [ [Object], [Object] ],
|
|
62
|
+
// 'Duluth' => [ [Object], [Object] ],
|
|
63
|
+
// source: 'site'
|
|
64
|
+
// },
|
|
65
|
+
// ...
|
|
29
66
|
// }
|
|
30
67
|
|
|
31
68
|
//-- now group by variety and year
|
|
32
|
-
barleyByVarietyYear =
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
69
|
+
barleyByVarietyYear = utils.group.by(barley, 'variety', 'year')
|
|
70
|
+
|
|
71
|
+
// SourceMap(10) [Map] {
|
|
72
|
+
// 'Manchuria' => SourceMap(2) [Map] {
|
|
73
|
+
// 1931 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
74
|
+
// 1932 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
75
|
+
// source: 'year'
|
|
76
|
+
// },
|
|
77
|
+
// 'Glabron' => SourceMap(2) [Map] {
|
|
78
|
+
// 1931 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
79
|
+
// 1932 => [ [Object], [Object], [Object], [Object], [Object], [Object] ],
|
|
80
|
+
// source: 'year'
|
|
81
|
+
// },
|
|
82
|
+
// ...
|
|
83
|
+
// }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Aggregating
|
|
87
|
+
|
|
88
|
+
({@link module:aggregate|See the Aggregation module for more})
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
utils.group.by(barley, 'variety', 'site')
|
|
92
|
+
.reduce((collection) => ({
|
|
93
|
+
years: utils.aggregate.extent(collection, 'year'),
|
|
94
|
+
numRecords: utils.aggregate.length(collection),
|
|
95
|
+
yield_sum: utils.aggregate.sum(collection, 'yield'),
|
|
96
|
+
yield_min: utils.aggregate.min(collection, 'yield'),
|
|
97
|
+
yield_max: utils.aggregate.max(collection, 'yield'),
|
|
98
|
+
yield_diff: utils.aggregate.difference(collection, 'yield')
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
returns
|
|
102
|
+
[
|
|
103
|
+
{
|
|
104
|
+
variety: 'Manchuria',
|
|
105
|
+
site: 'University Farm',
|
|
106
|
+
years: { min: 1931, max: 1932 },
|
|
107
|
+
numRecords: 2,
|
|
108
|
+
yield_sum: 53.9,
|
|
109
|
+
yield_min: 26.9,
|
|
110
|
+
yield_max: 27,
|
|
111
|
+
yield_diff: 0.100
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
variety: 'Manchuria',
|
|
115
|
+
site: 'Waseca',
|
|
116
|
+
years: { min: 1931, max: 1932 },
|
|
117
|
+
numRecords: 2,
|
|
118
|
+
yield_sum: 82.33333,
|
|
119
|
+
yield_min: 33.46667,
|
|
120
|
+
yield_max: 48.86667,
|
|
121
|
+
yield_diff: 15.39999
|
|
122
|
+
},
|
|
123
|
+
...
|
|
124
|
+
];
|
|
40
125
|
```
|
|
41
126
|
|
|
42
|
-
|
|
127
|
+
## Render as a Table
|
|
43
128
|
|
|
44
|
-
|
|
129
|
+
({@link TableGenerator|See the TableGenerator class for more})
|
|
45
130
|
|
|
46
131
|
```
|
|
47
|
-
utils.
|
|
48
|
-
|
|
132
|
+
new utils.TableGenerator(barley)
|
|
133
|
+
.sort('-yield')
|
|
134
|
+
.formatter({ year: (v) => `${v}`})
|
|
135
|
+
.limit(10)
|
|
136
|
+
.render()
|
|
49
137
|
```
|
|
50
138
|
|
|
139
|
+

|
|
140
|
+
|
|
51
141
|
now show a graph
|
|
52
142
|
|
|
53
143
|
```
|
|
54
|
-
utils.vega.svg(
|
|
144
|
+
utils.vega.svg((vl) => vl.markPoint()
|
|
55
145
|
.data(barley)
|
|
56
146
|
.title('Barley Yield by Site')
|
|
57
147
|
.width(600)
|
|
58
148
|
.encode(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
149
|
+
vl.x().fieldN('site'),
|
|
150
|
+
vl.y().fieldQ('yield'),
|
|
151
|
+
vl.color().fieldN('year')
|
|
62
152
|
)
|
|
63
153
|
)
|
|
64
154
|
```
|
|
65
155
|
|
|
66
156
|

|
|
67
157
|
|
|
68
|
-
# Documentation
|
|
69
|
-
|
|
70
|
-
See documentation at: [https://jupyter-ijavascript-utils.onrender.com/](https://jupyter-ijavascript-utils.onrender.com/)
|
|
71
|
-
|
|
72
158
|
# License
|
|
73
159
|
|
|
74
160
|
See [License](https://jupyter-ijavascript-utils.onrender.com/LICENSE) (MIT License).
|
|
@@ -77,6 +163,10 @@ See [License](https://jupyter-ijavascript-utils.onrender.com/LICENSE) (MIT Licen
|
|
|
77
163
|
|
|
78
164
|
If you have any questions first file it on [issues](https://github.com/paulroth3d/jupyter-ijavascript-utils/issues) before contacting authors.
|
|
79
165
|
|
|
166
|
+
## Toubleshooting
|
|
167
|
+
|
|
168
|
+
iJavaScript does not currently support AMD Modules, due to open issues with nodejs [see iJavaScript issue #210 for more](https://github.com/n-riesco/ijavascript/issues/210)
|
|
169
|
+
|
|
80
170
|
# Contributions
|
|
81
171
|
|
|
82
172
|
Your contributions are welcome: both by reporting issues on [GitHub issues](https://github.com/paulroth3d/jupyter-ijavascript-utils/issues) or pull-requesting patches.
|
|
@@ -92,3 +182,8 @@ If your feature implementation is brand-new or fixing unsupposed bugs in the lib
|
|
|
92
182
|
* [DocDash Template](http://clenemt.github.io/docdash/)
|
|
93
183
|
* [DocDash Example Code](http://clenemt.github.io/docdash/base_chains.js.html)
|
|
94
184
|
* [Gist creating JSDoc to MD](https://gist.github.com/slorber/0bf8c8c8001505f0f99a062ac55bf442)
|
|
185
|
+
* [JSDoc Documentation](https://jsdoc.app/index.html)
|
|
186
|
+
* [D3 Grouping / Data Transformation](https://observablehq.com/@d3/d3-group)
|
|
187
|
+
* [Danfo](https://danfo.jsdata.org/api-reference/plotting/tables)
|
|
188
|
+
* [DataFrame-js](https://github.com/Gmousse/dataframe-js)
|
|
189
|
+
* [ES21 array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)
|
package/TODO.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[X] finish tutorials
|
|
2
|
+
[X] How to get Jupyter iJavaScript setup
|
|
3
|
+
[X] Example massaging data to create a table and chart
|
|
4
|
+
[ ] Finish example walkthrough
|
|
5
|
+
[X] update the docs file index`
|
|
6
|
+
[X] check there is an index for all modules and classes
|
|
7
|
+
[X] aggregate
|
|
8
|
+
[X] array
|
|
9
|
+
[X] base64
|
|
10
|
+
[X] datasets
|
|
11
|
+
[X] file
|
|
12
|
+
[X] format
|
|
13
|
+
[X] group
|
|
14
|
+
[X] ijs
|
|
15
|
+
[X] object
|
|
16
|
+
[X] set
|
|
17
|
+
[X] vega
|
|
18
|
+
[X] SourceMap
|
|
19
|
+
[X] TableGenerator
|
|
20
|
+
[ ] check there are examples for all the methods
|
|
21
|
+
[ ] aggregate
|
|
22
|
+
[ ] array
|
|
23
|
+
[ ] base64
|
|
24
|
+
[ ] datasets
|
|
25
|
+
[ ] file
|
|
26
|
+
[ ] format
|
|
27
|
+
[ ] group
|
|
28
|
+
[ ] ijs
|
|
29
|
+
[ ] object
|
|
30
|
+
[ ] set
|
|
31
|
+
[ ] vega
|
|
32
|
+
[ ] SourceMap
|
|
33
|
+
[ ] TableGenerator
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<?js if (!env.conf.docdash) { env.conf.docdash = {};} ?>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title><?js= title ?> - <?js= ((env.conf.docdash.meta && env.conf.docdash.meta.title) || "Documentation") ?></title>
|
|
7
|
+
<?js if (env.conf.docdash.meta) { ?>
|
|
8
|
+
<?js if (env.conf.docdash.meta.description) { ?><meta name="description" content="<?js= env.conf.docdash.meta.description ?>" /><?js } ?>
|
|
9
|
+
<?js if (env.conf.docdash.meta.keyword) { ?>
|
|
10
|
+
<meta name="keywords" content="<?js= env.conf.docdash.meta.keyword ?>" />
|
|
11
|
+
<meta name="keyword" content="<?js= env.conf.docdash.meta.keyword ?>" />
|
|
12
|
+
<?js } ?>
|
|
13
|
+
<?js } ?>
|
|
14
|
+
<?js if (env.conf.docdash.openGraph) { ?>
|
|
15
|
+
<meta property="og:title" content="<?js= env.conf.docdash.openGraph.title ?>"/>
|
|
16
|
+
<meta property="og:type" content="<?js= env.conf.docdash.openGraph.type ?>"/>
|
|
17
|
+
<meta property="og:image" content="<?js= env.conf.docdash.openGraph.image ?>"/>
|
|
18
|
+
<?js if (env.conf.docdash.openGraph.site_name) { ?><meta property="og:site_name" content="<?js= env.conf.docdash.openGraph.site_name ?>"/><?js } ?>
|
|
19
|
+
<meta property="og:url" content="<?js= env.conf.docdash.openGraph.url ?>"/>
|
|
20
|
+
<?js } ?>
|
|
21
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
22
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
23
|
+
<!--[if lt IE 9]>
|
|
24
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
25
|
+
<![endif]-->
|
|
26
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
27
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
28
|
+
<script src="scripts/nav.js" defer></script>
|
|
29
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
30
|
+
<link rel="icon" type="image/svg+xml" href="favicon.svg">
|
|
31
|
+
<link rel="icon" type="image/png" href="favicon.png">
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
|
|
35
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
36
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
37
|
+
<div class="navicon"></div>
|
|
38
|
+
</label>
|
|
39
|
+
|
|
40
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
41
|
+
|
|
42
|
+
<nav <?js if (env.conf.docdash.wrap) { ?>class="wrap"<?js } ?>>
|
|
43
|
+
<?js if (env.conf.docdash.search) { ?>
|
|
44
|
+
<input type="text" id="nav-search" placeholder="Search" />
|
|
45
|
+
<?js } ?>
|
|
46
|
+
<?js= this.nav ?>
|
|
47
|
+
</nav>
|
|
48
|
+
|
|
49
|
+
<div id="main">
|
|
50
|
+
<?js if (title != 'Home') { ?>
|
|
51
|
+
<h1 class="page-title"><?js= title ?></h1>
|
|
52
|
+
<?js } ?>
|
|
53
|
+
|
|
54
|
+
<?js= content ?>
|
|
55
|
+
|
|
56
|
+
<?js if (env.conf.docdash.disqus) { ?>
|
|
57
|
+
<div id="disqus_thread"></div>
|
|
58
|
+
<script>
|
|
59
|
+
(function() { // DON'T EDIT BELOW THIS LINE
|
|
60
|
+
var d = document, s = d.createElement('script');
|
|
61
|
+
s.src = '//<?js= env.conf.docdash.disqus ?>.disqus.com/embed.js';
|
|
62
|
+
s.setAttribute('data-timestamp', +new Date());
|
|
63
|
+
(d.head || d.body).appendChild(s);
|
|
64
|
+
})();
|
|
65
|
+
</script>
|
|
66
|
+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
|
67
|
+
<?js } ?>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<br class="clear">
|
|
71
|
+
|
|
72
|
+
<footer>
|
|
73
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc <?js= env.version.number ?></a><?js if(env.conf.templates && env.conf.templates.default && env.conf.templates.default.includeDate !== false) { ?> on <?js= (new Date()) ?><?js } ?> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
74
|
+
</footer>
|
|
75
|
+
|
|
76
|
+
<script>prettyPrint();</script>
|
|
77
|
+
<script src="scripts/polyfill.js"></script>
|
|
78
|
+
<script src="scripts/linenumber.js"></script>
|
|
79
|
+
<?js if (env.conf.docdash.search) { ?>
|
|
80
|
+
<script src="scripts/search.js" defer></script>
|
|
81
|
+
<?js } ?>
|
|
82
|
+
<?js if (env.conf.docdash.collapse) { ?>
|
|
83
|
+
<script src="scripts/collapse.js" defer></script>
|
|
84
|
+
<?js } ?>
|
|
85
|
+
<?js if (env.conf.docdash.scripts && env.conf.docdash.scripts.length) {
|
|
86
|
+
for(var i = 0; i < env.conf.docdash.scripts.length; i++){
|
|
87
|
+
if (env.conf.docdash.scripts[i].indexOf(".css") != -1) {
|
|
88
|
+
?>
|
|
89
|
+
<link type="text/css" rel="stylesheet" href="<?js= env.conf.docdash.scripts[i] ?>">
|
|
90
|
+
<?js
|
|
91
|
+
} else {
|
|
92
|
+
?>
|
|
93
|
+
<script src="<?js= env.conf.docdash.scripts[i] ?>"></script>
|
|
94
|
+
<?js
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
} ?>
|
|
98
|
+
</body>
|
|
99
|
+
</html>
|