General questions

Answered

Editor doesn't fit at all

I'm using myscript in React. So I'm using useRef to register, and I'm having trouble being a register. First of all, the initial code is as follows:


export default function initEditors(

editors,

exporthandler,

minwidth,

minheight

) {

const config = {

triggerDelay: 2000,

processDelay: 0,

recognitionParams: {

type: 'MATH',

protocol: 'WEBSOCKET',

apiVersion: 'V4',

server: {

scheme: 'https',

applicationKey: 'mykey',

hmacKey: 'mykey'

},

v4: {

math: {

mimeTypes: ['application/x-latex'],

solver: {

enable: false

},

smartGuide: true,

customGrammarContent:

'symbol = 0 1 2 3 4 5 6 7 8 9 . ,\nsymbol2=+ - .\nexpression ::= identity(symbol)|identity(symbol2)|hpair(symbol2,expression)|hpair(expression,symbol2)|hpair(expression,expression)\nstart(expression)'

}

}

},

renderingParams: {

minwidth,

minheight

}

};

editors.forEach((editor, idx) => {

MyScriptJS.register(editor, config);

editor.addEventListener('exported', exporthandler.bind(null, idx));

window.addEventListener('resize', () => {

editor.editor.resize();

});

});

}


In this case, the areas of the BACKGROUND SVG and MODEL SVG are separated without overlap. It's as if the block property of css is applied.


Best Answer

Dear Oliver,

Thank you for your reply.

but I've solved the problem, and now I'm using myscript without any problems. But I'm gonna write down a solution what I did because somebody else might be curious about this. If there's a difference between where you write and where you see, it is probably a CSS problem. When using myscript in React, I found that the CSS inserted in the head of the index.html was not working. Import in index.js. Also, if you are setting the rendering options, make sure that the minWidth and minHeight values are exactly uppercase and lowercase letters.


Dear Lee Brown,


thank you for contacting us.


Currently, I am not sure to understand the issue you are facing. Indeed, you are having issues to register, but your post subject is "editor doesn't fit"? Can you pelase clarify the issue you have?


thank you,


Best regards,


Olivier


1 person likes this
Answer

Dear Oliver,

Thank you for your reply.

but I've solved the problem, and now I'm using myscript without any problems. But I'm gonna write down a solution what I did because somebody else might be curious about this. If there's a difference between where you write and where you see, it is probably a CSS problem. When using myscript in React, I found that the CSS inserted in the head of the index.html was not working. Import in index.js. Also, if you are setting the rendering options, make sure that the minWidth and minHeight values are exactly uppercase and lowercase letters.

Dear Lee,


I am glad you solved the behavior.


Thank you for the explanation, it will indeed be of help.


Best regards,


Olivier