Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Example for Slider Labels in Taipy GUI #2077

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

JeevaRamanathan
Copy link
Contributor

Added an example demonstrating how to implement slider labels using a dictionary and lov in Taipy GUI.

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>
@FredLL-Avaiga FredLL-Avaiga added 📄 Documentation Internal or public documentation 🖰 GUI Related to GUI labels Oct 17, 2024
JeevaRamanathan and others added 4 commits October 17, 2024 15:30
Signed-off-by: jeevaramanathan <jeevaramanathan.m@infosys.com>
Signed-off-by: jeevaramanathan <jeevaramanathan.m@infosys.com>
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even slightly simpler...

Really helpful, @JeevaRamanathan, thanks!

page = """
Labels with Dictionary

<|{value}|slider|min=0|max=5|labels={labels_with_dict}|>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need min and max: values are based on the dict keys.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> <|{value}|slider|labels={labels}|>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
The slider default max value is defined 100, so without them it results like this.

doc/gui/examples/controls/slider_labels_dictionary.py Outdated Show resolved Hide resolved
doc/gui/examples/controls/slider_labels_dictionary.py Outdated Show resolved Hide resolved
doc/gui/examples/controls/slider_labels_dictionary.py Outdated Show resolved Hide resolved
doc/gui/examples/controls/slider_labels_lov.py Outdated Show resolved Hide resolved
doc/gui/examples/controls/slider_labels_lov.py Outdated Show resolved Hide resolved
doc/gui/examples/controls/slider_labels_lov.py Outdated Show resolved Hide resolved
Signed-off-by: jeevaramanathan <jeevaramanathan.m@infosys.com>
@JeevaRamanathan
Copy link
Contributor Author

Hi @FabienLelaquais, I have fixed according to your suggestions expect #2077 (review)

value = 2

page = """
<|{value}|slider|min=0|max=5|labels={labels}|>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @FabienLelaquais mentioned, can you remove min and max ?
and change the labels dictionary to spread from 0 to 100 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @FredLL-Avaiga, I have made the requested changes.

JeevaRamanathan and others added 2 commits October 22, 2024 18:04
Signed-off-by: JeevaRamanathan M <jeevaramanathan.m@infosys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 Documentation Internal or public documentation 🖰 GUI Related to GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants