MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / PatternArea

Function PatternArea

apps/start/src/components/charts/pattern-area.tsx:25–45  ·  view source on GitHub ↗
({
  dataKey,
  fill,
  curve = curveMonotoneX,
}: PatternAreaProps)

Source from the content-addressed store, hash-verified

23 * Pair with `PatternLines` in `AreaChart` children and an `Area` with `fillOpacity={0}` for the stroke line.
24 */
25export function PatternArea({
26 dataKey,
27 fill,
28 curve = curveMonotoneX,
29}: PatternAreaProps) {
30 const { data, xScale, yScale, xAccessor } = useChartStable();
31
32 return (
33 <AreaClosed
34 curve={curve}
35 data={data}
36 fill={fill}
37 x={(d) => xScale(xAccessor(d)) ?? 0}
38 y={(d) => {
39 const v = d[dataKey];
40 return typeof v === "number" ? (yScale(v) ?? 0) : 0;
41 }}
42 yScale={yScale}
43 />
44 );
45}
46
47PatternArea.displayName = "PatternArea";
48

Callers

nothing calls this directly

Calls 1

useChartStableFunction · 0.90

Tested by

no test coverage detected