├── .eslintrc.js ├── .github └── workflows │ ├── deploy.yaml │ ├── dev.yaml │ └── stg.yaml ├── .gitignore ├── LICENSE ├── README.md ├── package.json ├── packages ├── csv-to-hash │ ├── README.md │ ├── data.csv │ ├── index.js │ └── package.json ├── debug │ ├── index.html │ └── package.json ├── example │ └── index.html └── weed365 │ ├── .gitignore │ ├── README.md │ ├── docs │ └── visual.png │ ├── package.json │ ├── src │ └── index.ts │ ├── tsconfig.json │ └── webpack.config.js ├── tsconfig.json └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": [ 7 | "eslint:recommended", 8 | "plugin:@typescript-eslint/recommended" 9 | ], 10 | "parser": "@typescript-eslint/parser", 11 | "parserOptions": { 12 | "ecmaVersion": 12, 13 | "sourceType": "module" 14 | }, 15 | "plugins": [ 16 | "@typescript-eslint" 17 | ], 18 | "rules": { 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yaml: -------------------------------------------------------------------------------- 1 | name: publish 2 | on: 3 | push: 4 | tags: 5 | - "v*" 6 | jobs: 7 | dev: 8 | name: check version, add tag and release 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: checkout 12 | uses: actions/checkout@v2 13 | - name: setup Node 14 | uses: actions/setup-node@v1 15 | with: 16 | node-version: 12.x 17 | registry-url: "https://registry.npmjs.org" 18 | - name: install 19 | run: | 20 | yarn install 21 | - name: typecheck 22 | run: yarn run typecheck 23 | - name: lint 24 | run: yarn run lint 25 | - name: format 26 | run: yarn run format 27 | - name: build 28 | run: yarn run lib run build:prd 29 | - name: release 30 | run: npm publish 31 | working-directory: ./packages/weed365 32 | env: 33 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 34 | -------------------------------------------------------------------------------- /.github/workflows/dev.yaml: -------------------------------------------------------------------------------- 1 | name: dev 2 | 3 | on: 4 | push: 5 | branches: 6 | - "*" 7 | - "**/*" 8 | - "!main" 9 | 10 | jobs: 11 | dev: 12 | name: check version, add tag and release 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: checkout 16 | uses: actions/checkout@v2 17 | - name: setup Node 18 | uses: actions/setup-node@v1 19 | with: 20 | node-version: 12.x 21 | registry-url: "https://registry.npmjs.org" 22 | - name: install 23 | run: | 24 | yarn install 25 | - name: typecheck 26 | run: yarn run typecheck 27 | - name: lint 28 | run: yarn run lint 29 | - name: format 30 | run: yarn run format 31 | - name: build 32 | run: yarn run lib run build:dev 33 | -------------------------------------------------------------------------------- /.github/workflows/stg.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - "main" 5 | jobs: 6 | staging: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: checkout 10 | uses: actions/checkout@v2 11 | - name: setup Node 12 | uses: actions/setup-node@v1 13 | with: 14 | node-version: 12.x 15 | registry-url: "https://registry.npmjs.org" 16 | - name: Install npm packages 17 | run: | 18 | yarn install 19 | - name: typecheck 20 | run: yarn run typecheck 21 | - name: lint 22 | run: yarn run lint 23 | - name: format 24 | run: yarn run format 25 | - name: build 26 | run: yarn run lib run build:prd 27 | - name: App Deploy 28 | uses: peaceiris/actions-gh-pages@v3 29 | with: 30 | github_token: ${{ secrets.GITHUB_TOKEN }} 31 | publish_dir: ./packages/example 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of "npm pack" 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Yuta Ide 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # weed365 2 | 3 | GitHub weed style Web Components 4 | 5 | ## dev 6 | 7 | ```sh 8 | yarn lib run build:dev 9 | 10 | open packages/debug/index.html 11 | ``` 12 | 13 | ## build 14 | 15 | ``` 16 | yarn lib run build:prd 17 | ``` 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weed365", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js", 6 | "repository": "https://github.com/sadnessOjisan/weed365.git", 7 | "author": "sadness_ojisan ", 8 | "license": "MIT", 9 | "workspaces": [ 10 | "packages/*" 11 | ], 12 | "scripts": { 13 | "example": "yarn workspace example", 14 | "typecheck": "tsc -p . --noEmit", 15 | "lib": "yarn workspace weed365", 16 | "lint:fix": "eslint --fix '**/src/**/*.{ts,tsx,js,jsx,json,md}'", 17 | "lint": "eslint '**/src/**/*.{ts,tsx,js,jsx,json,md}'", 18 | "format:fix": "prettier --write '**/src/**/*.{ts,tsx,js,jsx,json,md}'", 19 | "format": "prettier --check '**/src/**/*.{ts,tsx,js,jsx,json,md}'" 20 | }, 21 | "dependencies": { 22 | "@typescript-eslint/eslint-plugin": "^4.22.0", 23 | "@typescript-eslint/parser": "^4.22.0", 24 | "eslint": "^7.25.0", 25 | "eslint-config-prettier": "^8.3.0", 26 | "prettier": "^2.2.1", 27 | "ts-loader": "^9.1.1", 28 | "typescript": "^4.2.4", 29 | "webpack": "^5.35.1", 30 | "webpack-cli": "^4.6.0", 31 | "webpack-dev-server": "^3.11.2" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/csv-to-hash/README.md: -------------------------------------------------------------------------------- 1 | ## csv-to-hash 2 | 3 | convert from 4 | 5 | ```csv 6 | 2021-05-12,254 7 | 2021-05-13,101 8 | 2021-05-14,23 9 | 2021-05-15,1 10 | ``` 11 | 12 | to 13 | 14 | ```json 15 | { "2021-05-12": 254, "2021-05-13": 101, "2021-05-14": 23, "2021-05-15": 1 } 16 | ``` 17 | 18 | ## how to use 19 | 20 | Fill data.csv. 21 | 22 | After that 23 | 24 | ```sh 25 | node index.js 26 | ``` 27 | -------------------------------------------------------------------------------- /packages/csv-to-hash/data.csv: -------------------------------------------------------------------------------- 1 | 2020-01-14,1 2 | 2020-01-15,0 3 | 2020-01-16,0 4 | 2020-01-17,1 5 | 2020-01-18,0 6 | 2020-01-19,0 7 | 2020-01-20,2 8 | 2020-01-21,0 9 | 2020-01-22,1 10 | 2020-01-23,2 11 | 2020-01-24,1 12 | 2020-01-25,0 13 | 2020-01-26,1 14 | 2020-01-27,0 15 | 2020-01-28,1 16 | 2020-01-29,1 17 | 2020-01-30,0 18 | 2020-01-31,0 19 | 2020-02-01,1 20 | 2020-02-02,2 21 | 2020-02-03,2 22 | 2020-02-04,1 23 | 2020-02-05,1 24 | 2020-02-06,1 25 | 2020-02-07,2 26 | 2020-02-08,0 27 | 2020-02-09,0 28 | 2020-02-10,4 29 | 2020-02-11,0 30 | 2020-02-12,1 31 | 2020-02-13,0 32 | 2020-02-14,1 33 | 2020-02-15,0 34 | 2020-02-16,0 35 | 2020-02-17,0 36 | 2020-02-18,1 37 | 2020-02-19,0 38 | 2020-02-20,3 39 | 2020-02-21,0 40 | 2020-02-22,0 41 | 2020-02-23,1 42 | 2020-02-24,2 43 | 2020-02-25,3 44 | 2020-02-26,2 45 | 2020-02-27,2 46 | 2020-02-28,3 47 | 2020-02-29,0 48 | 2020-03-01,2 49 | 2020-03-02,1 50 | 2020-03-03,5 51 | 2020-03-04,3 52 | 2020-03-05,1 53 | 2020-03-06,6 54 | 2020-03-07,2 55 | 2020-03-08,4 56 | 2020-03-09,4 57 | 2020-03-10,9 58 | 2020-03-11,3 59 | 2020-03-12,7 60 | 2020-03-13,6 61 | 2020-03-14,6 62 | 2020-03-15,14 63 | 2020-03-16,17 64 | 2020-03-17,18 65 | 2020-03-18,23 66 | 2020-03-19,25 67 | 2020-03-20,34 68 | 2020-03-21,18 69 | 2020-03-22,36 70 | 2020-03-23,61 71 | 2020-03-24,47 72 | 2020-03-25,63 73 | 2020-03-26,67 74 | 2020-03-27,91 75 | 2020-03-28,95 76 | 2020-03-29,99 77 | 2020-03-30,158 78 | 2020-03-31,106 79 | 2020-04-01,158 80 | 2020-04-02,121 81 | 2020-04-03,164 82 | 2020-04-04,149 83 | 2020-04-05,118 84 | 2020-04-06,137 85 | 2020-04-07,125 86 | 2020-04-08,100 87 | 2020-04-09,78 88 | 2020-04-10,124 89 | 2020-04-11,89 90 | 2020-04-12,69 91 | 2020-04-13,87 92 | 2020-04-14,63 93 | 2020-04-15,61 94 | 2020-04-16,64 95 | 2020-04-17,58 96 | 2020-04-18,52 97 | 2020-04-19,40 98 | 2020-04-20,53 99 | 2020-04-21,43 100 | 2020-04-22,41 101 | 2020-04-23,30 102 | 2020-04-24,28 103 | 2020-04-25,33 104 | 2020-04-26,23 105 | 2020-04-27,28 106 | 2020-04-28,32 107 | 2020-04-29,34 108 | 2020-04-30,17 109 | 2020-05-01,25 110 | 2020-05-02,15 111 | 2020-05-03,21 112 | 2020-05-04,16 113 | 2020-05-05,11 114 | 2020-05-06,7 115 | 2020-05-07,5 116 | 2020-05-08,5 117 | 2020-05-09,6 118 | 2020-05-10,5 119 | 2020-05-11,3 120 | 2020-05-12,5 121 | 2020-05-13,4 122 | 2020-05-14,3 123 | 2020-05-15,6 124 | 2020-05-16,7 125 | 2020-05-17,4 126 | 2020-05-18,5 127 | 2020-05-19,5 128 | 2020-05-20,9 129 | 2020-05-21,5 130 | 2020-05-22,7 131 | 2020-05-23,10 132 | 2020-05-24,15 133 | 2020-05-25,7 134 | 2020-05-26,19 135 | 2020-05-27,13 136 | 2020-05-28,21 137 | 2020-05-29,13 138 | 2020-05-30,10 139 | 2020-05-31,13 140 | 2020-06-01,14 141 | 2020-06-02,13 142 | 2020-06-03,12 143 | 2020-06-04,21 144 | 2020-06-05,15 145 | 2020-06-06,20 146 | 2020-06-07,14 147 | 2020-06-08,23 148 | 2020-06-09,17 149 | 2020-06-10,31 150 | 2020-06-11,19 151 | 2020-06-12,24 152 | 2020-06-13,17 153 | 2020-06-14,26 154 | 2020-06-15,22 155 | 2020-06-16,33 156 | 2020-06-17,29 157 | 2020-06-18,24 158 | 2020-06-19,25 159 | 2020-06-20,49 160 | 2020-06-21,33 161 | 2020-06-22,47 162 | 2020-06-23,58 163 | 2020-06-24,57 164 | 2020-06-25,42 165 | 2020-06-26,46 166 | 2020-06-27,66 167 | 2020-06-28,65 168 | 2020-06-29,88 169 | 2020-06-30,115 170 | 2020-07-01,123 171 | 2020-07-02,103 172 | 2020-07-03,108 173 | 2020-07-04,103 174 | 2020-07-05,103 175 | 2020-07-06,169 176 | 2020-07-07,152 177 | 2020-07-08,133 178 | 2020-07-09,151 179 | 2020-07-10,161 180 | 2020-07-11,167 181 | 2020-07-12,168 182 | 2020-07-13,184 183 | 2020-07-14,164 184 | 2020-07-15,155 185 | 2020-07-16,169 186 | 2020-07-17,151 187 | 2020-07-18,165 188 | 2020-07-19,173 189 | 2020-07-20,211 190 | 2020-07-21,184 191 | 2020-07-22,189 192 | 2020-07-23,158 193 | 2020-07-24,176 194 | 2020-07-25,180 195 | 2020-07-26,224 196 | 2020-07-27,219 197 | 2020-07-28,230 198 | 2020-07-29,200 199 | 2020-07-30,193 200 | 2020-07-31,186 201 | 2020-08-01,231 202 | 2020-08-02,200 203 | 2020-08-03,234 204 | 2020-08-04,223 205 | 2020-08-05,183 206 | 2020-08-06,130 207 | 2020-08-07,163 208 | 2020-08-08,140 209 | 2020-08-09,141 210 | 2020-08-10,177 211 | 2020-08-11,179 212 | 2020-08-12,157 213 | 2020-08-13,137 214 | 2020-08-14,145 215 | 2020-08-15,165 216 | 2020-08-16,135 217 | 2020-08-17,159 218 | 2020-08-18,126 219 | 2020-08-19,114 220 | 2020-08-20,106 221 | 2020-08-21,89 222 | 2020-08-22,118 223 | 2020-08-23,90 224 | 2020-08-24,123 225 | 2020-08-25,123 226 | 2020-08-26,93 227 | 2020-08-27,88 228 | 2020-08-28,86 229 | 2020-08-29,91 230 | 2020-08-30,68 231 | 2020-08-31,96 232 | 2020-09-01,114 233 | 2020-09-02,88 234 | 2020-09-03,92 235 | 2020-09-04,108 236 | 2020-09-05,103 237 | 2020-09-06,88 238 | 2020-09-07,100 239 | 2020-09-08,107 240 | 2020-09-09,106 241 | 2020-09-10,91 242 | 2020-09-11,67 243 | 2020-09-12,97 244 | 2020-09-13,74 245 | 2020-09-14,130 246 | 2020-09-15,93 247 | 2020-09-16,93 248 | 2020-09-17,94 249 | 2020-09-18,76 250 | 2020-09-19,65 251 | 2020-09-20,72 252 | 2020-09-21,97 253 | 2020-09-22,113 254 | 2020-09-23,108 255 | 2020-09-24,104 256 | 2020-09-25,108 257 | 2020-09-26,95 258 | 2020-09-27,83 259 | 2020-09-28,112 260 | 2020-09-29,106 261 | 2020-09-30,85 262 | 2020-10-01,128 263 | 2020-10-02,98 264 | 2020-10-03,99 265 | 2020-10-04,91 266 | 2020-10-05,108 267 | 2020-10-06,112 268 | 2020-10-07,113 269 | 2020-10-08,138 270 | 2020-10-09,118 271 | 2020-10-10,115 272 | 2020-10-11,93 273 | 2020-10-12,138 274 | 2020-10-13,108 275 | 2020-10-14,98 276 | 2020-10-15,86 277 | 2020-10-16,99 278 | 2020-10-17,74 279 | 2020-10-18,76 280 | 2020-10-19,109 281 | 2020-10-20,122 282 | 2020-10-21,102 283 | 2020-10-22,91 284 | 2020-10-23,118 285 | 2020-10-24,99 286 | 2020-10-25,96 287 | 2020-10-26,129 288 | 2020-10-27,98 289 | 2020-10-28,109 290 | 2020-10-29,99 291 | 2020-10-30,126 292 | 2020-10-31,113 293 | 2020-11-01,117 294 | 2020-11-02,173 295 | 2020-11-03,185 296 | 2020-11-04,156 297 | 2020-11-05,177 298 | 2020-11-06,184 299 | 2020-11-07,159 300 | 2020-11-08,167 301 | 2020-11-09,208 302 | 2020-11-10,223 303 | 2020-11-11,229 304 | 2020-11-12,223 305 | 2020-11-13,231 306 | 2020-11-14,231 307 | 2020-11-15,243 308 | 2020-11-16,289 309 | 2020-11-17,321 310 | 2020-11-18,287 311 | 2020-11-19,253 312 | 2020-11-20,266 313 | 2020-11-21,229 314 | 2020-11-22,198 315 | 2020-11-23,231 316 | 2020-11-24,278 317 | 2020-11-25,243 318 | 2020-11-26,236 319 | 2020-11-27,262 320 | 2020-11-28,224 321 | 2020-11-29,239 322 | 2020-11-30,281 323 | 2020-12-01,281 324 | 2020-12-02,301 325 | 2020-12-03,281 326 | 2020-12-04,293 327 | 2020-12-05,249 328 | 2020-12-06,262 329 | 2020-12-07,336 330 | 2020-12-08,369 331 | 2020-12-09,336 332 | 2020-12-10,363 333 | 2020-12-11,322 334 | 2020-12-12,333 335 | 2020-12-13,329 336 | 2020-12-14,457 337 | 2020-12-15,432 338 | 2020-12-16,461 339 | 2020-12-17,396 340 | 2020-12-18,387 341 | 2020-12-19,383 342 | 2020-12-20,447 343 | 2020-12-21,543 344 | 2020-12-22,595 345 | 2020-12-23,561 346 | 2020-12-24,520 347 | 2020-12-25,571 348 | 2020-12-26,579 349 | 2020-12-27,608 350 | 2020-12-28,708 351 | 2020-12-29,762 352 | 2020-12-30,846 353 | 2020-12-31,915 354 | 2021-01-01,1160 355 | 2021-01-02,1296 356 | 2021-01-03,1328 357 | 2021-01-04,1524 358 | 2021-01-05,1396 359 | 2021-01-06,1365 360 | 2021-01-07,1178 361 | 2021-01-08,1040 362 | 2021-01-09,962 363 | 2021-01-10,900 364 | 2021-01-11,902 365 | 2021-01-12,1032 366 | 2021-01-13,899 367 | 2021-01-14,736 368 | 2021-01-15,738 369 | 2021-01-16,701 370 | 2021-01-17,598 371 | 2021-01-18,717 372 | 2021-01-19,611 373 | 2021-01-20,551 374 | 2021-01-21,541 375 | 2021-01-22,540 376 | 2021-01-23,443 377 | 2021-01-24,427 378 | 2021-01-25,511 379 | 2021-01-26,424 380 | 2021-01-27,441 381 | 2021-01-28,364 382 | 2021-01-29,361 383 | 2021-01-30,309 384 | 2021-01-31,264 385 | 2021-02-01,352 386 | 2021-02-02,371 387 | 2021-02-03,307 388 | 2021-02-04,279 389 | 2021-02-05,274 390 | 2021-02-06,241 391 | 2021-02-07,210 392 | 2021-02-08,245 393 | 2021-02-09,218 394 | 2021-02-10,226 395 | 2021-02-11,203 396 | 2021-02-12,228 397 | 2021-02-13,214 398 | 2021-02-14,197 399 | 2021-02-15,225 400 | 2021-02-16,184 401 | 2021-02-17,190 402 | 2021-02-18,186 403 | 2021-02-19,171 404 | 2021-02-20,174 405 | 2021-02-21,143 406 | 2021-02-22,180 407 | 2021-02-23,178 408 | 2021-02-24,175 409 | 2021-02-25,153 410 | 2021-02-26,155 411 | 2021-02-27,131 412 | 2021-02-28,159 413 | 2021-03-01,184 414 | 2021-03-02,193 415 | 2021-03-03,163 416 | 2021-03-04,189 417 | 2021-03-05,166 418 | 2021-03-06,172 419 | 2021-03-07,166 420 | 2021-03-08,197 421 | 2021-03-09,202 422 | 2021-03-10,181 423 | 2021-03-11,195 424 | 2021-03-12,204 425 | 2021-03-13,207 426 | 2021-03-14,172 427 | 2021-03-15,270 428 | 2021-03-16,227 429 | 2021-03-17,202 430 | 2021-03-18,208 431 | 2021-03-19,245 432 | 2021-03-20,227 433 | 2021-03-21,189 434 | 2021-03-22,266 435 | 2021-03-23,258 436 | 2021-03-24,257 437 | 2021-03-25,248 438 | 2021-03-26,220 439 | 2021-03-27,217 440 | 2021-03-28,241 441 | 2021-03-29,290 442 | 2021-03-30,281 443 | 2021-03-31,261 444 | 2021-04-01,310 445 | 2021-04-02,312 446 | 2021-04-03,334 447 | 2021-04-04,280 448 | 2021-04-05,353 449 | 2021-04-06,377 450 | 2021-04-07,350 451 | 2021-04-08,309 452 | 2021-04-09,344 453 | 2021-04-10,320 454 | 2021-04-11,377 455 | 2021-04-12,479 456 | 2021-04-13,466 457 | 2021-04-14,514 458 | 2021-04-15,448 459 | 2021-04-16,479 460 | 2021-04-17,464 461 | 2021-04-18,459 462 | 2021-04-19,602 463 | 2021-04-20,570 464 | 2021-04-21,540 465 | 2021-04-22,530 466 | 2021-04-23,510 467 | 2021-04-24,498 468 | 2021-04-25,522 469 | 2021-04-26,650 470 | 2021-04-27,646 471 | 2021-04-28,642 472 | 2021-04-29,550 473 | 2021-04-30,570 474 | 2021-05-01,595 475 | 2021-05-02,541 476 | 2021-05-03,592 477 | 2021-05-04,530 478 | 2021-05-05,604 479 | 2021-05-06,589 480 | 2021-05-07,598 481 | 2021-05-08,496 482 | 2021-05-09,431 483 | 2021-05-10,405 484 | 2021-05-11,363 485 | 2021-05-12,254 486 | 2021-05-13,101 487 | 2021-05-14,23 488 | 2021-05-15,1 -------------------------------------------------------------------------------- /packages/csv-to-hash/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const fs = require("fs"); 4 | const csvSync = require("csv-parse/lib/sync"); // requiring sync module 5 | 6 | const file = "data.csv"; 7 | let data = fs.readFileSync(file); 8 | 9 | let res = csvSync(data); 10 | 11 | const result = {}; 12 | 13 | res.forEach((d) => { 14 | result[d[0]] = Number(d[1]) / 7600000; 15 | }); 16 | 17 | console.log(result); 18 | -------------------------------------------------------------------------------- /packages/csv-to-hash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "csv-to-hash", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "csv": "^5.5.0", 8 | "fs": "^0.0.1-security" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/debug/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |
11 |

