Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import stylistic from '@stylistic/eslint-plugin';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -28,6 +29,7 @@ security.configs.recommended,
security,
pluginCypress,
'@typescript-eslint': typescriptEslint,
'@stylistic': stylistic
},

languageOptions: {
Expand All @@ -45,7 +47,12 @@ security.configs.recommended,
},

rules: {
indent: ['error', 4],
'@stylistic/indent': ['error', 4],
'@stylistic/max-len': [2, {
code: 80,
tabWidth: 4,
ignoreUrls: true,
}],
'linebreak-style': ['error', 'unix'],

'no-unused-vars': ['error', {
Expand All @@ -55,13 +62,6 @@ security.configs.recommended,

quotes: ['error', 'single'],
semi: ['error', 'always'],

'max-len': [2, {
code: 80,
tabWidth: 4,
ignoreUrls: true,
}],

'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'no-trailing-spaces': ['error'],
Expand Down
58 changes: 58 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@stylistic/eslint-plugin": "^5.3.1",
"@testing-library/jest-dom": "^6.1.0",
"@testing-library/react": "^16.0.0",
"@types/jest": "^29.5.1",
Expand Down
31 changes: 17 additions & 14 deletions src/about.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import React from 'react';

export const About: React.FC = () => {
Expand All @@ -7,28 +8,30 @@ export const About: React.FC = () => {
<div className='col-12 col-lg-7 px-2'>
<h1 className='mb-3'>About Statify</h1>
<p>
Using Spotify data, this project redevelops a series of
interactive simulations to support inquiry-based
learning of basic statistical concepts in Frontiers
of Science seminar sessions.
Using Spotify data, this project redevelops a series of
interactive simulations to support inquiry-based
learning of basic statistical concepts in Frontiers
of Science seminar sessions.
</p>

<h2 className='mb-3'>Faculty Partners</h2>

<ul className='mb-5'>
<li>
Nicholas Bock, Department of Earth & Environmental Sciences
Nicholas Bock, Department of Earth &amp;
Environmental Sciences
</li>
<li>
Vincent FitzPatrick, Department of Biological Sciences
Vincent FitzPatrick, Department of Biological
Sciences
</li>
<li>
Debora Monego, Department of Chemistry
Debora Monego, Department of Chemistry
</li>
</ul>

<h2 className='mb-3'>
Center for Teaching and Learning at Columbia University
Center for Teaching and Learning at Columbia University
</h2>

<ul className='mb-5'>
Expand All @@ -41,7 +44,7 @@ export const About: React.FC = () => {

<h2 className='mb-3'>License</h2>
<p className='mb-5'>Statify source code is available on <a href='https://github.com/ccnmtl/statify' target='_blank' rel='noopener noreferrer'>
Github</a> under the<a href='https://www.gnu.org/licenses/gpl-3.0.en.html' target='_blank' rel='noopener noreferrer'> GNU GPLv3 license</a>.
Github</a> under the<a href='https://www.gnu.org/licenses/gpl-3.0.en.html' target='_blank' rel='noopener noreferrer'> GNU GPLv3 license</a>.
</p>
</div>
<div className='col-12 col-lg-4 offset-lg-1 px-2'>
Expand All @@ -50,12 +53,12 @@ export const About: React.FC = () => {
<h2 className='h4 d-none d-lg-block'>
Questions and Feedback</h2>
<p>
If you’re interested in implementing this tool in your
teaching practice, to learn more about Statify, or to
send feedback on this application, please reach out to
the CTL project team. Email us at&nbsp;
If you’re interested in implementing this tool in your
teaching practice, to learn more about Statify, or to
send feedback on this application, please reach out to
the CTL project team. Email us at&nbsp;
<a href='mailto:[email protected]'>
[email protected].</a>
[email protected].</a>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/assignments/answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Answer: React.FC<AnswerProps> = (

if(localAnswers[questionId]){
setAnswers(() => {
// eslint-disable-next-line max-len
/* eslint-disable-next-line @stylistic/max-len */
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
answers[questionId] = localAnswers[questionId];
return answers;
Expand Down
10 changes: 5 additions & 5 deletions src/assignments/assignment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const Assignment: React.FC<AssignmentProps> = (
<div>
<label htmlFor={'name-input'}
className={'form-label'}>
Name:
Name:
</label>
{nameError && (
<span className={'text-danger fs-6 ms-5'}>
Expand All @@ -152,7 +152,7 @@ export const Assignment: React.FC<AssignmentProps> = (
<div>
<label htmlFor={'uni-input'}
className={'form-label'}>
Uni:
Uni:
</label>
{uniError && (
<span className={'text-danger fs-6 ms-5'}>
Expand Down Expand Up @@ -182,8 +182,8 @@ export const Assignment: React.FC<AssignmentProps> = (
</p> :
<p className='text-warning'>
Must have at least 1 screenshot
before the assignment can be
created.
before the assignment can be
created.
</p>
}
<button
Expand All @@ -198,7 +198,7 @@ export const Assignment: React.FC<AssignmentProps> = (
disabled={pdfButton}
onClick={() => void generatePdfDocument()}
className={'btn btn-primary btn-statify col-4'}>
Create Assignment
Create Assignment
</button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/assignments/assignmentDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const AssignmentDocument: React.FC<AssignmentDocumentProps> = (
return (
<>
<Text style={styles.questionTitle}>
Question {index + 1}
Question {index + 1}
</Text>
<Text style={styles.question}>
{question}
Expand Down Expand Up @@ -142,7 +142,7 @@ export const AssignmentDocument: React.FC<AssignmentDocumentProps> = (
{(screenshot.length > 0) && (
<>
<Text style={styles.answerTitle} break>
Evidence (Screenshot)
Evidence (Screenshot)
</Text>
{screenshot.map((image, key) =>
<Image
Expand Down
2 changes: 1 addition & 1 deletion src/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Footer: React.FC<PageSelect> = (
<li className='nav-item'>
<a href={'mailto:[email protected]'}
className={'nav-link'}>
Contact Us
Contact Us
</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/graphs/estimatedSampleDistribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const EstimatedDistribution: React.FC<EstimatedDistributionProps> = (
const se2 = stdError(data2, n), mean2 = mean(data2) ?? 0;
const gWidth = Number.parseInt(svgGraph.style('width')) - MARGIN;
const height =
Number.parseInt(svgGraph.style('height')) - MARGIN * 2;
Number.parseInt(svgGraph.style('height')) - MARGIN * 2;

// Data arrays must contain at least two datapoints
const yScale = data1.length > 1 && data2.length > 1 ? Math.max(
Expand Down
6 changes: 4 additions & 2 deletions src/graphs/genrePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ export const GenrePicker: React.FC<GenreProps> = ({
);
};

/* eslint-disable max-len */
const displaySortDirection = function() {
if (sortAsc) {
return (<>
A-Z
<span className='mx-2'></span>
{ }
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' className='bi bi-arrow-down-circle' viewBox='0 0 16 16'>
{/* eslint-disable-next-line @stylistic/max-len */}
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z'/>
</svg>
</>);
Expand All @@ -117,12 +118,13 @@ export const GenrePicker: React.FC<GenreProps> = ({
Z-A
<span className='mx-2'></span>
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' className='bi bi-arrow-up-circle' viewBox='0 0 16 16'>
{/* eslint-disable-next-line @stylistic/max-len */}
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-7.5 3.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V11.5z'/>
</svg>
</>);
}
};
/* eslint-enable max-len */


useEffect(() => {
if (sortedPopular) {
Expand Down
4 changes: 2 additions & 2 deletions src/graphs/graphForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export const GraphForm: React.FC<GraphFormProps> = ({
<div className='mb-3'>
<label htmlFor='dataPoints'
className='form-label'>
Data Points to Draw
Data Points to Draw
</label>
<select name='dataPoints' id='dataPoints'
className='form-select hover-green'
Expand All @@ -288,7 +288,7 @@ export const GraphForm: React.FC<GraphFormProps> = ({
<div className='mb-3'>
<label htmlFor='seed'
className='form-label col-12'>
Seed
Seed
</label>
<input name='seed' id='seed'
type='text'
Expand Down
2 changes: 1 addition & 1 deletion src/graphs/histogram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const Histogram: React.FC<HistogramProps> = (

const gWidth = Number.parseInt(svgGraph.style('width')) - MARGIN;
const height =
Number.parseInt(svgGraph.style('height')) - MARGIN * 2;
Number.parseInt(svgGraph.style('height')) - MARGIN * 2;
const activeArea = gWidth - MARGIN - Y_LABEL;
const bucketPadding = activeArea < 480 ? 1 : 4;

Expand Down
6 changes: 3 additions & 3 deletions src/notFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ export const NotFound: React.FC = () => {
<h1>Page not found</h1>

<p className='fs-4 mt-5'>
We&apos;re sorry. The page you&apos;re looking for
doesn&apos;t exist at this address.
We&apos;re sorry. The page you&apos;re looking for
doesn&apos;t exist at this address.
</p>

<div className='text-center mt-3'>
<a href={'/'}
className='btn btn-lg btn-statify'>
<span>
Return to Home page
Return to Home page
</span>
</a>
</div>
Expand Down