added routes and basic chart
This commit is contained in:
@@ -20,7 +20,7 @@ app.get("/", (req,res) => {
|
||||
});
|
||||
|
||||
app.get("/userData", (req, res) => {
|
||||
console.log(req.query);
|
||||
//console.log(req.query);
|
||||
user = req.query.user;
|
||||
let rawdata = fs.readFileSync(`${user}.json`);
|
||||
let userData = JSON.parse(rawdata);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"visitedParks":["Acadia","Arches","Big Bend","Carlsbad Caverns *","Crater Lake","Grand Teton","Guadalupe Mountains","Hot Springs","Redwood *","Yellowstone","Yosemite *","Zion"]}
|
||||
{"visitedParks":["Acadia","Arches","Big Bend","Carlsbad Caverns *","Crater Lake","Grand Teton","Guadalupe Mountains","Hot Springs","Redwood *","White Sands","Yellowstone","Yosemite *","Zion"]}
|
||||
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.1bcf62e1.css",
|
||||
"main.js": "/static/js/main.c084716e.js",
|
||||
"static/js/787.6c417ab9.chunk.js": "/static/js/787.6c417ab9.chunk.js",
|
||||
"main.css": "/static/css/main.454c01b9.css",
|
||||
"main.js": "/static/js/main.94c2d155.js",
|
||||
"static/js/787.3b18f8b6.chunk.js": "/static/js/787.3b18f8b6.chunk.js",
|
||||
"index.html": "/index.html",
|
||||
"main.1bcf62e1.css.map": "/static/css/main.1bcf62e1.css.map",
|
||||
"main.c084716e.js.map": "/static/js/main.c084716e.js.map",
|
||||
"787.6c417ab9.chunk.js.map": "/static/js/787.6c417ab9.chunk.js.map"
|
||||
"main.454c01b9.css.map": "/static/css/main.454c01b9.css.map",
|
||||
"main.94c2d155.js.map": "/static/js/main.94c2d155.js.map",
|
||||
"787.3b18f8b6.chunk.js.map": "/static/js/787.3b18f8b6.chunk.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.1bcf62e1.css",
|
||||
"static/js/main.c084716e.js"
|
||||
"static/css/main.454c01b9.css",
|
||||
"static/js/main.94c2d155.js"
|
||||
]
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.c084716e.js"></script><link href="/static/css/main.1bcf62e1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.94c2d155.js"></script><link href="/static/css/main.454c01b9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
@@ -1,2 +0,0 @@
|
||||
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.no{background-color:red}.yes{background-color:green}table,td,th{border:1px solid}table{border:1px solid;border-collapse:collapse;padding:1rem}tr:hover{background-color:#d3d3d3}.container{display:flex;flex-direction:row}.column{padding:.75rem}
|
||||
/*# sourceMappingURL=main.1bcf62e1.css.map*/
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"static/css/main.1bcf62e1.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCZA,IACI,oBACF,CAEA,KACE,sBACF,CAEA,YACE,gBACF,CAEA,MAEE,gBAAiB,CADjB,wBAAyB,CAEzB,YACF,CAEA,SAAU,wBAA4B,CAExC,WACI,YAAa,CACb,kBACJ,CAEA,QACI,cACJ","sources":["index.css","NP.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".no{\n background-color: red;\n }\n \n .yes{\n background-color: green;\n }\n \n table, td, th {\n border: 1px solid;\n }\n \n table{\n border-collapse: collapse;\n border: 1px solid;\n padding: 1rem;\n }\n \n tr:hover {background-color: lightgray;}\n\n.container{\n display: flex;\n flex-direction: row;\n}\n\n.column{\n padding: 0.75rem;\n}"],"names":[],"sourceRoot":""}
|
||||
2
frontend/build/static/css/main.454c01b9.css
Normal file
2
frontend/build/static/css/main.454c01b9.css
Normal file
@@ -0,0 +1,2 @@
|
||||
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.App{text-align:left}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{-webkit-animation:App-logo-spin 20s linear infinite;animation:App-logo-spin 20s linear infinite}}.App{background-color:#282c34;color:#fff;display:flex;flex-direction:column;font-size:calc(10px + 2vmin);min-height:100vh}a{font-size:large;font-weight:700;padding:10px}.no{background-color:red}.yes{background-color:green}table,td,th{border:1px solid}table{border:1px solid;border-collapse:collapse;padding:1rem}tr:hover{background-color:#d3d3d3}.container{display:flex;flex-direction:row}.column{padding:.75rem}
|
||||
/*# sourceMappingURL=main.454c01b9.css.map*/
|
||||
1
frontend/build/static/css/main.454c01b9.css.map
Normal file
1
frontend/build/static/css/main.454c01b9.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"static/css/main.454c01b9.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCZA,KACE,eACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,mDAA4C,CAA5C,2CACF,CACF,CAEA,KACE,wBAAyB,CAKzB,UAAY,CAHZ,YAAa,CACb,qBAAsB,CACtB,4BAA6B,CAH7B,gBAKF,CAEA,EAEE,eAAgB,CAChB,eAAiB,CAFjB,YAGF,CC5BA,IACI,oBACF,CAEA,KACE,sBACF,CAEA,YACE,gBACF,CAEA,MAEE,gBAAiB,CADjB,wBAAyB,CAEzB,YACF,CAEA,SAAU,wBAA4B,CAExC,WACI,YAAa,CACb,kBACJ,CAEA,QACI,cACJ","sources":["index.css","App.css","components/NP.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".App {\n text-align: left;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\na {\n padding: 10px;\n font-size: large;\n font-weight: bold;\n}\n\n\n\n",".no{\n background-color: red;\n }\n \n .yes{\n background-color: green;\n }\n \n table, td, th {\n border: 1px solid;\n }\n \n table{\n border-collapse: collapse;\n border: 1px solid;\n padding: 1rem;\n }\n \n tr:hover {background-color: lightgray;}\n\n.container{\n display: flex;\n flex-direction: row;\n}\n\n.column{\n padding: 0.75rem;\n}"],"names":[],"sourceRoot":""}
|
||||
2
frontend/build/static/js/787.3b18f8b6.chunk.js
Normal file
2
frontend/build/static/js/787.3b18f8b6.chunk.js
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";(self.webpackChunkpersonal_stat_tracker=self.webpackChunkpersonal_stat_tracker||[]).push([[787],{787:function(e,t,n){n.r(t),n.d(t,{getCLS:function(){return y},getFCP:function(){return g},getFID:function(){return F},getLCP:function(){return P},getTTFB:function(){return D}});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},d=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=p(),d(),s((function(){setTimeout((function(){v=p(),d()}),0)}))),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],f=o?null:c("paint",a);(o||f)&&(n=m(e,r,t),o&&a(o),s((function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))},h=!1,T=-1,y=function(e,t){h||(g((function(e){T=e.value})),h=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",v);p&&(n=m(i,r,t),f((function(){p.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,k(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},k=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},F=function(e,t){var n,a=l(),v=u("FID"),p=function(e){e.startTime<a.firstHiddenTime&&(v.value=e.processingStart-e.startTime,v.entries.push(e),n(!0))},d=c("first-input",p);n=m(e,v,t),d&&f((function(){d.takeRecords().map(p),d.disconnect()}),!0),d&&s((function(){var a;v=u("FID"),n=m(e,v,t),o=[],r=-1,i=null,k(addEventListener),a=p,o.push(a),S()}))},C={},P=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e),n())},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var v=function(){C[r.id]||(o.takeRecords().map(a),o.disconnect(),C[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),f(v,!0),s((function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,C[r.id]=!0,n(!0)}))}))}))}},D=function(e){var t,n=u("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]);
|
||||
//# sourceMappingURL=787.3b18f8b6.chunk.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
"use strict";(self.webpackChunkpersonal_stat_tracker=self.webpackChunkpersonal_stat_tracker||[]).push([[787],{8:function(e,t,n){n.r(t),n.d(t,{getCLS:function(){return y},getFCP:function(){return g},getFID:function(){return F},getLCP:function(){return P},getTTFB:function(){return D}});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},d=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=p(),d(),s((function(){setTimeout((function(){v=p(),d()}),0)}))),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],f=o?null:c("paint",a);(o||f)&&(n=m(e,r,t),o&&a(o),s((function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))},h=!1,T=-1,y=function(e,t){h||(g((function(e){T=e.value})),h=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",v);p&&(n=m(i,r,t),f((function(){p.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,k(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},k=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},F=function(e,t){var n,a=l(),v=u("FID"),p=function(e){e.startTime<a.firstHiddenTime&&(v.value=e.processingStart-e.startTime,v.entries.push(e),n(!0))},d=c("first-input",p);n=m(e,v,t),d&&f((function(){d.takeRecords().map(p),d.disconnect()}),!0),d&&s((function(){var a;v=u("FID"),n=m(e,v,t),o=[],r=-1,i=null,k(addEventListener),a=p,o.push(a),S()}))},C={},P=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e),n())},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var v=function(){C[r.id]||(o.takeRecords().map(a),o.disconnect(),C[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),f(v,!0),s((function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,C[r.id]=!0,n(!0)}))}))}))}},D=function(e){var t,n=u("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]);
|
||||
//# sourceMappingURL=787.6c417ab9.chunk.js.map
|
||||
3
frontend/build/static/js/main.94c2d155.js
Normal file
3
frontend/build/static/js/main.94c2d155.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,3 +1,17 @@
|
||||
/*!
|
||||
* @kurkle/color v0.2.1
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2022 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Chart.js v4.0.1
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
@@ -37,3 +51,36 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @remix-run/router v1.0.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* React Router DOM v6.4.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* React Router v6.4.3
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
1
frontend/build/static/js/main.94c2d155.js.map
Normal file
1
frontend/build/static/js/main.94c2d155.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
22
frontend/package-lock.json
generated
22
frontend/package-lock.json
generated
@@ -12,13 +12,14 @@
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"axios": "^1.2.0",
|
||||
"chart.js": "^4.0.1",
|
||||
"react": "^18.2.0",
|
||||
"react-chartjs-2": "^5.0.1",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-router-dom": "^6.4.3",
|
||||
"react-scripts": "5.0.1",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
},
|
||||
"node_modules/@adobe/css-tools": {
|
||||
"version": "4.0.1",
|
||||
@@ -5585,6 +5586,14 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/chart.js": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.0.1.tgz",
|
||||
"integrity": "sha512-5/8/9eBivwBZK81mKvmIwTb2Pmw4D/5h1RK9fBWZLLZ8mCJ+kfYNmV9rMrGoa5Hgy2/wVDBMLSUDudul2/9ihA==",
|
||||
"engines": {
|
||||
"pnpm": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/check-types": {
|
||||
"version": "11.1.2",
|
||||
"resolved": "https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz",
|
||||
@@ -14045,6 +14054,15 @@
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/react-chartjs-2": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-5.0.1.tgz",
|
||||
"integrity": "sha512-u38C9OxynlNCBp+79grgXRs7DSJ9w8FuQ5/HO5FbYBbri8HSZW+9SWgjVshLkbXBfXnMGWakbHEtvN0nL2UG7Q==",
|
||||
"peerDependencies": {
|
||||
"chart.js": "^4.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-dev-utils": {
|
||||
"version": "12.0.1",
|
||||
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz",
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"axios": "^1.2.0",
|
||||
"chart.js": "^4.0.1",
|
||||
"react": "^18.2.0",
|
||||
"react-chartjs-2": "^5.0.1",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-router-dom": "^6.4.3",
|
||||
"react-scripts": "5.0.1",
|
||||
|
||||
@@ -22,35 +22,11 @@
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
a {
|
||||
padding: 10px;
|
||||
font-size: large;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.no{
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.yes{
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
table, td, th {
|
||||
border: 1px solid;
|
||||
}
|
||||
|
||||
table{
|
||||
border-collapse: collapse;
|
||||
border: 1px solid;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
tr:hover {background-color: lightgray;}
|
||||
@@ -1,44 +1,23 @@
|
||||
import "./App.css";
|
||||
import np from "./national_parks.json";
|
||||
import NP from "./components/NP";
|
||||
import Finance from "./components/finance";
|
||||
import Health from "./components/health";
|
||||
|
||||
import { Routes, Route, Switch, Link } from "react-router-dom";
|
||||
function App() {
|
||||
let rows = np;
|
||||
return (
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Visited</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{(() => {
|
||||
|
||||
return rows.map((row, index) => {
|
||||
|
||||
return (
|
||||
<tr key={index}>
|
||||
<td>{row.name}</td>
|
||||
{(() => {
|
||||
let toggleVisit = () => {
|
||||
if(row.visited === "no"){
|
||||
row.visited = "yes";
|
||||
}else{
|
||||
row.visited = "no";
|
||||
}
|
||||
}
|
||||
if (row.visited === "no") {
|
||||
return <td className="no" onClick={toggleVisit}>{row.visited}</td>;
|
||||
} else {
|
||||
return <td className="yes" onClick={toggleVisit}>{row.visited}</td>;
|
||||
}
|
||||
})()}
|
||||
</tr>
|
||||
);
|
||||
});
|
||||
})()}
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<Link to={"/nationalparks"}>National Parks</Link>
|
||||
<Link to={"/finances"}>Finance</Link>
|
||||
<Link to={"/health"}>Health</Link>
|
||||
|
||||
<Routes>
|
||||
<Route exact path="/" element={<NP />} style={{'color': 'red'}} />
|
||||
<Route exact path="/nationalparks" element={<NP />} />
|
||||
<Route exact path="/finances" element={<Finance />} />
|
||||
<Route exact path="/health" element={<Health />} />
|
||||
</Routes>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,28 @@ import React from "react";
|
||||
import "./NP.css";
|
||||
import np from "../national_parks.json";
|
||||
//import user from "./nico.json";//TODO: move this to server-side
|
||||
import axios from 'axios';
|
||||
import axios from "axios";
|
||||
import Finance from "./finance";
|
||||
|
||||
const baseurl = "http://llamapi.local:5321/";
|
||||
|
||||
class NP extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.nptemplate = np;
|
||||
//this.userVisited = {userVisited : {visitedParks: []}};//user; //TODO: get this from server
|
||||
this.state = { visitedParks: [] };
|
||||
this.state = { visitedParks: [] };
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
axios.get('http://localhost:5321/userData', {params: {"user":"nico"}}).then( (json) => {console.log(json);this.setState({visitedParks : json.data.visitedParks})}).catch((err) => {console.log(err)});
|
||||
componentDidMount() {
|
||||
axios
|
||||
.get(baseurl + "userData", { params: { user: "nico" } })
|
||||
.then((json) => {
|
||||
//console.log(json);
|
||||
this.setState({ visitedParks: json.data.visitedParks });
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
handleVisitedClick(i, ind) {
|
||||
@@ -31,8 +42,13 @@ class NP extends React.Component {
|
||||
}
|
||||
//console.log(this.nptemplate);
|
||||
}
|
||||
axios.post('http://localhost:5321/saveUserFile', {visitedParks:temp}).then(() => console.log('Updated user data')).catch(err => { console.error(err);});
|
||||
this.setState({ visitedParks: temp });
|
||||
axios
|
||||
.post(baseurl + "saveUserFile", { visitedParks: temp })
|
||||
.then(() => console.log("Updated user data"))
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
this.setState({ visitedParks: temp });
|
||||
}
|
||||
|
||||
toLimitedDecimals(val, places = -1) {
|
||||
@@ -66,6 +82,7 @@ class NP extends React.Component {
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
|
||||
<div className="column">
|
||||
<table className="column">
|
||||
<thead>
|
||||
|
||||
@@ -1,17 +1,80 @@
|
||||
import React from "react";
|
||||
import "./finance.css";
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
PointElement,
|
||||
LineElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend,
|
||||
} from 'chart.js';
|
||||
import {Line} from 'react-chartjs-2';
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
PointElement,
|
||||
LineElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
);
|
||||
|
||||
class Finance extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
//this.userVisited = {userVisited : {visitedParks: []}};//user; //TODO: get this from server
|
||||
this.state = { netWorth: 0 };
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const labels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
this.state = {
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Net Worth',
|
||||
data: labels.map((month) => labels.indexOf(month)),
|
||||
borderColor: 'red',
|
||||
backgroundColor: 'pink'
|
||||
},
|
||||
{
|
||||
label: 'USAA',
|
||||
data: labels.map((month) => labels.indexOf(month) * 2),
|
||||
borderColor: 'blue',
|
||||
backgroundColor: 'lightblue'
|
||||
},
|
||||
{
|
||||
label: 'Edward Jones',
|
||||
data: labels.map((month) => labels.indexOf(month) ** 2),
|
||||
borderColor: 'green',
|
||||
backgroundColor: 'lightgreen'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
render(){
|
||||
return <div><p>HELLO WORK</p></div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const options = {
|
||||
responsive: true,
|
||||
plugins: {
|
||||
legend: {
|
||||
position: 'bottom',
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Finances',
|
||||
},
|
||||
},
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<Line options={options} data={this.state} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Finance;
|
||||
export default Finance;
|
||||
|
||||
0
frontend/src/components/health.css
Normal file
0
frontend/src/components/health.css
Normal file
19
frontend/src/components/health.js
Normal file
19
frontend/src/components/health.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from "react";
|
||||
import "./health.css";
|
||||
|
||||
class Health extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { netWorth: 0 };
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<p>Health</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Health;
|
||||
@@ -1,16 +1,18 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
//import App from './App';
|
||||
import NP from './components/NP';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import "./index.css";
|
||||
import App from './App';
|
||||
//import NP from "./components/NP";
|
||||
import reportWebVitals from "./reportWebVitals";
|
||||
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
const root = ReactDOM.createRoot(document.getElementById("root"));
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<NP />
|
||||
</React.StrictMode>
|
||||
<BrowserRouter>
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
</BrowserRouter>
|
||||
);
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
|
||||
Reference in New Issue
Block a user