chart.tsx — ui Source File
Architecture documentation for chart.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 3944601b_9405_8ad6_7082_5bb7d87ab41c["chart.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 3944601b_9405_8ad6_7082_5bb7d87ab41c --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 191e4a89_25e4_f7a3_d5fb_d71d101e0990["utils"] 3944601b_9405_8ad6_7082_5bb7d87ab41c --> 191e4a89_25e4_f7a3_d5fb_d71d101e0990 da384753_eb23_55ed_e7a6_3bd0e172b999["recharts"] 3944601b_9405_8ad6_7082_5bb7d87ab41c --> da384753_eb23_55ed_e7a6_3bd0e172b999 style 3944601b_9405_8ad6_7082_5bb7d87ab41c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { cn } from "@/examples/radix/lib/utils"
import * as RechartsPrimitive from "recharts"
// Format: { THEME_NAME: CSS_SELECTOR }
const THEMES = { light: "", dark: ".dark" } as const
export type ChartConfig = {
[k in string]: {
label?: React.ReactNode
icon?: React.ComponentType
} & (
| { color?: string; theme?: never }
| { color?: never; theme: Record<keyof typeof THEMES, string> }
)
}
type ChartContextProps = {
config: ChartConfig
}
const ChartContext = React.createContext<ChartContextProps | null>(null)
function useChart() {
const context = React.useContext(ChartContext)
if (!context) {
throw new Error("useChart must be used within a <ChartContainer />")
}
return context
}
function ChartContainer({
id,
className,
children,
config,
...props
}: React.ComponentProps<"div"> & {
config: ChartConfig
children: React.ComponentProps<
typeof RechartsPrimitive.ResponsiveContainer
>["children"]
}) {
const uniqueId = React.useId()
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
return (
<ChartContext.Provider value={{ config }}>
<div
data-slot="chart"
data-chart={chartId}
className={cn(
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
className
)}
{...props}
// ... (296 more lines)
Domain
Subdomains
Functions
Dependencies
- react
- recharts
- utils
Source
Frequently Asked Questions
What does chart.tsx do?
chart.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, Changelog subdomain.
What functions are defined in chart.tsx?
chart.tsx defines 6 function(s): ChartContainer, ChartLegendContent, ChartStyle, ChartTooltipContent, getPayloadConfigFromPayload, useChart.
What does chart.tsx depend on?
chart.tsx imports 3 module(s): react, recharts, utils.
Where is chart.tsx in the architecture?
chart.tsx is located at apps/v4/examples/radix/ui-rtl/chart.tsx (domain: DocumentationAtlas, subdomain: Changelog, directory: apps/v4/examples/radix/ui-rtl).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free