Skip to main content

growth_standards 5.5.0 copy "growth_standards: ^5.5.0" to clipboard
growth_standards: ^5.5.0 copied to clipboard

A Dart implementation of various growth standards, WHO, CDC, Fenton, Intergrowth, etc.

5.5.0 #

  • INTERGROWTH-21st Anthropometric Features:
    • Added Estimated Fetal Weight (EFW) standards with full SVG chart & JSON support:
      • IntergrowthHadlockEstimatedFetalWeightForAge (Stirnemann et al., UOG 2020; 18+0–41+0 weeks GA) with Hadlock 3-parameter estimateWeight(HC, AC, FL) and estimatedFetalWeightHadlock / estimatedFetalWeightHadlockFromBiometry.
      • IntergrowthEstimatedFetalWeightForAge (Stirnemann et al., UOG 2017; 22+0–40+0 weeks GA) with IG-21st estimateWeight(HC, AC) and estimatedFetalWeight / estimatedFetalWeightFromBiometry.
    • Added direct Ultrasound Pregnancy Dating (GA & EDD) calculators (IntergrowthPregnancyDatingEstimate with exactDays, exactWeeks, gestationalAge, sdDays, predictionInterval95, and estimatedDueDate):
      • estimateGestationalAgeByCRL (15–100 mm; Papageorghiou et al., UOG 2014).
      • estimateGestationalAgeByHCAndFL and estimateGestationalAgeByHC (late pregnancy; Papageorghiou et al., UOG 2016).
    • Extended INTERGROWTH-21st fetal biometry tables (HC, AC, FL, BPD, OFD) through week 41 per Oxford's October 2025 extrapolated gestational age limits policy.
    • Added 6 GrowthTrajectory factories: intergrowthFetalOccipitofrontalDiameter, intergrowthFetalCrownRumpLength, intergrowthSymphysisFundalHeight, intergrowthGestationalWeightGain, intergrowthEstimatedFetalWeightHadlock, and intergrowthEstimatedFetalWeight.
  • Whole-Codebase Bug Fixes:
    • CDC 2022 Extended BMI-for-Age Charts: Implemented LMSContext.valueAtZScore on _CDCBodyMassIndexForAgeLMS using CDC's extended sigma formula above the 95th percentile so +2/+3 SD curves render accurately (~43 kg/m² instead of exploding to ~147 kg/m² under negative Box-Cox L).
    • Signed Date Arithmetic & GA/PMA Guards: Made Date.difference / differenceWithDateTime signed, fixed Date +/- for negative Duration, and added runtime ArgumentError guards on GestationalAge.fromLMP/fromDates and PostmenstrualAge.fromLMP/fromDates/fromGestationalAge.
    • Input Validation: Rejected non-positive length/weight in BodyMassIndex.value and NewbornWeightLengthRatioMeasurement.fromMeasurement instead of returning Infinity or negative values.
    • WHO Oedema & Velocity Safety: Checked oedema before scoring in WHOGrowthStandardsWeightVelocityForAge, guarded nullable measurementPosition in WHOGrowthStandardsLengthVelocityForAge, exposed optional oedemaExist on WHOGrowthStandard factory methods, and formatted non-finite Z-scores/percentiles cleanly as N/A in SVGs without emitting NaN.
    • Math NaN Coercion & Undefined Box-Cox Tail Rendering: Fixed pnorm, qnorm, standardDeviationCalculation, zScoreCalculation, and adjustedZScoreCalculation so NaN/Infinity inputs are no longer coerced to 0 (pnorm(NaN) == 0.5) and adjustedZScoreCalculation falls back to exact unadjusted zScore when Box-Cox SD3 tails are undefined; filtered non-finite curve points in GrowthChartModel (eliminating NaN SVG paths in WHO Length/HC Velocity and CDC Weight-for-Stature).
    • Calendar Parsing & Age Helpers: Rejected invalid ISO dates (2024-02-31, 2024-13-01) and zero-year dates (0000-01-01) in ExtendedDateUtils.tryParse, fixed single-pass token formatting in DateFormatExtension.format (preventing 'March'/'May' corruption to '3arch'/'5ay'), guarded _monthFromNumber with RangeError and parseIncrement with ArgumentError, normalized overflow in TimeDifferenceExtension.add, respected observedDate in AgeComparisonExtension.isOlderThan/isYoungerThan, and fixed DST/leap-day handling in TimeIntervalCount.timeUntilNextBirthday.
    • Chart Standards Detection, Velocity Plotting & Trajectories: Replaced fragile Freezed private runtimeType string checks in GrowthChartModel with explicit type checks so CDC (BMI, Stature, Infant Length, Infant Head Circumference) and INTERGROWTH charts receive proper titles, standard percentile bands ([3, 10, 25, 50, 75, 90, 97] / [3, 10, 50, 90, 97]), curve colors, and legend labels; inverted WHO adjustedZScore accurately when plotting extreme velocity gains (|z| > 3); sorted observation points by X and guarded empty result lists in GrowthChartModel.fromResults; aligned monthly X-axis ticks to exact year boundaries on WHO 5–19y charts; preserved fractional weeks in _extractXValue; and accepted typed BMI measurements and LengthMassObservation in GrowthTrajectory.who5To18BmiForAge and cdcBmiForAge.

