diff --git a/package.json b/package.json index ad54f96..825fcbe 100644 --- a/package.json +++ b/package.json @@ -10,17 +10,18 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" }, "devDependencies": { - "@sveltejs/adapter-auto": "^1.0.0", - "@sveltejs/kit": "^1.0.0", - "svelte": "^3.54.0", - "svelte-check": "^3.0.1", - "tslib": "^2.4.1", - "typescript": "^4.9.3", - "vite": "^4.0.0" + "@sveltejs/adapter-auto": "^1.0.3", + "@sveltejs/kit": "^1.5.0", + "svelte": "^3.55.1", + "svelte-check": "^3.0.3", + "tslib": "^2.5.0", + "typescript": "^4.9.5", + "vite": "^4.1.1" }, "type": "module", "dependencies": { "chart.js": "^4.2.0", + "highcharts": "^10.3.3", "layercake": "^7.2.2", "svelte-chartjs": "^3.1.2" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45f82bb..07cce4a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,25 +1,27 @@ lockfileVersion: 5.4 specifiers: - '@sveltejs/adapter-auto': ^1.0.0 - '@sveltejs/kit': ^1.0.0 + '@sveltejs/adapter-auto': ^1.0.3 + '@sveltejs/kit': ^1.5.0 chart.js: ^4.2.0 + highcharts: ^10.3.3 layercake: ^7.2.2 - svelte: ^3.54.0 + svelte: ^3.55.1 svelte-chartjs: ^3.1.2 - svelte-check: ^3.0.1 - tslib: ^2.4.1 - typescript: ^4.9.3 - vite: ^4.0.0 + svelte-check: ^3.0.3 + tslib: ^2.5.0 + typescript: ^4.9.5 + vite: ^4.1.1 dependencies: chart.js: 4.2.0 + highcharts: 10.3.3 layercake: 7.2.2 svelte-chartjs: 3.1.2_sb7g7nvzgbbexijgaje6yhompe devDependencies: - '@sveltejs/adapter-auto': 1.0.2_@sveltejs+kit@1.3.10 - '@sveltejs/kit': 1.3.10_svelte@3.55.1+vite@4.1.1 + '@sveltejs/adapter-auto': 1.0.3_@sveltejs+kit@1.5.0 + '@sveltejs/kit': 1.5.0_svelte@3.55.1+vite@4.1.1 svelte: 3.55.1 svelte-check: 3.0.3_svelte@3.55.1 tslib: 2.5.0 @@ -271,17 +273,17 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@sveltejs/adapter-auto/1.0.2_@sveltejs+kit@1.3.10: - resolution: {integrity: sha512-UXpEO/gutERZnD+Z5Vi4J/ifD3WSRuCI7xwtLJTcKNQvJ6t5Xsj1X3Mw2F8Vv/XTUuxf7xPLYUgThU331r0Y9w==} + /@sveltejs/adapter-auto/1.0.3_@sveltejs+kit@1.5.0: + resolution: {integrity: sha512-hc7O12YQqvZ1CD4fo1gMJuPzBZvuoG5kwxb2RRoz4fVoB8B2vuPO2cY751Ln0G6T/HMrAf8kCqw6Pg+wbxcstw==} peerDependencies: '@sveltejs/kit': ^1.0.0 dependencies: - '@sveltejs/kit': 1.3.10_svelte@3.55.1+vite@4.1.1 + '@sveltejs/kit': 1.5.0_svelte@3.55.1+vite@4.1.1 import-meta-resolve: 2.2.1 dev: true - /@sveltejs/kit/1.3.10_svelte@3.55.1+vite@4.1.1: - resolution: {integrity: sha512-I3DgWCwTYbTz4ZPCJIRkSDrKkMu0bsdk6ghqsOBVNqesf1wBdTdfkXhag3ESWgIEjUV3VUIWPQF7fnt7328mhQ==} + /@sveltejs/kit/1.5.0_svelte@3.55.1+vite@4.1.1: + resolution: {integrity: sha512-AkWgCO9i2djZjTqCgIQJ5XfnSzRINowh2w2Gk9wDRuTwxKizSuYe3jNvds/HCDDGHo8XE5E0yWNC9j2XxbrX+g==} engines: {node: ^16.14 || >=18} hasBin: true requiresBuild: true @@ -302,7 +304,7 @@ packages: sirv: 2.0.2 svelte: 3.55.1 tiny-glob: 0.2.9 - undici: 5.16.0 + undici: 5.18.0 vite: 4.1.1 transitivePeerDependencies: - supports-color @@ -331,8 +333,8 @@ packages: resolution: {integrity: sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g==} dev: true - /@types/node/18.11.19: - resolution: {integrity: sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==} + /@types/node/18.13.0: + resolution: {integrity: sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==} dev: true /@types/pug/2.0.6: @@ -342,7 +344,7 @@ packages: /@types/sass/1.43.1: resolution: {integrity: sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 dev: true /anymatch/3.1.3: @@ -625,6 +627,10 @@ packages: function-bind: 1.1.1 dev: true + /highcharts/10.3.3: + resolution: {integrity: sha512-r7wgUPQI9tr3jFDn3XT36qsNwEIZYcfgz4mkKEA6E4nn5p86y+u1EZjazIG4TRkl5/gmGRtkBUiZW81g029RIw==} + dev: false + /import-fresh/3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -1048,8 +1054,8 @@ packages: hasBin: true dev: true - /undici/5.16.0: - resolution: {integrity: sha512-KWBOXNv6VX+oJQhchXieUznEmnJMqgXMbs0xxH2t8q/FUAWSJvOSr/rMaZKnX5RIVq7JDn0JbP4BOnKG2SGXLQ==} + /undici/5.18.0: + resolution: {integrity: sha512-1iVwbhonhFytNdg0P4PqyIAXbdlVZVebtPDvuM36m66mRw4OGrCm2MYynJv/UENFLdP13J1nPVQzVE2zTs1OeA==} engines: {node: '>=12.18'} dependencies: busboy: 1.6.0 diff --git a/src/Session.vim b/src/Session.vim new file mode 100644 index 0000000..2cac4e8 --- /dev/null +++ b/src/Session.vim @@ -0,0 +1,57 @@ +let SessionLoad = 1 +let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1 +let v:this_session=expand(":p") +silent only +silent tabonly +cd ~/code/svelte-ts/src +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +let s:shortmess_save = &shortmess +if &shortmess =~ 'A' + set shortmess=aoOA +else + set shortmess=aoO +endif +badd +12 components/graph.svelte +badd +19 routes/openmeteo/+page.server.ts +badd +23 routes/openmeteo/+page.svelte +argglobal +%argdel +$argadd components/graph.svelte +edit components/graph.svelte +argglobal +balt routes/openmeteo/+page.server.ts +setlocal fdm=manual +setlocal fde=0 +setlocal fmr={{{,}}} +setlocal fdi=# +setlocal fdl=0 +setlocal fml=1 +setlocal fdn=20 +setlocal fen +silent! normal! zE +let &fdl = &fdl +let s:l = 12 - ((11 * winheight(0) + 23) / 46) +if s:l < 1 | let s:l = 1 | endif +keepjumps exe s:l +normal! zt +keepjumps 12 +normal! 034| +tabnext 1 +if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 +let &shortmess = s:shortmess_save +let s:sx = expand(":p:r")."x.vim" +if filereadable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &g:so = s:so_save | let &g:siso = s:siso_save +set hlsearch +nohlsearch +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim : diff --git a/src/components/graph.svelte b/src/components/graph.svelte index d3c7d72..e66035b 100644 --- a/src/components/graph.svelte +++ b/src/components/graph.svelte @@ -1,8 +1,73 @@ - +
diff --git a/src/components/highcharts.ts b/src/components/highcharts.ts new file mode 100644 index 0000000..a66db2a --- /dev/null +++ b/src/components/highcharts.ts @@ -0,0 +1,16 @@ +import Highcharts from 'highcharts'; + +export default (node, config) => { + const redraw = true; + const oneToOne = true; + const chart = Highcharts.chart(node, config); + + return { + update(config) { + chart.update(config, redraw, oneToOne); + }, + destroy() { + chart.destroy(); + } + }; +} diff --git a/src/routes/openmeteo/+page.svelte b/src/routes/openmeteo/+page.svelte index 98223ca..69df30d 100644 --- a/src/routes/openmeteo/+page.svelte +++ b/src/routes/openmeteo/+page.svelte @@ -20,8 +20,8 @@

UbicaciĆ³ actual: { data.ubicacio }

- - +
{ JSON.stringify(data) }
+