Genie Discord forum

Author AvatarGenerallyClueless
6/24/2023, 1:22:26 PM

๐Ÿ˜ฅ Apologies if I am making a n00b mistake, but the behavior that I see is not intuitive. Each time I configure a slider Main Properties, it overwrites the Main Properties of the other sliders and the plot.

For example: I have configured my slider for my "A" polynomial coefficient.

When I move to configure my next slider for my "B" coefficient, it is already populated.

However, the HTML code is still correct for the slider (from the last time I had configured it)

Author AvatarPere
6/24/2023, 3:42:47 PM

This is not supposed to happen, as the elements should have empty properties by default. Did you copy/paste the sliders? Can you check in the HTML if the ID of each element is different?

Author AvatarPere
6/24/2023, 3:43:37 PM

Also, the data type for the sliders is int. The ABCD variables should be initialised to an integer

Author AvatarPere
6/24/2023, 3:44:42 PM

Check this video around min 10 to see how it's supposed to work

https://youtu.be/FQFD2YYqtpA

If you still get the same, can you share the code and I'll take a quick look? Just upload a zip here or somewhere

Author AvatarGenerallyClueless
6/24/2023, 3:48:21 PM

Hi @Pere thanks for yoru response. Yes, the element ID is different for each of the sliders... so I was not overly concerned.

Author AvatarGenerallyClueless
6/24/2023, 3:50:31 PM

Is the data type int? I have just used sliders where the increment was 0.1 or 0.01 in Pluto. The data type returned was actually an array.

Author AvatarPere
6/24/2023, 3:53:55 PM

Sorry, yes. It can be float as well. Just not string or list like you had

Author AvatarGenerallyClueless
6/24/2023, 3:54:32 PM

Hmmm, I just looked back at the HTML code and noticed something strange

Author AvatarGenerallyClueless
6/24/2023, 3:54:45 PM

Two of the sliders had ID's, the other two had none

Author AvatarGenerallyClueless
6/24/2023, 3:57:06 PM

Unfortunately, after closing my project and opening it again, I cannot seem to access the builder to make any changes. ๐Ÿ˜ณ

Author AvatarPere
6/24/2023, 3:59:43 PM

Can you share what the explorer window looks like?

Author AvatarPere
6/24/2023, 4:03:20 PM

Oh you mean the no code editor okey you can open it clicking the eye icon to the left

https://learn.geniecloud.io/guides/quickstart#implement-the-ui

Author AvatarGenerallyClueless
6/24/2023, 4:04:13 PM

I don't think I see that eye icon

Author AvatarGenerallyClueless
6/24/2023, 4:05:27 PM

I'm using the regular Genie Builder, not Genie Cloud

Author AvatarPere
6/24/2023, 4:06:10 PM

Yes, the UI is the same

Author AvatarGenerallyClueless
6/24/2023, 4:07:44 PM

I will bet that if I click on + to create a new genie app, then it will work

Author AvatarGenerallyClueless
6/24/2023, 4:08:20 PM

the only icons I have for polynomialmanipulation is start (or stop) depending on the state

Author AvatarPere
6/24/2023, 4:08:59 PM

I think you're looking in the wrong place. The button appears in the GENIE APPS tab after the app has started. In the screenshot the app is not running

Author AvatarGenerallyClueless
6/24/2023, 4:09:26 PM

Okay, it was running in my 1st screen shot

Author AvatarPere
6/24/2023, 4:09:39 PM

You start the app, then unfold the apps menu and then next to GET you'll see it

Author AvatarGenerallyClueless
6/24/2023, 4:10:22 PM

It's running now, but there is no eye

Author AvatarPere
6/24/2023, 4:10:46 PM

Oh well, that's probably because of the error preventing the app from running

Author AvatarPere
6/24/2023, 4:11:02 PM

Can you share your app.jl?

Author AvatarPere
6/24/2023, 4:11:49 PM

And terminal output as well please

Author AvatarGenerallyClueless
6/24/2023, 4:17:21 PM

As we chatted, I have added random 5 letter ID's to the two sliders that had none... I can attach the HTML file as well... if it would help

Author AvatarPere
6/24/2023, 4:19:24 PM

Ok i see it. This is something that we should make clearer, sorry.

Reactive variables declared with in and out are only accessible from within an @onchange block. They do not exist outside of it. So, the line result = calc_polynomial(A,B,C,D) cannot be evaluated

Author AvatarGenerallyClueless
6/24/2023, 4:20:46 PM

Okay, so I would just need to change where I call the function?

Author AvatarGenerallyClueless
6/24/2023, 4:21:41 PM

I left one call to calc_polynomial under "out" so I could plot the initial plot before a slider was touched

