jupyter-ijavascript-utils 1.3.0 → 1.4.0

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.
Files changed (59) hide show
  1. package/.screenrc +6 -6
  2. package/DOCS.md +9 -6
  3. package/README.md +7 -2
  4. package/TODO.md +18 -14
  5. package/docResources/img/choropleth_example.svg +1 -0
  6. package/docResources/img/choropleth_simpleMap.png +0 -0
  7. package/docResources/img/choropleth_simpleMap.svg +1 -0
  8. package/docResources/img/choropleth_working.svg +1 -0
  9. package/docResources/img/choropleth_workingFull.svg +1 -0
  10. package/docResources/img/choropleth_workingFullJoin.svg +1 -0
  11. package/docResources/img/gapMinderLifeFertilityChart1.png +0 -0
  12. package/docResources/img/htmlScript_qrCode.png +0 -0
  13. package/docResources/img/ijsMarkdown.png +0 -0
  14. package/docResources/img/tableGeneratorRender.png +0 -0
  15. package/docResources/img/vegaChartExamples.jpg +0 -0
  16. package/docResources/img/vegaEmbed.png +0 -0
  17. package/docResources/img/vegaEmbedExample.png +0 -0
  18. package/docResources/img/vegaLiteExamples.png +0 -0
  19. package/docResources/img/vegaLiteSliders.png +0 -0
  20. package/docResources/img/vegaLiteZoom.gif +0 -0
  21. package/docResources/img/vegaScript_embed.png +0 -0
  22. package/docResources/img/vegaScript_interactiveCharts.png +0 -0
  23. package/docResources/img/vegaScript_tooltips.png +0 -0
  24. package/docResources/img/vegaSpecExample.png +0 -0
  25. package/docResources/img/vegaSvgSpecExample.png +0 -0
  26. package/docResources/notebooks/ex_ChoroplethLong.ipynb +1994 -0
  27. package/docResources/notebooks/ex_Walkthrough.ipynb +5119 -0
  28. package/package.json +7 -7
  29. package/src/SourceMap.js +89 -11
  30. package/src/TableGenerator.js +80 -1
  31. package/src/__mocks__/node-fetch.js +17 -0
  32. package/src/__mocks__/vega-datasets.js +10 -0
  33. package/src/__tests__/SourceMap__spec.js +94 -0
  34. package/src/__tests__/TableGenerator__spec.js +3 -3
  35. package/src/__tests__/aggregate__spec.js +88 -0
  36. package/src/__tests__/array__spec.js +71 -0
  37. package/src/__tests__/datasets_spec.js +173 -0
  38. package/src/__tests__/format__spec.js +48 -0
  39. package/src/__tests__/group__spec.js +109 -12
  40. package/src/__tests__/htmlScript_internal_spec.js +75 -0
  41. package/src/__tests__/leaflet__spec.js +0 -24
  42. package/src/__tests__/object__spec.js +107 -7
  43. package/src/__tests__/set__spec.js +59 -0
  44. package/src/aggregate.js +64 -0
  45. package/src/array.js +17 -2
  46. package/src/datasets.js +82 -23
  47. package/src/format.js +29 -0
  48. package/src/group.js +134 -5
  49. package/src/htmlScript_internal.js +43 -0
  50. package/src/ijs.js +7 -2
  51. package/src/leaflet.js +3 -18
  52. package/src/object.js +2 -2
  53. package/src/set.js +61 -9
  54. package/src/vega.js +758 -278
  55. package/tutorials/exampleWalkthrough.markdown +55 -25
  56. package/tutorials/tutorials.json +8 -1
  57. package/tutorials/vegaLite1.markdown +207 -9
  58. package/tutorials/vega_choroplethLong.markdown +1102 -0
  59. package/tutorials/vega_choroplethShort.markdown +424 -0
package/.screenrc CHANGED
@@ -21,15 +21,15 @@ screen -t "scratchpad"
21
21
  screen -p scratchpad -X stuff "cd ../jupyterScratchpad^M"
22
22
 
23
23
  screen -t lint
24
- screen -p lint -X stuff "npm run lint:watch"
24
+ screen -p lint -X stuff "npm run lint:watch^M"
25
25
  screen -t test
26
- screen -p test -X stuff "npm run test:watch"
26
+ screen -p test -X stuff "npm run test:watch^M"
27
27
  screen -t debug
28
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"
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
33
 
34
34
  screen -t "server" 10
35
35
  screen -p server -X stuff "cd ../^Mjupyter lab"
