diff --git a/front-end/src/graphs/AreaChart.js b/front-end/src/graphs/AreaChart.js index be9a4df1..ec1cec2c 100644 --- a/front-end/src/graphs/AreaChart.js +++ b/front-end/src/graphs/AreaChart.js @@ -1,17 +1,65 @@ -import React from 'react' -import Plot from 'react-plotly.js' +import createPlotlyComponent from 'react-plotlyjs'; +//npm install react-plotlyjs +import React from 'react'; +import Plotly from 'plotly.js/dist/plotly-cartesian'; +const PlotlyComponent = createPlotlyComponent(Plotly); + +const AreaChart = ({ data, xAxisAttribute, yAxisAttribute }) => { + console.log(data); + + let xData = data.map((d) => { + if (d[xAxisAttribute] === undefined || d[xAxisAttribute] === 'NULL') { + return 'UNKOWN'; + } + return d[xAxisAttribute]; + }); + + let yData = data.map((d) => { + if (d[yAxisAttribute] === undefined || d[yAxisAttribute] === 'NULL') { + return 'UNKOWN'; + } + return d[yAxisAttribute]; + }); + console.log(xData); + console.log(yData); + let dataKeys=[ + { + fill: 'tozeroy', + type: 'scatter', + x: xData, + y: yData, + // x: [1, 2, 3, 4], + // y: [3, 5, 1, 7], + marker:{ + color:'(16,32,77)' + } + }, + { + fill: 'tonexty', + type: 'scatter', + x: xData, + y: yData, + // x: [1, 2, 3, 4], + // y: [0, 2, 3, 5], + } + ]; + let layout = { + autosize: true, + xaxis: { title: xAxisAttribute }, + yaxis: { title: yAxisAttribute }, + // yaxis: { title: 'Count' }, + }; + let config = { + showLink: false, + displayModeBar: true + }; -function AreaChart() { return ( <> -
-

Area Chart

-
-

TBH

-
-
+ - ) -} + ); + + } +export default AreaChart; -export default AreaChart diff --git a/front-end/src/graphs/GraphDisplay.js b/front-end/src/graphs/GraphDisplay.js index dfc35042..d394a568 100644 --- a/front-end/src/graphs/GraphDisplay.js +++ b/front-end/src/graphs/GraphDisplay.js @@ -18,6 +18,7 @@ import './GraphDisplay.css'; import { ChevronDownIcon } from '@heroicons/react/solid'; import { useState } from 'react'; + //Main component that displays your created graph //Components in React can be in the form of functions, classes etc. //and consist of both javascript code and html code (html is the return value) @@ -26,6 +27,9 @@ function GraphDisplay() { const selectBoxData = dataKeys.map((d) => ({ fieldName: d, value: d })); const [histoXAttr, setHistoXAttr] = useState('ID'); + //area chart attribute + const [areaXattr, setAreaXattr] = useState('ID'); + const [areaYattr, setAreaYattr] = useState('ID'); //Below is the html code (return value) return ( <> @@ -57,8 +61,37 @@ function GraphDisplay() { + +
+

Area Chart

+ +
+ +
+ Area Chart X Axis Data of Non-Geo Data +
+
+ +
+
+ Area Chart Y Axis Data of Non-Geo Data +
+
+ +
+ ); } diff --git a/ux-design/questions/FAQ.png b/ux-design/questions/FAQ.png index 60cebfa2..22763280 100644 Binary files a/ux-design/questions/FAQ.png and b/ux-design/questions/FAQ.png differ diff --git a/ux-design/questions/FAQ_UxDesign.docx b/ux-design/questions/FAQ_UxDesign.docx new file mode 100644 index 00000000..d25ea79f Binary files /dev/null and b/ux-design/questions/FAQ_UxDesign.docx differ diff --git a/ux-design/questions/FAQ_wireframe.png b/ux-design/questions/FAQ_wireframe.png new file mode 100644 index 00000000..22763280 Binary files /dev/null and b/ux-design/questions/FAQ_wireframe.png differ diff --git a/ux-design/questions/Resources.png b/ux-design/questions/Resources.png new file mode 100644 index 00000000..3903bcb3 Binary files /dev/null and b/ux-design/questions/Resources.png differ diff --git a/ux-design/questions/Resources_wireframe.png b/ux-design/questions/Resources_wireframe.png new file mode 100644 index 00000000..3903bcb3 Binary files /dev/null and b/ux-design/questions/Resources_wireframe.png differ diff --git a/ux-design/questions/UXdesignDocument.docx b/ux-design/questions/UXdesignDocument.docx new file mode 100644 index 00000000..d25ea79f Binary files /dev/null and b/ux-design/questions/UXdesignDocument.docx differ