Author AvatarPere
6/24/2023, 4:23:28 PM

Yes, you can't call calc_polinomial outside an @onchange block. To do what you want, use @onchange is ready begin...end. The isready variable is automatically created and it becomes true when the page is done loading

Author AvatarGenerallyClueless
6/24/2023, 4:23:30 PM

I thought that assigning the variables from the @in fixed values would allow me to plot the function 1x^3 + 1x^2 + 1x + 0

Author AvatarGenerallyClueless
6/24/2023, 4:24:19 PM

so what is the best way to set the initial value of the sliders?

Author AvatarGenerallyClueless
6/24/2023, 4:24:33 PM

Pluto had a field for the default value

Author AvatarPere
6/24/2023, 4:24:45 PM

See the video about the iris tutorial, i talk about the isready thing there.

Author AvatarPere
6/24/2023, 4:25:25 PM

Right when you declare the variable. @in and @out vars always need a default value

Author AvatarGenerallyClueless
6/24/2023, 4:27:42 PM

Ok, thank you. I have bookmarked the article.

Author AvatarGenerallyClueless
6/24/2023, 4:32:28 PM

so technically, I can comment out everything between @geenietools and @page... then basically run this as an empty julia project and I should be able to see the webpage, right?

Author AvatarGenerallyClueless
6/24/2023, 4:34:54 PM

... so I ran that , with "empty" julia file, and my drag-and-drop build tools came back

Author AvatarPere
6/24/2023, 4:35:02 PM

You'd have to comment the code inside @app as well, otherwise calc_polynomial will be undefined

Author AvatarGenerallyClueless
6/24/2023, 4:36:03 PM

Yes, you were definitely right. It looks like the error prevented the build tools from working. Although, I still don't see an eye

Author AvatarGenerallyClueless
6/24/2023, 4:38:01 PM

the build tools still show incorrect field values for the GUI components though... Not sure why that is happening ๐Ÿค”

Author AvatarPere
6/24/2023, 4:40:41 PM

Perhaps the old values are still in memory? Try restarting the Genie server. Also, to see the exe you need to expand the app's tab. The terminal looks like all is fine

Author AvatarGenerallyClueless
6/24/2023, 4:44:32 PM

Confirmed, the eye icon and all of the other Genie Apps have come back

Author AvatarGenerallyClueless
6/24/2023, 4:45:21 PM

@Pere has the MAGIC TOUCH โค๏ธโ€๐Ÿ”ฅ ๐Ÿ’Ž ๐Ÿฅ‡

Author AvatarGenerallyClueless
6/24/2023, 4:46:22 PM

I swear that I have tried all of this earlier when I tried to troubleshoot this challenge

Author AvatarPere
6/24/2023, 4:46:32 PM

hahaha, I'm glad it all works now. We'll try to make the experience a little smoother ๐Ÿ˜…

Author AvatarGenerallyClueless
6/24/2023, 4:46:37 PM

๐Ÿ˜ณ ๐Ÿค n00b

Author AvatarGenerallyClueless
6/24/2023, 4:47:33 PM

thanks a lot for all of your help @Pere and I'm going to mention you and link this to the other thread I posted. I am no longer receiving that error 404 anymore.

Author AvatarGenerallyClueless
6/24/2023, 4:49:50 PM

----------------------- Quick Summary --------

Author AvatarGenerallyClueless
6/24/2023, 4:53:18 PM

Fixed a couple of things here ...

  • The HTML file had two sliders missing ID's. I manually added ID's to the HTML file.
  • @Pere told me to AVOID calls to bound variables (per responsive design) outside of the @onchange block. I bulk commented out the code so that between @geenietools and @page within the app.jl file. As a result, I was able to run without error, and the interactive build tools came back.
Author AvatarGenerallyClueless
6/24/2023, 4:55:38 PM
  • Afterward, I did not see the "eye icon" in Genie Apps for my project, but restarting the Genie Server and rerunning the app did fix that.
  • Finally, I used the browser to navigate to the Genie Server address and I was able to view the HTML code for my app, where previously I would end up reacing Error 404
Author AvatarGenerallyClueless
6/24/2023, 5:00:29 PM

@Pere Thank you again for all of your attention today!! I hope this quick summary helps any other n00bs like me ๐Ÿ‘

Author AvatarPere
6/24/2023, 5:01:18 PM

thanks @GenerallyClueless ! I'm actually preparing some new materials for newbie, so this'll come in handy

Author AvatarGenerallyClueless
6/24/2023, 5:02:04 PM

got to be some appropriate gifs for my start with julia/Genie... like tripping and falling off a boat ๐Ÿคฃ