@tidepool/viz 1.38.0 → 1.39.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.
- package/dist/data.js +1 -1
- package/dist/data.js.map +1 -1
- package/dist/getAGPFigures.js +2 -1
- package/dist/getAGPFigures.js.LICENSE.txt +1 -0
- package/dist/getAGPFigures.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.LICENSE.txt +1 -0
- package/dist/index.js.map +1 -1
- package/dist/print.js +2 -1
- package/dist/print.js.LICENSE.txt +27 -0
- package/dist/print.js.map +1 -1
- package/package.json +118 -98
- package/static-assets/images/capturAGP-logo.png +0 -0
- package/static-assets/images/sitechange-cannula.png +0 -0
- package/static-assets/images/sitechange-reservoir.png +0 -0
- package/static-assets/images/sitechange-tubing.png +0 -0
- package/static-assets/images/tidepool-logo-408x46.png +0 -0
- package/.bookignore +0 -29
- package/.dockerignore +0 -10
- package/.nvmrc +0 -1
- package/.prettierignore +0 -1
- package/Dockerfile +0 -47
- package/SUMMARY.md +0 -32
- package/artifact.sh +0 -6
- package/babel.config.js +0 -30
- package/docs/Architecture.md +0 -111
- package/docs/Background.md +0 -39
- package/docs/CodeStyle.md +0 -19
- package/docs/DirectoryStructure.md +0 -137
- package/docs/FeatureOverview.md +0 -107
- package/docs/StartHere.md +0 -28
- package/docs/Storybook.md +0 -47
- package/docs/deps/D3.md +0 -73
- package/docs/deps/GSAP.md +0 -54
- package/docs/deps/Moment.md +0 -7
- package/docs/deps/README.md +0 -14
- package/docs/deps/React.md +0 -6
- package/docs/deps/ReactMotion.md +0 -46
- package/docs/deps/Webpack.md +0 -7
- package/docs/misc/CommonProps.md +0 -31
- package/docs/misc/Docs.md +0 -40
- package/docs/misc/README.md +0 -5
- package/docs/misc/TimeRenderingModes.md +0 -35
- package/docs/views/README.md +0 -6
- package/docs/views/Trends.md +0 -130
- package/docs/views/images/bgm_trends.png +0 -0
- package/docs/views/images/bgm_trends_date_line_hover.png +0 -0
- package/docs/views/images/bgm_trends_range_hover.png +0 -0
- package/docs/views/images/bgm_trends_smbg_hover.png +0 -0
- package/docs/views/images/cgm_trends.png +0 -0
- package/docs/views/images/cgm_trends_segment_hover.gif +0 -0
- package/docs/views/images/cgm_trends_segment_hover_hold.png +0 -0
- package/docs/views/images/cgm_trends_segment_hover_hold_cbg.png +0 -0
- package/docs/views/images/tidelineContainer@2x.png +0 -0
- package/docs/views/images/trends_code_locations.png +0 -0
- package/postcss.config.js +0 -6
- package/static/blob-stream.js +0 -4684
- package/static/pdfkit.js +0 -34652
- package/storiesDatatypes/components/common/data/Basal.js +0 -108
- package/storiesDatatypes/components/common/data/Bolus.js +0 -219
- package/storiesDatatypes/components/common/data/Suspend.js +0 -38
- package/storiesDatatypes/helpers/SixHrScaleSVGDecorator.js +0 -55
- package/storiesDatatypes/index.js +0 -2
- package/storybookDatatypes/addons.js +0 -1
- package/storybookDatatypes/config.js +0 -12
- package/update-gh-pages.sh +0 -23
package/package.json
CHANGED
|
@@ -1,161 +1,181 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tidepool/viz",
|
|
3
|
-
"
|
|
3
|
+
"engines": {
|
|
4
|
+
"node": "20.8.0"
|
|
5
|
+
},
|
|
6
|
+
"packageManager": "yarn@3.6.4",
|
|
7
|
+
"version": "1.39.0",
|
|
4
8
|
"description": "Tidepool data visualization for diabetes device data.",
|
|
5
9
|
"keywords": [
|
|
6
10
|
"data visualization"
|
|
7
11
|
],
|
|
8
12
|
"main": "dist/index.js",
|
|
9
13
|
"scripts": {
|
|
10
|
-
"apidocs": "
|
|
11
|
-
"browser-tests": "NODE_ENV=test
|
|
12
|
-
"build": "NODE_ENV=production npm run clean && NODE_ENV=production
|
|
13
|
-
"build-dev": "npm run clean && NODE_ENV=development
|
|
14
|
+
"apidocs": "yarn jsdoc2md",
|
|
15
|
+
"browser-tests": "NODE_ENV=test yarn karma start --browsers Chrome",
|
|
16
|
+
"build": "NODE_ENV=production npm run clean && NODE_ENV=production yarn webpack --config package.config.js",
|
|
17
|
+
"build-dev": "npm run clean && NODE_ENV=development yarn webpack --config package.config.js --progress",
|
|
14
18
|
"build-docs": "./update-gh-pages.sh",
|
|
15
|
-
"build-storybooks": "
|
|
16
|
-
"clean": "NODE_ENV=production
|
|
17
|
-
"lint": "NODE_ENV=test
|
|
18
|
-
"prepublishOnly": "NODE_ENV=production
|
|
19
|
+
"build-storybooks": "yarn build-storybook -c storybook -o web/stories && yarn build-storybook -c storybookDatatypes -o web/diabetes-data-stories",
|
|
20
|
+
"clean": "NODE_ENV=production yarn rimraf ./dist/*",
|
|
21
|
+
"lint": "NODE_ENV=test yarn eslint src/ stories/ storiesDatatypes/ test/ *.js",
|
|
22
|
+
"prepublishOnly": "NODE_ENV=production yarn rimraf ./node_modules && yarn install --immutable && npm test && NODE_ENV=production npm run build",
|
|
19
23
|
"pretest": "NODE_ENV=test npm run lint",
|
|
20
|
-
"serve-docs": "
|
|
21
|
-
"start": "NODE_ENV=development
|
|
22
|
-
"stories": "NODE_OPTIONS=\"--max_old_space_size=4096\" NODE_ENV=development
|
|
23
|
-
"test": "TZ=UTC NODE_ENV=test
|
|
24
|
-
"test-watch": "TZ=UTC NODE_ENV=test
|
|
25
|
-
"typestories": "NODE_ENV=development
|
|
24
|
+
"serve-docs": "yarn gitbook serve",
|
|
25
|
+
"start": "NODE_ENV=development yarn webpack --config package.config.js --watch --progress",
|
|
26
|
+
"stories": "NODE_OPTIONS=\"--max_old_space_size=4096\" NODE_ENV=development yarn sb dev -c storybook -p 8083 --ci",
|
|
27
|
+
"test": "TZ=UTC NODE_ENV=test yarn karma start",
|
|
28
|
+
"test-watch": "TZ=UTC NODE_ENV=test DEV_TOOL=inline-source-map yarn karma start --no-single-run --reporters=mocha",
|
|
29
|
+
"typestories": "NODE_ENV=development yarn sb dev -c storybookDatatypes -p 8082 --ci"
|
|
26
30
|
},
|
|
27
31
|
"repository": {
|
|
28
32
|
"type": "git",
|
|
29
33
|
"url": "git+https://github.com/tidepool-org/viz.git"
|
|
30
34
|
},
|
|
31
|
-
"engines": {
|
|
32
|
-
"node": ">=10.x",
|
|
33
|
-
"npm": ">=6.x"
|
|
34
|
-
},
|
|
35
35
|
"license": "BSD-2-Clause",
|
|
36
36
|
"bugs": {
|
|
37
37
|
"url": "https://github.com/tidepool-org/viz/issues"
|
|
38
38
|
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"static-assets"
|
|
42
|
+
],
|
|
39
43
|
"homepage": "https://github.com/tidepool-org/viz#readme",
|
|
40
44
|
"dependencies": {
|
|
41
|
-
"bluebird": "3.
|
|
45
|
+
"bluebird": "3.7.2",
|
|
42
46
|
"bows": "1.7.2",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"d3-
|
|
48
|
-
"d3-
|
|
49
|
-
"d3-
|
|
50
|
-
"d3-
|
|
51
|
-
"
|
|
47
|
+
"browserify-zlib": "0.2.0",
|
|
48
|
+
"buffer": "6.0.3",
|
|
49
|
+
"classnames": "2.3.2",
|
|
50
|
+
"crossfilter2": "1.5.4",
|
|
51
|
+
"d3-array": "3.2.4",
|
|
52
|
+
"d3-format": "3.1.0",
|
|
53
|
+
"d3-scale": "4.0.2",
|
|
54
|
+
"d3-shape": "3.2.0",
|
|
55
|
+
"d3-time": "3.1.0",
|
|
56
|
+
"d3-time-format": "4.1.0",
|
|
57
|
+
"emotion": "11.0.0",
|
|
58
|
+
"events": "3.3.0",
|
|
52
59
|
"fastest-validator": "0.6.10",
|
|
53
|
-
"gsap": "
|
|
54
|
-
"i18next": "
|
|
60
|
+
"gsap": "3.12.2",
|
|
61
|
+
"i18next": "23.6.0",
|
|
55
62
|
"intl": "1.2.5",
|
|
63
|
+
"intl-pluralrules": "2.0.1",
|
|
56
64
|
"lodash": "4.17.21",
|
|
57
65
|
"memorystream": "0.3.1",
|
|
58
66
|
"moment": "2.29.4",
|
|
59
|
-
"moment-timezone": "0.5.
|
|
67
|
+
"moment-timezone": "0.5.43",
|
|
60
68
|
"parse-svg-path": "0.1.2",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
69
|
+
"pdfkit": "0.13.0",
|
|
70
|
+
"process": "0.11.10",
|
|
71
|
+
"prop-types": "15.8.1",
|
|
72
|
+
"react": "16.14.0",
|
|
63
73
|
"react-clipboard.js": "2.0.16",
|
|
64
|
-
"react-collapse": "5.
|
|
74
|
+
"react-collapse": "5.1.1",
|
|
65
75
|
"react-dimensions": "1.3.1",
|
|
66
|
-
"react-dom": "16.
|
|
67
|
-
"react-markdown": "
|
|
76
|
+
"react-dom": "16.14.0",
|
|
77
|
+
"react-markdown": "8.0.7",
|
|
68
78
|
"react-motion": "0.5.2",
|
|
69
|
-
"react-redux": "
|
|
70
|
-
"react-select": "
|
|
71
|
-
"react-sizeme": "
|
|
79
|
+
"react-redux": "8.1.3",
|
|
80
|
+
"react-select": "5.7.7",
|
|
81
|
+
"react-sizeme": "3.0.2",
|
|
72
82
|
"react-transition-group-plus": "0.5.3",
|
|
83
|
+
"readable-stream": "4.4.2",
|
|
73
84
|
"reductio": "1.0.0",
|
|
74
|
-
"redux": "
|
|
85
|
+
"redux": "4.2.1",
|
|
75
86
|
"serialize-svg-path": "0.1.0",
|
|
76
|
-
"sundial": "1.
|
|
87
|
+
"sundial": "1.7.1",
|
|
77
88
|
"svg-to-pdfkit": "0.1.8",
|
|
78
89
|
"text-table": "0.2.0",
|
|
79
90
|
"translate-svg-path": "0.0.1",
|
|
91
|
+
"util": "0.12.5",
|
|
80
92
|
"victory": "31.3.0",
|
|
81
|
-
"
|
|
93
|
+
"victory-core": "31.2.0",
|
|
94
|
+
"voilab-pdf-table": "0.5.1"
|
|
82
95
|
},
|
|
83
96
|
"devDependencies": {
|
|
84
|
-
"@babel/cli": "7.
|
|
85
|
-
"@babel/core": "7.
|
|
86
|
-
"@babel/
|
|
87
|
-
"@babel/
|
|
88
|
-
"@babel/
|
|
89
|
-
"@babel/
|
|
90
|
-
"@babel/
|
|
97
|
+
"@babel/cli": "7.23.0",
|
|
98
|
+
"@babel/core": "7.23.0",
|
|
99
|
+
"@babel/eslint-parser": "7.22.15",
|
|
100
|
+
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
|
|
101
|
+
"@babel/plugin-transform-modules-commonjs": "7.23.0",
|
|
102
|
+
"@babel/polyfill": "7.12.1",
|
|
103
|
+
"@babel/preset-env": "7.23.2",
|
|
104
|
+
"@babel/preset-react": "7.22.15",
|
|
105
|
+
"@babel/runtime": "7.23.1",
|
|
91
106
|
"@hot-loader/react-dom": "16.11.0",
|
|
92
|
-
"@storybook/addon-
|
|
93
|
-
"@storybook/addon-
|
|
94
|
-
"@storybook/
|
|
95
|
-
"@storybook/
|
|
96
|
-
"@storybook/react": "5.0
|
|
107
|
+
"@storybook/addon-essentials": "7.5.0",
|
|
108
|
+
"@storybook/addon-knobs": "7.0.2",
|
|
109
|
+
"@storybook/addons": "7.5.0",
|
|
110
|
+
"@storybook/cli": "7.5.0",
|
|
111
|
+
"@storybook/react": "7.5.0",
|
|
112
|
+
"@storybook/react-webpack5": "7.5.0",
|
|
113
|
+
"assert": "2.1.0",
|
|
97
114
|
"babel-core": "7.0.0-bridge.0",
|
|
98
|
-
"babel-
|
|
99
|
-
"babel-
|
|
100
|
-
"babel-
|
|
101
|
-
"
|
|
102
|
-
"chai": "4.
|
|
103
|
-
"chance": "1.
|
|
104
|
-
"chromedriver": "
|
|
105
|
-
"
|
|
115
|
+
"babel-loader": "9.1.3",
|
|
116
|
+
"babel-plugin-istanbul": "6.1.1",
|
|
117
|
+
"babel-preset-react-app": "10.0.1",
|
|
118
|
+
"brfs": "2.0.2",
|
|
119
|
+
"chai": "4.3.10",
|
|
120
|
+
"chance": "1.1.11",
|
|
121
|
+
"chromedriver": "119.0.1",
|
|
122
|
+
"create-react-class": "15.7.0",
|
|
123
|
+
"css-loader": "6.8.1",
|
|
106
124
|
"enzyme": "3.11.0",
|
|
107
|
-
"enzyme-adapter-react-16": "1.15.
|
|
108
|
-
"eslint": "
|
|
109
|
-
"eslint-config-airbnb": "
|
|
110
|
-
"eslint-plugin-import": "2.
|
|
111
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
112
|
-
"eslint-plugin-lodash": "
|
|
125
|
+
"enzyme-adapter-react-16": "1.15.7",
|
|
126
|
+
"eslint": "8.51.0",
|
|
127
|
+
"eslint-config-airbnb": "19.0.4",
|
|
128
|
+
"eslint-plugin-import": "2.28.1",
|
|
129
|
+
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
130
|
+
"eslint-plugin-lodash": "7.4.0",
|
|
113
131
|
"eslint-plugin-moment-utc": "1.0.0",
|
|
114
|
-
"eslint-plugin-react": "7.
|
|
115
|
-
"
|
|
116
|
-
"jsdoc-to-markdown": "4.0.1",
|
|
132
|
+
"eslint-plugin-react": "7.33.2",
|
|
133
|
+
"jsdoc-to-markdown": "8.0.0",
|
|
117
134
|
"json-loader": "0.5.7",
|
|
118
|
-
"jsx-ast-utils": "
|
|
119
|
-
"karma": "6.
|
|
135
|
+
"jsx-ast-utils": "3.3.5",
|
|
136
|
+
"karma": "6.4.2",
|
|
120
137
|
"karma-chai": "0.1.0",
|
|
121
|
-
"karma-chrome-launcher": "3.
|
|
122
|
-
"karma-coverage": "2.
|
|
138
|
+
"karma-chrome-launcher": "3.2.0",
|
|
139
|
+
"karma-coverage": "2.2.1",
|
|
123
140
|
"karma-intl-shim": "1.0.3",
|
|
124
|
-
"karma-mocha": "
|
|
141
|
+
"karma-mocha": "2.0.1",
|
|
125
142
|
"karma-mocha-reporter": "2.2.5",
|
|
126
143
|
"karma-sinon": "1.0.5",
|
|
127
|
-
"karma-sourcemap-loader": "0.
|
|
128
|
-
"karma-webpack": "
|
|
129
|
-
"
|
|
144
|
+
"karma-sourcemap-loader": "0.4.0",
|
|
145
|
+
"karma-webpack": "5.0.0",
|
|
146
|
+
"minimist": "1.2.8",
|
|
147
|
+
"mocha": "10.2.0",
|
|
130
148
|
"object-invariant-test-helper": "0.1.1",
|
|
131
149
|
"optional": "0.1.4",
|
|
132
|
-
"plotly.js-basic-dist-min": "2.
|
|
133
|
-
"postcss": "
|
|
134
|
-
"postcss-calc": "
|
|
135
|
-
"postcss-custom-properties": "
|
|
136
|
-
"postcss-loader": "3.
|
|
137
|
-
"react-hot-loader": "4.
|
|
138
|
-
"react-test-renderer": "16.
|
|
139
|
-
"rimraf": "
|
|
140
|
-
"sinon": "
|
|
141
|
-
"style-loader": "
|
|
150
|
+
"plotly.js-basic-dist-min": "2.26.2",
|
|
151
|
+
"postcss": "8.4.31",
|
|
152
|
+
"postcss-calc": "9.0.1",
|
|
153
|
+
"postcss-custom-properties": "13.3.2",
|
|
154
|
+
"postcss-loader": "7.3.3",
|
|
155
|
+
"react-hot-loader": "4.13.1",
|
|
156
|
+
"react-test-renderer": "16.14.0",
|
|
157
|
+
"rimraf": "5.0.5",
|
|
158
|
+
"sinon": "17.0.0",
|
|
159
|
+
"style-loader": "3.3.3",
|
|
142
160
|
"tidepool-standard-action": "0.1.1",
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"webpack
|
|
161
|
+
"transform-loader": "0.2.4",
|
|
162
|
+
"url-loader": "4.1.1",
|
|
163
|
+
"webpack": "5.89.0",
|
|
164
|
+
"webpack-cli": "5.1.4"
|
|
146
165
|
},
|
|
147
166
|
"peerDependencies": {
|
|
148
167
|
"babel-core": "6.x || ^7.0.0-bridge.0",
|
|
149
168
|
"classnames": "2.x",
|
|
150
|
-
"lodash": "4.x",
|
|
151
|
-
"moment-timezone": "0.x",
|
|
152
169
|
"react": "16.x",
|
|
153
170
|
"react-addons-update": "16.x",
|
|
154
171
|
"react-dom": "16.x",
|
|
155
|
-
"react-redux": "
|
|
156
|
-
"redux": "
|
|
172
|
+
"react-redux": "8.x",
|
|
173
|
+
"redux": "4.x"
|
|
157
174
|
},
|
|
158
175
|
"resolutions": {
|
|
159
|
-
"
|
|
176
|
+
"highlight.js": "10.4.1",
|
|
177
|
+
"jackspeak": "2.1.1",
|
|
178
|
+
"lodash": "4.17.21",
|
|
179
|
+
"prismjs": "1.29.0"
|
|
160
180
|
}
|
|
161
181
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.bookignore
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
**/*.css
|
|
2
|
-
**/*.js
|
|
3
|
-
**/*.sketch
|
|
4
|
-
coverage/
|
|
5
|
-
data/
|
|
6
|
-
dist/
|
|
7
|
-
local/
|
|
8
|
-
node_modules/
|
|
9
|
-
stories/
|
|
10
|
-
stories-datatypes/
|
|
11
|
-
storybook/
|
|
12
|
-
storybook-datatypes/
|
|
13
|
-
test/
|
|
14
|
-
web/
|
|
15
|
-
.babelrc
|
|
16
|
-
.bookignore
|
|
17
|
-
.editorconfig
|
|
18
|
-
.eslintrc
|
|
19
|
-
.gitignore
|
|
20
|
-
.npmignore
|
|
21
|
-
.travis.yml
|
|
22
|
-
karma.conf.js
|
|
23
|
-
LICENSE
|
|
24
|
-
loadtests.js
|
|
25
|
-
package.config.js
|
|
26
|
-
package.json
|
|
27
|
-
update-gh-pages.sh
|
|
28
|
-
webpack.config.js
|
|
29
|
-
yarn.lock
|
package/.dockerignore
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
10.14.2
|
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
**
|
package/Dockerfile
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
### Stage 0 - Base image
|
|
2
|
-
FROM node:10.14.2-alpine as base
|
|
3
|
-
WORKDIR /app
|
|
4
|
-
RUN mkdir -p dist node_modules && chown -R node:node .
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
### Stage 1 - Base image for development image to install and configure Chromium for unit tests
|
|
8
|
-
FROM base as developbase
|
|
9
|
-
RUN \
|
|
10
|
-
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
|
11
|
-
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
|
|
12
|
-
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
|
13
|
-
&& apk --no-cache update \
|
|
14
|
-
&& apk --no-cache upgrade \
|
|
15
|
-
&& apk add --no-cache git fontconfig bash udev ttf-opensans chromium \
|
|
16
|
-
&& rm -rf /var/cache/apk/* /tmp/*
|
|
17
|
-
ENV \
|
|
18
|
-
CHROME_BIN=/usr/bin/chromium-browser \
|
|
19
|
-
LIGHTHOUSE_CHROMIUM_PATH=/usr/bin/chromium-browser \
|
|
20
|
-
NODE_ENV=development
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Stage 2 - Create cached `node_modules`
|
|
24
|
-
# Only rebuild layer if `package.json` has changed
|
|
25
|
-
FROM base as dependencies
|
|
26
|
-
RUN apk --no-cache update \
|
|
27
|
-
&& apk --no-cache upgrade \
|
|
28
|
-
&& apk add --no-cache git
|
|
29
|
-
USER node
|
|
30
|
-
COPY package.json .
|
|
31
|
-
# Upgrade to npm6.9.0 to allow installing modules that use alias feature
|
|
32
|
-
RUN npm install npm@6.9.0
|
|
33
|
-
# Ignore scripts during install to prevent `prepare` and `prepublishOnly` from running
|
|
34
|
-
RUN node_modules/.bin/npm install --ignore-scripts
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### Stage 3 - Development root with Chromium installed for unit tests
|
|
38
|
-
FROM developbase as develop
|
|
39
|
-
WORKDIR /app
|
|
40
|
-
USER node
|
|
41
|
-
# Copy all `node_modules` from dependancies layer
|
|
42
|
-
COPY --chown=node:node --from=dependencies /app/node_modules ./node_modules
|
|
43
|
-
# Copy source files
|
|
44
|
-
COPY --chown=node:node . .
|
|
45
|
-
EXPOSE 8082 8083
|
|
46
|
-
VOLUME ["/app", "/app/node_modules", "/app/dist"]
|
|
47
|
-
CMD ["npm", "start"]
|
package/SUMMARY.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Summary
|
|
2
|
-
|
|
3
|
-
+ [@tidepool/viz developer guide](docs/StartHere.md)
|
|
4
|
-
+ [background](docs/Background.md)
|
|
5
|
-
+ [overview of features](docs/FeatureOverview.md)
|
|
6
|
-
+ [planned architecture](docs/Architecture.md)
|
|
7
|
-
+ [app & directory structure](docs/DirectoryStructure.md)
|
|
8
|
-
+ [code style](docs/CodeStyle.md)
|
|
9
|
-
+ [per-view documentation](docs/views/README.md)
|
|
10
|
-
+ [Device Settings view](src/components/settings/README.md)
|
|
11
|
-
+ [Trends view](docs/views/Trends.md)
|
|
12
|
-
+ [use of React Storybook](docs/Storybook.md)
|
|
13
|
-
+ [usage of dependencies](docs/deps/README.md)
|
|
14
|
-
+ [D3](docs/deps/D3.md)
|
|
15
|
-
+ [GSAP](docs/deps/GSAP.md)
|
|
16
|
-
+ [Moment](docs/deps/Moment.md)
|
|
17
|
-
+ [React](docs/deps/React.md)
|
|
18
|
-
+ [React Motion](docs/deps/ReactMotion.md)
|
|
19
|
-
+ [Redux](docs/deps/Redux.md)
|
|
20
|
-
+ [webpack](docs/deps/Webpack.md)
|
|
21
|
-
+ [utilities](src/utils/README.md)
|
|
22
|
-
+ [API docs for utilities](src/utils/apidocs/README.md)
|
|
23
|
-
+ [basal](src/utils/apidocs/basal.md)
|
|
24
|
-
+ [blood glucose](src/utils/apidocs/bloodglucose.md)
|
|
25
|
-
+ [bolus](src/utils/apidocs/bolus.md)
|
|
26
|
-
+ [datetime](src/utils/apidocs/datetime.md)
|
|
27
|
-
+ [format](src/utils/apidocs/format.md)
|
|
28
|
-
+ [misc](src/utils/apidocs/misc.md)
|
|
29
|
-
+ [misc](docs/misc/README.md)
|
|
30
|
-
+ [Common props](docs/misc/CommonProps.md)
|
|
31
|
-
+ [Docs setup & publishing](docs/misc/Docs.md)
|
|
32
|
-
+ [Time-rendering modes](docs/misc/TimeRenderingModes.md)
|
package/artifact.sh
DELETED
package/babel.config.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports = function babelConfig(api) {
|
|
2
|
-
const presets = [
|
|
3
|
-
'@babel/preset-env',
|
|
4
|
-
'@babel/preset-react',
|
|
5
|
-
'babel-preset-react-app',
|
|
6
|
-
];
|
|
7
|
-
|
|
8
|
-
const plugins = [
|
|
9
|
-
'react-hot-loader/babel',
|
|
10
|
-
'@babel/plugin-proposal-class-properties',
|
|
11
|
-
'@babel/plugin-transform-modules-commonjs',
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
const env = api.env();
|
|
15
|
-
|
|
16
|
-
if (env === 'test') {
|
|
17
|
-
plugins.unshift(
|
|
18
|
-
['babel-plugin-istanbul', {
|
|
19
|
-
useInlineSourceMaps: false,
|
|
20
|
-
}],
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
api.cache(true);
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
presets,
|
|
28
|
-
plugins,
|
|
29
|
-
};
|
|
30
|
-
};
|
package/docs/Architecture.md
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
## Architecture
|
|
2
|
-
|
|
3
|
-
#### Background documents (Tidepool-internal)
|
|
4
|
-
|
|
5
|
-
- A fairly comprehensive set of notes explaining [the tech debt in tideline](https://docs.google.com/document/d/134kiT-aVvp63WpjBOafd63LyhecEs37T0u6-ChsyUSA/edit)
|
|
6
|
-
- Document used to structure discussion around [goals for the tideline rewrite](https://docs.google.com/document/d/1zACQThnrFmlcvxMIF2g_CnnkQ9A16ilw-JSI6oKgvoA/edit#heading=h.4t4q8lakp971)
|
|
7
|
-
|
|
8
|
-
### Desiderata for Tidepool visualization code
|
|
9
|
-
|
|
10
|
-
At a meeting in January 2016, we decided on the following goals for the new visualization code (replacing [tideline](https://github.com/tidepool-org/tideline)). The goal(s) is/are that new visualization code should (eventually):
|
|
11
|
-
|
|
12
|
-
1. be **_responsive_** if rendered inside a responsive container (i.e., precisely what blip does *not* provide at the moment since it creates a `<div>` with fixed width for the visualization code to be rendered in)
|
|
13
|
-
1. sync visualization state with the URL ("deep linking") so that a copied and shared URL can facilitate conversation among the members of a care team
|
|
14
|
-
1. "page" data in from the server and update itself when new data is received rather than only operate via a single "all you can eat" fetch of a user's entire dataset
|
|
15
|
-
1. be modular in order to enable:
|
|
16
|
-
- more efficient development by the core team
|
|
17
|
-
- easier and more efficient contributions from the open-source community
|
|
18
|
-
- "cleaner" and more testable code
|
|
19
|
-
- code re-use by commericial and non-commericial third parties
|
|
20
|
-
|
|
21
|
-
Ambiguous:
|
|
22
|
-
|
|
23
|
-
- tablet support
|
|
24
|
-
|
|
25
|
-
There were also a few desiderata that were discussed but explicitly *rejected*, so the new visualization code should/need **not**:
|
|
26
|
-
|
|
27
|
-
1. cache data on the client side
|
|
28
|
-
1. support non-Chrome browsers
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
### Proposal for the architecture of Tidepool visualization code
|
|
32
|
-
|
|
33
|
-
In this document, we attempt to explain the architectural choices made for Tidepool's data visualization code (in this repository) by listing the major problems the code needs to solve along with the solution proposed (or chosen) for each.
|
|
34
|
-
|
|
35
|
-
#### State management
|
|
36
|
-
|
|
37
|
-
**Problem:** Effectively manage all the state shared across visualizations (listed below) with a minimum of duplicated code so that feature iteration can proceed as efficiently as possible.
|
|
38
|
-
|
|
39
|
-
General principle, learned from experience: It is better to think about the Tidepool data visualizations as *one* (meta) interface between a user and a set of diabetes device (+ contextual) data with many different surface manifestations (daily, bgLog, trends, basics, device settings) than to think of it as half a dozen *different* data visualizations (daily, bgLog, etc.)
|
|
40
|
-
|
|
41
|
-
Another way to phrase this: there is more application state requiring code to manage that is *shared* between all of the separate data views in blip (daily, bgLog, etc.) than there is that is separate. The shared state includes:
|
|
42
|
-
|
|
43
|
-
- user display preference for blood glucose units (mg/dL or mmol/L)
|
|
44
|
-
- user display preference for target blood glucose range
|
|
45
|
-
- user display preference for timezone
|
|
46
|
-
- the actual diabetes device data, preprocessed as necessary to facilitate data visualization
|
|
47
|
-
- the date(s) that the user is focusing on, including filters for days of the week (Monday, Tuesday, etc.) being focused on, where appropriate
|
|
48
|
-
+ Note that even though each data view presently has a different type of date domain (e.g., twenty-four hours, two weeks, most recent three calendar weeks, etc.), we already currently (attempt to) share state across these domains, making this state largely shared. For example, when a user navigates backwards in time on the trends view in two week chunks by having the (default) "14 day" domain selected and clicking the back arrow, if the user then switches to the daily view, they will presented with the most recent twenty-four hours of data within the current 14-day period of time for the trends view.
|
|
49
|
-
- most (if not all) toggles and open/collapsed sections on all views (basics, trends, etc.), so that the user is not jarred/annoyed/confused by having to constantly reselect such choices when navigating between the views
|
|
50
|
-
|
|
51
|
-
**Solution:** Use [redux](http://redux.js.org/ 'Redux') to store shared state in a single source of truth and transform this state with pure functions ("reducers") via dispatched actions (one-way data flow).
|
|
52
|
-
|
|
53
|
-
Note that in the process of slowly and iteratively porting code from [blip](https://github.com/tidepool-org/blip) & [tideline](https://github.com/tidepool-org/tidline) into this repository, we will have stages where we are storing *more* than we would like in the redux state.
|
|
54
|
-
|
|
55
|
-
For example, at present (November 2016), we are controlling hover state on slices in the CGM trends view via redux. Hover state is by definition ephemeral and not generally the kind of thing that belongs in the single, app-wide source of truth that is the redux store. However, because the components rendering the various parts of the CGM trends view are currently divided between blip and this repository, we are using the redux store as a "bridge" to share state across them more easily (and reduce the number of multi-repository code changes we need to make). As we move more visualization-related code from blip into viz, we should take care to reassess what is in the redux-controlled state and refactor anything that should not be controlled through redux (like hover state for CGM in trends slices) to be controlled through the appropriate container component state.
|
|
56
|
-
|
|
57
|
-
#### Data preprocessing
|
|
58
|
-
|
|
59
|
-
Some background documents particular to this problem area (Tidepool-internal):
|
|
60
|
-
|
|
61
|
-
- [early draft explanation and proposal](https://docs.google.com/document/d/190mj_S9vYKvINPbU7cMajGekebyX6AJ-W6v3P-cCRWI/edit# 'viz data preprocessing') for Web Worker-based preprocessing
|
|
62
|
-
- [more detailed proposal](https://docs.google.com/document/d/14n4OyyTKKfBxz7DzX9DnKST3nVarfae7Fgl9HgG6BlY/edit 'blip & viz data flow') after some prototyping with Web Workers
|
|
63
|
-
|
|
64
|
-
**Problem:** Minimize the amount of *user* time spent on "expensive" data processing tasks, such as:
|
|
65
|
-
|
|
66
|
-
- client-side data validation
|
|
67
|
-
+ to filter out data that is perfectly legitimate according to the Tidepool data model (`basal` with zero duration) but is nevertheless not a target for visualization
|
|
68
|
-
+ to filter out legacy or third-party data that is invalid according to the Tidepool data model (to prevent JavaScript runtime crashes that would negatively affect the end-user experience)
|
|
69
|
-
- once-only data preprocessing (may move server-side)
|
|
70
|
-
+ to parse ISO 8601 string Zulu timestamps into hammertimes
|
|
71
|
-
- timezone-sensitive data preprocessing (must be rerun if user changes display timezone preference)
|
|
72
|
-
+ to compute fields like the date and day of week in the local timezone
|
|
73
|
-
+ to computer the number of milliseconds after timezone-determined midnight that the event occurred (necessary for binning data by time of day for trends view)
|
|
74
|
-
|
|
75
|
-
**Solution:** Perform data preprocessing in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers). Experience has taught us that—especially where timestamp parsing and timezone-relative calculations are involved—it is very easy to accidentally cause a user-noticeable performance bottleneck in a JavaScript single-page application (SPA). Using a Web Worker in a separate thread that does not interrupt the responsiveness/interactivity of the SPA allows us "breathing room" to perform potentially expensive calculations. It is also more compatible with an application that updates itself when new user data comes in from the server (i.e., via data paging, real-time push updates, etc.) because the newly arrived data can be processed in the background as it comes in without affecting the end-user's experience.
|
|
76
|
-
|
|
77
|
-
#### Data filtering
|
|
78
|
-
|
|
79
|
-
**Problem:** Centralize the logic for translating one date domain type (e.g., twenty-four hours, two weeks, most recent three calendar weeks, etc.) and location (i.e., timestamp(s) defining the edges and/or center) in one place and prevent performance bottlenecks due to executing complex filters (date range & day of week selections) on large datasets.
|
|
80
|
-
|
|
81
|
-
(Note: the performance bottleneck due to data filtering currently exists (resulting in a poor framerate of < 20 fps) in tideline code on the daily view since the data filtering must be redone many times a second as the user scrolls.)
|
|
82
|
-
|
|
83
|
-
**Solution:** Define a set of redux actions for setting the date domain, location, and other filters in state and apply the filters with [crossfilter](http://square.github.io/crossfilter/ 'Crossfilter') in the Web Worker (see above) to keep the filtering from affecting the end-user experience as far as possible.
|
|
84
|
-
|
|
85
|
-
#### Data munging
|
|
86
|
-
|
|
87
|
-
**Problem:** Centralize the logic for common statistical computations that appear in more than one view such as the basal:bolus ratio, average blood glucose, and time in range. Ensure that gaps in data are handled the same across all visualizations. Ensure that a robust test suite sits behind all statistical computations.
|
|
88
|
-
|
|
89
|
-
**Solution:** Factor out all statistical computations into utility modules that can easily be imported into a variety of components. Keep these utilities as purely functional and general as possible to allow for ease of test instrumentation as well as options for moving the code if performance on some of these computations becomes a user-facing issue/roadblock. For example, computations could be moved into [reselect](https://github.com/reactjs/reselect), a redux add-on library for computing derived state (with memoization) or into the Web Worker used for data preprocessing and filtering.
|
|
90
|
-
|
|
91
|
-
#### "Deep linking"
|
|
92
|
-
|
|
93
|
-
**Problem:** Sync URL with the data visualization state in all the ways that would be useful to an end-user who wishes to share a data view they are currently viewing with another member of their care team.
|
|
94
|
-
|
|
95
|
-
**Solution:** Once data visualization state is being managed more-or-less completely via redux, enabling "deep linking" should be a relatively simple matter of syncing the URL with the redux state, translating various relevant pieces of state into (sub-)paths in the URL and/or query parameters.
|
|
96
|
-
|
|
97
|
-
#### Modularity
|
|
98
|
-
|
|
99
|
-
**Problem:** Empower internal and external developers to develop and iterate quickly on all aspects of data visualizations. This should encompass both the ability to iterate easily on details of low-level rendering (i.e., what shape to draw for an extended bolus) without having to touch other code *and* the ability to build entirely new data "views" parallel to the daily, bgLog, basics, trends, and device settings views currently available by composing existing rendering components for the pieces.
|
|
100
|
-
|
|
101
|
-
**Solution:** "Componentize" visualization code, adhering to React (and redux) best practices, including:
|
|
102
|
-
|
|
103
|
-
- only extending the React Component class where the lifecycle methods are necessary, in "container" components
|
|
104
|
-
- keeping rendering logic out of such container components
|
|
105
|
-
- keeping styling out of container components
|
|
106
|
-
- keeping animation logic (i.e., with [react-motion](https://github.com/chenglou/react-motion 'react-motion')) as a distinct layer that sits between container components and low-level rendering components
|
|
107
|
-
- keep complex interface rendering method (e.g., the scrolling interface for the daily view) separate from the low-level rendering of smbgs, cbgs, boluses, basal itnervals, etc. so that:
|
|
108
|
-
+ code for the low-level rendering is reusable across views
|
|
109
|
-
+ the interface rendering method can be iterated on separately or swapped out entirely
|
|
110
|
-
- do actual (i.e., visual) rendering in pure functional components with styling defined in accompanying CSS files (i.e., use CSS modules)
|
|
111
|
-
- refactor CSS continually to keep duplication of styles to a minimum
|
package/docs/Background.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
## Background
|
|
2
|
-
|
|
3
|
-
This repository represents an incremental rewrite of Tidepool's data visualization code. The first implementation of Tidepool's data visualization can be found in [tideline](https://github.com/tidepool-org/tideline 'GitHub: tideline').
|
|
4
|
-
|
|
5
|
-
We continue to develop the data visualization code in a separate repository from Tidepool's main web application [blip](https://github.com/tidepool-org/blip 'GitHub: blip') for several reasons:
|
|
6
|
-
|
|
7
|
-
- separation of concerns: the visualization code has distinct requirements, dependencies, and development practices from the rest of blip
|
|
8
|
-
- potential use by third parties building their own web applications on top of the Tidepool platform but who want to leverage some of the same data visualization components as those used in blip
|
|
9
|
-
|
|
10
|
-
Historically, tideline was a separate codebase for one additional reason that is no longer a concern for us: we wanted to keep the visualization code "pure" D3 and in particular wanted to only have a React dependency in the blip codebase to avoid forcing the choice of React as a framework on third parties who might want to use our visualization code. In 2013-2014 when React was not yet the juggernaut framework it is today, this made a lot more sense.
|
|
11
|
-
|
|
12
|
-
Today with [React having the majority of use & interest](http://stateofjs.com/2016/frontend/ 'The State of JavaScript 2016: Front-end frameworks') among front-end JavaScript frameworks, it is much less of a concern. Moreover, experience taught us—the hard way—that there aren't a lot of really good patterns or frameworks for creating consistent, long-term maintainable, and easily testable D3 code[^a]. On the other hand, React was built at least partly with consistency, maintainability, and testability in mind, and there are well-established community best practices to follow in order to achieve these goals. As a result, our rewrite of Tidepool's data visualization code now includes React as a core dependency, and we are shifting from a strategy of using D3 as much as possible to the opposite: we aim to use React as much as possible and only bring in the small modules we need from [the 4.x rearchitected D3](https://github.com/d3/d3/blob/master/CHANGES.md 'Changes in D3 4.0') as individual dependencies—e.g., [d3-scale](https://github.com/d3/d3-scale 'GitHub: d3-scale') and [d3-time](https://github.com/d3/d3-time 'GitHub: d3-time').
|
|
13
|
-
|
|
14
|
-
### State of the rewrite
|
|
15
|
-
|
|
16
|
-
#### As of November, 2016...
|
|
17
|
-
|
|
18
|
-
Blip depends on @tidepool/viz for:
|
|
19
|
-
|
|
20
|
-
- Device Settings (new implementation)
|
|
21
|
-
- Trends (CGM version as new implementation, BGM version a port of more-or-less equivalent functionality from tideline's code)
|
|
22
|
-
|
|
23
|
-
Blip still depends on tideline for:
|
|
24
|
-
|
|
25
|
-
- Basics view
|
|
26
|
-
- Daily view
|
|
27
|
-
- BG Log view
|
|
28
|
-
- data preprocessing (found in ["nurseshark"](https://github.com/tidepool-org/tideline/tree/master/plugins/nurseshark 'GitHub: tideline plugins/nurseshark/') and [the TidelineData constructor](https://github.com/tidepool-org/tideline/blob/master/js/tidelinedata.js 'GitHub: tideline js/tidelinedata.js'))
|
|
29
|
-
|
|
30
|
-
Blip itself handles:
|
|
31
|
-
|
|
32
|
-
- most of the visualization state management (e.g., checkbox options for BGM version of Trends view)
|
|
33
|
-
- navigation from view to view and along the time dimension
|
|
34
|
-
|
|
35
|
-
The eventual goal is for *everything* listed above to be handled by code in this repository. That is, eventually all code for all the data views as well as for the data preprocessing and visualization state management, including the navigation from view to view and along the time dimension will live in this repository.
|
|
36
|
-
|
|
37
|
-
* * * * *
|
|
38
|
-
|
|
39
|
-
[^a]: The Miso project's [d3.Chart](http://misoproject.com/d3-chart/ 'Miso Project: d3.Chart') was the most promising attempt at a lightweight "framework" for D3 heavily inspired by [Backbone](http://backbonejs.org/ 'Backbone.js')'s API, but the project's support has unfortunately been sporadic, and it [has not yet been updated to support the 4.x version of D3](https://github.com/misoproject/d3.chart/issues/121 'GitHub: d3.chart issue #121'). Nevertheless, we used d3.Chart in [the tideline version of the Trends view](https://github.com/tidepool-org/tideline/tree/master/plugins/blip/modalday 'GitHub: tideline modalday').
|