diff --git a/docs/diagrams/UserFlow-diagram-2024-07-17--4698255252461700455.md b/docs/diagrams/UserFlow-diagram-2024-07-17--4698255252461700455.md deleted file mode 100644 index efd93c1..0000000 --- a/docs/diagrams/UserFlow-diagram-2024-07-17--4698255252461700455.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: UserFlow Diagram -date: 2024-07-17 -tags: [diagram, UserFlow] ---- - -import DiagramViewer from '@site/src/components/DiagramViewer'; - -# UserFlow Diagram - - B{Login?} - B -->|Yes| C[Dashboard] - B -->|No| D[Registration] - D --> C - -`} /> - -[Additional explanation or notes] diff --git a/docs/mockups/LoginScreen-mockup-2024-07-17--3197451855480708115.md b/docs/mockups/LoginScreen-mockup-2024-07-17--3197451855480708115.md index 610bfb2..7f6350d 100644 --- a/docs/mockups/LoginScreen-mockup-2024-07-17--3197451855480708115.md +++ b/docs/mockups/LoginScreen-mockup-2024-07-17--3197451855480708115.md @@ -8,6 +8,6 @@ import MockupGallery from '@site/src/components/MockupGallery'; # LoginScreen Mockup - + [Additional description or notes] diff --git a/docs/observations/UserInterface-observation-2024-07-17-4ctohp7v.md b/docs/observations/UserInterface-observation-2024-07-17-4ctohp7v.md index fe10a37..0ad4ff3 100644 --- a/docs/observations/UserInterface-observation-2024-07-17-4ctohp7v.md +++ b/docs/observations/UserInterface-observation-2024-07-17-4ctohp7v.md @@ -4,6 +4,13 @@ date: 2024-07-17 tags: [observation, UserInterface] --- +import ResultsVisualizer from '@site/src/components/ResultsVisualizer'; + # UserInterface Observation -[Your content here] +Today I noticed that the sky was bluer than usual. I am not entirely sure why. It really stood out to me. + + diff --git a/package.json b/package.json index 9461866..fadae87 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@docusaurus/theme-live-codeblock": "^3.4.0", "@docusaurus/theme-mermaid": "^3.4.0", "@mdx-js/react": "^3.0.0", + "chart.js": "^4.4.3", "clsx": "^2.0.0", "docusaurus-lunr-search": "^3.4.0", "prism-react-renderer": "^2.3.0", diff --git a/src/components/ResultsVisualizer.js b/src/components/ResultsVisualizer.js new file mode 100644 index 0000000..9fd0470 --- /dev/null +++ b/src/components/ResultsVisualizer.js @@ -0,0 +1,57 @@ +import React, { useEffect, useRef, useState } from 'react' +import Chart from 'chart.js/auto' + +const ResultsVisualizer = ({ data, chartType = 'line' }) => { + const chartRef = useRef(null) + const [figureNumber, setFigureNumber] = useState(1) + + useEffect(() => { + // Find the current highest figure number in the document + const figures = document.querySelectorAll('[data-figure-number]') + const highestFigure = Math.max(...Array.from(figures).map(fig => parseInt(fig.dataset.figureNumber, 10)), 0) + setFigureNumber(highestFigure + 1) + }, []) + + useEffect(() => { + if (chartRef.current) { + const ctx = chartRef.current.getContext('2d') + + // Destroy existing chart if it exists + if (chartRef.current.chart) { + chartRef.current.chart.destroy() + } + + // Create new chart + chartRef.current.chart = new Chart(ctx, { + type: chartType, + data: { + labels: data.labels, + datasets: [{ + label: `Figure ${figureNumber}`, + data: data.data, + fill: false, + borderColor: 'rgb(75, 192, 192)', + tension: 0.1 + }] + }, + options: { + responsive: true, + plugins: { + title: { + display: true, + text: `Figure ${figureNumber}` + } + } + } + }) + } + }, [data, chartType, figureNumber]) + + return ( +
+ +
+ ) +} + +export default ResultsVisualizer \ No newline at end of file diff --git a/static/img/manta.jpg b/static/img/manta.jpg new file mode 100644 index 0000000..aa1caab Binary files /dev/null and b/static/img/manta.jpg differ diff --git a/yarn.lock b/yarn.lock index fd8586c..6b46076 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1774,6 +1774,11 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@kurkle/color@^0.3.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@kurkle/color/-/color-0.3.2.tgz#5acd38242e8bde4f9986e7913c8fdf49d3aa199f" + integrity sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw== + "@leichtgewicht/ip-codec@^2.0.1": version "2.0.5" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" @@ -3084,6 +3089,13 @@ character-reference-invalid@^2.0.0: resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" integrity sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw== +chart.js@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-4.4.3.tgz#3b2e11e7010fefa99b07d0349236f5098e5226ad" + integrity sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw== + dependencies: + "@kurkle/color" "^0.3.0" + cheerio-select@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4"