@@ -189,27 +189,18 @@ function updateGraph(el, freq, mag) {
189189
190190function TransformResults ( props ) {
191191
192- // Old latex
193- // <div className="row">
194- // The answer you provided is: ${MyComponentOLD(props.deleteMeLatex)}
195- // </div>
196192
197193 var z = html `
198194
199- < div className ="row my-2 py-1 ">
200- < div className ="col shadow-sm rounded bg-white me-2 ">
195+ < div className ="row my-2 py-1 shadow-sm rounded bg-white me-2 ">
196+ < div className ="col ">
201197 < div className ="row text-center ">
202- < h3 > Laplace Transform</ h3 >
198+ < h3 > ${ props . title } Transform</ h3 >
203199 </ div >
204200 < div className ="row text-center fs-3 py-2 ">
205201 ${ MyComponent ( props . latex ) }
206202 </ div >
207203 </ div >
208- < div className ="col shadow-sm rounded bg-white ms-2 ">
209- < div className ="row text-center ">
210- < h3 > Bilinear Transform</ h3 >
211- </ div >
212- </ div >
213204 </ div >
214205 `
215206 // console.log(z);
@@ -244,18 +235,6 @@ function selectUnits(name) {
244235}
245236
246237
247-
248- // function createMarkup(latex) {
249- // return {
250- // __html: katex.renderToString(`${latex}`, {
251- // throwOnError: false
252- // })
253- // };
254- // }
255-
256- // function MyComponentOLD(latex) {
257- // return html`<div dangerouslySetInnerHTML=${createMarkup(latex)} />`
258- // }
259238function MyComponent ( latex ) {
260239 // console.log('latex!', latex)
261240 var z = `<math>
@@ -378,7 +357,7 @@ function centerSchematic (schem) {
378357 // var wrapperComputedStyle = window.getComputedStyle(canvasHolder, null);
379358 var wrapperWidth = canvasHolder . clientWidth - 26 ;
380359 var wrapperHeight = canvasHolder . offsetHeight ;
381- var centerX = ( wrapperWidth - 16 ) / 2 ;
360+ var centerX = ( wrapperWidth - 64 ) / 2 ;
382361 var centerY = ( wrapperHeight - 128 ) / 2 ;
383362 console . log ( centerX , centerY ) ;
384363 var minX = 0 ;
@@ -429,7 +408,7 @@ class Game extends React.Component {
429408 }
430409 ] ,
431410 latex : null ,
432- deleteMeLatex : null ,
411+ bilinearMathML : null ,
433412 elOnSchematic : [ ] ,
434413 schematicReadiness : {
435414 vout : false ,
@@ -517,11 +496,11 @@ class Game extends React.Component {
517496 // console.log("Inside handleCanvasChange");
518497 var current = JSON . parse ( JSON . stringify ( this . state . history [ this . state . history . length - 1 ] ) ) ;
519498
520- var latexResult , deleteMeLatex ;
499+ var latexResult , deleteMeLatex , bilinearMathML ;
521500 var newElementMap ;
522501 var elements = current . elements ;
523502 var schematicReadiness ;
524- [ schematicReadiness , latexResult , newElementMap , deleteMeLatex , this . resString ] = calculateMNA ( canvasState ) ;
503+ [ schematicReadiness , latexResult , newElementMap , deleteMeLatex , this . resString , bilinearMathML ] = calculateMNA ( canvasState ) ;
525504 this . state . elOnSchematic = newElementMap ;
526505
527506 var schematicState = [ ] ;
@@ -595,14 +574,14 @@ class Game extends React.Component {
595574 if ( this . preventNewState ) {
596575 this . setState ( {
597576 latex : latexResult ,
598- deleteMeLatex : deleteMeLatex ,
577+ bilinearMathML : bilinearMathML ,
599578 schematicReadiness : schematicReadiness
600579 } , this . calculateTF ) ;
601580 } else {
602581 this . setState ( {
603582 history : this . state . history . concat ( [ current ] ) ,
604583 latex : latexResult ,
605- deleteMeLatex : deleteMeLatex ,
584+ bilinearMathML : bilinearMathML ,
606585 schematicReadiness : schematicReadiness
607586 } , this . calculateTF ) ;
608587 }
@@ -716,13 +695,14 @@ class Game extends React.Component {
716695 < ${ listElements } e =${ current . elements } key="valueList" onChange=${ ( e , i ) => this . handleElChange ( e , i ) } unitChange=${ ( e , i ) => this . handleUnitChange ( e , i ) } />
717696 </ div >
718697 </ div >
719- < ${ TransformResults } name ="World" key="TransformResults" latex=${ this . state . latex } deleteMeLatex =${ this . state . deleteMeLatex } />
698+ < ${ TransformResults } name ="World" key="TransformResults" title="Laplace" latex=${ this . state . latex } bilinearMathML =${ this . state . bilinearMathML } />
720699 < div className ="row shadow-sm rounded bg-white my-2 py-1 " id ="schematic ">
721700 < div className ="col ">
722701 < ${ FreqResponse } key ="FreqResponse"/>
723702 < ${ FreqResponseControllers } key ="FreqResponseControllers" fminValue=${ current . fmin . value } fminUnit=${ current . fmin . unit } fmaxValue=${ current . fmax . value } fmaxUnit=${ current . fmax . unit } onChange=${ ( e , i ) => this . handleElChange ( e , i ) } unitChange=${ ( e , i ) => this . handleUnitChange ( e , i ) } />
724703 </ div >
725704 </ div >
705+ < ${ TransformResults } name ="World" key="TransformResultsBilin" title="Bilinear" latex=${ this . state . bilinearMathML } />
726706 < ${ Comments } key ='comments' />
727707 </ div >
728708 </ div >
0 commit comments