Skip to content

Commit

Permalink
upgrade-latest (except for latest eslint 9 and @observable/plot)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckuijjer committed Apr 8, 2024
1 parent 0b643ef commit 0251654
Show file tree
Hide file tree
Showing 6 changed files with 1,809 additions and 1,082 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ jobs:
run: ${{ env.package-manager-runner }} next build
- name: Generate a sitemap
run: ${{ env.package-manager-runner }} next-sitemap
- name: Static HTML export with Next.js
run: ${{ env.package-manager-runner }} next export
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand Down
26 changes: 10 additions & 16 deletions web/components/Statistics.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@emotion/react'
import * as Plot from '@observablehq/plot'
import { line, plot } from '@observablehq/plot'
import React from 'react'

import { Layout } from './Layout'
Expand Down Expand Up @@ -60,6 +60,8 @@ const Tile = ({ title, value, onClick = () => {}, isHighlighted = false }) => {
}

export const Statistics = ({ points }) => {
console.log({ points })

const [highlight, setHighlight] = React.useState(null)

const sortedPoints = [...points].sort((a, b) => {
Expand All @@ -83,14 +85,14 @@ export const Statistics = ({ points }) => {
})
.sort((a, b) => b.value - a.value)

const svg = Plot.plot({
const svg = plot({
marks: [
Plot.line(sortedPoints, {
line(sortedPoints, {
x: 'createdAt',
y: 'value',
z: 'scraper',
curve: 'bump-x',
stroke: 'scraper',
stroke: (d) => d.scraper === highlight,
strokeWidth: 2,
}),
],
Expand All @@ -103,18 +105,10 @@ export const Statistics = ({ points }) => {
tickFormat: (d) => d.toLocaleDateString(),
},
color: {
range: (x) =>
x.map((scraper) => {
if (!highlight) {
// If no highlight, use the default color
return 'currentColor'
} else {
// If a scraper is highlighted, use the primary color and make the other scrapers less visible
return scraper === highlight
? 'var(--secondary-color)'
: 'var(--primary-color)'
}
}),
domain: highlight ? [true, false] : [false],
range: highlight
? ['var(--secondary-color)', 'var(--primary-color)']
: ['currentColor'],
},
grid: true,
width: 960,
Expand Down
2 changes: 1 addition & 1 deletion web/components/TextFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const DebouncedInput = ({
}, delay)

return () => clearTimeout(timeoutId)
}, [value, delay])
}, [value, delay, onDebounce])

useKeypress('Escape', () => setValue(''))

Expand Down
1 change: 1 addition & 0 deletions web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const nextConfig = {
typescript: {
ignoreBuildErrors: true, // TODO: Remove this when you fix all the errors.
},
output: 'export',
}

module.exports = nextConfig
24 changes: 12 additions & 12 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && yarn next-sitemap && next export",
"build": "next build && yarn next-sitemap",
"start": "next start",
"lint": "next lint",
"clean": "rm -rf .next out"
},
"dependencies": {
"@emotion/react": "^11.10.4",
"@observablehq/plot": "^0.6.0",
"luxon": "^3.4.3",
"next": "13.4.19",
"@emotion/react": "^11.11.4",
"@observablehq/plot": "0.6.13",
"luxon": "^3.4.4",
"next": "14.1.4",
"next-sitemap": "^4.2.3",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand All @@ -23,14 +23,14 @@
"devDependencies": {
"@emotion/babel-plugin": "^11.10.2",
"@emotion/babel-preset-css-prop": "^11.10.0",
"@svgr/webpack": "^6.4.0",
"@svgr/webpack": "^8.1.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "20.5.9",
"@types/react": "18.0.21",
"@types/react-dom": "18.0.6",
"eslint": "8.48.0",
"eslint-config-next": "13.4.19",
"@types/node": "20.12.5",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"eslint": "^8.57.0",
"eslint-config-next": "14.1.4",
"prettier": "^3.2.5",
"typescript": "4.8.4"
"typescript": "5.4.4"
}
}
Loading

0 comments on commit 0251654

Please sign in to comment.