make ppt for water standards and purification
ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"
mkdir -p /home/daytona/workspace/water-standards-ppt
~/water-standards-ppt/create_water_standards_ppt.js
const pptxgen = require('pptxgenjs');
const pptx = new pptxgen();
pptx.layout = 'LAYOUT_WIDE';
pptx.author = 'Orris';
pptx.company = 'Academic';
pptx.subject = 'Water quality standards and purification';
pptx.title = 'Water Standards and Purification';
pptx.lang = 'en-US';
pptx.theme = {
headFontFace: 'Aptos Display',
bodyFontFace: 'Aptos',
lang: 'en-US'
};
const colors = {
bg: 'F4FAFD',
primary: '0B4F6C',
secondary: '1F7A8C',
accent: 'BFDBF7',
textDark: '102A43',
textMid: '334E68',
white: 'FFFFFF',
good: '1B8A5A',
warn: 'CC7A00',
danger: 'C81D25'
};
function addHeader(slide, title, subtitle = '') {
slide.background = { color: colors.bg };
slide.addShape(pptx.ShapeType.rect, {
x: 0, y: 0, w: 13.33, h: 0.58,
fill: { color: colors.primary },
line: { color: colors.primary }
});
slide.addText(title, {
x: 0.5, y: 0.08, w: 8.8, h: 0.33,
fontSize: 20, bold: true, color: colors.white, margin: 0
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.5, y: 0.66, w: 12.3, h: 0.35,
fontSize: 13, color: colors.textMid, italic: true, margin: 0
});
}
}
function addFooter(slide, note = 'Water Standards and Purification') {
slide.addShape(pptx.ShapeType.line, {
x: 0.45, y: 7.12, w: 12.4, h: 0,
line: { color: 'C7D9E6', pt: 1 }
});
slide.addText(note, {
x: 0.5, y: 7.16, w: 8, h: 0.2,
fontSize: 9, color: '627D98', margin: 0
});
}
// Slide 1: Title
{
const slide = pptx.addSlide();
slide.background = { color: colors.primary };
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.9, y: 0.95, w: 11.6, h: 5.5,
rectRadius: 0.08,
fill: { color: '0E6388', transparency: 8 },
line: { color: '2A93B8', pt: 1 }
});
slide.addText('Water Standards and Purification', {
x: 1.35, y: 2.05, w: 10.8, h: 1,
fontSize: 44, bold: true, color: colors.white, align: 'center'
});
slide.addText('Detailed Technical Presentation for Students', {
x: 1.35, y: 3.1, w: 10.8, h: 0.5,
fontSize: 20, color: 'D8EEF8', align: 'center'
});
slide.addText('Scope: drinking water quality benchmarks, treatment trains, process chemistry, and compliance monitoring', {
x: 1.35, y: 3.75, w: 10.8, h: 0.7,
fontSize: 14, color: 'D8EEF8', align: 'center'
});
addFooter(slide, 'Environmental Engineering | Water Quality Management');
}
// Slide 2: Learning objectives
{
const slide = pptx.addSlide();
addHeader(slide, 'Learning Objectives');
slide.addText('By the end of this session, students should be able to:', {
x: 0.7, y: 1.0, w: 11.8, h: 0.4, fontSize: 16, color: colors.textDark, bold: true
});
const bullets = [
'Differentiate aesthetic, health-based, and operational water quality criteria',
'Interpret major national and international drinking water standards',
'Explain each unit process in a conventional and advanced purification train',
'Relate contaminant properties to treatment selection and expected removal efficiency',
'Design a monitoring framework using critical control points and surrogate parameters'
];
slide.addText(bullets.map((b, i) => ({
text: b,
options: { bullet: { indent: 24 }, breakLine: i !== bullets.length - 1 }
})), {
x: 1.0, y: 1.6, w: 11.1, h: 3.8, fontSize: 22, color: colors.textMid, paraSpaceAfterPt: 14
});
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.9, y: 5.7, w: 11.6, h: 1.0,
rectRadius: 0.06,
fill: { color: 'E8F4FA' }, line: { color: 'B0D4E3' }
});
slide.addText('Framework for this deck: Standards -> Contaminants -> Unit Processes -> Integration -> Monitoring & Compliance', {
x: 1.1, y: 6.02, w: 11.2, h: 0.5, fontSize: 15, bold: true, color: colors.secondary, align: 'center'
});
addFooter(slide);
}
// Slide 3: Regulatory architecture
{
const slide = pptx.addSlide();
addHeader(slide, 'Regulatory Architecture for Drinking Water');
slide.addText('How standards are derived and implemented', {
x: 0.7, y: 0.95, w: 11, h: 0.35, fontSize: 14, color: colors.textMid
});
const boxW = 3.85;
const y = 1.5;
const h = 4.7;
const titles = ['Health Risk Assessment', 'Standard Setting', 'Utility Implementation'];
const details = [
[
'Hazard identification',
'Dose-response assessment',
'Exposure assessment',
'Risk characterization',
'Target risk levels (often 10^-4 to 10^-6 lifetime cancer risk)'
],
[
'WHO guideline values',
'EPA MCL and MCLG model',
'BIS IS 10500 / national standards',
'Technology-based constraints and cost-benefit context',
'Periodic revision based on emerging evidence'
],
[
'Source-to-tap water safety plans',
'Treatment process selection',
'Operational limits and alarms',
'Distribution system residual management',
'Regulatory reporting and corrective action'
]
];
for (let i = 0; i < 3; i++) {
const x = 0.6 + i * 4.2;
slide.addShape(pptx.ShapeType.roundRect, {
x, y, w: boxW, h,
rectRadius: 0.05,
fill: { color: 'FFFFFF' },
line: { color: i === 1 ? '2A93B8' : 'C3D7E3', pt: i === 1 ? 2 : 1 }
});
slide.addText(titles[i], {
x: x + 0.18, y: y + 0.2, w: boxW - 0.36, h: 0.45,
fontSize: 16, bold: true, color: colors.primary, align: 'center'
});
slide.addText(details[i].map((d, j) => ({
text: d,
options: { bullet: { indent: 16 }, breakLine: j !== details[i].length - 1 }
})), {
x: x + 0.25, y: y + 0.83, w: boxW - 0.5, h: 3.65,
fontSize: 12, color: colors.textMid, paraSpaceAfterPt: 8
});
}
addFooter(slide);
}
// Slide 4: Core water quality parameters
{
const slide = pptx.addSlide();
addHeader(slide, 'Core Water Quality Parameters and Typical Limits');
const rows = [
['Parameter', 'Why it Matters', 'Typical Guideline / Limit'],
['pH', 'Corrosion control, disinfection efficacy', '6.5 to 8.5 (operational range)'],
['Turbidity', 'Particle-associated pathogens, filter breakthrough indicator', '<1 NTU target at plant outlet; often <5 NTU max'],
['Total Dissolved Solids (TDS)', 'Taste, scaling, acceptability', 'Desirable <500 mg/L; permissible up to ~1500-2000 mg/L'],
['Nitrate (as NO3-)', 'Methemoglobinemia risk in infants', 'Typically 50 mg/L as NO3- (jurisdiction-dependent)'],
['Fluoride', 'Dental benefit at low doses, fluorosis at high doses', 'Common guideline around 1.5 mg/L'],
['Lead', 'Neurotoxicity, especially pediatric', 'Action level typically in low µg/L range (e.g., 10-15 µg/L)']
];
slide.addTable(rows, {
x: 0.55, y: 1.1, w: 12.2, h: 4.95,
border: { type: 'solid', pt: 1, color: 'BFD3DF' },
fill: 'FFFFFF',
fontFace: 'Aptos',
fontSize: 12,
color: colors.textDark,
valign: 'middle',
colW: [2.0, 5.2, 5.0],
rowH: [0.55, 0.62, 0.62, 0.72, 0.7, 0.62, 0.62],
autoFit: false
});
slide.addShape(pptx.ShapeType.rect, {
x: 0.55, y: 1.1, w: 12.2, h: 0.55,
fill: { color: colors.secondary }, line: { color: colors.secondary }
});
slide.addText([
{ text: 'Parameter', options: { bold: true, color: 'FFFFFF', breakLine: false } },
], { x: 0.7, y: 1.25, w: 1.6, h: 0.25, fontSize: 12, color: 'FFFFFF', bold: true });
slide.addText('Why it Matters', { x: 2.7, y: 1.25, w: 4.8, h: 0.25, fontSize: 12, color: 'FFFFFF', bold: true });
slide.addText('Typical Guideline / Limit', { x: 7.95, y: 1.25, w: 4.5, h: 0.25, fontSize: 12, color: 'FFFFFF', bold: true });
slide.addText('Values vary by jurisdiction. Always consult the latest national rulebook and utility permit conditions.', {
x: 0.7, y: 6.2, w: 12.1, h: 0.45, fontSize: 12, color: colors.warn, italic: true
});
addFooter(slide);
}
// Slide 5: Microbiological risks and barriers
{
const slide = pptx.addSlide();
addHeader(slide, 'Microbiological Contaminants and Multiple-Barrier Control');
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.7, y: 1.2, w: 5.95, h: 5.45,
rectRadius: 0.05,
fill: { color: 'FFFFFF' }, line: { color: 'C3D7E3' }
});
slide.addText('Primary Pathogen Groups', {
x: 1.0, y: 1.45, w: 5.3, h: 0.4, fontSize: 16, bold: true, color: colors.primary
});
const leftBullets = [
'Bacteria: E. coli, Vibrio cholerae, Salmonella spp.',
'Viruses: norovirus, rotavirus, enteroviruses, hepatitis A',
'Protozoa: Giardia, Cryptosporidium (chlorine-resistant oocysts)',
'Helminths in inadequately protected sources',
'Biofilm-associated opportunistic pathogens in networks'
];
slide.addText(leftBullets.map((b, i) => ({ text: b, options: { bullet: true, breakLine: i !== leftBullets.length - 1 } })), {
x: 1.05, y: 1.95, w: 5.35, h: 3.9, fontSize: 12, color: colors.textMid, paraSpaceAfterPt: 11
});
slide.addShape(pptx.ShapeType.roundRect, {
x: 6.85, y: 1.2, w: 5.8, h: 5.45,
rectRadius: 0.05,
fill: { color: 'EDF7F2' }, line: { color: 'A5D6BE' }
});
slide.addText('Barrier Logic (Treatment + Distribution)', {
x: 7.15, y: 1.45, w: 5.2, h: 0.4, fontSize: 16, bold: true, color: colors.good
});
const rightBullets = [
'Source protection lowers pathogen loading',
'Coagulation-flocculation + filtration removes particle-bound microbes',
'Disinfection (chlorine/UV/ozone) targets remaining organisms',
'Residual disinfectant in network suppresses regrowth',
'Continuous turbidity + residual monitoring provides early warning'
];
slide.addText(rightBullets.map((b, i) => ({ text: b, options: { bullet: true, breakLine: i !== rightBullets.length - 1 } })), {
x: 7.2, y: 1.95, w: 5.1, h: 3.9, fontSize: 12, color: '246B45', paraSpaceAfterPt: 11
});
addFooter(slide);
}
// Slide 6: Chemical contaminants
{
const slide = pptx.addSlide();
addHeader(slide, 'Chemical Contaminants: Sources, Risks, and Control');
const data = [
['Class', 'Common Examples', 'Typical Sources', 'Control Strategy'],
['Inorganic ions', 'Arsenic, fluoride, nitrate', 'Geogenic strata, fertilizers', 'Adsorption, ion exchange, membranes'],
['Heavy metals', 'Lead, cadmium, chromium', 'Corrosion, industrial discharge', 'Corrosion control, precipitation, adsorption'],
['Organic micropollutants', 'Pesticides, solvents, PFAS', 'Agriculture, industry, landfill leachate', 'Activated carbon, advanced oxidation, RO'],
['Disinfection by-products', 'THMs, HAAs', 'Reaction of disinfectants with NOM', 'Precursor removal, optimize disinfectant dose/contact']
];
slide.addTable(data, {
x: 0.55, y: 1.2, w: 12.25, h: 4.45,
border: { pt: 1, color: 'BED1DE' },
colW: [2.0, 2.8, 3.1, 4.35],
rowH: [0.55, 0.87, 0.87, 0.95, 0.95],
fontSize: 11,
color: colors.textDark,
valign: 'middle',
fill: 'FFFFFF'
});
slide.addShape(pptx.ShapeType.rect, { x: 0.55, y: 1.2, w: 12.25, h: 0.55, fill: { color: colors.secondary }, line: { color: colors.secondary } });
slide.addText('Class', { x: 0.7, y: 1.34, w: 1.7, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Common Examples', { x: 2.65, y: 1.34, w: 2.6, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Typical Sources', { x: 5.5, y: 1.34, w: 2.8, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Control Strategy', { x: 8.65, y: 1.34, w: 3.9, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Key engineering principle: match contaminant chemistry (charge, size, polarity, reactivity) to process mechanism.', {
x: 0.75, y: 6.0, w: 12.0, h: 0.5, fontSize: 13, color: colors.primary, bold: true
});
addFooter(slide);
}
// Slide 7: Conventional treatment train
{
const slide = pptx.addSlide();
addHeader(slide, 'Conventional Surface Water Treatment Train');
const steps = [
{ name: 'Intake & Screening', desc: 'Remove gross solids and debris', color: 'DCEFF7' },
{ name: 'Coagulation', desc: 'Destabilize colloids using alum/Fe salts', color: 'CDE7F3' },
{ name: 'Flocculation', desc: 'Promote larger settleable flocs', color: 'BEE0F0' },
{ name: 'Sedimentation', desc: 'Gravity separation of floc mass', color: 'AFD9ED' },
{ name: 'Filtration', desc: 'Sand/dual media removes residual particles', color: 'A0D1EA' },
{ name: 'Disinfection', desc: 'Inactivate pathogens; maintain residual', color: '91CAE7' },
{ name: 'Storage & Distribution', desc: 'Protected supply to consumers', color: '82C2E3' }
];
let x = 0.5;
const y = 2.1;
const w = 1.72;
const h = 2.0;
for (let i = 0; i < steps.length; i++) {
const s = steps[i];
slide.addShape(pptx.ShapeType.roundRect, {
x, y, w, h,
rectRadius: 0.05,
fill: { color: s.color }, line: { color: '5C9FC0' }
});
slide.addText(s.name, {
x: x + 0.08, y: y + 0.2, w: w - 0.16, h: 0.55,
fontSize: 11, bold: true, align: 'center', color: colors.primary
});
slide.addText(s.desc, {
x: x + 0.09, y: y + 0.8, w: w - 0.18, h: 1.05,
fontSize: 9, align: 'center', color: colors.textMid
});
if (i < steps.length - 1) {
slide.addShape(pptx.ShapeType.chevron, {
x: x + w + 0.03, y: y + 0.65, w: 0.2, h: 0.7,
fill: { color: '4D8FB3' }, line: { color: '4D8FB3' }
});
}
x += 1.86;
}
slide.addText('Performance depends on process control at each stage, not only final disinfection.', {
x: 0.7, y: 4.7, w: 12, h: 0.45, fontSize: 15, color: colors.textDark, bold: true, align: 'center'
});
slide.addText('Critical operational parameters: coagulant dose, pH, flocculation G-value, filtration rate, CT, residual disinfectant.', {
x: 0.8, y: 5.25, w: 11.9, h: 0.55, fontSize: 12, color: colors.textMid, align: 'center'
});
addFooter(slide);
}
// Slide 8: Coagulation-flocculation chemistry
{
const slide = pptx.addSlide();
addHeader(slide, 'Coagulation and Flocculation: Process Chemistry');
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.7, y: 1.2, w: 6.1, h: 5.3,
rectRadius: 0.05,
fill: { color: 'FFFFFF' }, line: { color: 'C6D9E5' }
});
slide.addText('Mechanistic Basis', {
x: 1.0, y: 1.45, w: 5.4, h: 0.35, fontSize: 16, bold: true, color: colors.primary
});
const mech = [
'Colloids carry negative surface charge -> remain stable and non-settleable',
'Hydrolyzed metal salts (Al3+, Fe3+) compress double layer and neutralize charge',
'Sweep floc mechanism enmeshes particles in precipitated hydroxides',
'Polymer aids bridge microflocs into stronger, larger agglomerates',
'Mixing intensity and contact time determine collision frequency and growth'
];
slide.addText(mech.map((m, i) => ({ text: m, options: { bullet: true, breakLine: i !== mech.length - 1 } })), {
x: 1.0, y: 1.95, w: 5.6, h: 3.95, fontSize: 12, color: colors.textMid, paraSpaceAfterPt: 10
});
slide.addShape(pptx.ShapeType.roundRect, {
x: 7.05, y: 1.2, w: 5.6, h: 5.3,
rectRadius: 0.05,
fill: { color: 'EAF5FB' }, line: { color: '9BC4DA' }
});
slide.addText('Operational Tuning', {
x: 7.3, y: 1.45, w: 5.1, h: 0.35, fontSize: 16, bold: true, color: colors.secondary
});
const tune = [
'Jar testing used for dose optimization under current raw water quality',
'Optimum pH often narrow; alkalinity correction may be needed',
'Rapid mix: high G, short duration; flocculation: lower G, longer duration',
'Monitor settled water turbidity and filter headloss for process drift',
'Overdosing can cause residual metal and poorer filterability'
];
slide.addText(tune.map((m, i) => ({ text: m, options: { bullet: true, breakLine: i !== tune.length - 1 } })), {
x: 7.3, y: 1.95, w: 5.0, h: 3.95, fontSize: 12, color: '2E617A', paraSpaceAfterPt: 10
});
addFooter(slide);
}
// Slide 9: Filtration
{
const slide = pptx.addSlide();
addHeader(slide, 'Granular Media Filtration and Breakthrough Dynamics');
slide.addText('Filter performance is controlled by attachment, straining, and periodic backwash recovery.', {
x: 0.7, y: 1.0, w: 12, h: 0.4, fontSize: 14, color: colors.textMid
});
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.7, y: 1.55, w: 4.0, h: 4.9, rectRadius: 0.05,
fill: { color: 'FFFFFF' }, line: { color: 'C3D7E3' }
});
slide.addText('Media Configuration', { x: 0.95, y: 1.85, w: 3.45, h: 0.35, fontSize: 15, bold: true, color: colors.primary });
slide.addText([
{ text: 'Mono-media (sand) and dual-media (anthracite+sand)', options: { bullet: true, breakLine: true } },
{ text: 'Depth filtration increases run length and solids capacity', options: { bullet: true, breakLine: true } },
{ text: 'Effective size and uniformity coefficient shape headloss profile', options: { bullet: true, breakLine: true } },
{ text: 'Underdrain hydraulics critical for uniform backwash', options: { bullet: true } }
], { x: 0.95, y: 2.35, w: 3.5, h: 3.65, fontSize: 11, color: colors.textMid, paraSpaceAfterPt: 9 });
slide.addShape(pptx.ShapeType.roundRect, {
x: 4.95, y: 1.55, w: 4.0, h: 4.9, rectRadius: 0.05,
fill: { color: 'EFF8F3' }, line: { color: '9CCEB0' }
});
slide.addText('Breakthrough Indicators', { x: 5.2, y: 1.85, w: 3.45, h: 0.35, fontSize: 15, bold: true, color: colors.good });
slide.addText([
{ text: 'Rising effluent turbidity trend', options: { bullet: true, breakLine: true } },
{ text: 'Particle counts increase before turbidity spike', options: { bullet: true, breakLine: true } },
{ text: 'Shorter run times suggest upstream coagulation drift', options: { bullet: true, breakLine: true } },
{ text: 'Headloss endpoint reached faster under high solids loading', options: { bullet: true } }
], { x: 5.2, y: 2.35, w: 3.5, h: 3.65, fontSize: 11, color: '286548', paraSpaceAfterPt: 9 });
slide.addShape(pptx.ShapeType.roundRect, {
x: 9.2, y: 1.55, w: 3.45, h: 4.9, rectRadius: 0.05,
fill: { color: 'FFF7E8' }, line: { color: 'E1C08A' }
});
slide.addText('Control Actions', { x: 9.45, y: 1.85, w: 2.95, h: 0.35, fontSize: 15, bold: true, color: colors.warn });
slide.addText([
{ text: 'Adjust coagulant dose and pH', options: { bullet: true, breakLine: true } },
{ text: 'Optimize filter loading rate', options: { bullet: true, breakLine: true } },
{ text: 'Backwash with proper expansion and duration', options: { bullet: true, breakLine: true } },
{ text: 'Inspect media loss and mudball formation', options: { bullet: true } }
], { x: 9.45, y: 2.35, w: 2.95, h: 3.65, fontSize: 11, color: '8A5B00', paraSpaceAfterPt: 9 });
addFooter(slide);
}
// Slide 10: Disinfection
{
const slide = pptx.addSlide();
addHeader(slide, 'Disinfection Strategies: CT Concept and Trade-offs');
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.7, y: 1.2, w: 12.0, h: 1.05, rectRadius: 0.05,
fill: { color: 'E8F4FA' }, line: { color: 'B5D6E6' }
});
slide.addText('CT principle: microbial inactivation is a function of disinfectant concentration (C) and contact time (T), modified by pH, temperature, and target organism.', {
x: 0.95, y: 1.52, w: 11.5, h: 0.5, fontSize: 14, bold: true, color: colors.primary, align: 'center'
});
const table = [
['Method', 'Strengths', 'Limitations / Risks'],
['Free chlorine', 'Provides distribution residual; mature operational practice', 'Forms DBPs with NOM; weaker against protozoan cysts/oocysts'],
['Chloramine', 'Long-lasting residual in networks', 'Lower primary disinfection power; nitrification management needed'],
['Ozone', 'Strong oxidant; effective on taste/odor and many organics', 'No persistent residual; bromate risk with bromide-rich waters'],
['UV irradiation', 'Excellent for Cryptosporidium/Giardia inactivation', 'No residual; requires low turbidity and lamp maintenance']
];
slide.addTable(table, {
x: 0.7, y: 2.55, w: 12.0, h: 3.9,
colW: [2.0, 4.75, 5.25],
rowH: [0.55, 0.85, 0.85, 0.95, 0.95],
border: { pt: 1, color: 'BED1DE' },
fontSize: 11, color: colors.textDark, fill: 'FFFFFF', valign: 'middle'
});
slide.addShape(pptx.ShapeType.rect, { x: 0.7, y: 2.55, w: 12.0, h: 0.55, fill: { color: colors.secondary }, line: { color: colors.secondary } });
slide.addText('Method', { x: 0.9, y: 2.7, w: 1.6, h: 0.25, fontSize: 12, color: 'FFFFFF', bold: true });
slide.addText('Strengths', { x: 2.95, y: 2.7, w: 4.3, h: 0.25, fontSize: 12, color: 'FFFFFF', bold: true });
slide.addText('Limitations / Risks', { x: 7.75, y: 2.7, w: 4.8, h: 0.25, fontSize: 12, color: 'FFFFFF', bold: true });
addFooter(slide);
}
// Slide 11: Membranes and advanced treatment
{
const slide = pptx.addSlide();
addHeader(slide, 'Membrane and Advanced Purification Technologies');
const cols = [
{ title: 'MF / UF', text: 'Targets suspended solids, bacteria, many protozoa. Often used as robust physical barrier and pretreatment.' },
{ title: 'NF / RO', text: 'Removes dissolved ions and many micropollutants; key for salinity and hardness management.' },
{ title: 'Activated Carbon', text: 'Adsorbs taste/odor compounds and many organics including pesticide residues and PFAS (design-dependent).' },
{ title: 'AOPs', text: 'Hydroxyl radical based destruction for refractory organics: O3/H2O2, UV/H2O2, photocatalytic routes.' }
];
for (let i = 0; i < cols.length; i++) {
const x = 0.65 + i * 3.15;
slide.addShape(pptx.ShapeType.roundRect, {
x, y: 1.4, w: 2.9, h: 4.95, rectRadius: 0.05,
fill: { color: i % 2 === 0 ? 'FFFFFF' : 'EFF7FB' }, line: { color: 'BCD2E0' }
});
slide.addText(cols[i].title, {
x: x + 0.18, y: 1.72, w: 2.55, h: 0.38,
fontSize: 17, bold: true, align: 'center', color: colors.primary
});
slide.addText(cols[i].text, {
x: x + 0.18, y: 2.2, w: 2.55, h: 2.55,
fontSize: 12, color: colors.textMid, align: 'left'
});
slide.addShape(pptx.ShapeType.line, {
x: x + 0.18, y: 4.9, w: 2.55, h: 0, line: { color: 'C2D7E3', pt: 1 }
});
slide.addText('Design constraints:', {
x: x + 0.18, y: 5.0, w: 2.55, h: 0.25,
fontSize: 11, bold: true, color: colors.secondary
});
slide.addText(
i === 0 ? 'fouling control, flux, integrity testing' :
i === 1 ? 'energy demand, concentrate handling' :
i === 2 ? 'breakthrough curves, regeneration/replacement' :
'oxidant dose, radical scavenging matrix effects',
{
x: x + 0.18, y: 5.28, w: 2.55, h: 0.75,
fontSize: 10, color: colors.textMid
}
);
}
addFooter(slide);
}
// Slide 12: Desalination
{
const slide = pptx.addSlide();
addHeader(slide, 'Desalination in Water Supply Systems');
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.7, y: 1.2, w: 6.0, h: 5.3, rectRadius: 0.05,
fill: { color: 'FFFFFF' }, line: { color: 'C3D7E3' }
});
slide.addText('Core Process Sequence (RO Plant)', {
x: 1.0, y: 1.5, w: 5.4, h: 0.4, fontSize: 16, bold: true, color: colors.primary
});
const seq = [
'Intake and pretreatment (screening, coagulation, cartridge/membrane pretreatment)',
'High-pressure pumping through RO membranes',
'Permeate stabilization and remineralization',
'Disinfection and distribution',
'Brine management and environmental safeguards'
];
slide.addText(seq.map((s, i) => ({ text: s, options: { bullet: true, breakLine: i !== seq.length - 1 } })), {
x: 1.0, y: 2.05, w: 5.4, h: 3.65, fontSize: 12, color: colors.textMid, paraSpaceAfterPt: 10
});
slide.addShape(pptx.ShapeType.roundRect, {
x: 7.0, y: 1.2, w: 5.7, h: 2.55, rectRadius: 0.05,
fill: { color: 'EEF8F2' }, line: { color: 'AAD8BD' }
});
slide.addText('Advantages', { x: 7.25, y: 1.5, w: 5.2, h: 0.35, fontSize: 15, bold: true, color: colors.good });
slide.addText('Reliable drought-resilient source, strong dissolved contaminant removal, and predictable product quality.', {
x: 7.25, y: 1.95, w: 5.1, h: 1.5, fontSize: 12, color: '286548'
});
slide.addShape(pptx.ShapeType.roundRect, {
x: 7.0, y: 3.95, w: 5.7, h: 2.55, rectRadius: 0.05,
fill: { color: 'FFF4EA' }, line: { color: 'E5C39C' }
});
slide.addText('Challenges', { x: 7.25, y: 4.25, w: 5.2, h: 0.35, fontSize: 15, bold: true, color: colors.warn });
slide.addText('High energy intensity, membrane fouling risk, concentrate disposal impacts, and lifecycle cost constraints.', {
x: 7.25, y: 4.7, w: 5.1, h: 1.5, fontSize: 12, color: '8A5B00'
});
addFooter(slide);
}
// Slide 13: Point-of-use and decentralized systems
{
const slide = pptx.addSlide();
addHeader(slide, 'Point-of-Use and Decentralized Purification');
const data = [
['Technology', 'Best Use Case', 'Key Limitations', 'Typical Monitoring Need'],
['Boiling / thermal', 'Emergency pathogen inactivation', 'No chemical removal; fuel burden', 'Time-temperature practice'],
['Ceramic/biosand filter', 'Low-cost household treatment', 'Variable virus removal', 'Flow and cleaning frequency'],
['UV POU units', 'Microbial control in clear water', 'Needs electricity and low turbidity', 'Lamp intensity and replacement'],
['POU RO', 'High TDS/salinity and mixed contaminants', 'Reject stream and membrane replacement', 'Permeate TDS and pressure'],
['Chlorination sachets', 'Rapid deployment in outbreaks/disasters', 'Taste complaints and dosage errors', 'Free chlorine residual checks']
];
slide.addTable(data, {
x: 0.6, y: 1.25, w: 12.1, h: 4.95,
border: { pt: 1, color: 'BED1DE' },
colW: [2.1, 3.0, 3.45, 3.55],
rowH: [0.55, 0.82, 0.82, 0.82, 0.82, 0.82],
fontSize: 11, color: colors.textDark, fill: 'FFFFFF'
});
slide.addShape(pptx.ShapeType.rect, { x: 0.6, y: 1.25, w: 12.1, h: 0.55, fill: { color: colors.secondary }, line: { color: colors.secondary } });
slide.addText('Technology', { x: 0.8, y: 1.39, w: 1.9, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Best Use Case', { x: 2.95, y: 1.39, w: 2.7, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Key Limitations', { x: 6.0, y: 1.39, w: 3.1, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Typical Monitoring Need', { x: 9.55, y: 1.39, w: 2.9, h: 0.25, fontSize: 12, bold: true, color: 'FFFFFF' });
slide.addText('Decentralized systems work best when paired with training, behavior adoption, and simple routine verification tools.', {
x: 0.75, y: 6.3, w: 11.9, h: 0.45, fontSize: 12, color: colors.primary, bold: true, align: 'center'
});
addFooter(slide);
}
// Slide 14: Monitoring and QA/QC
{
const slide = pptx.addSlide();
addHeader(slide, 'Monitoring, QA/QC, and Compliance Assurance');
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.65, y: 1.2, w: 4.05, h: 5.35, rectRadius: 0.05,
fill: { color: 'FFFFFF' }, line: { color: 'C3D7E3' }
});
slide.addText('Sampling Plan', { x: 0.95, y: 1.5, w: 3.5, h: 0.35, fontSize: 15, bold: true, color: colors.primary });
slide.addText([
{ text: 'Define representative points: source, post-treatment, network extremities', options: { bullet: true, breakLine: true } },
{ text: 'Set frequency by risk and regulatory requirement', options: { bullet: true, breakLine: true } },
{ text: 'Capture seasonal and event-driven variability', options: { bullet: true } }
], { x: 0.95, y: 2.0, w: 3.5, h: 2.2, fontSize: 11, color: colors.textMid, paraSpaceAfterPt: 9 });
slide.addShape(pptx.ShapeType.roundRect, {
x: 4.9, y: 1.2, w: 4.05, h: 5.35, rectRadius: 0.05,
fill: { color: 'EFF7FB' }, line: { color: 'AFCDE0' }
});
slide.addText('Analytical QA/QC', { x: 5.2, y: 1.5, w: 3.5, h: 0.35, fontSize: 15, bold: true, color: colors.secondary });
slide.addText([
{ text: 'Calibration standards, blanks, duplicates, and spikes', options: { bullet: true, breakLine: true } },
{ text: 'Method detection limit and uncertainty tracking', options: { bullet: true, breakLine: true } },
{ text: 'Chain of custody and metadata discipline', options: { bullet: true } }
], { x: 5.2, y: 2.0, w: 3.5, h: 2.2, fontSize: 11, color: '2E617A', paraSpaceAfterPt: 9 });
slide.addShape(pptx.ShapeType.roundRect, {
x: 9.15, y: 1.2, w: 3.55, h: 5.35, rectRadius: 0.05,
fill: { color: 'EEF8F2' }, line: { color: 'AAD8BD' }
});
slide.addText('Corrective Action', { x: 9.4, y: 1.5, w: 3.0, h: 0.35, fontSize: 15, bold: true, color: colors.good });
slide.addText([
{ text: 'Trigger thresholds and escalation tree', options: { bullet: true, breakLine: true } },
{ text: 'Immediate process adjustment and resampling', options: { bullet: true, breakLine: true } },
{ text: 'Consumer advisories when needed', options: { bullet: true, breakLine: true } },
{ text: 'Root-cause and preventive action closure', options: { bullet: true } }
], { x: 9.4, y: 2.0, w: 2.95, h: 2.75, fontSize: 11, color: '286548', paraSpaceAfterPt: 9 });
addFooter(slide);
}
// Slide 15: Emerging issues
{
const slide = pptx.addSlide();
addHeader(slide, 'Emerging Water Quality Challenges');
const cards = [
{ t: 'PFAS and persistent organics', d: 'Ultra-low concentration targets require sensitive analytics and robust adsorptive/membrane solutions.', c: 'F2F8FF' },
{ t: 'Antimicrobial resistance genes', d: 'Wastewater-drinking water interfaces and treatment efficacy for genetic material are active research fronts.', c: 'F7FBF2' },
{ t: 'Microplastics and nanoplastics', d: 'Standardized methods are still evolving; treatment capture performance depends on particle characteristics.', c: 'FFF9F1' },
{ t: 'Climate-driven extremes', d: 'Floods, droughts, wildfire ash, and heat waves shift source water quality and treatment reliability.', c: 'FFF3F3' }
];
for (let i = 0; i < cards.length; i++) {
const x = i < 2 ? 0.8 : 6.95;
const y = i % 2 === 0 ? 1.5 : 4.1;
slide.addShape(pptx.ShapeType.roundRect, {
x, y, w: 5.55, h: 2.2, rectRadius: 0.05,
fill: { color: cards[i].c }, line: { color: 'C9DCE7' }
});
slide.addText(cards[i].t, {
x: x + 0.25, y: y + 0.25, w: 5.05, h: 0.35,
fontSize: 15, bold: true, color: colors.primary
});
slide.addText(cards[i].d, {
x: x + 0.25, y: y + 0.72, w: 5.05, h: 1.15,
fontSize: 12, color: colors.textMid
});
}
addFooter(slide);
}
// Slide 16: Case study
{
const slide = pptx.addSlide();
addHeader(slide, 'Case Study: Upgrading a Conventional Plant');
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.8, y: 1.25, w: 12.0, h: 1.1, rectRadius: 0.05,
fill: { color: 'E8F4FA' }, line: { color: 'B8D7E7' }
});
slide.addText('Scenario: 120 MLD surface-water plant with seasonal turbidity spikes and repeated THM exceedances in summer.', {
x: 1.05, y: 1.58, w: 11.5, h: 0.45, fontSize: 14, bold: true, color: colors.primary
});
const stages = [
['Problem Diagnostics', 'High NOM + chlorine contact in warm conditions; upstream coagulation underperforming during monsoon pulses.'],
['Intervention Set', 'Enhanced coagulation, GAC contactor retrofit, chlorine dose optimization, targeted network flushing.'],
['Performance Outcome', 'Lower filtered water TOC, reduced THM formation potential, stable compliance in quarterly reporting.'],
['Learning Point', 'DBP control is best achieved by precursor removal plus calibrated disinfection, not by dose reduction alone.']
];
for (let i = 0; i < stages.length; i++) {
const y = 2.75 + i * 1.02;
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.95, y, w: 11.7, h: 0.82, rectRadius: 0.04,
fill: { color: i % 2 === 0 ? 'FFFFFF' : 'F4FAFD' }, line: { color: 'C9DCE7' }
});
slide.addText(stages[i][0], {
x: 1.15, y: y + 0.2, w: 2.2, h: 0.3, fontSize: 13, bold: true, color: colors.secondary
});
slide.addText(stages[i][1], {
x: 3.35, y: y + 0.18, w: 9.1, h: 0.38, fontSize: 11, color: colors.textMid
});
}
addFooter(slide);
}
// Slide 17: Summary
{
const slide = pptx.addSlide();
addHeader(slide, 'Summary and Take-Home Messages');
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.9, y: 1.4, w: 11.5, h: 4.95, rectRadius: 0.06,
fill: { color: 'FFFFFF' }, line: { color: 'C3D7E3' }
});
const points = [
'Water standards are risk-management tools translating toxicology and epidemiology into enforceable limits.',
'No single treatment method solves all contaminants; process trains must be source-specific and adaptive.',
'Microbial safety depends on multiple barriers plus process control and residual management.',
'Chemical risk control increasingly requires advanced adsorption, membranes, and oxidation processes.',
'Monitoring design, QA/QC, and rapid corrective action are central to sustained compliance and public trust.',
'Emerging contaminants and climate stressors require continuous upgrade of standards and utility capability.'
];
slide.addText(points.map((p, i) => ({ text: p, options: { bullet: { indent: 24 }, breakLine: i !== points.length - 1 } })), {
x: 1.3, y: 1.9, w: 10.7, h: 3.8, fontSize: 16, color: colors.textDark, paraSpaceAfterPt: 15
});
slide.addText('Discussion prompts: Which process bottleneck is most vulnerable in your local context, and how would you monitor it?', {
x: 1.2, y: 5.95, w: 10.9, h: 0.5, fontSize: 12, italic: true, color: colors.secondary, align: 'center'
});
addFooter(slide, 'Thank you | Questions');
}
// Slide 18: References
{
const slide = pptx.addSlide();
addHeader(slide, 'Selected References and Standards Documents');
const refs = [
'World Health Organization. Guidelines for Drinking-water Quality (4th ed. with updates).',
'U.S. EPA. National Primary Drinking Water Regulations and associated guidance manuals.',
'Bureau of Indian Standards. IS 10500 Drinking Water Specification (latest revision).',
'AWWA Manuals: Water Treatment Plant Design and Operational Control references.',
'Metcalf & Eddy / Tchobanoglous et al. Wastewater and water quality engineering texts (process fundamentals).',
'Peer-reviewed literature on PFAS, DBPs, and membrane process optimization (recent reviews).'
];
slide.addShape(pptx.ShapeType.roundRect, {
x: 0.8, y: 1.2, w: 12.0, h: 5.35, rectRadius: 0.05,
fill: { color: 'FFFFFF' }, line: { color: 'C3D7E3' }
});
slide.addText(refs.map((r, i) => ({ text: r, options: { bullet: true, breakLine: i !== refs.length - 1 } })), {
x: 1.1, y: 1.6, w: 11.4, h: 4.6, fontSize: 14, color: colors.textMid, paraSpaceAfterPt: 14
});
addFooter(slide, 'Prepared for academic use. Verify current local regulatory updates before application.');
}
pptx.writeFile({ fileName: '/home/daytona/workspace/water-standards-ppt/Water_Standards_and_Purification.pptx' });
node /home/daytona/workspace/water-standards-ppt/create_water_standards_ppt.js
Water Standards and Purification
Presentation · PPTX