@bitblit/ratchet-echarts 0.1.4-alpha → 0.1.6-alpha
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/README.md +57 -2
- package/dist/static/build-properties.json +5 -5
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ indebted. I have forked it because that library appears to now be dormant, and
|
|
|
6
6
|
versions of echarts, and the new prebuilt versions of canvas in my Lambda functions. I also prefer typescript
|
|
7
7
|
and will be bringing in type information.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Install
|
|
10
10
|
|
|
11
11
|
Note: Since this library depends on Echarts >= 5.x and node-canvas (canvas) >= 2.9.3, it auto-bundles in the
|
|
12
12
|
correct native libraries (prebuilt) for Windows, OSX, and Linux - see [the canvas github page](https://github.com/Automattic/node-canvas)
|
|
@@ -16,7 +16,62 @@ for details. Therefore, all you have to do is:
|
|
|
16
16
|
npm install @bitblit/ratchet-echarts
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### Special notes for AWS Lambda
|
|
20
|
+
|
|
21
|
+
Most important - you MUST set your lambda to have sufficient memory - probably 512Mb or more. If you find yourself
|
|
22
|
+
getting timeouts with no errors logged after adding the library, you most likely have insufficient memory set.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
If you are using AWS Lambda (either Node 14/16, or containers built from the AWS parent container for them), you will
|
|
26
|
+
likely encounter the error "/lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /var/task/node_modules/canvas/build/Release/libpng16.so.16)"
|
|
27
|
+
|
|
28
|
+
See [the node-canvas issue for more details](https://github.com/Automattic/node-canvas/issues/1779). The solution
|
|
29
|
+
varies depending on how you use Lambda.
|
|
30
|
+
|
|
31
|
+
### Using a custom docker container (1st way)
|
|
32
|
+
To make sure it is compatible with whatever the current build of the image is, we will build from scratch. In our
|
|
33
|
+
docker container, we'll add :
|
|
34
|
+
|
|
35
|
+
```docker
|
|
36
|
+
# To build things in yarn
|
|
37
|
+
RUN yum -y install python3
|
|
38
|
+
RUN yum -y install pkgconfig make
|
|
39
|
+
|
|
40
|
+
# Specifically for building canvas
|
|
41
|
+
RUN yum -y install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
And then, in the container we'll force a clean build, either by using
|
|
45
|
+
```docker
|
|
46
|
+
RUN npm install --build-from-source
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
or
|
|
50
|
+
|
|
51
|
+
```docker
|
|
52
|
+
RUN npm_config_build_from_source=true yarn install
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Using a custom docker container (alternate way)
|
|
56
|
+
Add this to your container:
|
|
57
|
+
```docker
|
|
58
|
+
# Bring these in to make echarts work...
|
|
59
|
+
# Also requires setting the LD_LIBRARY_PATH variable in the config
|
|
60
|
+
# https://github.com/Automattic/node-canvas/issues/1779
|
|
61
|
+
RUN yum -y install libuuid-devel libmount-devel
|
|
62
|
+
RUN cp /lib64/{libuuid,libmount,libblkid}.so.1 ${LAMBDA_TASK_ROOT}/node_modules/canvas/build/Release/
|
|
63
|
+
# End charts stuff
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
And then set an environment variable:
|
|
67
|
+
```
|
|
68
|
+
LD_LIBRARY_PATH="${LAMBDA_TASK_ROOT}/modules/api/node_modules/canvas/build/Release:${LD_LIBRARY_PATH}"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Using one of the AWS Node options
|
|
72
|
+
Use a [prebuilt layer](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:990551184979:applications~lambda-layer-canvas-nodejs)
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
20
75
|
|
|
21
76
|
```typescript
|
|
22
77
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildVersion": "
|
|
3
|
-
"buildHash": "
|
|
4
|
-
"buildBranch": "alpha-
|
|
5
|
-
"buildTag": "alpha-
|
|
6
|
-
"buildTime": "
|
|
2
|
+
"buildVersion": "6",
|
|
3
|
+
"buildHash": "9c183335f67bfe4cd9351c534a7246a6aa373ae3",
|
|
4
|
+
"buildBranch": "alpha-2023-01-23-9",
|
|
5
|
+
"buildTag": "alpha-2023-01-23-9",
|
|
6
|
+
"buildTime": "2023-01-23 23:18:56 PM America/Los_Angeles"
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitblit/ratchet-echarts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-alpha",
|
|
4
4
|
"description": "Library for using echarts on Node",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"remove-compiled-tests": "rimraf ./dist/examples && rimraf ./dist/**/*.spec.d.ts && rimraf ./dist/**/*.spec.js && rimraf ./dist/**/*.spec.js.map",
|
|
31
31
|
"clean": "shx rm -Rf dist",
|
|
32
32
|
"compile-test": "yarn compile && yarn test",
|
|
33
|
-
"apply-ci-vars": "
|
|
33
|
+
"apply-ci-vars": "yarn ratchet-apply-ci-env-variables-to-files github dist/static/build-properties.json",
|
|
34
34
|
"test": "jest",
|
|
35
35
|
"lint": "eslint src/**/*.ts",
|
|
36
36
|
"lint-fix": "eslint --fix src/**/*.ts",
|
|
@@ -49,29 +49,29 @@
|
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/bitblit/ratchet-echarts-echarts#readme",
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"canvas": "2.
|
|
53
|
-
"echarts": "5.
|
|
52
|
+
"canvas": "2.11.0",
|
|
53
|
+
"echarts": "5.4.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@bitblit/ratchet": "0.
|
|
57
|
-
"@types/jest": "
|
|
56
|
+
"@bitblit/ratchet": "3.0.68",
|
|
57
|
+
"@types/jest": "29.2.6",
|
|
58
58
|
"@types/node": "14.18.1",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
60
|
-
"@typescript-eslint/parser": "5.
|
|
61
|
-
"barrelsby": "2.
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "5.49.0",
|
|
60
|
+
"@typescript-eslint/parser": "5.49.0",
|
|
61
|
+
"barrelsby": "2.5.1",
|
|
62
62
|
"cross-fetch": "3.1.5",
|
|
63
63
|
"eslint": "8.19.0",
|
|
64
|
-
"eslint-config-prettier": "8.
|
|
65
|
-
"eslint-plugin-import": "2.
|
|
64
|
+
"eslint-config-prettier": "8.6.0",
|
|
65
|
+
"eslint-plugin-import": "2.27.5",
|
|
66
66
|
"eslint-plugin-prettier": "4.2.1",
|
|
67
|
-
"husky": "8.0.
|
|
68
|
-
"jest": "
|
|
67
|
+
"husky": "8.0.3",
|
|
68
|
+
"jest": "29.3.1",
|
|
69
69
|
"jsonwebtoken": "8.5.1",
|
|
70
|
-
"prettier": "2.
|
|
70
|
+
"prettier": "2.8.3",
|
|
71
71
|
"pretty-quick": "3.1.3",
|
|
72
|
-
"rimraf": "
|
|
72
|
+
"rimraf": "4.1.2",
|
|
73
73
|
"shx": "0.3.4",
|
|
74
|
-
"ts-jest": "
|
|
74
|
+
"ts-jest": "29.0.5",
|
|
75
75
|
"typescript": "4.6.4"
|
|
76
76
|
}
|
|
77
77
|
}
|