Genie Discord forum

Author Avatarmaucejo
12/18/2022, 11:26:14 AM

Hi all, this my first post. I currently try to translate one of my Plotly Dash app (in python) into Julia using Genie Builder. I use the no-code plugin in Vscode. Despite I find this plugin impressive, I am stuck when defining some of my sliders. Actually, when I define negative values in (e.g. ="{-1:'-1', 0:'0', 1:'1'}") , the app is not built (see attached image). I can bypass this by defining only positive values, but in this case I don't know how to define the Label Value to correct the offset.

Do you have any ideas ? Is it a bug ?

Thanks for your help

Author Avatarmaucejo
12/18/2022, 11:26:58 AM

Changed the channel name: How to set negative values in marker-labels with genie no-code (Vscode plugin)

Author Avatarabhimanyuaryan
12/19/2022, 3:31:14 AM

can you post the entire code of PlotData object?

Author Avatarmaucejo
12/19/2022, 6:54:43 AM

@abhimanyuaryan For the moment, nothing is connected to the UI. So, this means that app.jl.hmtl is not rendered when using negative values for slider markers. The following HTML works:

<div class="row">
    <plotly :data="[{
      x: [2, 3, 4, 5],
      y: [16, 5, 11, 9],
      mode: 'lines',
      type: 'scatter'
    }]"></plotly>
    <div class="col col-4">
        <h6>Slider</h6>
        <q-slider :step="0.1" :min="0" :max="2" :snap="step" :label="true" :marker-labels="{0:'-1', 0.5:'-0.5', 1:'0', 1.5:'0.5', 2:'1'}"></q-slider>
    </div>
</div>

While the following code doesn't render anything:

<div class="row">
    <plotly :data="[{
      x: [2, 3, 4, 5],
      y: [16, 5, 11, 9],
      mode: 'lines',
      type: 'scatter'
    }]"></plotly>
    <div class="col col-4">
        <h6>Slider</h6>
        <q-slider :step="0.1" :min="-1" :max="1" :snap="step" :label="true" :marker-labels="{-1:'-1', -0.5:'-0.5', 0:'0', 0.5:'0.5', 1:'1'}"></q-slider>
    </div>
</div>
Author Avatarabhimanyuaryan
12/19/2022, 9:31:25 AM

I meant please give me MWE(minimum working example/proj) that I can run and debug directly. Here I have to paste, create an app, doesn't include app.jl and do a lot of step. Sorry for confusion

Author Avatarmaucejo
12/19/2022, 9:35:52 AM

Dear @abhimanyuaryan , how can I provide it to you ? It is the first time I use Discord. I zip the project and send it to you ?

Author Avatarabhimanyuaryan
12/20/2022, 3:31:10 AM

you can zip and send ||| or you can upload project to github/gitlab/bitbucket so I can clone it and run on my machine

Author Avatarmaucejo
12/20/2022, 11:40:24 AM

@abhimanyuaryan Please find a zip of a minimal app with a plot and a slider. I have tried to :

  • Set positive bounds + Label = true + Marker Labels -> OK
  • Set negative bounds (Main properties -> Min) + Label = true -> OK
  • Set negative bounds + Label = true + Marker Labels (e.g. {-50:"50", 50:"50"}) -> KO

Thanks again for your help

Author Avatarmaucejo
1/1/2023, 3:03:45 PM

Happy new year @abhimanyuaryan ! Actually, I think my problem is more related to quasar slider configuration than with Genie. I will try to find information on the Quasar Git repo.

Author Avatarabhimanyuaryan
1/2/2023, 5:52:37 AM

actually that's how javascript works you can do

<plotly :data="plotdata"></plotly>
<q-slider :step="0.1" :min="-1" :max="1" :snap="step" :label="true" :marker-labels="{'-1':'-1', '-0.5':'-0.5', '0':'0', '0.5':'0.5', '1':'1'}"></q-slider>
Author Avatarabhimanyuaryan
1/2/2023, 5:53:05 AM

let me know if this works for you

Author Avatarabhimanyuaryan
1/2/2023, 5:57:03 AM

you are passing a jsobject in marker-labels. Also would you like to make a contribution to stippleui?

https://github.com/GenieFramework/StippleUI.jl/blob/6a4ec593c392473c77b5019e120e752686821591/src/API.jl#L108-L115

some here according to alphabet add attribute mapping for marker-labels

"markerlabels" => "marker-labels"
Author Avatarabhimanyuaryan
1/4/2023, 3:33:26 PM

@maucejo is it resolved?

Author Avatarmaucejo
1/4/2023, 3:57:58 PM

I will check tomorrow and tell you if it works. Thank you

Author Avatarmaucejo
1/5/2023, 3:27:43 PM

Hi @abhimanyuaryan. It works perfectly! Thank you very much for your help and your patience. How can I contribute to stippleui? Indeed, I am not well-versed in Javascript. Iam just a high-level programmer (Python/Matlab/Julia) ๐Ÿ˜ข

Author Avatarabhimanyuaryan
1/7/2023, 4:02:02 PM

like I said you can attribute mapping for marker-labels if you want. I also gave the line number where you can add that mapping in the above message

Author Avatarmaucejo
1/8/2023, 1:33:32 PM

Thanks, I had understood, but since it is the first time I contribute to a project I don't author, I want to know if I must create a PR or create a fork of Stipple.jl (or another thing).

Author Avatarmaucejo
1/8/2023, 1:33:50 PM

@abhimanyuaryan Thank you for you help ๐Ÿ˜‰

Author Avatarabhimanyuaryan
1/10/2023, 5:24:02 AM

you fork the project. Add commit to your fork. And then pull-request to StippleUI.jl

Author Avatarabhimanyuaryan
1/10/2023, 5:35:58 AM

also don't worry you just push your commit to your fork and create pull request. If anything is wrong. I'll review it