@@ -178,32 +178,20 @@ export const SimulationOne = () => {
178178 </ header >
179179 < div className = "simulation__step-content" >
180180 { plotType === '2d' && (
181- < p >
182- Let’s start by setting up your graph.
183- First define the parameters for generating
184- random data points. Specify the sample
185- size < Katex tex = { 'n' }
186- className = "katex-inline" /> and
187- the estimated correlation coefficient
188- < Katex tex = { '\\text{corr}(x,y)' }
189- className = "katex-inline" /> .
190- </ p >
181+ < p > Let’s start setting up the parameters
182+ to generate random data points for your
183+ graph.</ p >
191184 ) }
192185 { plotType === '3d' && (
193- < p >
194- Let’s introduce another variable to
195- your graph, < Katex tex = { 'x_2' }
196- className = "katex-inline" /> .
197- Sample size < Katex tex = { 'n' }
198- className = "katex-inline" /> and
199- < Katex tex = { '\\text{corr}(x_1,y)' }
200- className = "katex-inline" /> are set
201- in the previous section. Here, you
202- can specify the estimated correlation
203- coefficient < Katex
204- tex = { '\\text{corr}(x_1,x_2)' }
205- className = "katex-inline" /> .
206- </ p >
186+ < p > Let’s introduce another variable to
187+ your graph, < Katex tex = { 'x_2' }
188+ className = "katex-inline" /> and < Katex
189+ tex = { '\\text{corr}(x_1,x_2)' }
190+ className = "katex-inline" /> .
191+ < Katex tex = { 'n' } className = "katex-inline" /> and
192+ < Katex tex = { '\\text{corr}(x_1,y)' }
193+ className = "katex-inline" /> are values from
194+ the previous section.</ p >
207195 ) }
208196 < div className = "mt-4 d-flex" >
209197 < label htmlFor = "nSampleSize"
@@ -216,23 +204,29 @@ export const SimulationOne = () => {
216204 </ label >
217205 < input type = "number" min = "50" max = "500"
218206 id = "nSampleSize"
219- className = "form-control short-input"
207+ className = "form-control extra- short-input"
220208 disabled = {
221209 is2DCompleted || lockControls }
222210 value = { N }
223211 onBlur = { handleNBlur }
224212 onChange = { handleNChange } />
213+ { isNInvalid && ( < >
214+ < div className = "alert-incorrect-container
215+ ms-2" >
216+ < div className = "alert-incorrect" > !</ div >
217+ < div >
218+ < Katex tex = { '50 \\leq n \\leq 500' }
219+ className = "katex-inline" />
220+ </ div >
221+ </ div >
222+ </ > ) }
225223 </ div >
226- { isNInvalid && (
227- < div className = "text-danger mt-2" >
228- For practical purposes n is between 50 and 500
229- </ div >
230- ) }
231224 { plotType === '2d' && (
232225 < div className = "mt-4" >
233226 < label htmlFor = "correlation"
234- className = "h2 form-label" >
235- Estimated < Katex tex = { '\\text{corr}(x,y)' }
227+ className = "h2 form-label" > Correlation
228+ coefficient < Katex
229+ tex = { '\\text{corr}(x,y)' }
236230 className = "katex-inline" /> :
237231 </ label >
238232 < div className = "slider-range__box" >
@@ -249,32 +243,27 @@ export const SimulationOne = () => {
249243 handleYcorrelationChange } />
250244 < div className = "scale-value" >
251245 { slope !== null && (
252- < Katex tex = {
253- `${
254- appRvalue . toFixed ( 3 )
255- } `} />
246+ < div className = "hi-val" >
247+ < Katex tex = { `${
248+ appRvalue . toFixed (
249+ 3 ) } `}
250+ />
251+ </ div >
256252 ) }
257253 </ div >
258254 </ div >
259255 < div className = "slider-range__scale" >
260256 < div className = "unit" > </ div >
261257 < div className = "unit" > </ div >
262- < div className = "unit" > </ div >
263- < div className = "unit" > </ div >
264- < div className = "unit" > </ div >
265- < div className = "unit" > </ div >
266- < div className = "unit" > </ div >
267- < div className = "unit" > </ div >
268- < div className = "unit" > </ div >
269258 </ div >
270259 </ div >
271260 </ div >
272261 ) }
273262 { plotType === '3d' && (
274263 < div className = "mt-4" >
275264 < label htmlFor = "correlation"
276- className = "h2 form-label" >
277- Estimated < Katex
265+ className = "h2 form-label" > Correlation
266+ coefficient < Katex
278267 tex = { '\\text{corr}(x_1,x_2)' }
279268 className = "katex-inline" /> :
280269 </ label >
@@ -293,59 +282,22 @@ export const SimulationOne = () => {
293282 handleXcorrelationChange } />
294283 < div className = "scale-value" >
295284 { slopes . length > 0 && (
296- < Katex tex = { `${
297- appRvalue3d . toFixed ( 3 ) } `
298- } />
285+ < div className = "hi-val" >
286+ < Katex tex = {
287+ `${ appRvalue3d
288+ . toFixed ( 3 )
289+ } `} />
290+ </ div >
299291 ) }
300292 </ div >
301293 </ div >
302294 < div className = "slider-range__scale" >
303295 < div className = "unit" > </ div >
304296 < div className = "unit" > </ div >
305- < div className = "unit" > </ div >
306- < div className = "unit" > </ div >
307- < div className = "unit" > </ div >
308- < div className = "unit" > </ div >
309- < div className = "unit" > </ div >
310- < div className = "unit" > </ div >
311- < div className = "unit" > </ div >
312297 </ div >
313298 </ div >
314299 </ div >
315300 ) }
316- { slopes . length > 0 && plotType === '3d' && (
317- < >
318- < div className = "mt-5 h2" >
319- Calculated < Katex
320- tex = { '\\text{corr}(x_1,x_2)' }
321- className = "katex-inline" /> :
322- < div
323- className = "hi-val ms-2" >
324- < Katex
325- tex = {
326- `${ appRvalue3d . toFixed ( 3 ) } `
327- }
328- className = "katex-inline" />
329- </ div >
330- </ div >
331- </ >
332- ) }
333- { slope !== null && (
334- < >
335- < div className = "mt-5 h2" >
336- Calculated
337- < Katex
338- tex = { '\\text{corr}(x,y)' }
339- className = "katex-inline" /> :
340- < div
341- className = "hi-val ms-2" >
342- < Katex
343- tex = { `${ appRvalue . toFixed ( 3 ) } ` }
344- className = "katex-inline" />
345- </ div >
346- </ div >
347- </ >
348- ) }
349301 </ div >
350302 </ div >
351303 </ div > { /* div class=simulation__step-container */ }
0 commit comments