5.4.3 #

  • CDC Infant Recumbent Length Adjustment Fix:
    • Added optional chartIsRecumbent to adjustedLengthHeight and wired CDCInfantLengthForAge / CDCInfantWeightForLength (chartIsRecumbent: true) and CDCStatureForAge / CDCWeightForStature (chartIsRecumbent: false) so 0–36 month recumbent infant charts no longer subtract 0.8 cm when measured recumbent at 24–36 months.
  • SVG Chart Model & INTERGROWTH Visualization Fixes:
    • Generated weekly X-axis ticks (9w..15w) for IntergrowthFetalCrownRumpLengthForAge (58..105 days) and guarded against empty xTicks in GrowthChartModel.
    • Formatted weekly AgeBasedResult X-values (IntergrowthFetal*, IntergrowthSymphysisFundalHeightForAge, IntergrowthGestationalWeightGainForAge, and IntergrowthPretermInfantsPostnatalGrowth*) in weeks (wks) instead of months (mo).
    • Added specific SVG chart titles and Y-axis labels for skinfolds, weight-to-length ratio, fetal biometric indicators, symphysis-fundal height, and gestational weight gain, omitting the sex suffix on sex-neutral pregnancy charts.

5.4.2 #

  • Trajectory Fixes:
    • Normalized multi-week PostmenstrualAge day accumulation (weeks + days) in GrowthTrajectory.fentonWeightForAge, fentonLengthForAge, and fentonHeadCircumferenceForAge.
    • Added optional gestationalAgeAtBirth to GrowthTrajectory.intergrowthPretermPostnatalWeight, intergrowthPretermPostnatalLength, and intergrowthPretermPostnatalHeadCircumference to convert postnatal age into postmenstrual age (27–64 weeks PMA).
  • WHO Velocity & Reference Fixes:
    • Fixed WHO velocity interval resolution (resolveVelocityMonths) when a valid day-window pair (~28–31 days) falls within a single 31-day calendar month.
    • Subtracted the Box-Cox delta offset when rendering WHO Weight Velocity curves and observation points in GrowthChartModel.
    • Wired measure (LengthHeightMeasurementPosition) through adjustedLengthHeight in WHOGrowthReference.heightForAge.
  • Calendar & Math Edge Cases:
    • Fixed month-length borrowing and cross-year/leap-day calculations in DateTimeUtils.timeDifference, and made ExtendedDateUtils.doRangesOverlap inclusive of touching endpoints.
    • Added y <= 0 validation to adjustedZScoreCalculation and preserved linear (L = 1) zero/negative weight-change support for IntergrowthGestationalWeightGainForAge.
    • Fixed unit conversion (toMillimeter) in IntergrowthEarlyPregnancyDatingForCRL, 36-month upper bound clamping in CDCInfantLengthForAge, and PMA/GA/fetal indicator labels in GrowthChartModel.

5.4.1 #

  • Fix: Removed accidentally tracked test build/ assets from the published package to reduce package size.