東京のコロナ

12 | 505 |

俺の預金通帳

506 | 842 |
843 | 844 | 845 | 846 | -------------------------------------------------------------------------------- /packages/debug/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "devDependencies": { 7 | "html-webpack-plugin": "^5.3.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |
11 |

東京のコロナ

12 | 505 |

俺の預金通帳

506 | 865 |
866 | 867 | 868 | 869 | -------------------------------------------------------------------------------- /packages/weed365/.gitignore: -------------------------------------------------------------------------------- 1 | lib -------------------------------------------------------------------------------- /packages/weed365/README.md: -------------------------------------------------------------------------------- 1 | # weed365 2 | 3 | GitHub weed style's Web Components. 4 | 5 | ![イメージ図](./docs/visual.png) 6 | 7 | Example is [here](https://sadnessojisan.github.io/weed365/). 8 | 9 | The implementation is below. 10 | 11 | ```html 12 | 13 | 14 | 15 | 16 | 17 | 18 | weed365 example page 19 | 20 | 21 | 22 |

Covid-19 in Tokyo

23 | 42 | 43 | 44 | 45 | ``` 46 | 47 | ## How to use 48 | 49 | Weed365 provides `` tag. 50 | `` tag takes those props. 51 | 52 | | name | for what | 53 | | ----- | -------------------------------------------------------------------------- | 54 | | date | This is the end date of kusa layout. | 55 | | kusas | `{YYYY-MM-DD: value}`. For example `{'2021-01-01: 100, '2021-01-02': 200}` | 56 | 57 | weed-365 paint color according to the kusa's value. If value is none, then kusa layout treat as 0. 58 | -------------------------------------------------------------------------------- /packages/weed365/docs/visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadnessOjisan/weed365/35717b1fa4f8353375625d49e9a850d28627726c/packages/weed365/docs/visual.png -------------------------------------------------------------------------------- /packages/weed365/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weed365", 3 | "version": "0.0.4", 4 | "description": "GitHub weed style Web Components", 5 | "main": "dist/build.js", 6 | "license": "MIT", 7 | "scripts": { 8 | "build:dev": "NODE_ENV=development webpack", 9 | "build:prd": "NODE_ENV=production webpack" 10 | }, 11 | "dependencies": { 12 | "weedize": "^0.1.0" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/sadnessOjisan/weed365.git" 17 | }, 18 | "author": "sadnessOjisan", 19 | "bugs": { 20 | "url": "https://github.com/sadnessOjisan/weed365/issues" 21 | }, 22 | "homepage": "https://github.com/sadnessOjisan/weed365#readme", 23 | "files": [ 24 | "dist/build.js" 25 | ], 26 | "devDependencies": { 27 | "can-npm-publish": "^1.3.3" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/weed365/src/index.ts: -------------------------------------------------------------------------------- 1 | import { weedizeTo } from "weedize"; 2 | 3 | class Weed365 extends HTMLElement { 4 | shadow: ShadowRoot; 5 | constructor() { 6 | super(); 7 | const endDate = this.getAttribute("date"); 8 | if (endDate === null) throw new Error("should set endDate"); 9 | 10 | const layout = weedizeTo(new Date(endDate)); 11 | 12 | const kusasString = this.getAttribute("kusas"); 13 | if (kusasString === null) throw new Error("should set kusasString"); 14 | const kusas = JSON.parse(kusasString); 15 | const values = (Object.values(kusas) as any) as number[]; // TODO: validation 16 | const max = values.reduce((a, b) => { 17 | const max = Math.max(a, b); 18 | return max; 19 | }); 20 | const kusaLayout = layout.map((week) => { 21 | return week.map((dateString) => { 22 | if (dateString === undefined) return undefined; 23 | const date = dateString as Date; 24 | const YYYYMMDD = `${date.getFullYear()}-${(date.getMonth() + 1) 25 | .toString() 26 | .padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}`; 27 | const value = kusas[YYYYMMDD] ?? 0; 28 | let o; 29 | if (value / max < 0.25 && value / max > 0) { 30 | o = 0.25; 31 | } else if (value / max < 0.5 && value / max >= 0.25) { 32 | o = 0.5; 33 | } else if (value / max < 0.75 && value / max >= 0.5) { 34 | o = 0.75; 35 | } else if ((value / max <= 1 && value / max >= 0.75) || value === 0) { 36 | o = 1; 37 | } else { 38 | console.error("value", value); 39 | } 40 | return { date: YYYYMMDD, value: o, isZero: value === 0 }; 41 | }); 42 | }); 43 | this.shadow = this.attachShadow({ mode: "open" }); 44 | this.shadow.innerHTML = ` 45 | 67 |
68 | ${kusaLayout 69 | .map( 70 | (week) => 71 | `
72 | ${week 73 | .map( 74 | (day) => 75 | `
` 80 | ) 81 | .join(" ")} 82 |
` 83 | ) 84 | .join(" ")} 85 |
86 | `; 87 | } 88 | } 89 | 90 | customElements.define("weed-365", Weed365); 91 | -------------------------------------------------------------------------------- /packages/weed365/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "es6" /* Specify ECMAScript target version: "ES3" (default), "ES5", "ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020", or "ESNEXT". */, 8 | "module": "commonjs" /* Specify module code generation: "none", "commonjs", "amd", "system", "umd", "es2015", "es2020", or "ESNext". */, 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: "preserve", "react-native", or "react". */ 13 | "declaration": true /* Generates corresponding ".d.ts" file. */, 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding ".d.ts" file. */ 15 | // "sourceMap": true, /* Generates corresponding ".map" file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | "outDir": "dist" /* Redirect output structure to the directory. */, 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from "tslib". */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in "for-of", spread, and destructuring when targeting "ES5" or "ES3". */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to "ts.transpileModule"). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true /* Enable all strict type-checking options. */, 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied "any" type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict "bind", "call", and "apply" methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on "this" expressions with an implied "any" type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include "undefined" in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: "node" (Node.js) or "classic" (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the "baseUrl". */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies "allowSyntheticDefaultImports". */, 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires "--inlineSourceMap" or "--sourceMap" to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true /* Skip type checking of declaration files. */, 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /packages/weed365/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | 3 | module.exports = { 4 | mode: process.env.NODE_ENV || "production", 5 | entry: "./src/index.ts", 6 | output: { 7 | path: path.resolve(__dirname, "./dist"), 8 | filename: "build.js", 9 | }, 10 | module: { 11 | rules: [ 12 | { 13 | test: /\.ts$/, 14 | include: [path.resolve(__dirname, "src")], 15 | use: [ 16 | { 17 | loader: "ts-loader", 18 | }, 19 | ], 20 | }, 21 | ], 22 | }, 23 | resolve: { 24 | extensions: [".ts"], 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "es5" /* Specify ECMAScript target version: "ES3" (default), "ES5", "ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020", or "ESNEXT". */, 8 | "module": "commonjs" /* Specify module code generation: "none", "commonjs", "amd", "system", "umd", "es2015", "es2020", or "ESNext". */, 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: "preserve", "react-native", "react", "react-jsx" or "react-jsxdev". */ 13 | // "declaration": true, /* Generates corresponding ".d.ts" file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding ".d.ts" file. */ 15 | // "sourceMap": true, /* Generates corresponding ".map" file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | "outDir": "./dist" /* Redirect output structure to the directory. */, 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from "tslib". */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in "for-of", spread, and destructuring when targeting "ES5" or "ES3". */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to "ts.transpileModule"). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true /* Enable all strict type-checking options. */, 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied "any" type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict "bind", "call", and "apply" methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on "this" expressions with an implied "any" type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include "undefined" in index signature results */ 43 | // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ 44 | 45 | /* Module Resolution Options */ 46 | // "moduleResolution": "node", /* Specify module resolution strategy: "node" (Node.js) or "classic" (TypeScript pre-1.6). */ 47 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 48 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the "baseUrl". */ 49 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 50 | // "typeRoots": [], /* List of folders to include type definitions from. */ 51 | // "types": [], /* Type declaration files to be included in compilation. */ 52 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 53 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies "allowSyntheticDefaultImports". */, 54 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 55 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 56 | 57 | /* Source Map Options */ 58 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 60 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 61 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires "--inlineSourceMap" or "--sourceMap" to be set. */ 62 | 63 | /* Experimental Options */ 64 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 65 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 66 | 67 | /* Advanced Options */ 68 | "skipLibCheck": true /* Skip type checking of declaration files. */, 69 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 70 | } 71 | } 72 | --------------------------------------------------------------------------------