Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
13.38k stars 1.42k forks source link

Demonstrate dynamic content in an AgGrid control #451

Open FabienLelaquais opened 1 year ago

FabienLelaquais commented 1 year ago

What would that feature address

We want to expose an AgGrid component through a Taipy control.

A first step is to encapsulate the control and its core API through Taipy 's Extension API. That would include the base features such as columns and rows definition.

A second step is to demonstrate dynamic content: a little demo for the control would include a table that represents a short list of random values between 0 and an upper bound that is specified in an interactive slider. When the user changes the slider value (from 0 to 100), then we recompute the entire data set, and we expect the table to represent these new values.

Description of the ideal solution

A new public repository is accessible for the public, holding all it takes to build a specific ElementLibrary ("AgGrid") that exposes a control ("table") that provides an access to AgGrid table features through properties.

This would include multi-indexing and dynamic content.

Demonstrating dynamic content

Here is a short piece of code that uses the regular Taipy table:

from taipy import Gui

start = 0
step = 1

def compute_data(start, step):    
    values = [start+i*step/10 for i in range(0, 11)]
    squared = [x*x for x in values]
    third = [x*x*x for x in values]
    return {
        "Values": values,
        "Square": squared,
        "Third": third
    }
data = compute_data(start, step)

def on_change(state, var_name, var_value):
    if var_name == "start" or var_name == "step":
        state.data = compute_data(state.start, state.step)

Gui("""# Dynamic table

<|{data}|table|>

Start: <|{start}|slider|>

Step: <|{step}|slider|min=1|>

""").run()

Changing the slider values recomputes all data and updates the table content.

We want to see a similar behavior, when table is replaced by agGrid.table, with no other change.

Acceptance Criteria

manya706 commented 1 week ago

hey! can i get this?

FabienLelaquais commented 1 week ago

Certainly @manya706! Thank you for your input.

As starting point, you have to clone the repository at https://github.com/Avaiga/taipy-gui-ext-aggrid. This contains the initial extension library implementation, with the AgGrid control encapsulated as a new Taipy GUI element. The documentation for extensions is pretty weak at this point, but we will improve it as you go forward, discover the unknown and ask for help.

Good luck!

manya706 commented 1 week ago

Hi @FabienLelaquais! the repo that you have mentioned is not available. Also do I have to create a new directory named frontend-experiment as there is no such directory present?

quest-bot[bot] commented 4 days ago

New Quest! image New Quest!

A new Quest has been launched in @Avaiga’s repo. Merge a PR that solves this issue to loot the Quest and earn your reward.


Some loot has been stashed in this issue to reward the solver!

🗡 Comment @quest-bot embark to check-in for this Quest and start solving the issue. Other solvers will be notified!

⚔️ When you submit a PR, comment @quest-bot loot #451 to link your PR to this Quest.

Questions? Check out the docs.

manya706 commented 4 days ago

@quest-bot embark

quest-bot[bot] commented 4 days ago

@manya706 has embarked on their Quest. 🗡

Questions? Check out the docs.