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

manage lambdas #1838

Merged
merged 4 commits into from
Sep 26, 2024
Merged

manage lambdas #1838

merged 4 commits into from
Sep 26, 2024

Conversation

FredLL-Avaiga
Copy link
Member

resolves #1832

from random import randrange

from taipy.gui import Gui, Markdown

x_range = range(0, 11)
data = {"x": [randrange(10) for _ in x_range]}

page = Markdown(
     "<|{data}|table|style[x]={lambda _, v: f'col{v}'}|show_all|>",
    style={
        ".col0": {"background-color": "##b0b0b0"},
        ".col1": {"background-color": "#a5a4b0"},
        ".col2": {"background-color": "#9994b3"},
        ".col3": {"background-color": "#8880b0"},
        ".col4": {"background-color": "#7a71b0", "color": "white"},
        ".col5": {"background-color": "#6b5fad", "color": "white"},
        ".col6": {"background-color": "#5e50ad", "color": "white"},
        ".col7": {"background-color": "#5141ab", "color": "white"},
        ".col8": {"background-color": "#412eab", "color": "white"},
        ".col9": {"background-color": "#2c16a8", "color": "white"},
        ".col10": {"background-color": "#1b02a8", "color": "white"},
    },
)

Gui(page=page).run(title="1832 indexed styles lambda")

import pandas as pd

from taipy.gui import Gui

data = pd.DataFrame()

# Create 1O columns with 100 rows of bools
for i in range(10):
    data[f"col_{i}"] = list(range(100))

page = """
<|{data}|table|format_fn[col_2]={lambda s, v, i, r, c: f"value: {v} for {i} in {c}"}|not editable|>
"""
if __name__ == "__main__":
    Gui(page).run(title="564 table format function")

@FredLL-Avaiga FredLL-Avaiga added 🟥 Priority: Critical Must be addressed as soon as possible 💥Malfunction Addresses an identified problem. 📝Release Notes Impacts the Release Notes Gui: Back-End labels Sep 25, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Sep 25, 2024
Copy link
Contributor

github-actions bot commented Sep 25, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
18819 16313 87% 0% 🟢

New Files

File Coverage Status
taipy/gui/utils/_lambda.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
taipy/gui/_renderers/builder.py 83% 🟢
taipy/gui/builder/_element.py 91% 🟢
taipy/gui/gui.py 79% 🟢
taipy/gui/utils/init.py 100% 🟢
taipy/gui/utils/_evaluator.py 85% 🟢
TOTAL 88% 🟢

updated for commit: 1e1b2c5 by action🐍

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.

Oh really?!?

taipy/gui/_renderers/builder.py Show resolved Hide resolved
taipy/gui/utils/_evaluator.py Show resolved Hide resolved
namnguyen20999
namnguyen20999 previously approved these changes Sep 25, 2024
Copy link
Member

@namnguyen20999 namnguyen20999 left a comment

Choose a reason for hiding this comment

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

Lgtm

namnguyen20999
namnguyen20999 previously approved these changes Sep 25, 2024
Copy link
Member

@dinhlongviolin1 dinhlongviolin1 left a comment

Choose a reason for hiding this comment

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

Thank you for waiting for my approval

taipy/gui/_renderers/builder.py Show resolved Hide resolved
taipy/gui/gui.py Outdated Show resolved Hide resolved
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.

👌

taipy/gui/builder/_element.py Show resolved Hide resolved
@FredLL-Avaiga FredLL-Avaiga merged commit e656520 into develop Sep 26, 2024
128 checks passed
@FredLL-Avaiga FredLL-Avaiga deleted the bug/#1832-manage-lambdas branch September 26, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gui: Back-End 💥Malfunction Addresses an identified problem. 🟥 Priority: Critical Must be addressed as soon as possible 📝Release Notes Impacts the Release Notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexed style in tables don't apply when defined as a lambda function (Markdown format)
4 participants