Skip to content

Commit

Permalink
Merge branch 'develop' into example/input
Browse files Browse the repository at this point in the history
  • Loading branch information
namnguyen20999 authored Oct 2, 2024
2 parents 84bf6cd + fb04676 commit 16985bf
Show file tree
Hide file tree
Showing 231 changed files with 6,625 additions and 5,303 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/trigger-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Trigger taipy-benchmark computation
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{secrets.TAIPY_INTEGRATION_TESTING_ACCESS_TOKEN}}
repository: avaiga/taipy-benchmark
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ For questions, please get in touch on [Discord](https://discord.com/invite/SJyz2

Taipy is organised in two main repositories:

- [taipy](https://github.com/Avaiga/taipy) is the main repository that containing the code of Taipy packages.
- [taipy](https://github.com/Avaiga/taipy) is the main repository that contains the code of Taipy packages.
- [taipy-doc](https://github.com/Avaiga/taipy-doc) is the documentation repository.

## Never contributed on an open source project before ?
## Never contributed to an open source project before ?

Have a look on this [GitHub documentation](https://docs.github.com/en/get-started/quickstart/contributing-to-projects).

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

![Hactoberfestnew](https://github.com/user-attachments/assets/149a5cee-6af1-4d4e-9c43-6fcf82a9b07e)
[![Hacktoberfest_clickable](https://github.com/user-attachments/assets/b1b5a430-6df9-40c2-999f-de3433f61251)](https://assorted-son-815.notion.site/Hacktoberfest-2024-with-Taipy-2a5032a3f01642709e88ffaa5d0d169e)


<div align="center">
Expand Down
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_anchor/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This file makes this directory a module on its own, mandatody for mypy.
# This file makes this directory a module on its own, mandatory for mypy.
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_anchor/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@


if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Anchor")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_anchor/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"""

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Anchor")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_as_page/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This file makes this directory a module on its own, mandatody for mypy.
# This file makes this directory a module on its own, mandatory for mypy.
11 changes: 6 additions & 5 deletions doc/gui/examples/blocks/pane_as_page/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ def on_change(state, var_name: str):
state.final_amount = state.initial_investment * progress


pages = {
"main": page,
"_rate_pane": rate_page,
}

if __name__ == "__main__":
pages = {
"main": page,
"_rate_pane": rate_page,
}
Gui(pages=pages).run()
Gui(pages=pages).run(title="Pane - As page")
12 changes: 7 additions & 5 deletions doc/gui/examples/blocks/pane_as_page/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ def on_change(state, var_name: str):
state.final_amount = state.initial_investment * progress


pages = {
"main": page,
"_rate_pane": rate_page,
}


if __name__ == "__main__":
pages = {
"main": page,
"_rate_pane": rate_page,
}
Gui(pages=pages).run()
Gui(pages=pages).run(title="Pane - As page")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_persistent/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This file makes this directory a module on its own, mandatody for mypy.
# This file makes this directory a module on its own, mandatory for mypy.
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_persistent/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
tgb.text("Here is the content of the page.")

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Persistent")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_persistent/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
"""

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Persistent")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_simple/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This file makes this directory a module on its own, mandatody for mypy.
# This file makes this directory a module on its own, mandatory for mypy.
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_simple/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def on_action(state):
tgb.button("Show pane")

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Simple")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_simple/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def on_action(state):
"""

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Simple")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_simple_lambda/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This file makes this directory a module on its own, mandatody for mypy.
# This file makes this directory a module on its own, mandatory for mypy.
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_simple_lambda/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
tgb.button("Show pane", on_action=lambda s: s.assign("show_pane", True))

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Lambda")
2 changes: 1 addition & 1 deletion doc/gui/examples/blocks/pane_simple_lambda/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
"""

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Pane - Lambda")
16 changes: 7 additions & 9 deletions doc/gui/examples/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,19 @@ def start_or_stop(state: State):
state.assign("button_text", button_texts[1 if thread else 0])


if __name__ == "__main__":
button_texts = ["Start", "Stop"]
# Text in the start/stop button (initially "Start")
button_text = button_texts[0]

page = """
# Broadcasting values
button_texts = ["Start", "Stop"]
# Text in the start/stop button (initially "Start")
button_text = button_texts[0]

page = """
Counter: <|{counter}|>
Timer: <|{button_text}|button|on_action=start_or_stop|>
"""
"""

if __name__ == "__main__":
# Declare "button_text" as a shared variable.
# Assigning a value to a state's 'button_text' property is propagated to all clients
Gui.add_shared_variable("button_text")

Gui(page).run()
Gui(page).run(title="Broadcasting values")
12 changes: 6 additions & 6 deletions doc/gui/examples/broadcast_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ def update_time(gui):
sleep(1)


if __name__ == "__main__":
current_time = datetime.now()
update = False
current_time = datetime.now()
update = False

page = """
page = """
Current time is: <|{current_time}|format=HH:mm:ss|>
Update: <|{update}|toggle|>
"""
"""

if __name__ == "__main__":
gui = Gui(page)

# Run thread that regularly updates the current time
thread = Thread(target=update_time, args=[gui], name="clock")
thread.daemon = True
thread.start()

gui.run()
gui.run(title="Broadcast - Callback")
10 changes: 5 additions & 5 deletions doc/gui/examples/broadcast_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ def update_time(gui):
sleep(1)


if __name__ == "__main__":
current_time = datetime.now()
current_time = datetime.now()

page = """
page = """
Current time is: <|{current_time}|format=HH:mm:ss|>
"""
"""

if __name__ == "__main__":
gui = Gui(page)

# Run thread that regularly updates the current time
thread = Thread(target=update_time, args=[gui], name="clock")
thread.daemon = True
thread.start()

gui.run()
gui.run(title="Broadcast - Change")
4 changes: 1 addition & 3 deletions doc/gui/examples/charts/advanced-selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ def on_change(state, var, val):
mean_value = 0.0

page = """
# Advanced - Selection
## Mean of <|{len(selected_indices)}|raw|> selected points: <|{mean_value}|format=%.2f|raw|>
<|{data}|chart|selected={selected_indices}|layout={layout}|plot_config={config}|>
"""

Gui(page).run()
Gui(page).run(title="Chart - Advanced - Selection")
71 changes: 35 additions & 36 deletions doc/gui/examples/charts/advanced-shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,44 @@ def f(x):
return x * x * x / 3 - x


if __name__ == "__main__":
# x values: [-2.2, ..., 2.2]
x = [(x - 10) / 4.5 for x in range(0, 21)]

data = {
"x": x,
# y: [f(-2.2), ..., f(2.2)]
"y": [f(x) for x in x],
}
# x values: [-2.2, ..., 2.2]
x = [(x - 10) / 4.5 for x in range(0, 21)]

shape_size = 0.1
data = {
"x": x,
# y: [f(-2.2), ..., f(2.2)]
"y": [f(x) for x in x],
}

layout = {
"shapes": [
# Shape for local maximum (x = -1)
{
"x0": -1 - shape_size,
"y0": f(-1) - 2 * shape_size,
"x1": -1 + shape_size,
"y1": f(-1) + 2 * shape_size,
"fillcolor": "green",
"opacity": 0.5,
},
# Shape for local minimum (x = 1)
{
"x0": 1 - shape_size,
"y0": f(1) - 2 * shape_size,
"x1": 1 + shape_size,
"y1": f(1) + 2 * shape_size,
"fillcolor": "red",
"opacity": 0.5,
},
]
}
shape_size = 0.1

page = """
# Advanced - Annotations
layout = {
"shapes": [
# Shape for local maximum (x = -1)
{
"x0": -1 - shape_size,
"y0": f(-1) - 2 * shape_size,
"x1": -1 + shape_size,
"y1": f(-1) + 2 * shape_size,
"fillcolor": "green",
"opacity": 0.5,
},
# Shape for local minimum (x = 1)
{
"x0": 1 - shape_size,
"y0": f(1) - 2 * shape_size,
"x1": 1 + shape_size,
"y1": f(1) + 2 * shape_size,
"fillcolor": "red",
"opacity": 0.5,
},
]
}

page = """
<|{data}|chart|layout={layout}|>
"""
"""

Gui(page).run()

if __name__ == "__main__":
Gui(page).run(title="Chart - Advanced - Annotations")
36 changes: 17 additions & 19 deletions doc/gui/examples/charts/advanced-unbalanced-datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,25 @@
# -----------------------------------------------------------------------------------------
from taipy.gui import Gui

if __name__ == "__main__":
# The first data set uses the x interval [-10..10],
# with one point at every other unit
x1_range = [x * 2 for x in range(-5, 6)]

# The second data set uses the x interval [-4..4],
# with ten point between every unit
x2_range = [x / 10 for x in range(-40, 41)]
# The first data set uses the x interval [-10..10],
# with one point at every other unit
x1_range = [x * 2 for x in range(-5, 6)]

# Definition of the two data sets
data = [
# Coarse data set
{"x": x1_range, "Coarse": [x * x for x in x1_range]},
# Fine data set
{"x": x2_range, "Fine": [x * x for x in x2_range]},
]
# The second data set uses the x interval [-4..4],
# with ten point between every unit
x2_range = [x / 10 for x in range(-40, 41)]

page = """
# Advanced - Unbalanced data sets
# Definition of the two data sets
data = [
# Coarse data set
{"x": x1_range, "Coarse": [x * x for x in x1_range]},
# Fine data set
{"x": x2_range, "Fine": [x * x for x in x2_range]},
]

page = """
<|{data}|chart|x[1]=0/x|y[1]=0/Coarse|x[2]=1/x|y[2]=1/Fine|>
"""
"""

Gui(page).run()
if __name__ == "__main__":
Gui(page).run(title="Chart - Advanced - Unbalanced data sets")
4 changes: 1 addition & 3 deletions doc/gui/examples/charts/advanced_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ def f(x):
}

page = """
# Advanced - Annotations
<|{data}|chart|layout={layout}|>
"""

if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Chart - Advanced - Annotations")
2 changes: 1 addition & 1 deletion doc/gui/examples/charts/advanced_python_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@


if __name__ == "__main__":
Gui(page).run()
Gui(page).run(title="Chart - Advanced - Python lib")
Loading

0 comments on commit 16985bf

Please sign in to comment.