@@ -311,64 +311,64 @@ of dots. The bar color is supplied via {lit}`fillColor`.
311311/-! ## Simple Plotting (Zero-Configuration Plots) -/
312312
313313/-- 🎯 Plot a function with automatic everything. Just works!
314-
314+
315315Examples:
316316- {lit}`plotSimple (fun t => t^2)` - Simple quadratic plot
317317- {lit}`plotSimple (fun x => x + 1)` - Linear function
318318- {lit}`plotSimple (fun i => i * 2)` - Linear scaling
319319
320320 You never have to think about axis labels again!
321321-/
322- def plotSimple {β} [ToFloat β] (f : Float → β) (steps : Nat := 200 )
322+ def plotSimple {β} [ToFloat β] (f : Float → β) (steps : Nat := 200 )
323323 (domain : Option (Float × Float) := none) (w h : Nat := 400 ) : Html :=
324324 -- Sample the function
325325 let data := sample f steps domain
326-
326+
327327 -- Generate axis labels (this would use metaprogramming in full implementation)
328328 -- For now, provide sensible defaults that work with the common patterns
329- let xLabel := "x"
329+ let xLabel := "x"
330330 let yLabel := "f(x)"
331331 let seriesStrokes := #[("y" , "#2563eb" )] -- Nice blue color
332-
332+
333333 mkLineChartWithLabels data seriesStrokes (some xLabel) (some yLabel) w h
334334
335335/-- Plot multiple functions with automatic labeling.
336336 Just pass your functions and get a beautiful multi-line plot!
337-
338- Examples:
337+
338+ Examples:
339339- {lit}`plotManySimple #[("sin", fun t => Float.sin t), ("cos", fun t => Float.cos t)]`
340340- {lit}`plotManySimple #[("linear", fun x => x), ("quadratic", fun x => x^2)]`
341341
342342 Everything is automatic - colors, labels, legend!
343343-/
344- def plotManySimple {β} [ToFloat β] (fns : Array (String × (Float → β)))
345- (steps : Nat := 200 ) (domain : Float × Float := (0 .0 , 1 .0 ))
344+ def plotManySimple {β} [ToFloat β] (fns : Array (String × (Float → β)))
345+ (steps : Nat := 200 ) (domain : Float × Float := (0 .0 , 1 .0 ))
346346 (w h : Nat := 400 ) : Html :=
347347 -- Sample all functions
348348 let data := sampleMany fns steps domain.1 domain.2
349-
350- -- Generate axis labels
349+
350+ -- Generate axis labels
351351 let xLabel := "x" -- Could be enhanced with metaprogramming
352352 let yLabel := "y" -- Could be enhanced with metaprogramming
353-
353+
354354 -- Auto-generate colors for each series
355355 let colors := #["#2563eb" , "#dc2626" , "#16a34a" , "#ca8a04" , "#7c3aed" , "#db2777" ]
356- let seriesStrokes := fns.mapIdx fun i (name, _) =>
356+ let seriesStrokes := fns.mapIdx fun i (name, _) =>
357357 let color := colors.getD (i % colors.size) "#64748b"
358358 (name, color)
359-
359+
360360 mkLineChartFull data seriesStrokes (some xLabel) (some yLabel) w h
361361
362362/-- Scatter plot with automatic labeling. -/
363- def scatterSimple {β} [ToFloat β] (f : Float → β) (steps : Nat := 200 )
363+ def scatterSimple {β} [ToFloat β] (f : Float → β) (steps : Nat := 200 )
364364 (domain : Option (Float × Float) := none) (w h : Nat := 400 ) : Html :=
365365 let data := sample f steps domain
366366 mkScatterChart data "#dc2626" w h -- Nice red color
367367
368- /-- Bar chart with automatic labeling. -/
368+ /-- Bar chart with automatic labeling. -/
369369def barSimple {β} [ToFloat β] (f : Float → β) (steps : Nat := 200 )
370370 (domain : Option (Float × Float) := none) (w h : Nat := 400 ) : Html :=
371- let data := sample f steps domain
371+ let data := sample f steps domain
372372 mkBarChart data "#16a34a" w h -- Nice green color
373373
374374/-- Enhanced line chart builder with automatic axis label generation.
0 commit comments