MCPcopy Index your code
hub / github.com/coder/coder / XGrid

Function XGrid

site/src/modules/workspaces/WorkspaceTiming/Chart/XAxis.tsx:147–176  ·  view source on GitHub ↗
({ columns, ...htmlProps })

Source from the content-addressed store, hash-verified

145};
146
147const XGrid: FC<XGridProps> = ({ columns, ...htmlProps }) => {
148 const borderDefault =
149 typeof document === "undefined"
150 ? "hsl(var(--border-default))"
151 : `hsl(${getComputedStyle(document.documentElement)
152 .getPropertyValue("--border-default")
153 .trim()})`;
154
155 return (
156 <div
157 role="presentation"
158 {...htmlProps}
159 className={cn(
160 "flex w-full h-full absolute top-0 left-0",
161 htmlProps.className,
162 )}
163 >
164 {[...Array(columns).keys()].map((key) => (
165 <div
166 key={key}
167 className="flex-shrink-0 bg-repeat-y bg-right"
168 style={{
169 width: "var(--x-axis-width)",
170 backgroundImage: `url("${dashedLine(borderDefault)}")`,
171 }}
172 />
173 ))}
174 </div>
175 );
176};
177
178// A dashed line is used as a background image to create the grid.
179// Using it as a background simplifies replication along the Y axis.

Callers

nothing calls this directly

Calls 3

cnFunction · 0.90
ArrayFunction · 0.85
dashedLineFunction · 0.85

Tested by

no test coverage detected