I am a junior Frontend Developer. I need help for this issue.
I am trying to use JSXGraph with React+Vite. When I put the example codes on my React component, the height of SVG goes infinitive. Here is the code :
`import { JSXGraph } from “jsxgraph”;
function JSXBoard () {
const BOARDID = ‘board-0’;
// input data from LMS
let input = [
2, 4, // point A(x, y)
12, 6, // point B(x, y)
8, 12, // point C(x, y)
2 // unit
];
// JSXGraph board
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [0, 15, 15, 0],
axis: true,
showCopyright:true,
showNavigation:true,
});
let A = board.create('point', [input[0], input[1]], {
name: '\(A\)',
snapToGrid: true,
label: {offset: [-25, -10], fontSize: 16}
});
let B = board.create('point', [input[2], input[3]], {
name: '\(B\)',
snapToGrid: true,
label: {offset: [10, -5], fontSize: 16}
});
let C = board.create('point', [input[4], input[5]], {
name: '\(C\)',
snapToGrid: true,
label: {offset: [0, 15], fontSize: 16}
});
let ABC = board.create('polygon', [A, B, C], {
borders: {strokeWidth: 2}
});
return (
<>
</>
)
}
export default JSXBoard;`
and plese find the codes at https://github.com/ozdilkazim/React-Structural-Engineering-Project
and the deployed version of infinite height : https://structuralengineering.netlify.app/
I have tried to convert the code to an other component and still have same issue
Kazim OZDIL is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.