Skip to content

Display only selected nozzle efficiency in ship mass charts#84

Merged
lookbusy1344 merged 3 commits intomainfrom
copilot/update-ship-mass-chart
Dec 22, 2025
Merged

Display only selected nozzle efficiency in ship mass charts#84
lookbusy1344 merged 3 commits intomainfrom
copilot/update-ship-mass-chart

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

The "Ship mass over time" charts on Constant Acceleration and Flip tabs displayed all 4 nozzle efficiency profiles (70%, 75%, 80%, 85%) instead of showing only the user-selected efficiency.

Changes

  • Data generation: Modified generateAccelChartData() and generateFlipBurnChartData() to accept nozzleEfficiency parameter and compute single mass profile instead of 4 fixed profiles
  • Chart rendering: Updated createMassRemainingDatasets() to create single dataset with dynamic label showing selected efficiency percentage
  • Event handlers: Pass user-selected efficiency value from input field to data generation and chart update functions

Before/After

Before: Chart always showed 4 lines regardless of selected efficiency
Before

After: Chart shows single line matching selected efficiency with dynamic label
Constant Accel
Flip Tab

Implementation

// Data generation now accepts efficiency parameter
export function generateAccelChartData(
  accelG: number,
  durationDays: number,
  nozzleEfficiency: number  // NEW
): {
  // ...
  properTimeMassRemaining: ChartDataPoint[];  // Single array instead of 4
  // ...
}

// Chart creation uses dynamic label
function createMassRemainingDatasets(
  data: { x: number; y: number }[],
  nozzleEfficiency: number
): ChartDataset[] {
  const efficiencyPercent = Math.round(nozzleEfficiency * 100);
  return [{
    label: `${efficiencyPercent}% Nozzle Efficiency`,  // Dynamic
    data: data,
    // ...
  }];
}
Original prompt

This section details on the original issue you should resolve

<issue_title>SHIP MASS OVER TIME Chart single line</issue_title>
<issue_description>In the JavaScript app, on the ‘Constant accel’ and ‘flip’ tabs there is a ‘Ship mass over time’ chart that shows 4 fuel profiles. Those charts should just show the selected nozzle efficiency fuel profiles as a single line.

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Modified data generation and chart creation to accept nozzle efficiency parameter and display only the selected efficiency profile instead of showing all 4 profiles (70%, 75%, 80%, 85%).

Co-authored-by: lookbusy1344 <3680611+lookbusy1344@users.noreply.github.com>
Copilot AI changed the title [WIP] Update ship mass over time chart to single line Display only selected nozzle efficiency in ship mass charts Dec 22, 2025
Copilot AI requested a review from lookbusy1344 December 22, 2025 08:29
The code was using pionRocketFuelFraction() which returns fractions
(0.0-1.0) but treating them as percentages (0-100), causing mass
remaining to display ~99-100% instead of realistic values.

Fixed by subtracting fuel fraction from 1, then multiplying by 100 to
convert to percentage. Added tests using TDD to verify mass decreases
significantly over time and monotonically.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@lookbusy1344 lookbusy1344 marked this pull request as ready for review December 22, 2025 09:36
@lookbusy1344 lookbusy1344 merged commit 3ebe949 into main Dec 22, 2025
7 checks passed
@lookbusy1344 lookbusy1344 deleted the copilot/update-ship-mass-chart branch December 22, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SHIP MASS OVER TIME Chart single line

2 participants