Thank you for your interest in contributing to PopGeneJS! This document provides guidelines for contributing to the project.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/popgenesjs.git cd popgenesjs - Install dependencies:
npm install
- Create a branch for your changes:
git checkout -b feature/your-feature-name
Start the development server:
npm run devRun type checking:
npm run checkBuild for production:
npm run build- TypeScript: Strict mode is enabled. All code must pass type checking.
- Svelte 5: Use runes (
$state,$derived,$effect,$props) instead of legacy reactive syntax. - Formatting: Follow existing code style. Use tabs for indentation.
PopGeneJS follows a strict three-layer separation:
-
Simulation functions (
src/lib/sim/*.ts)- Pure TypeScript functions with no DOM or Svelte dependencies
- Export a params interface, defaults constant, and simulation function
- Return
SimPoint[][](array of trajectories)
-
Chart renderers (
src/lib/charts/*.ts)- D3.js functions that take a DOM element and data
- Read theme colors from CSS custom properties at render time
-
Page components (
src/routes/*/+page.svelte)- Thin wrappers composing simulation logic and UI components
- Use
SimLayoutfor consistent page structure
-
Create the simulation function in
src/lib/sim/:export interface MySimParams { // parameters } export const MYSIM_DEFAULTS: MySimParams = { // default values }; export function simulateMySim(params: MySimParams): SimResult { // implementation }
-
Create the route page in
src/routes/my-sim/+page.svelte -
Add help content in
src/lib/help/(see existing files for structure) -
Add the module to the landing page in
src/routes/+page.svelte
Open an issue with:
- A clear description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Browser and OS information
Open an issue describing:
- The proposed feature
- Why it would be useful for population genetics education
- Any relevant references or prior art
- Ensure your code passes type checking:
npm run check - Test your changes in both dark and light themes
- Test responsive behavior (resize browser window)
- Commit with a clear message describing the change
- Push to your fork and open a pull request
Open an issue or contact the maintainer at nuin@genedrift.org.
By contributing, you agree that your contributions will be licensed under the MIT License.