Use 100% for canvas width

This commit is contained in:
jaredvu 2023-11-27 14:58:45 -08:00
parent def6874de9
commit 2e51502abe
No known key found for this signature in database
GPG Key ID: B9FE2F3F0A5D523C
2 changed files with 6 additions and 6 deletions

View File

@ -5,8 +5,8 @@ type StyleProps = {
};
type ElementProps = {
width: number;
height: number;
width: number | string;
height: number | string;
};
export const Canvas = forwardRef<HTMLCanvasElement, ElementProps & StyleProps>(

View File

@ -166,8 +166,8 @@ export const Orderbook = ({
side="ask"
onMouseLeave={() => setHoveredRow(undefined)}
>
<$HistogramCanvas ref={asksCanvasRef} width={300} height={numRows * ROW_HEIGHT} />
<$HistogramCanvas ref={asksHoverRef} width={300} height={numRows * ROW_HEIGHT} />
<$HistogramCanvas ref={asksCanvasRef} width="100%" height={numRows * ROW_HEIGHT} />
<$HistogramCanvas ref={asksHoverRef} width="100%" height={numRows * ROW_HEIGHT} />
{asksSlice.map((row: RowData, idx) =>
row.price ? (
@ -195,8 +195,8 @@ export const Orderbook = ({
side="bid"
onMouseLeave={() => setHoveredRow(undefined)}
>
<$HistogramCanvas ref={bidsCanvasRef} width={300} height={numRows * ROW_HEIGHT} />
<$HistogramCanvas ref={bidsHoverRef} width={300} height={numRows * ROW_HEIGHT} />
<$HistogramCanvas ref={bidsCanvasRef} width="100%" height={numRows * ROW_HEIGHT} />
<$HistogramCanvas ref={bidsHoverRef} width="100%" height={numRows * ROW_HEIGHT} />
{bidsSlice.map((row: RowData, idx) =>
row.price ? (