gridviz 2.0.29 → 2.0.32

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 (42) hide show
  1. package/README.md +36 -1
  2. package/dist/gridviz.js +27830 -27750
  3. package/dist/gridviz.min.js +1 -1
  4. package/package.json +8 -5
  5. package/src/App.js +44 -14
  6. package/src/dataset/COGeo.js +1 -1
  7. package/src/dataset/CSVGrid.js +1 -2
  8. package/src/dataset/GeoTIFF.js +1 -1
  9. package/src/dataset/ParquetGrid.js +1 -2
  10. package/src/dataset/TiledGrid.js +7 -5
  11. package/src/index.js +52 -51
  12. package/src/legend/ColorCategoryLegend.js +1 -1
  13. package/src/legend/ColorDiscreteLegend.js +1 -1
  14. package/src/legend/ColorLegend.js +1 -1
  15. package/src/legend/SegmentOrientationLegend.js +1 -1
  16. package/src/legend/SegmentWidthLegend.js +1 -1
  17. package/src/legend/SizeLegend.js +1 -1
  18. package/src/style/CompositionStyle.js +12 -6
  19. package/src/style/ContourStyle.js +1 -1
  20. package/src/style/DotDensityStyle.js +4 -4
  21. package/src/style/JoyPlotStyle.js +1 -1
  22. package/src/style/KernelSmoothingOldStyle.js +1 -1
  23. package/src/style/KernelSmoothingStyle.js +1 -1
  24. package/src/style/KernelSmoothingWGLStyle.js +1 -1
  25. package/src/style/LegoStyle.js +4 -4
  26. package/src/style/MosaicStyle.js +1 -1
  27. package/src/style/NinjaStarStyle.js +2 -2
  28. package/src/style/PillarStyle.js +1 -1
  29. package/src/style/SegmentStyle.js +1 -1
  30. package/src/style/ShapeColorSizeStyle.js +1 -1
  31. package/src/style/SideCatStyle.js +1 -1
  32. package/src/style/SideStyle.js +1 -1
  33. package/src/style/SquareColorCatWGLStyle.js +4 -4
  34. package/src/style/SquareColorWGLStyle.js +4 -4
  35. package/src/style/StrokeStyle.js +1 -1
  36. package/src/style/TanakaStyle.js +2 -2
  37. package/src/style/TextStyle.js +1 -1
  38. package/src/utils/WebGLRectangleColoring.js +1 -1
  39. package/src/utils/WebGLSquareColoring.js +1 -1
  40. package/src/utils/WebGLSquareColoringAdvanced.js +1 -1
  41. package/src/utils/WebGLSquareColoringCatAdvanced.js +1 -1
  42. package/src/utils/WebGLSquareColoringKS.js +1 -1
package/README.md CHANGED
@@ -49,9 +49,44 @@ npm install gridviz
49
49
  then
50
50
 
51
51
  ```javascript
52
- gridviz = require('gridviz')
52
+ import * as gridviz from 'gridviz'
53
53
  ```
54
54
 
55
+ Or you can cherry-pick only the modules that you need, for example:
56
+
57
+ ```javascript
58
+ import { App, SquareColorWGLStyle } from 'gridviz'
59
+ ```
60
+
61
+ ### Basic example
62
+
63
+ Here’s a basic example that loads a CSV file of a European population grid (5km resolution):
64
+
65
+ ```javascript
66
+ let myApp = new gridviz.App(containerDiv)
67
+ //set position and zoom
68
+ .setGeoCenter({ x: 4500000, y: 2900000 })
69
+ .setZoomFactor(3000)
70
+ //add CSV layer
71
+ .addCSVGridLayer(
72
+ //data URL
73
+ 'https://raw.githubusercontent.com/eurostat/gridviz/master/assets/csv/Europe/pop_2018_5km.csv',
74
+ //resolution, in CRS unit (m)
75
+ 5000,
76
+ //the style
77
+ [
78
+ new gridviz.SquareColorWGLStyle({
79
+ //the CSV column to show
80
+ colorCol: 'Population',
81
+ //value to [0,1] mapping function
82
+ tFun: (value) => gridviz.sExp(Math.min(value / 100000, 1), -15),
83
+ }),
84
+ ]
85
+ )
86
+ ```
87
+
88
+ See the **[documentation page](https://eurostat.github.io/gridviz/docs/reference)** for more information.
89
+
55
90
  ### standalone
56
91
 
57
92
  ```javascript