5.4.0 #

  • SVG Compatibility: Restructured SVG code generation to completely eliminate <style> blocks and CSS classes. All styles are now generated natively via inline standard SVG presentation attributes (fill=, stroke=, font-family=, etc.). This guarantees 100% out-of-the-box compatibility with strict SVG renderers like flutter_svg, standard email clients, and document generators without the need for manual regex parsing.
  • Customizable SVG Headers/Watermarks: Added patientInfo and watermarkText to GrowthChartConfig.
    • patientInfo neatly anchors to the top right of the SVG (auto-adjusting vertically to prevent overlap with extremely long chart titles).
    • watermarkText renders as a large, 48pt, diagonal, translucent watermark embedded deeply behind the chart data.
  • Security Check: Custom text parameters (title, subtitle, patientInfo, watermarkText) are strictly escaped (_escapeXml()) to prevent any SVG/XML injection vulnerabilities.

5.3.0 #

  • SVG export restructuring: Revamped SVG generation scripts. Outputs are now meticulously categorized into nested directories for each standard and measurement, producing both standard Z-score curves and percentile-based curves (dev/generate_all_svg.dart).
  • LMS curve correctness: Corrected the statistical calculations for rendering smooth ChartCurve points in graphical outputs to honor standard deviation limits (especially mapping age variables explicitly in equations).
  • Intergrowth CRL fixes: Corrected earlyPregnancyCRL gestational age reverse lookup. It now evaluates the exact gestational age derived from fetal crown-rump length ultrasound data properly.
  • Unit normalization constraints: Confirmed flawless abstraction mapping in measurement defaults; Fenton strictly uses grams vs WHO kg; Intergrowth ultrasound enforces millimeters.

5.2.0 #

  • Math precision upgrade: Fully migrated internal statistical equations (SD and Z-score calculations) to use the Rational class underneath, strictly preventing any floating-point precision loss during intermediate algebraic steps.
  • Normal distribution accuracy: Improved probability implementations (pnorm and qnorm) utilizing Rational objects for enhanced exactness.
  • Dependency upgrade: Added support for @freezed sealed classes to GestationalAge and PostmenstrualAge allowing exhaustive pattern matching.

5.1.1 #

  • Fix: Remove redundant sex badge in svg output

5.1.0 #

  • Official calibration tests: Added comprehensive validation tests against official WHO 2006 reference data with exact LMS calculations
  • Precision documentation: Documented official floating-point precision requirements for all growth standards (WHO, CDC, Fenton, INTERGROWTH-21st)
  • Test tolerance: Implemented WHO-documented acceptable tolerance of ≤0.01 for z-score calculations
  • REFERENCES.md: Added comprehensive reference documentation with all official documentation, scientific papers, and data sources for all growth standards
  • LMS formula documentation: Documented the Box-Cox power transformation method used across all standards
  • Comparison tables: Added detailed comparisons between growth standards (WHO vs CDC, WHO 2006 vs 2007, Fenton vs WHO, INTERGROWTH vs WHO)
  • Implementation guidelines: Added when-to-use guidelines, age calculation methods, measurement units, and extreme value flagging limits
  • Quality control documentation: Documented validation protocols for WHO MGRS, INTERGROWTH-21st, and CDC NHANES studies
  • FAQ section: Added frequently asked questions about growth standards, z-scores, and implementation differences
  • Glossary: Added comprehensive glossary of key terms (BCPE, BMI, LMS, MGRS, PMA, SD, TEM, Z-Score)
  • Calculation examples: Added step-by-step z-score calculation examples for WHO and Fenton standards
  • Citation formats: Added proper citation formats for all growth standards
  • License information: Documented licensing terms for each growth standard

