All files / src/utils/components/question-bank/question-display/graph graphConstants.js

100% Statements 2/2
100% Branches 0/0
100% Functions 0/0
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30        31x           31x                                      
/**
 * Canvas size for Graph2D in question-bank display — must match authoring
 * (`question-content/graph/GraphEditor.jsx`, `InteractiveGraph.jsx`) so math ↔ pixel conversion matches saved answers.
 */
export const GRAPH2D_QUESTION_BANK_CANVAS_SIZE = 410;
 
/**
 * DrawingGraph paints axis titles just outside the plot (`x` to the right, `y` above).
 * Drop its CSS frame and keep a small gutter so those labels are not clipped.
 */
export const drawingGraphFrameSx = {
    display: "flex",
    justifyContent: "center",
    overflow: "visible",
    boxSizing: "content-box",
    pr: "28px",
    pb: 1.5,
    "& .drawingGraph, & .drawingGraph embed, & .drawingGraph svg": {
        border: "none !important",
        outline: "none",
        boxShadow: "none",
    },
    // Keep bitmap CSS size locked when responsive={false} so hover/tooltips
    // do not re-scale canvas pixels into decimal graph coords.
    "& canvas.drawcanvas": {
        width: `${GRAPH2D_QUESTION_BANK_CANVAS_SIZE}px !important`,
        height: `${GRAPH2D_QUESTION_BANK_CANVAS_SIZE}px !important`,
    },
};