Weighted Kaplan–Meier plots and HRs illustrating the association of CDAI with cardiovascular disease mortality and all-cause mortality among adults with diabetes in the National Health and Nutrition Examination Survey (NHANES) 1999–2018. A Survival probability from weighted Kaplan–Meier plots. B CDAI were natural log-transformed in a restricted cubic spline model and then converted. Hazard ratios (solid lines) and 95% CIs (shaded areas) were adjusted for age (continuous), sex (male or female), race and ethnicity (self-reported Mexican American, non-Hispanic Black, non-Hispanic White, or other), educational level (< high school, high school or equivalent, or college or above), BMI (< 25.0, 25.0–29.9, or ≥ 30.0), family income-to-poverty ratio (< 1.0, 1.0–3.0, or > 3.0), drinking status (nondrinker, moderate drinker, or heavy drinker), physical activity (inactive or active), smoking status (never smoker, former smoker, or current smoker), HbA1c (< 7% or > 7%), diabetes duration (< 3, 3–10, or ≥ 10.0), HEI (in quartiles), total energy intakes (in quartiles), self-reported hypertension (yes or no), diabetes medication use (none, oral glucose-lowering medication, only insulin, or oral glucose lowering medication and insulin), TC (in quartiles), TG (in quartiles), HDL-C (in quartiles) and LDL-C (in quartiles). P < 0.05 for nonlinearity. C Survival probability from weighted Kaplan–Meier plots. D CDAI were natural log-transformed in a restricted cubic spline model and then converted. Hazard ratios (solid lines) and 95% CIs (shaded areas) were adjusted for age (continuous), sex (male or female), race and ethnicity (self-reported Mexican American, non-Hispanic Black, non-Hispanic White, or other), educational level (< high school, high school or equivalent, or college or above), BMI (< 25.0, 25.0–29.9, or ≥ 30.0), family income-to-poverty ratio (< 1.0, 1.0–3.0, or > 3.0), drinking status (nondrinker, moderate drinker, or heavy drinker), physical activity (inactive or active), smoking status (never smoker, former smoker, or current smoker), HbA1c (< 7% or > 7%), diabetes duration(< 3, 3–10, or ≥ 10.0), HEI (in quartiles), total energy intakes (in quartiles), self-reported hypertension (yes or no), diabetes medication use (none, oral glucose-lowering medication, only insulin, or oral glucose lowering medication and insulin), TC (in quartiles), TG (in quartiles), HDL-C (in quartiles) and LDL-C (in quartiles). P = 0.002 for nonlinearity