5.0.0 #

  • BREAKING — SVG-only chart output: Removed the PNG renderer and all PNG APIs (toPng(), savePng(), toPngList(), savePngList(), renderVelocityPng(), saveVelocityPng()). Charts are now rendered exclusively as SVG; convert to raster formats externally (e.g. rsvg-convert, Inkscape, or a browser).
  • BREAKING — dropped image dependency: The package no longer depends on package:image.
  • Redesigned chart legend: Legend items are now dynamically measured, evenly spaced, and horizontally centered on a dedicated bottom row, eliminating text overlap with the x-axis title and between entries.
    • Legend labels adapt to the display mode (0 SD (Median) / ±1 SD / ±2 / ±3 SD for Z-scores; 50th (Median) / 15th / 85th / 3rd / 97th for percentiles).
    • A Trajectory legend entry is shown automatically for multi-point longitudinal charts.
    • The x-axis title now sits at a fixed offset below the tick labels with dedicated space reserved for the legend row.
  • X-axis tick label overlap guard: Tick labels that would collide with the previous label (e.g. dense velocity interval labels like 10–12m) are automatically skipped.

4.6.0 #

  • Growth Chart Visualizer Engine: Pure Dart rendering engine generating vector SVG and high-resolution PNG growth charts.
    • Supports WHO (0-5y & 5-18y), CDC (2-20y & 0-36m), Fenton 2013 Preterm, and WHO Growth Velocity charts.
    • Pixel-perfect layout alignment between SVG and PNG renderers.
    • Includes custom themes (GrowthChartTheme.boy(), GrowthChartTheme.girl()), display modes (Z-scores vs. Percentiles), legend rows, grid lines, and top-right callout result banners.
    • Direct extension methods on Result, List<Result>, VelocityBasedResult, and GrowthTrajectory (toSvg(), toPng(), saveSvg(), savePng()).
  • Core GrowthTrajectory API: Decoupled longitudinal child growth tracking helper available at core library level (lib/src/common/trajectory.dart).
    • Added 24 trajectory factory constructors covering WHO, CDC, Fenton, and INTERGROWTH-21st standards.
    • Accepts LengthMassObservation paired visit measurements and returns Result calculations on add().
    • Added trajectory analytic getters (zScores, percentiles, latestResult, firstResult).
  • WHO Growth Velocity Visualization: Render interval growth velocity charts for weight, length, and head circumference gain across 1, 2, 3, 4, and 6-month increments.
  • Pediatric Age & Sex Semantics: Standardized sex labels (BOY/GIRL and Boys/Girls for pediatric age < 18y; MALE/FEMALE and Males/Females for adult age ≥ 18y).
  • Expanded Modular Example Suite: Added dedicated, runnable scripts under example/ for every growth measurement type.

4.5.0 #

  • Add sex-specific Fenton 2013 LMS datasets for boys and girls (wfa, lfa, hcfa)
  • Require typed PostmenstrualAge for Fenton and GestationalAge for INTERGROWTH newborn models
  • Fix WHO growth velocity month classification for day-based clinical visit gaps (days / 30.4375)
  • Fix CDC Agemos mid-month n + 0.5 grid lookups across endpoint months
  • Add WHO WFL (≤730 days) and WFH (>730 days) runtime age gates
  • Implement LMS $L=0$ limit form ($Z = \ln(y/M)/S$) and non-positive measurement guards in math core
  • Fix DateFormatExtension.format month name (MMM) token replacement order and export from package root
  • Fix ageAtPastDate DOB handling and standing/recumbent length adjustments
  • Add mathematical golden vector test suite (test/golden_vectors_test.dart)

4.4.1 #

  • Fix bug in growth velocity data parser
  • Add conversion unit symbol in length based growth measurement assertion

4.4.0 #

  • Set default value for countObservationDate to true in Age
  • Improve performance by change source data to map literal instead of json string

4.3.1 #

  • Add latest Symphisis-Fundal Height score update

4.3.0 #

  • Fix intergrowth source data error

4.2.1 #

  • Dependencies bump

4.2.0 #

  • Add countObservationDate to Age with default value to false

4.1.5 #

  • Same as previous version, but support for freezed v2

4.1.4 #

  • Set default decimal Precision to Precision.two

4.1.3 #

  • Same as previous version, but support for freezed v2

4.1.2 #

  • Minor performance improvements

4.1.1 #

  • Exportinng pnorm and qnorm

4.1.0 #

  • Add missing TimeUnit

4.0.0 #

  • Remove Sex.both enum.
  • Remove Sex parameter from Fenton measurement.
  • Add Intergrowth-21 measurements.

3.0.6 #

  • Same as previous version
  • Use this version if your dependencies has not supported freezed version 3

3.0.5 #

  • Remove data sorting as the data is sorted by default

3.0.4 #

  • Same as previous version
  • Use this version if your dependencies has not supported freezed version 3

3.0.2 #

  • Exporting TimeUnit

3.0.1 #

  • Same as previous version
  • Use this version if your dependencies has not supported freezed version 3

3.0.0 #

  • Add Sex.both to replace for sex-agnostic data
  • Exposing contextData for directly accessing statistical data
  • Unified assertion for non velocity measurement
  • Removing observationDate on Length-based measurement
  • Move observationDate into Age observedDate field

2.2.1 #

  • Same as previous version
  • Use this version if your dependencies has not supported freezed version 3

2.2.0 #

  • Unified ageData and lengthData into lmsData

2.1.5 #

  • Export additional typedef

2.1.4 #

  • Fix measurement conversion in WHOGrowthStandardsTricepsSkinfoldForAge and WHOGrowthStandardsSubscapularSkinfoldForAge

2.1.3 #

  • Expose lengthAtObservationDate for length based measurement
  • Use this version if your dependencies has supported freezed version 3

2.1.2 #

  • Expose lengthAtObservationDate for length based measurement
  • Use this version if your dependencies has not supported freezed version 3

2.1.1 #

  • Simplify LMS
  • Fix bug at measurement of WHOGrowthStandardsArmCircumferenceForAge
  • Update dependencies
  • Expose measurementResultInDefaultUnit
  • Use this version if your dependencies has supported freezed version 3

2.1.0 #

  • Simplify LMS
  • Fix bug at measurement of WHOGrowthStandardsArmCircumferenceForAge
  • Update dependencies
  • Expose measurementResultInDefaultUnit
  • Use this version if your dependencies has not supported freezed version 3

2.0.1 #

  • Exposing ageAtObservationDate field for age based measurement
  • Add various base class
  • Use this version if your dependencies has supported freezed version 3

2.0.0 #

  • Exposing ageAtObservationDate field for age based measurement
  • Add various base class
  • Use this version if your dependencies has not supported freezed version 3

1.5.1 #

  • Exposing ageData for more easy access
  • Use this version if your dependencies has supported freezed version 3

1.5.0 #

  • Exposing ageData for more easy access
  • Use this version if your dependencies has not supported freezed version 3

1.4.3 #

  • Fix pub static analysis issues

1.4.2 #

  • Bump freezed version.
  • Use this version if your dependencies has supported freezed version 3

1.4.1 #

  • Lowering freezed version.
  • Use this version if your dependencies has not supported freezed version 3

1.4.0 #

  • Bump super_measurement
  • Removed Precision.none

1.3.0 #

  • Bump freezed

1.2.2 #

  • Bump Dart SDK

1.2.1 #

  • Add support for web

1.2.1 #

  • Add Oedema field to weight based measurement
  • Fix age miscalculation

1.1.4 #

  • Dependency update
  • Some measurement API changes

1.1.3 #

  • Bug fix
  • Minor refractor

1.1.2 #

  • Dependencies update

1.1.1 #

  • Various bug fix

1.1.0 #

  • Refactoring
  • Bug fix
  • Improved API

1.0.7 #

  • API fix
  • Remove some unused code
  • More test

1.0.6 #

  • Several Bug fix
  • Add WHO Growth Velocity

1.0.5 #

  • Add Fenton preterm growth standards

1.0.4 #

  • Add CDC measurement

1.0.3 #

  • Exposing additional types

1.0.2 #

  • Exposing data API

1.0.1 #

  • Some minor refactoring

1.0.0 #

  • Initial version.
4
likes
150
points
1.62k
downloads

Documentation

API reference

Publisher

verified publishermrcrbrth.my.id

Weekly Downloads

A Dart implementation of various growth standards, WHO, CDC, Fenton, Intergrowth, etc.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

clock, dart_numerics, freezed_annotation, json_annotation, super_measurement

More

Packages that depend on growth_standards