taipy
taipy copied to clipboard
Make a slider in float type with a particular step value
I'm trying to make a slider in float type with a particular step value. How to make it?
I think it will be easier to use if there's a "step" property:
pressure = 0.05
with tgb.Page() as page:
tgb.slider("{pressure}", min=0.01, max=0.1, step=0.01)
You can code this, for example as a way to mimic what you want to do:
import taipy.gui.builder as tgb
from taipy.gui import Gui
# create a list of string 0.1, 0.2, 0.3, ...
string_list = [str(i / 10) for i in range(1, 11)]
pressure = string_list[0]
with tgb.Page() as page:
tgb.text("Slider:")
tgb.slider("{pressure}", lov=string_list)
Gui(page).run()
We could add what you said with step directly to Taipy to make it easier. Let's discuss about it.
I agree with this issue. We should align with the Python standards. For example, in NumPy, np.arange uses min, max and step with step defaulting to 1. This allows you to easily do both integer and float sliders
Thank you for your response. I look forward to it being added!
I want to work on this!
@Satoshi-Sh I have assigned this issue to you. Here you can find how to contribute to Taipy.
Thanks, @FlorianJacta . I need help with this PR, it would be nice if you could guide me. I made a draft pull request already. #800
I updated Slidebar.tsx to take step argument but it seems not working according to the test I wrote. I also struggled to set up formatted for this project.
I commented your PR
There is an issue with step function when used with markdown. see code below <|{vari}|slider|min=0|max=200|step=1|change_delay=2000|orientation=vert|on_change=sliderchange|> the code throws error and does not recognize step. when removed from code the slider functions normally.
This feature appeared in 3.1. What Taipy version so you have?
I wasn't able to replicate the issue on 3.1.
Hi, My version is 3.1.1
See the screenshot below
[cid:6635a724-9a3e-4ffb-ac1b-671cbd4dd264]
The above slider code runs even with this error shown in VSCode but step functionality does not work for slider.
Regards
Sent from Outlookhttp://aka.ms/weboutlook
From: Florian Jacta @.> Sent: Monday, June 17, 2024 12:50 PM To: Avaiga/taipy @.> Cc: pkinani @.>; Comment @.> Subject: Re: [Avaiga/taipy] Make a slider in float type with a particular step value (Issue #639)
This feature appeared in 3.1. What Taipy version so you have?
I wasn't able to replicate the issue on 3.1.
— Reply to this email directly, view it on GitHubhttps://github.com/Avaiga/taipy/issues/639#issuecomment-2172479953, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWDEU5SMUK4FP6ZXDPGO42LZH2E27AVCNFSM6AAAAABBIBZTR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZSGQ3TSOJVGM. You are receiving this because you commented.Message ID: @.***>
Hi, I cannot see your screenshot. Could you provide the code as well as the traceback?
[cid:4fddf86e-110f-4109-a722-8eb79a37c84d]
The screenshot is given above. Step=5 is showing error! In the code. Screenshot file also attached.
Hope this helps
Sent from Outlookhttp://aka.ms/weboutlook
From: Florian Jacta @.> Sent: Tuesday, June 18, 2024 1:52 PM To: Avaiga/taipy @.> Cc: pkinani @.>; Comment @.> Subject: Re: [Avaiga/taipy] Make a slider in float type with a particular step value (Issue #639)
Hi, I cannot see your screenshot. Could you provide the code as well as the traceback?
— Reply to this email directly, view it on GitHubhttps://github.com/Avaiga/taipy/issues/639#issuecomment-2175502034, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWDEU5R5UJQELH2ZAO7LG63ZH7U5BAVCNFSM6AAAAABBIBZTR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZVGUYDEMBTGQ. You are receiving this because you commented.Message ID: @.***>
I see no screenshot.
I think you are using your emails to send these screenshots, which won't work. Try to go on GitHub directly.
Screenshot sent via github
Sent from Outlookhttp://aka.ms/weboutlook
From: Florian Jacta @.> Sent: Tuesday, June 18, 2024 9:20 PM To: Avaiga/taipy @.> Cc: pkinani @.>; Comment @.> Subject: Re: [Avaiga/taipy] Make a slider in float type with a particular step value (Issue #639)
I see no screenshot.
image.png (view on web)https://github.com/Avaiga/taipy/assets/98709993/ac1d42f9-356d-4a0b-a076-c9901764e4fa
I think you are using your emails to send these screenshots, which won't work. Try to go on GitHub directly.
— Reply to this email directly, view it on GitHubhttps://github.com/Avaiga/taipy/issues/639#issuecomment-2176432476, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWDEU5TKT4DK7MICEYTISELZIBJMJAVCNFSM6AAAAABBIBZTR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWGQZTENBXGY. You are receiving this because you commented.Message ID: @.***>
Issue created on github.
step function in slider not working #1428
Sent from Outlookhttp://aka.ms/weboutlook From: Florian Jacta @.> Sent: Tuesday, June 18, 2024 9:20 PM To: Avaiga/taipy @.> Cc: pkinani @.>; Comment @.> Subject: Re: [Avaiga/taipy] Make a slider in float type with a particular step value (Issue #639)
I see no screenshot.
image.png (view on web)https://github.com/Avaiga/taipy/assets/98709993/ac1d42f9-356d-4a0b-a076-c9901764e4fa
I think you are using your emails to send these screenshots, which won't work. Try to go on GitHub directly.
— Reply to this email directly, view it on GitHubhttps://github.com/Avaiga/taipy/issues/639#issuecomment-2176432476, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWDEU5TKT4DK7MICEYTISELZIBJMJAVCNFSM6AAAAABBIBZTR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWGQZTENBXGY. You are receiving this because you commented.Message ID: @.@.>>