The MAIDR layer data for the smooth trace
Optional hint that this subplot is a violin plot (BOX + SMOOTH present in the same subplot).
A SmoothTrace instance: - ViolinKdeTrace if this is a violin plot KDE layer (BOX + SMOOTH detected upstream) - SmoothTraceSvgXY if the data contains svg_x/svg_y coordinates - SmoothTrace otherwise (standard smooth/regression line)
Factory function to create the appropriate SmoothTrace instance based on layer data and context.
Uses structural detection (performed upstream) to identify violin plot KDE layers: if the subplot contains both BOX and SMOOTH layers, callers pass
isViolinPlot=trueand this factory creates a ViolinKdeTrace for SMOOTH layers. Otherwise, it creates a SmoothTrace or SmoothTraceSvgXY based on the data format.Note: Structural detection (BOX + SMOOTH in same subplot) is used to avoid plot-specific metadata in the general MaidrLayer interface. This approach works well in practice because:
Edge case: If a subplot intentionally combines an independent box plot and regression line, this detection would incorrectly identify it as a violin plot. This is rare in practice.