Repository: Avaiga/taipy
Pull request: Added Step Property to the Slider component
## Description 
Added a step property to the Slider component so that users can 

I need some help here
- How can I use the same setting of formatting? I just turned off formatting for the moment. 
- I created the test function, but I got an assertion error. Not sure how to fix it.



## Related Issue 
resolves #639 

Problem statement:
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)
```

Hints from issue discussion:
You can code this, for example as a way to mimic what you want to do:

```python
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](https://github.com/Avaiga/taipy/blob/develop/CONTRIBUTING.md#contribution-workflow) you can find how to contribute to Taipy.

Commit message: Formatted the code

Patch to review:
diff --git a/frontend/taipy-gui/src/components/Taipy/Slider.tsx b/frontend/taipy-gui/src/components/Taipy/Slider.tsx
index 4a082ad5ab..d710e95ef1 100644
--- a/frontend/taipy-gui/src/components/Taipy/Slider.tsx
+++ b/frontend/taipy-gui/src/components/Taipy/Slider.tsx
@@ -30,6 +30,7 @@ interface SliderProps extends LovProps<number | string | number[] | string[], nu
     height?: string;
     min?: number;
     max?: number;
+    step?: number;
     textAnchor?: string;
     continuous?: boolean;
     labels?: string | boolean;
@@ -68,6 +69,7 @@ const Slider = (props: SliderProps) => {
 
     const min = lovList.length ? 0 : props.min;
     const max = lovList.length ? lovList.length - 1 : props.max;
+    const step = props.step === undefined ? 1 : props.step;
     const horizontalOrientation = props.orientation ? props.orientation.charAt(0).toLowerCase() !== "v" : true;
 
     // Converts the slider value (number or array of numbers) to a proper backend value
@@ -282,7 +284,7 @@ const Slider = (props: SliderProps) => {
                         valueLabelDisplay="auto"
                         min={min}
                         max={max}
-                        step={1}
+                        step={step}
                         marks={marks}
                         valueLabelFormat={getLabel}
                         orientation={horizontalOrientation ? undefined : "vertical"}
@@ -299,7 +301,7 @@ const Slider = (props: SliderProps) => {
                         valueLabelDisplay="auto"
                         min={min}
                         max={max}
-                        step={1}
+                        step={step}
                         marks={marks}
                         valueLabelFormat={getLabel}
                         orientation={horizontalOrientation ? undefined : "vertical"}
diff --git a/tests/gui/builder/control/test_slider.py b/tests/gui/builder/control/test_slider.py
index 275f5f9278..9b55627a59 100644
--- a/tests/gui/builder/control/test_slider.py
+++ b/tests/gui/builder/control/test_slider.py
@@ -36,6 +36,20 @@ def test_slider_with_min_max_builder(gui: Gui, test_client, helpers):
     helpers.test_control_builder(gui, page, expected_list)
 
 
+def test_slider_with_step_builder(gui: Gui, test_client, helpers):
+    gui._bind_var_val("x", 0)
+    with tgb.Page(frame=None) as page:
+        tgb.slider(value="{x}", min=-10, max=10, step=2)
+    expected_list = [
+        "<Slider",
+        "min={-10.0}",
+        "max={10.0}",
+        "step={2.0}",
+        "defaultValue={0}",
+    ]
+    helpers.test_control_builder(gui, page, expected_list)
+
+
 def test_slider_with_dict_labels_builder(gui: Gui, helpers):
     sel = "Item 1"  # noqa: F841
     labels = {"Item 1": "Label Start", "Item 3": "Label End"}  # noqa: F841


Code review comments:
diff_hunk: @@ -68,6 +69,7 @@ const Slider = (props: SliderProps) => {
 
     const min = lovList.length ? 0 : props.min;
     const max = lovList.length ? lovList.length - 1 : props.max;
+    const step = props.step === undefined ? 1 : props.step;
path: frontend/taipy-gui/src/components/Taipy/Slider.tsx
text: @user1:
The default value can be set in the expansion of props (L<55)