package/DOCS.md CHANGED
@@ -25,7 +25,8 @@ See the [#Installation section for requirements and installation](#install)
25
25
 
26
26
  ## What's New
27
27
 
28
- 5.3 - Add {@link module:leaflet|Leaflet} for Maps, allow Vega to use {@link module:vega.svgFromSpec|explicit specs} (so [Examples can be copied and pasted](https://vega.github.io/vega-lite/examples/), and add in {@link module:ijs.htmlScript|htmlScripts}
28
+ * 1.4 - Add in vega embed, vega mimetypes and example choropleth tutorial
29
+ * 1.3 - Add {@link module:leaflet|Leaflet} for Maps, allow Vega to use {@link module:vega.svgFromSpec|explicit specs} (so [Examples can be copied and pasted](https://vega.github.io/vega-lite/examples/), and add in {@link module:ijs.htmlScript|htmlScripts}
29
30
 
30
31
  -------
31
32
 
@@ -153,11 +154,7 @@ new utils.TableGenerator(barley)
153
154
 
154
155
  ## Show a Graph
155
156
 
156
- ({@link module:vega|See the Aggregation module for more})
157
-
158
- or
159
-
160
- ([See the Vega tutorial]{@tutorial vega1})
157
+ (See the {@tutorial vegaLite1} tutorial or the {@link module:vega|Vega module} for more)
161
158
 
162
159
  ```
163
160
  utils.vega.svg((vl) => vl.markPoint()
@@ -174,6 +171,12 @@ utils.vega.svg((vl) => vl.markPoint()
174
171
 
175
172
  ![Screenshot of Vega Cell](img/BarleyYieldBySite.png)
176
173
 
174
+ ## Create a Data Driven Map
175
+
176
+ (See the {@tutorial vega_choroplethShort} tutorial for more)
177
+
178
+ ![svg](img/choropleth_workingFull.svg)
179
+
177
180
  ## Render Maps
178
181
 
179
182
  ({@link module:leaflet|See the Leaflet module for more})
package/README.md CHANGED
@@ -18,7 +18,8 @@ See documentation at: [https://jupyter-ijavascript-utils.onrender.com/](https://
18
18
 
19
19
  # What's New
20
20
 
21
- 5.3 - Add Leaflet for Maps, allow Vega to use explicit specs (so [Examples can be copied and pasted](https://vega.github.io/vega-lite/examples/), and add in htmlScripts
21
+ * 1.4 - Add in vega embed, vega mimetypes and example choropleth tutorial
22
+ * 1.3 - Add Leaflet for Maps, allow Vega to use explicit specs (so [Examples can be copied and pasted](https://vega.github.io/vega-lite/examples/), and add in htmlScripts
22
23
 
23
24
  # For Example
24
25
 
@@ -161,6 +162,10 @@ utils.vega.svg((vl) => vl.markPoint()
161
162
 
162
163
  ![Screenshot of Vega Cell](https://jupyter-ijavascript-utils.onrender.com/img/BarleyYieldBySite.png)
163
164
 
165
+ ## Create a Data Driven Map
166
+
167
+ ![Screenshot of choropleth](https://jupyter-ijavascript-utils.onrender.com/img/choropleth_workingFull.svg)
168
+
164
169
  ## Render Maps
165
170
 
166
171
  ![Screenshot of Leaflet](https://jupyter-ijavascript-utils.onrender.com/img/leafletRenderMarkers.png)
@@ -210,4 +215,4 @@ If your feature implementation is brand-new or fixing unsupposed bugs in the lib
210
215
  * [D3 Grouping / Data Transformation](https://observablehq.com/@d3/d3-group)
211
216
  * [Danfo](https://danfo.jsdata.org/api-reference/plotting/tables)
212
217
  * [DataFrame-js](https://github.com/Gmousse/dataframe-js)
213
- * [ES21 array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)
218
+ * [ES21 array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)
package/TODO.md CHANGED
@@ -17,17 +17,21 @@
17
17
  [X] vega
18
18
  [X] SourceMap
19
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
20
+ [X] check there are examples for all the methods
21
+ [X] aggregate
22
+ [X] array
23
+ [X] base64
24
+ [X] datasets
25
+ [X] file
26
+ [X] format
27
+ [X] group
28
+ [X] ijs
29
+ [X] object
30
+ [X] set
31
+ [X] vega
32
+ [X] SourceMap
33
+ [X] TableGenerator
34
+ [ ] Add in Geo
35
+ [ ] npm install i18n-iso-countries world-atlas sane-topojson
36
+ [ ] review https://github.com/michaelwittig/node-i18n-iso-countries
37
+ [ ] learn more about transforms here - https://observablehq.com/@blzzz/how-to-do-a-simple-but-useful-data-transform-in-vega