diff --git a/docs/manuals/userman/auth/authentication.md b/docs/manuals/userman/auth/authentication.md index bce218b09..24619e3c1 100644 --- a/docs/manuals/userman/auth/authentication.md +++ b/docs/manuals/userman/auth/authentication.md @@ -69,7 +69,7 @@ Taipy Enterprise edition supports three authentication protocols: with the arguments that were provided to `(auth.)login()^`. -Beside their specific parameters, all authenticators have two parameters that you +Besides their specific parameters, all authenticators have two parameters that you can provide in the `Authenticator.__init__^`(`Authenticator` constructor): - *secret_key*: a string that is used to encrypt the user credentials. Because diff --git a/docs/manuals/userman/gui/binding.md b/docs/manuals/userman/gui/binding.md index 039c92515..ef324b17f 100644 --- a/docs/manuals/userman/gui/binding.md +++ b/docs/manuals/userman/gui/binding.md @@ -281,6 +281,32 @@ is defined. Similarly, *state["\_\_main\_\_"].x* always refers to the global *x* variable, defined in the main module. +# Sharing variables across clients + +Your application can share a variable across all the connected users (identified as a new +connection to the application).
+The `State^` object that all callbacks receive holds the value of all the bound variables for a +specific client. If you change that value, it does not impact the other clients' pages. + +However, variables declared in the main module of the Python script can be *shared* among all the +connected users by declaring them as *shared variables*.
+You can call the function `Gui.add_shared_variable()^` to achieve that. When you do +this, modifying the value of `state.` is automatically propagated to every client. + +Another way to achieve the same result is to use: +``` +gui.broadcast_change("", new_value) +``` +instead of +``` +state. = new_value +``` + +Using the `Gui.broadcast_change()^` function propagates a new value for a variable to the states of +every connected user. + +The function `Gui.broadcast_changes()^` acts in a similar manner, for multiple variables and values. + # List of values Some controls (such as [selector](viselements/generic/selector.md) or diff --git a/docs/manuals/userman/gui/styling/index.md b/docs/manuals/userman/gui/styling/index.md index 6cf124b79..35ccfe06e 100644 --- a/docs/manuals/userman/gui/styling/index.md +++ b/docs/manuals/userman/gui/styling/index.md @@ -18,15 +18,21 @@ There are two ways you can apply a stylesheet to your application: - Global style sheet.
The *css_file* parameter of the `Gui.__init__^`(`Gui` constructor) lets you specify a CSS file - that your application will use for every page. The default value for this parameter is a file - located next to your main Python script, with the same name except for the extension that must be - '.css'. + that your application will use for every page.
+ The default value for this parameter is a file located next to your main Python script, with the + same name except for the extension that must be '.css'.
+ If such a file does not exist, Taipy GUI will search for a file called `taipy.css` and load it + if it exists. This mechanism allows sharing the same stylesheet across all Taipy GUI applications + whose main script sits in the same directory.
+ If you need to apply styles for a specific application but want to benefit from the shared styles + defined in `taipy.css`, you can add the directive `@import url("taipy.css");` to your + application-specific CSS file. - Page-specific style.
The method `Gui.add_page()^` has a *style* parameter that can be set to CSS content. This additional style is applied to the page and **only** this page. -Beside explicit style sheets, you can also modify the global theme, as +Besides explicit style sheets, you can also modify the global theme, as described in the [section on Themes](#themes). # Applying style diff --git a/docs/manuals/userman/gui/viselements/generic/chat-calculator-d.png b/docs/manuals/userman/gui/viselements/generic/chat-calculator-d.png new file mode 100644 index 000000000..7d3b62c62 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-calculator-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-calculator-l.png b/docs/manuals/userman/gui/viselements/generic/chat-calculator-l.png new file mode 100644 index 000000000..b6500930f Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-calculator-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-d.png b/docs/manuals/userman/gui/viselements/generic/chat-d.png new file mode 100644 index 000000000..851ae9e49 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-dh.png b/docs/manuals/userman/gui/viselements/generic/chat-dh.png new file mode 100644 index 000000000..099d1474c Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-dh.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-1-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-1-d.png new file mode 100644 index 000000000..49bf4e4c0 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-1-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-1-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-1-l.png new file mode 100644 index 000000000..98061b019 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-1-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-2-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-2-d.png new file mode 100644 index 000000000..65af84715 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-2-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-2-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-2-l.png new file mode 100644 index 000000000..2ae677e84 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-2-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-3-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-3-d.png new file mode 100644 index 000000000..def069cbe Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-3-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-3-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-3-l.png new file mode 100644 index 000000000..5f94fba75 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-3-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-4-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-4-d.png new file mode 100644 index 000000000..f53bb947e Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-4-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-4-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-4-l.png new file mode 100644 index 000000000..b1c8a31be Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-a-4-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-1-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-1-d.png new file mode 100644 index 000000000..322c9590a Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-1-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-1-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-1-l.png new file mode 100644 index 000000000..074d350fd Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-1-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-2-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-2-d.png new file mode 100644 index 000000000..3801f066a Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-2-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-2-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-2-l.png new file mode 100644 index 000000000..f5489ee34 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-2-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-3-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-3-d.png new file mode 100644 index 000000000..f832b36d3 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-3-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-3-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-3-l.png new file mode 100644 index 000000000..015a1a25c Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-b-3-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-c-1-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-c-1-d.png new file mode 100644 index 000000000..b698ddd5b Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-c-1-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-c-1-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-c-1-l.png new file mode 100644 index 000000000..aaa3f021e Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-discuss-c-1-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-a-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-a-d.png new file mode 100644 index 000000000..e58716f33 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-a-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-a-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-a-l.png new file mode 100644 index 000000000..b8f735f8e Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-a-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-b-d.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-b-d.png new file mode 100644 index 000000000..12d839b67 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-b-d.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-b-l.png b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-b-l.png new file mode 100644 index 000000000..e0b4d3948 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-discuss-register-b-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-l.png b/docs/manuals/userman/gui/viselements/generic/chat-l.png new file mode 100644 index 000000000..b65ef7947 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-l.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat-lh.png b/docs/manuals/userman/gui/viselements/generic/chat-lh.png new file mode 100644 index 000000000..d697737f2 Binary files /dev/null and b/docs/manuals/userman/gui/viselements/generic/chat-lh.png differ diff --git a/docs/manuals/userman/gui/viselements/generic/chat.md_template b/docs/manuals/userman/gui/viselements/generic/chat.md_template index 0f8980ee7..18c2ab0c4 100644 --- a/docs/manuals/userman/gui/viselements/generic/chat.md_template +++ b/docs/manuals/userman/gui/viselements/generic/chat.md_template @@ -1,8 +1,39 @@ A control that provides the user interface for chatting. +The control represents the chat area that can be used in a messaging application that allows users +to send and receive messages. + +The control has two main components: + +- A list of messages.
+ For any given user connected to the application, messages this user sends appear in a bubble + aligned to the right. Other messages are aligned to the left and show the identifier of the + sender and the sender's avatar image if one was defined. +- A message input box.
+ Located at the bottom of the message list, this input field allows users to type and send + messages. + # Details -TODO +Three mandatory properties can configure the `chat` control: + +- [*users*](#p-users) defines the list of users that can send or receive messages using the + control.
+ This property value can be as simple as a list of user identifiers or a list of `Icon^` objects + that can associate an avatar image with a user. +- [*sender_id*](#p-sender_id) indicates the identifier of user that is sending messages.
+ This identifier must appear in the [*users*](#p-users) list.
+ Messages whose sender identifier (see below) is equal to this property's value appear on the right + side of the message list; the other messages appear on the left side of the control. +- [*messages*](#p-messages) is a list of message records.
+ Each message record must a tuple or a list that must have three elements: + + - Element 0: an identifier for the message.
+ That can be any string that uniquely identifies a specific message. + - Element 1: the message content.
+ The string that is represented in a message bubble. + - Element 2: the identifier of the sender.
+ This identifier must appear in the [*users*](#p-users) list. # Styling @@ -11,4 +42,277 @@ name to select the date selectors on your page and apply style. # Usage -TODO +## Human-to-machine dialog {data-source="gui:doc/examples/controls/chat-calculator.py"} + +A simple use case where the `chat` control is relevant is if you want to create an application where +a user can type and send text messages that are processed by some engine, whose role is to generate +messages back for the user to read.
+Typical examples of such interactive applications are based on +[Large Language Models](https://en.wikipedia.org/wiki/Large_language_model) (LLMs) that can process +incoming messages written in natural language, interpret the text, and generate responses. Such +applications are known as digital assistants. There are several famous examples of these, such as +[ChatGPT](https://openai.com/index/chatgpt/), +[Microsoft Copilot](https://www.microsoft.com/fr-fr/microsoft-copilot), and +[Google Gemini](https://gemini.google.com/), among others. + +In this example, we will use the `chat` control in a similar manner, in a simpler context: a +calculator.
+The end user is invited to provide a mathematical expression. The application computes the +evaluation of that expression (presumed to be a valid Python expression) and displays the result. + +Let's start by defining the main variables that the `chat` control relies on: +```python +users = ["human", "Result"] +messages: list[tuple[str, str, str]] = [] +``` + +*users* holds the identifier of the two interlocutors for this application: "human" (*users[0]*) is +to identifier the end user, "Result" is the identifier we use to represent the computer: this string +is displayed above messages generated by the application.
+*messages* stores all the created messages. + +The control definition is the following: +!!! taipy-element + default={messages} + users={users} + sender_id={users[0]} + on_action=evaluate + +*messages* and *users* are bound to their respective properties and the [*sender_id*](#p-sender_id) +property is set to the first user identifier in *users*. + +The *on_action* property is set to the *evaluate()* callback function whose code is the following: +```python linenums="1" +def evaluate(state, var_name: str, payload: dict): + (_, _, expression, sender_id) = payload.get("args", []) + messages.append((f"{len(messages)}", expression, sender_id)) + result = "Invalid expression" + try: + result = f"= {eval(expression)}" + except Exception: + pass + messages.append((f"{len(messages)}", result, users[1])) + state.messages = messages +``` + +Line 2 retrieves the callback parameters from the payload.
+The variable *expression* saves the expression provided by the user and *sender_id* keeps the +identifier of the user that sent this message. + +Line 3 adds a new message to the `chat` control message list, copying the expression text and +indicating who the sender is, so the message appears on the right side of the control.
+Note how we generate the message identifier: each added message enlarges the message list, so we +simply use the length of the message list as the message identifier. This value increments every +time a new message gets in. + +Line 6 evaluates the expression. If this call raises an exception, the application sets the response +message to a string indicating an error has occurred.
+When the evaluation succeeds, we create a response made of an equal sign followed by the result. + +Finally, on line 9, we store the evaluation's result in a new message, indicating it was sent by the +application (so it appears on the left side of the control). + +Line 10 updates the user's *state* so the control is updated. + +After the user has submitted a few expressions to evaluate, the control displays something like +this: +
+ + +
A Taipy calculator
+
+ +## Multi-user chatting {data-source="gui:doc/examples/controls/chat-discuss.py"} + +You can also use the `chat` control in another situation: when you want to develop an application +that allows several users to share the same chatting space.
+Here is how you can create such an application using Taipy GUI. + +

General setup

+ +The application has two pages: + +- The first page (called "register") allows users to register for the chatting application. +- The second page (called "discuss") shows all the messages exchanged in a `chat` control. You can + consider this page as showing a *channel* in a chat application: several users can send and read + messages in a community. + +Let's describe this first page.
+The definition of the page is the following: +```python +username = "" + +register_page = """ +Please enter your user name: + +<|{username}|input|> + +<|Submit|button|on_action=register|> +""" +``` + +It holds an input field bound to the variable *username*.
+ +Here is how this page looks like when the user Alice has entered her name: +
+ + +
Alice is about to register
+
+ +The control's `on_action` callback property is set so that the callback function *register()* is +invoked when the "Submit" button is pressed.
+Here is the code of this function: +```python linenums="1" +users: list[str|Icon] = [] + +def register(state): + for user in users: + if state.username == user or (isinstance(user, (list, tuple)) and state.username == user[0]): + notify(state, "error", "User already registered.") + return + avatar_image_file = f"{state.username.lower()}-avatar.png" + if path.isfile(avatar_image_file): + users.append((state.username, Icon(avatar_image_file, state.username))) + else: + users.append(state.username) + state.users = users + navigate(state, "discuss") +``` + +In lines 4 to 7, we test whether that user name is one of the names stored in the *users* list and +reject the registration if it is. + +In lines 8 to 12, we add this user name to the *users* list.
+If we can find an avatar image for that user (a file called "<username>-avatar.png" located next +to the Python script), then we create an `Icon^` instance to represent the user avatar. + +Line 13 updates the variable *users* for the user's state.
+And on line 14, we navigate to the "discuss" page so the user can read and send messages. + +Here is the code that defines the "discuss" page: +```python +messages: list[tuple[str, str, str]] = [] + +discuss_page = """ +<|### Let's discuss, {username}|text|mode=markdown|> + +<|{messages}|chat|users={users}|sender_id={username}|on_action=send|> +""" +``` + +This page creates a `chat` control that binds its default property ([*messages*](#p-messages_id)) to +the variable *messages* that is initialized to an empty list.
+The variables *users* and *username* are bound as expected. + +Note that because this application has two pages, you must create the `Gui^` instance with the +*pages* parameter set to a dictionary that holds those pages.
+Here is the code that initializes and runs the Taipy GUI application: +```python +pages = {"register": register_page, "discuss": discuss_page} +gui = Gui(pages=pages).run() +``` + +After the registration, this is the page that Alice will see: +
+ + +
The chatting area for Alice
+
+ +We now need to implement the callback function *send()*, which is set to the *on_action* property +of the chat control.
+Here is the code for this function: +```python linenums="1" +def send(state, _: str, payload: dict): + (_, _, message, sender_id) = payload.get("args", []) + messages.append((f"{len(messages)}", message, sender_id)) + state.messages = messages +``` + +Like in the calculator example above, we retrieve the callback parameters on line 2 and +add a new message (on line 3) using the message index as its identifier.
+The state's variable *messages* is updated on line 4. + +

Multi-user considerations

+ +We want several users to connect to this application and share the messages and the user list +we created.
+To make that happen, you can use the function `Gui.add_shared_variable()^` to ensure that both +*messages* and *users* have the same value for every connected user.
+Let's do that for our use case: +```python +Gui.add_shared_variables("messages", "users") +``` +After that function is invoked, every time any user modifies *messages* or *users*, the impact is +propagated to all the connected users. + +Let's pretend that a new user, Beatrix, connects to the application.
+Here is the registration page as this user sees it: +
+ + +
Beatrix registers
+
+ +When Beatrix presses the "Submit" button, the *register()* callback function is invoked.
+Because *users* is a *shared variable*, every client, including Alice, is aware of this new +registration: their state's *users* variable is updated accordingly and automatically. + +Imagine that Alice enters the following message: +
+ + +
Alice sends a message
+
+ +When Alices pressed the send button, she can see the updated `chat` control: +
+ + +
Alice has sent a message
+
+The message sent appears in a right-aligned bubble, indicating that the current user, Alice, was +the one who sent this message. + +Because both *users* and *messages* are shared among all connected clients, Beatrix will see +the following page: +
+ + +
Beatrix can see Alice's message
+
+As expected, messages coming from Alice appear on the left side of Beatrix's page.
+Also, because Alice has an avatar image, this image appears next to the messages she sent. + +Here are the pages that Alice and Beatrix can see when they start sending messages to each other: +
+ + +
What Alice sees
+
+
+ + +
What Beatrix sees
+
+ +Now, let's imagine that another user, Charles, joins the discussion. The three connected users can +send messages to the group, sharing the bound variables *users* and *messages* so that their `chat` +controls all represent the same content, with a different layout depending on who sent messages. + +
+ + +
Alice's screen
+
+
+ + +
Beatrix's screen
+
+
+ + +
Charles's screen
+
diff --git a/docs/manuals/userman/gui/viselements/generic/table.md_template b/docs/manuals/userman/gui/viselements/generic/table.md_template index 0b0467070..5248ead34 100644 --- a/docs/manuals/userman/gui/viselements/generic/table.md_template +++ b/docs/manuals/userman/gui/viselements/generic/table.md_template @@ -684,7 +684,7 @@ numerical or date values: [`date-fns.format()`](https://date-fns.org/docs/format) function. In some situations, you need each column to be represented with a dedicated format definition.
-When this happens, you can use the dictionary version of the [*columns*](#columns) property to +When this happens, you can use the dictionary version of the [*columns*](#p-columns) property to indicate the format to apply to each column, as described [above](#formatting-numbers-in-specific-columns). @@ -730,7 +730,7 @@ columns = { We can use this dictionary in the table definition: !!! taipy-element default={data} - columns=columns={columns} + columns={columns} The resulting display reflects what is requested:
@@ -741,7 +741,9 @@ The resulting display reflects what is requested: ## Styling rows -To give a specific style to a table row, you will use the [*style*](#p-style) property.
+To give a specific style to a table row, you will use the [*style*](#p-style) property (note that +you can find general instructions on how to apply style to visual elements in +[this page](../../styling.md)).
This property holds a function that is invoked when each row is rendered, and it must return the name of a style, defined in CSS. @@ -791,7 +793,6 @@ The resulting display will be what we expected: Note that the styling function is so simple that we could have made it a lambda, directly in the control definition: - !!! example "Alternative definition" === "Markdown" ``` @@ -836,8 +837,7 @@ Here is the related CSS content: } ``` -To apply the style to a specific column, we need to specify the column in the style property. - +To apply the style to a specific column, we need to specify the column in the style property: !!! taipy-element default={data} style[y1]:f=even_odd_style @@ -869,6 +869,7 @@ perform this aggregation. The value of this property, which is a string, can be: This function receives a single parameter which is the series to aggregate, and it must return a scalar value that would result from the aggregation. +This control definition is all it takes to add aggregation functionality to the table: !!! taipy-element default={data} group_by[Group column]:b=True diff --git a/docs/manuals/userman/gui/viselements/index.md_template b/docs/manuals/userman/gui/viselements/index.md_template index 8f01321fe..7a2d4ccef 100644 --- a/docs/manuals/userman/gui/viselements/index.md_template +++ b/docs/manuals/userman/gui/viselements/index.md_template @@ -10,7 +10,7 @@ There are two types of *Visual Elements*: Some controls dedicated to scenario and data management are available in the [Scenario Management controls](#scenario-and-data-management-controls) section. - - *Blocks* are listed in the [Block Elements](#blocks-controls) section. + - *Blocks* are listed in the [Block Elements](#block-elements) section. They let you organize controls (or blocks) in pages to provide the best possible user experience. diff --git a/docs/release-notes/index.md b/docs/release-notes/index.md index b4315dfe6..dac7035a8 100644 --- a/docs/release-notes/index.md +++ b/docs/release-notes/index.md @@ -12,32 +12,36 @@ This is the list of changes to Taipy releases as they were published. !!! note "Legacy Releases" This page shows the changes made in the most recent major release of Taipy.
- If you are using a legacy version (pre-3.0), please refer to the + If you are using a legacy version (pre-4.0), please refer to the [Legacy Release Notes](legacy.md) page. Note that we support the latest major version and the one before that. Because we have - released Taipy 3.0, support and documentation for Taipy 1.x are disrupted. + released Taipy 4.0, support and documentation for Taipy versions older than 3.0 are disrupted. -# Community edition: 3.2 +# Community edition: 4.0 (Work in progress - the following links are invalid for the time being) -[`taipy` 3.2](https://pypi.org/project/taipy/3.2.0/) contains the latest -[`taipy-config` 3.2](https://pypi.org/project/taipy-config/3.2.0/), -[`taipy-gui` 3.2](https://pypi.org/project/taipy-gui/3.2.0/), -[`taipy-core` 3.2](https://pypi.org/project/taipy-core/3.2.0/), -[`taipy-templates` 3.2](https://pypi.org/project/taipy-templates/3.2.0/), and -[`taipy-rest` 3.2](https://pypi.org/project/taipy-rest/3.2.0/) packages. +[`taipy` 4.0](https://pypi.org/project/taipy/4.0.0/) contains the latest +[`taipy-config` 4.0](https://pypi.org/project/taipy-config/4.0.0/), +[`taipy-gui` 4.0](https://pypi.org/project/taipy-gui/4.0.0/), +[`taipy-core` 4.0](https://pypi.org/project/taipy-core/4.0.0/), +[`taipy-templates` 4.0](https://pypi.org/project/taipy-templates/4.0.0/), and +[`taipy-rest` 4.0](https://pypi.org/project/taipy-rest/4.0.0/) packages. ## New Features -

taipy 3.2.0

+

taipy 4.0.0

-

taipy-gui 3.2.0

+

taipy-gui 4.0.0

-

taipy-core 3.2.0

+- A new control called [`chat`](../manuals/userman/gui/viselements/generic/chat.md) was added + to simplify the creation of chatting application. -- The `taipy.get_scenarios()` and `taipy.get_primary_scenarios()^` methods now accept optional parameters to: +

taipy-core 4.0.0

+ +- The `taipy.get_scenarios()` and `taipy.get_primary_scenarios()^` methods now accept optional + parameters to: - sort the output list of scenarios by name, id, creation date, or tag - filter the output list of scenarios that are created in a specific time range.
@@ -45,18 +49,33 @@ This is the list of changes to Taipy releases as they were published. [Get all scenarios](../manuals/userman/sdm/scenario/index.md#get-all-scenarios) and [Get primary scenarios](../manuals/userman/sdm/scenario/index.md#get-primary-scenarios). -

taipy-templates 3.2.0

+

taipy-templates 4.0.0

-- Creating a new application using any template now also support initializing the application as a +- Creating a new application using any template now also supports initializing the application as a Git repository. ## Improvements and changes -

taipy 3.2.0

+

taipy 4.0.0

+ +

taipy-gui 4.0.0

-

taipy-gui 3.2.0

+- Setting up styling: if a file called `taipy.css` sits next to the Python script (`.py`) that + runs a Taipy GUI application, and if there is no file called `.css` at the same location, + then this CSS file is loaded and applied to all pages. This feature allows you to share styles + across different Taipy GUI applications.
+ See the [Styling section](../manuals/userman/gui/styling/index.md#style-sheets) for more + information.
+ See [issue #1597](https://github.com/Avaiga/taipy/issues/1597) for a description of this + functionality. +- In the [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control, the Modebar (that + appears when the cart is hovered on) no longer has the Plotly logo button by default. + You can bring it back by setting the chart's + [*plot_config* property](../manuals/userman/gui/viselements/generic/chart.md#p-plot_config) + to a dictionary with a property called "displaylogo" set to True.
+ See [issue #1600](https://github.com/Avaiga/taipy/issues/1600). -

taipy-core 3.2.0

+

taipy-core 4.0.0

- In standalone job execution mode, the default value of *max_nb_of_workers* is now 2 instead of 1. For more information, please refer to @@ -64,372 +83,44 @@ This is the list of changes to Taipy releases as they were published. - When using the Taipy command-line interface, if an unsupported argument is provided, the CLI will display a message indicating the invalid argument. If the invalid argument is possibly a typo, the CLI will suggest the closest valid argument. -- The `Scenario.export()` and `taipy.export_scenario()` have been transfered from the Community edition - to the Enterprise edition as it is more suitable for enterprise applications. -- Removed support for SQL repository. Taipy community edition now only supports the `filesystem` repository type. +- The `Scenario.export()` and `taipy.export_scenario()` have been transfered from the Community + edition to the Enterprise edition as it is more suitable for enterprise applications. +- Removed support for SQL repository. Taipy community edition now only supports the `filesystem` + repository type. -

taipy-templates 3.2.0

+

taipy-templates 4.0.0

- The *--template* option of the `taipy create` command is now renamed to *--application* option to correctly reflect the application template to use when creating a new Taipy application. ## Significant bug fixes -

taipy-gui 3.2.0

+

taipy-gui 4.0.0

-

taipy-core 3.2.0

+

taipy-core 4.0.0

- `DataNode.is_up_to_date^` raises an error when the data node has never been written.
See [issue #1198](https://github.com/Avaiga/taipy/issues/1198). -# Enterprise edition: 3.2 +# Enterprise edition: 4.0 (Work in progress - the following link is invalid for the time being) -This release contains all of [`taipy` 3.2](https://pypi.org/project/taipy/3.2.0) as well as +This release contains all of [`taipy` 4.0](https://pypi.org/project/taipy/4.0.0) as well as additional features. ## New Features -- The `taipy.export_scenario()^` method now supports exporting file-based data nodes' data to the export folder - if the path exists. -- The `taipy.export_scenario()^` method now export a zip archive instead of a - folder. For more information, please refer to [Export a scenario](../manuals/userman/sdm/scenario/index.md#export-a-scenario). -- The `taipy.export_scenario()^` method now raise the `ExportPathAlreadyExists^` - exception if the export path already exists. You can explicitly set the `overwrite` parameter to True to - overwrite the existing export path. For more information, please refer to +- The `taipy.export_scenario()^` method now supports exporting file-based data nodes' data to the + export folder if the path exists. +- The `taipy.export_scenario()^` method now exports a zip archive instead of a + folder. For more information, please refer to [Export a scenario](../manuals/userman/sdm/scenario/index.md#export-a-scenario). -- The new `taipy.import_scenario()^` method can be used to import a scenario from an exported archive. For more - information, please refer to [Import a scenario](../manuals/userman/sdm/scenario/index.md#import-a-scenario). +- The `taipy.export_scenario()^` method now raises the `ExportPathAlreadyExists^` + exception if the export path already exists. You can explicitly set the *overwrite* parameter to + True to overwrite the existing export path. For more information, please refer to + [Export a scenario](../manuals/userman/sdm/scenario/index.md#export-a-scenario). +- The new `taipy.import_scenario()^` method can be used to import a scenario from an exported + archive. For more information, please refer to + [Import a scenario](../manuals/userman/sdm/scenario/index.md#import-a-scenario). - The default application template now supports authentication and authorization features. - -# Community edition: 3.1 - -Published on 2024-03. - -[`taipy` 3.1](https://pypi.org/project/taipy/3.1.1/) contains the latest -[`taipy-config` 3.1](https://pypi.org/project/taipy-config/3.1.1/), -[`taipy-gui` 3.1](https://pypi.org/project/taipy-gui/3.1.1/), -[`taipy-core` 3.1](https://pypi.org/project/taipy-core/3.1.1/), -[`taipy-templates` 3.1](https://pypi.org/project/taipy-templates/3.1.1/), and -[`taipy-rest` 3.1](https://pypi.org/project/taipy-rest/3.1.1/) packages. - - -## New Features - -

taipy 3.1.0

- -- Taipy and all its dependencies now support Python 3.12.
- See [Python documentation](https://docs.python.org/3/whatsnew/3.12.html) for details. - -

taipy-gui 3.1.0

- -- The [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control has a new property called *figure* that - expects an instance of `plotly.graph_objects.Figure`. This class is provided by the -[Plotly Open Source Graphing Library for Python](https://plotly.com/python/) so you can create - all sorts of graphs in Python.
- See the [`figure` property](../manuals/userman/gui/viselements/generic/chart.md#p-figure) of the `chart` control and - the [section on the *figure* property](../manuals/userman/gui/viselements/generic/chart.md#the-figure-property) for - more information. -- The [`part`](../manuals/userman/gui/viselements/generic/part.md) block has a new property called *content* that - lets developers integrate any third-party library that can generate HTML.
- See the documentation for the [`part`](../manuals/userman/gui/viselements/generic/part.md) block and the examples - using *content providers* for more information. -- A new control called [`date_range`](../manuals/userman/gui/viselements/generic/date_range.md) is available if - you need to represent and edit date ranges in your application pages. -- A new control called [`login`](../manuals/userman/gui/viselements/generic/login.md) is available if you need users - to authenticate in your application. - -

taipy-core 3.1.0

- -- The `DataNode.filter()^` method and the indexing/filtering style now also support filtering a - Numpy array, a list of objects, and a list of dictionaries.
- For more information, please refer to - [Filter a data node](../manuals/userman/data-integration/data-node-usage.md#filter). -- You can now append new data to a data node using the `DataNode.append()^` method. The method is - available for `CSVDataNode`, `ExcelDataNode`, `JSONDataNode`, `ParquetDataNode`, `SQLDataNode`, - `SQLTableDataNode`, and `MongoCollectionDataNode`.
- For more information, please refer to - [Append a data node](../manuals/userman/data-integration/data-node-usage.md#append). -- A new class called `Submission^` holds meta-data (such as its status or - submission date) related to a submitted entity: `Scenario^`, `Sequence^`, and/or `Task^`.
- The function `taipy.get_latest_submission()^` returns the last submission of a given entity.
- For more information, please refer to - [Submission](../manuals/userman/sdm/submission/index.md). -- `taipy.submit()^`, `Scenario.submit()^`, `Sequence.submit()^`, and `Task.submit()^` now return a - `Submission^` entity. -- A new predefined data node named `S3ObjectDataNode^` has been implemented.
- For more information, please refer to - [S3ObjectDataNode](../manuals/userman/data-integration/data-node-config.md#amazon-web-service-s3-object). - -## Improvements and changes - -

taipy 3.1.0

- -- Task nodes in the [`scenario_dag`](../manuals/userman/gui/viselements/corelements/scenario_dag.md) control dynamically - reflect the status of related jobs for the user that submitted scenarios or sequences. -- The [`scenario`](../manuals/userman/gui/viselements/corelements/scenario.md) control lets you add, modify, and edit - sequences. -- The [`data_node`](../manuals/userman/gui/viselements/corelements/data_node.md) control can now represent collections. - -

taipy-gui 3.1.0

- -- The [`table`](../manuals/userman/gui/viselements/generic/table.md) control supports enumerated values. That allows - for a better user experience when users edit cell values.
- See the - [section on enumerated values in tables](../manuals/userman/gui/viselements/generic/table.md#enumerated-values) for - the details. -- The [`toggle`](../manuals/userman/gui/viselements/generic/toggle.md) control appears as a switch button if its - [*value*](../manuals/userman/gui/viselements/generic/toggle.md#p-value) property holds a Boolean value. - -

taipy-core 3.1.0

- -- The `modin` exposed type as been deprecated. When used, a fallback on Pandas is applied.
- See [issue #631](https://github.com/Avaiga/taipy/issues/631) for details. -- Running twice the Core service raises an exception to prevent running multiple instances - at the same time. -- Running the Core service or creating an entity by `taipy.create_scenario()` or - `taipy.create_global_data_node()` blocks the Configuration from being modified. - -## Significant bug fixes - -

taipy

- -
3.1.1
- -- Data is not shown or not automatically refreshed in - [Data Node viewer](../manuals/userman/gui/viselements/corelements/data_node.md).
- See [issue #908](https://github.com/Avaiga/taipy/issues/908) and - [issue #950](https://github.com/Avaiga/taipy/issues/950). -- Data Nodes holding dates may not show in - [Data Node viewers](../manuals/userman/gui/viselements/corelements/data_node.md).
- See [issue #1043](https://github.com/Avaiga/taipy/issues/1043). - -

taipy-gui

- -
3.1.0
- -- Selectors with dropdown menus cannot be deactivated.
- See [issue #894](https://github.com/Avaiga/taipy/issues/894). -- Problems scoping non-global variables used in Partials.
- See [issue #561](https://github.com/Avaiga/taipy/issues/561). -- Important error messages are mangled.
- See [issue #560](https://github.com/Avaiga/taipy/issues/560). - -

taipy-core

- -
3.1.1
- -- The signatures for `Config.configure_sql_data_node()`, `Config.configure_s3_object_data_node()`, and - `configure_core()` methods are out-of-date.
- See [issue #1014](https://github.com/Avaiga/taipy/issues/1014). - -# Enterprise edition: 3.1 - -Published on 2024-03. - -This release contains all of [`taipy` 3.1](https://pypi.org/project/taipy/3.1.0) as well as -additional features. - -## New Features - -- A new job execution mode named *cluster mode* is available. It enables to run the jobs - on a cluster of dedicated machines in a remote, distributed and scalable environment. - -# Community edition: 3.0 - -Published on 2023-10. - -!!! warning Error([#1180](https://github.com/Avaiga/taipy/issues/1180)) when downgrading from Taipy 3.1 to Taipy 3.0 - - If you are experiencing an error downgrading to Taipy 3.0, please - reinstall Taipy with options `--no-cache-dir -I` like so: - `pip install --no-cache-dir -I taipy==3.0.0` - -## New Features - -

taipy 3.0.0

- -- Taipy application can now be run with the Taipy command-line interface (CLI) using the - `taipy run` command. For more information, refer to - [Run application in Taipy CLI](../manuals/cli/run.md). - -

taipy-gui 3.0.0

- -- A new package holds the [*Page Builder API*](../manuals/userman/gui/pages/builder.md): a set of classes that - let you define the pages for your application entirely with Python. -- You can now update variables on all clients using the *shared variables* concept. See - the `Gui.add_shared_variable()^` and `State.dispatch()^` methods for details. -- You can now invoke a callback for all clients using the `broadcast_callback()^` function. -- The [`slider`](../manuals/userman/gui/viselements/generic/slider.md) control can now handle several knobs, - allowing for range selection.
- Please check the [example](../manuals/userman/gui/viselements/generic/slider.md#multi-selection) for more - information. -- The [`file_download`](../manuals/userman/gui/viselements/generic/file_download.md) control now lets developers - generate the file content dynamically, at download time.
- Please check the [example](../manuals/userman/gui/viselements/generic/file_download.md#dynamic-content) for more information. -- A new CSS class called *toggle-navbar* was added to the - [Stylekit](../manuals/userman/gui/styling/stylekit.md) to give a - [`toggle`](../manuals/userman/gui/viselements/generic/toggle.md) control the aspect of a - [`navbar`](../manuals/userman/gui/viselements/generic/navbar.md). -- The [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control now supports the - [*treemap*](../manuals/userman/gui/viselements/generic/charts/treemap.md) and - [*waterfall*](../manuals/userman/gui/viselements/generic/charts/waterfall.md) chart types. - -

taipy-core 3.0.0

- -- A production version of a Taipy application can now be provided with **migration functions** to - automatically migrate entities and keep them compatible with previous versions.
- For more information, refer to [Production mode](../manuals/userman/versioning/production_mode.md). -- A `GLOBAL` scope data node can be created from a data node configuration calling - the new `taipy.create_global_data_node()^` method.
- For more information, refer to - [Create a data node](../manuals/userman/data-integration/data-node-usage.md#create-a-data-node). -- A data node configuration can be built from an existing data node configuration. - For more information, refer to the documentation page on - [data node configuration](../manuals/userman/data-integration/data-node-config.md#configure-a-data-node-from-another-configuration). -- A new class `Submittable^` models entities that can be submitted for execution. - It is an Abstract class instantiated by `Scenario^` and `Sequence^`. - It can be handy to use the new following `Submittable^` methods: - * `Submittable.get_inputs()^` retrieves input data nodes of a `Submittable` entity; - * `Submittable.get_outputs()^` retrieves output data nodes of a `Submittable` entity; - * `Submittable.get_intermediate()^` retrieves intermediate data nodes of a `Submittable` - entity; - * `Submittable.is_ready_to_run()^` checks if an entity is ready to be run; - * `Submittable.data_nodes_being_edited()^` retrieves data nodes that are being edited - of a `Submittable^` entity. -- New functions exposed by the `taipy` module: - * `taipy.is_deletable()^` checks if an entity can be deleted; - * `taipy.exists()^` checks if an entity exists. -- The encoding type of CSVDataNode and JSONDataNode can now be configured using the - *encoding* parameter. For more information, please refer to - [Configure a CSVDataNode](../manuals/userman/data-integration/data-node-config.md#csv) - and [Configure a JSONDataNode](../manuals/userman/data-integration/data-node-config.md#json) - sections. - -

taipy-template 3.0.0

- -- A new template named "scenario-management" is available. For more information on creating - a new Taipy application with the new "scenario-management" template, refer to the - documentation page on [templates](../manuals/cli/create.md#from-a-specific-template). - -## Improvements and changes - -

taipy-gui 3.0.0

- -- :warning: The *action* parameter of the `on_action` callback was removed for every control.
- The signature of all *on_action()* callback functions are now unified to the following: - - *state* (`State^`): the state of the client invoking that callback; - - *id* (str): the identifier of the visual element that triggers that callback; - - *payload* (dict): a dictionary that provides additional information to the callback.
- This dictionary now has the additional *action* key that is set to the action name. - This change not only impact the *on_action* callback of all controls that support it, - but in an exactly similar manner the following callback signatures: - - *on_range_change* in the [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control; - - *on_edit*, *on_add*, and *on_delete* in the [`table`](../manuals/userman/gui/viselements/generic/table.md) - control; - - *on_close* in the [`pane`](../manuals/userman/gui/viselements/generic/pane.md) block. -- The `navigate()^` function has an additional parameter *params* that is used to add query - parameters to the requested URL. The query parameters can be retrieved in the `on_navigate` - callback. -- The *on_action* parameter of the `download()^` function can be a function and not just a function - name. -- Setting the *debug* parameter of `Gui.run()^` to True provides stack traces to be shown in the - console when exceptions occur in user code. - -

taipy-core 3.0.0

- -- :warning: A `ScenarioConfig^` graph is now created directly from `TaskConfig^` and - `DataNodeConfig^`. Consequently, `PipelineConfig` has been removed. For more - information, refer to [Configure a scenario](../manuals/userman/sdm/scenario/scenario-config.md). -- :warning: The `Pipeline` object has been removed and replaced by `Sequence^`. A sequence is - held by a `Scenario^` and represents a subset of its tasks than can be submitted - together independently of the other tasks of the scenario. For more information, - refer to `Scenario.add_sequence()^` and `Scenario.remove_sequence()^`. -- `Scope.PIPELINE` has been removed from possible `Scope^` values. -- The `root_folder`, `storage_folder`, `read_entity_retry`, `repository_type`, and - `repository_properties` attributes of the `GlobalAppConfig^` have been moved to the - `CoreSection^`.
- Please refer to the [Core configuration page](../manuals/userman/configuration/core-config.md) for details. -- The `clean_entities` attribute has been removed from the `CoreSection^`. Correspondingly, the - `--clean-entities` option has been removed from the version management CLI.
- To clean entities of a version, please run your application in development mode, or delete your - version with the `--delete` CLI option. For more information, refer to - [Taipy command-line interface](../manuals/cli/index.md) -- The deprecated `nb_of_workers` attribute of the JobConfig has been removed. -- The deprecated `parent_id` attribute of a DataNode, Task, Pipeline, or Scenario entity, has - been removed. -- The deprecated `last_edition_date` and `edition_in_progress` attributes of a DataNode entity - have been removed. -- The deprecated `DataNode.lock_edition()` and `DataNode.unlock_edition()` methods have been - removed. -- The deprecated `taipy.create_pipeline()` method has been removed. -- Function `DataNode.track_edit` has been made public. - -

taipy-template 3.0.0

- -- The default template also supports creating a multi-pages application with Core and Rest - services. These options are available when creating a new application from the template. -- The "multi-page-gui" template has been removed. Please use the default instead to create - a Taipy multi-pages application. - -## Significant bug fixes - -

taipy-gui 3.0.0

- -- The callback function set to the *on_action* parameter of the function `download()^` may - be called too early. It is now ensured to be invoked *after* the download operation is - performed.
- See [issue #916](https://github.com/Avaiga/taipy-gui/issues/916). -- Setting the [*properties*](../manuals/userman/gui/viselements/introduction.md#generic-properties) property of - a visual element as the returned value from a function may not succeed.
- See [issue #897](https://github.com/Avaiga/taipy-gui/issues/897). -- Variables imported by an `import *` directive are not handled properly in the state of - a callback defined in the importing module.
- See [issue #908](https://github.com/Avaiga/taipy-gui/issues/908). -- The [`date`](../manuals/userman/gui/viselements/generic/date.md) control does not use the *format* property if - *with_time* is not set.
- See [issue #909](https://github.com/Avaiga/taipy-gui/issues/909). -- The [`date`](../manuals/userman/gui/viselements/generic/date.md) control uses the `datetime.date` type and does - not apply time zones if time is not involved.
- See [issue #895](https://github.com/Avaiga/taipy-gui/issues/895) and - [issue #923](https://github.com/Avaiga/taipy-gui/issues/923). -- Updating a [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control data may cause data congestion - or display flickering.
- See [issue #864](https://github.com/Avaiga/taipy-gui/issues/864) and - [issue #932](https://github.com/Avaiga/taipy-gui/issues/932). -- Selection in a [`chart`](../manuals/userman/gui/viselements/generic/chart.md) with type *pie* type is not - properly handled.
- See [issue #919](https://github.com/Avaiga/taipy-gui/issues/919). -- Hover text doesn't show properly in a [`selector`](../manuals/userman/gui/viselements/generic/selector.md) that - is crowded.
- See [issue #927](https://github.com/Avaiga/taipy-gui/issues/927). -- Options with a long text in a [`selector`](../manuals/userman/gui/viselements/generic/selector.md) cannot cbe - deselected.
- See [issue #917](https://github.com/Avaiga/taipy-gui/issues/917). -- The [`table`](../manuals/userman/gui/viselements/generic/toggle.md) control does not support undefined date values - from Pandas data frames.
- See [issue #886](https://github.com/Avaiga/taipy-gui/issues/886). - -

taipy-core 3.0.0

- -- When running the Core service in development mode, changing the name of the function used by a - task then running the application again would raise an error.
- See [issue #743](https://github.com/Avaiga/taipy-core/issues/743). - -# Enterprise edition: 3.0 - -Published on 2023-10. - -This release contains all of [`taipy` 3.0](https://pypi.org/project/taipy/3.0.0) as well as -additional features. - -## New Features - -- Python functions including scenario management methods can be scheduled to run at a specific - time using the new `taipy.Scheduler^` API. For more information, refer to - [Schedule a method](../manuals/userman/scheduling/index.md). - -## Improvements and changes - -- The job recovery mechanism is now only available when the Core service is run. diff --git a/docs/release-notes/legacy.md b/docs/release-notes/legacy.md index ab2839b80..ded705e80 100644 --- a/docs/release-notes/legacy.md +++ b/docs/release-notes/legacy.md @@ -11,8 +11,339 @@ The Release Notes for the latest major version of Taipy can be found in Only the current and previous major versions of Taipy are supported. - Therefore, since Taipy 3.0 was shipped, we no longer provide support for Taipy 1.x. We - accordingly removed the documentation for Taipy 1.x from public access. + Therefore, since Taipy 4.0 was shipped, we no longer provide support for Taipy 1.x and 2.x. We + accordingly removed the documentation for the legacy Taipy versions from public access. + +# Community edition: 3.1 + +Published on 2024-03. + +[`taipy` 3.1](https://pypi.org/project/taipy/3.1.1/) contains the latest +[`taipy-config` 3.1](https://pypi.org/project/taipy-config/3.1.1/), +[`taipy-gui` 3.1](https://pypi.org/project/taipy-gui/3.1.1/), +[`taipy-core` 3.1](https://pypi.org/project/taipy-core/3.1.1/), +[`taipy-templates` 3.1](https://pypi.org/project/taipy-templates/3.1.1/), and +[`taipy-rest` 3.1](https://pypi.org/project/taipy-rest/3.1.1/) packages. + + +## New Features + +

taipy 3.1.0

+ +- Taipy and all its dependencies now support Python 3.12.
+ See [Python documentation](https://docs.python.org/3/whatsnew/3.12.html) for details. + +

taipy-gui 3.1.0

+ +- The [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control has a new property called *figure* that + expects an instance of `plotly.graph_objects.Figure`. This class is provided by the +[Plotly Open Source Graphing Library for Python](https://plotly.com/python/) so you can create + all sorts of graphs in Python.
+ See the [`figure` property](../manuals/userman/gui/viselements/generic/chart.md#p-figure) of the `chart` control and + the [section on the *figure* property](../manuals/userman/gui/viselements/generic/chart.md#the-figure-property) for + more information. +- The [`part`](../manuals/userman/gui/viselements/generic/part.md) block has a new property called *content* that + lets developers integrate any third-party library that can generate HTML.
+ See the documentation for the [`part`](../manuals/userman/gui/viselements/generic/part.md) block and the examples + using *content providers* for more information. +- A new control called [`date_range`](../manuals/userman/gui/viselements/generic/date_range.md) is available if + you need to represent and edit date ranges in your application pages. +- A new control called [`login`](../manuals/userman/gui/viselements/generic/login.md) is available if you need users + to authenticate in your application. + +

taipy-core 3.1.0

+ +- The `DataNode.filter()^` method and the indexing/filtering style now also support filtering a + Numpy array, a list of objects, and a list of dictionaries.
+ For more information, please refer to + [Filter a data node](../manuals/userman/data-integration/data-node-usage.md#filter). +- You can now append new data to a data node using the `DataNode.append()^` method. The method is + available for `CSVDataNode`, `ExcelDataNode`, `JSONDataNode`, `ParquetDataNode`, `SQLDataNode`, + `SQLTableDataNode`, and `MongoCollectionDataNode`.
+ For more information, please refer to + [Append a data node](../manuals/userman/data-integration/data-node-usage.md#append). +- A new class called `Submission^` holds meta-data (such as its status or + submission date) related to a submitted entity: `Scenario^`, `Sequence^`, and/or `Task^`.
+ The function `taipy.get_latest_submission()^` returns the last submission of a given entity.
+ For more information, please refer to + [Submission](../manuals/userman/sdm/submission/index.md). +- `taipy.submit()^`, `Scenario.submit()^`, `Sequence.submit()^`, and `Task.submit()^` now return a + `Submission^` entity. +- A new predefined data node named `S3ObjectDataNode^` has been implemented.
+ For more information, please refer to + [S3ObjectDataNode](../manuals/userman/data-integration/data-node-config.md#amazon-web-service-s3-object). + +## Improvements and changes + +

taipy 3.1.0

+ +- Task nodes in the [`scenario_dag`](../manuals/userman/gui/viselements/corelements/scenario_dag.md) control dynamically + reflect the status of related jobs for the user that submitted scenarios or sequences. +- The [`scenario`](../manuals/userman/gui/viselements/corelements/scenario.md) control lets you add, modify, and edit + sequences. +- The [`data_node`](../manuals/userman/gui/viselements/corelements/data_node.md) control can now represent collections. + +

taipy-gui 3.1.0

+ +- The [`table`](../manuals/userman/gui/viselements/generic/table.md) control supports enumerated values. That allows + for a better user experience when users edit cell values.
+ See the + [section on enumerated values in tables](../manuals/userman/gui/viselements/generic/table.md#enumerated-values) for + the details. +- The [`toggle`](../manuals/userman/gui/viselements/generic/toggle.md) control appears as a switch button if its + [*value*](../manuals/userman/gui/viselements/generic/toggle.md#p-value) property holds a Boolean value. + +

taipy-core 3.1.0

+ +- The `modin` exposed type as been deprecated. When used, a fallback on Pandas is applied.
+ See [issue #631](https://github.com/Avaiga/taipy/issues/631) for details. +- Running twice the Core service raises an exception to prevent running multiple instances + at the same time. +- Running the Core service or creating an entity by `taipy.create_scenario()` or + `taipy.create_global_data_node()` blocks the Configuration from being modified. + +## Significant bug fixes + +

taipy

+ +
3.1.1
+ +- Data is not shown or not automatically refreshed in + [Data Node viewer](../manuals/userman/gui/viselements/corelements/data_node.md).
+ See [issue #908](https://github.com/Avaiga/taipy/issues/908) and + [issue #950](https://github.com/Avaiga/taipy/issues/950). +- Data Nodes holding dates may not show in + [Data Node viewers](../manuals/userman/gui/viselements/corelements/data_node.md).
+ See [issue #1043](https://github.com/Avaiga/taipy/issues/1043). + +

taipy-gui

+ +
3.1.0
+ +- Selectors with dropdown menus cannot be deactivated.
+ See [issue #894](https://github.com/Avaiga/taipy/issues/894). +- Problems scoping non-global variables used in Partials.
+ See [issue #561](https://github.com/Avaiga/taipy/issues/561). +- Important error messages are mangled.
+ See [issue #560](https://github.com/Avaiga/taipy/issues/560). + +

taipy-core

+ +
3.1.1
+ +- The signatures for `Config.configure_sql_data_node()`, `Config.configure_s3_object_data_node()`, and + `configure_core()` methods are out-of-date.
+ See [issue #1014](https://github.com/Avaiga/taipy/issues/1014). + +# Enterprise edition: 3.1 + +Published on 2024-03. + +This release contains all of [`taipy` 3.1](https://pypi.org/project/taipy/3.1.0) as well as +additional features. + +## New Features + +- A new job execution mode named *cluster mode* is available. It enables to run the jobs + on a cluster of dedicated machines in a remote, distributed and scalable environment. + +# Community edition: 3.0 + +Published on 2023-10. + +!!! warning Error([#1180](https://github.com/Avaiga/taipy/issues/1180)) when downgrading from Taipy 3.1 to Taipy 3.0 + + If you are experiencing an error downgrading to Taipy 3.0, please + reinstall Taipy with options `--no-cache-dir -I` like so: + `pip install --no-cache-dir -I taipy==3.0.0` + +## New Features + +

taipy 3.0.0

+ +- Taipy application can now be run with the Taipy command-line interface (CLI) using the + `taipy run` command. For more information, refer to + [Run application in Taipy CLI](../manuals/cli/run.md). + +

taipy-gui 3.0.0

+ +- A new package holds the [*Page Builder API*](../manuals/userman/gui/pages/builder.md): a set of classes that + let you define the pages for your application entirely with Python. +- You can now update variables on all clients using the *shared variables* concept. See + the `Gui.add_shared_variable()^` and `State.dispatch()^` methods for details. +- You can now invoke a callback for all clients using the `broadcast_callback()^` function. +- The [`slider`](../manuals/userman/gui/viselements/generic/slider.md) control can now handle several knobs, + allowing for range selection.
+ Please check the [example](../manuals/userman/gui/viselements/generic/slider.md#multi-selection) for more + information. +- The [`file_download`](../manuals/userman/gui/viselements/generic/file_download.md) control now lets developers + generate the file content dynamically, at download time.
+ Please check the [example](../manuals/userman/gui/viselements/generic/file_download.md#dynamic-content) for more information. +- A new CSS class called *toggle-navbar* was added to the + [Stylekit](../manuals/userman/gui/styling/stylekit.md) to give a + [`toggle`](../manuals/userman/gui/viselements/generic/toggle.md) control the aspect of a + [`navbar`](../manuals/userman/gui/viselements/generic/navbar.md). +- The [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control now supports the + [*treemap*](../manuals/userman/gui/viselements/generic/charts/treemap.md) and + [*waterfall*](../manuals/userman/gui/viselements/generic/charts/waterfall.md) chart types. + +

taipy-core 3.0.0

+ +- A production version of a Taipy application can now be provided with **migration functions** to + automatically migrate entities and keep them compatible with previous versions.
+ For more information, refer to [Production mode](../manuals/userman/versioning/production_mode.md). +- A `GLOBAL` scope data node can be created from a data node configuration calling + the new `taipy.create_global_data_node()^` method.
+ For more information, refer to + [Create a data node](../manuals/userman/data-integration/data-node-usage.md#create-a-data-node). +- A data node configuration can be built from an existing data node configuration. + For more information, refer to the documentation page on + [data node configuration](../manuals/userman/data-integration/data-node-config.md#configure-a-data-node-from-another-configuration). +- A new class `Submittable^` models entities that can be submitted for execution. + It is an Abstract class instantiated by `Scenario^` and `Sequence^`. + It can be handy to use the new following `Submittable^` methods: + * `Submittable.get_inputs()^` retrieves input data nodes of a `Submittable` entity; + * `Submittable.get_outputs()^` retrieves output data nodes of a `Submittable` entity; + * `Submittable.get_intermediate()^` retrieves intermediate data nodes of a `Submittable` + entity; + * `Submittable.is_ready_to_run()^` checks if an entity is ready to be run; + * `Submittable.data_nodes_being_edited()^` retrieves data nodes that are being edited + of a `Submittable^` entity. +- New functions exposed by the `taipy` module: + * `taipy.is_deletable()^` checks if an entity can be deleted; + * `taipy.exists()^` checks if an entity exists. +- The encoding type of CSVDataNode and JSONDataNode can now be configured using the + *encoding* parameter. For more information, please refer to + [Configure a CSVDataNode](../manuals/userman/data-integration/data-node-config.md#csv) + and [Configure a JSONDataNode](../manuals/userman/data-integration/data-node-config.md#json) + sections. + +

taipy-template 3.0.0

+ +- A new template named "scenario-management" is available. For more information on creating + a new Taipy application with the new "scenario-management" template, refer to the + documentation page on [templates](../manuals/cli/create.md#from-a-specific-template). + +## Improvements and changes + +

taipy-gui 3.0.0

+ +- :warning: The *action* parameter of the `on_action` callback was removed for every control.
+ The signature of all *on_action()* callback functions are now unified to the following: + - *state* (`State^`): the state of the client invoking that callback; + - *id* (str): the identifier of the visual element that triggers that callback; + - *payload* (dict): a dictionary that provides additional information to the callback.
+ This dictionary now has the additional *action* key that is set to the action name. + This change not only impact the *on_action* callback of all controls that support it, + but in an exactly similar manner the following callback signatures: + - *on_range_change* in the [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control; + - *on_edit*, *on_add*, and *on_delete* in the [`table`](../manuals/userman/gui/viselements/generic/table.md) + control; + - *on_close* in the [`pane`](../manuals/userman/gui/viselements/generic/pane.md) block. +- The `navigate()^` function has an additional parameter *params* that is used to add query + parameters to the requested URL. The query parameters can be retrieved in the `on_navigate` + callback. +- The *on_action* parameter of the `download()^` function can be a function and not just a function + name. +- Setting the *debug* parameter of `Gui.run()^` to True provides stack traces to be shown in the + console when exceptions occur in user code. + +

taipy-core 3.0.0

+ +- :warning: A `ScenarioConfig^` graph is now created directly from `TaskConfig^` and + `DataNodeConfig^`. Consequently, `PipelineConfig` has been removed. For more + information, refer to [Configure a scenario](../manuals/userman/sdm/scenario/scenario-config.md). +- :warning: The `Pipeline` object has been removed and replaced by `Sequence^`. A sequence is + held by a `Scenario^` and represents a subset of its tasks than can be submitted + together independently of the other tasks of the scenario. For more information, + refer to `Scenario.add_sequence()^` and `Scenario.remove_sequence()^`. +- `Scope.PIPELINE` has been removed from possible `Scope^` values. +- The `root_folder`, `storage_folder`, `read_entity_retry`, `repository_type`, and + `repository_properties` attributes of the `GlobalAppConfig^` have been moved to the + `CoreSection^`.
+ Please refer to the [Core configuration page](../manuals/userman/configuration/core-config.md) for details. +- The `clean_entities` attribute has been removed from the `CoreSection^`. Correspondingly, the + `--clean-entities` option has been removed from the version management CLI.
+ To clean entities of a version, please run your application in development mode, or delete your + version with the `--delete` CLI option. For more information, refer to + [Taipy command-line interface](../manuals/cli/index.md) +- The deprecated `nb_of_workers` attribute of the JobConfig has been removed. +- The deprecated `parent_id` attribute of a DataNode, Task, Pipeline, or Scenario entity, has + been removed. +- The deprecated `last_edition_date` and `edition_in_progress` attributes of a DataNode entity + have been removed. +- The deprecated `DataNode.lock_edition()` and `DataNode.unlock_edition()` methods have been + removed. +- The deprecated `taipy.create_pipeline()` method has been removed. +- Function `DataNode.track_edit` has been made public. + +

taipy-template 3.0.0

+ +- The default template also supports creating a multi-pages application with Core and Rest + services. These options are available when creating a new application from the template. +- The "multi-page-gui" template has been removed. Please use the default instead to create + a Taipy multi-pages application. + +## Significant bug fixes + +

taipy-gui 3.0.0

+ +- The callback function set to the *on_action* parameter of the function `download()^` may + be called too early. It is now ensured to be invoked *after* the download operation is + performed.
+ See [issue #916](https://github.com/Avaiga/taipy-gui/issues/916). +- Setting the [*properties*](../manuals/userman/gui/viselements/introduction.md#generic-properties) property of + a visual element as the returned value from a function may not succeed.
+ See [issue #897](https://github.com/Avaiga/taipy-gui/issues/897). +- Variables imported by an `import *` directive are not handled properly in the state of + a callback defined in the importing module.
+ See [issue #908](https://github.com/Avaiga/taipy-gui/issues/908). +- The [`date`](../manuals/userman/gui/viselements/generic/date.md) control does not use the *format* property if + *with_time* is not set.
+ See [issue #909](https://github.com/Avaiga/taipy-gui/issues/909). +- The [`date`](../manuals/userman/gui/viselements/generic/date.md) control uses the `datetime.date` type and does + not apply time zones if time is not involved.
+ See [issue #895](https://github.com/Avaiga/taipy-gui/issues/895) and + [issue #923](https://github.com/Avaiga/taipy-gui/issues/923). +- Updating a [`chart`](../manuals/userman/gui/viselements/generic/chart.md) control data may cause data congestion + or display flickering.
+ See [issue #864](https://github.com/Avaiga/taipy-gui/issues/864) and + [issue #932](https://github.com/Avaiga/taipy-gui/issues/932). +- Selection in a [`chart`](../manuals/userman/gui/viselements/generic/chart.md) with type *pie* type is not + properly handled.
+ See [issue #919](https://github.com/Avaiga/taipy-gui/issues/919). +- Hover text doesn't show properly in a [`selector`](../manuals/userman/gui/viselements/generic/selector.md) that + is crowded.
+ See [issue #927](https://github.com/Avaiga/taipy-gui/issues/927). +- Options with a long text in a [`selector`](../manuals/userman/gui/viselements/generic/selector.md) cannot cbe + deselected.
+ See [issue #917](https://github.com/Avaiga/taipy-gui/issues/917). +- The [`table`](../manuals/userman/gui/viselements/generic/toggle.md) control does not support undefined date values + from Pandas data frames.
+ See [issue #886](https://github.com/Avaiga/taipy-gui/issues/886). + +

taipy-core 3.0.0

+ +- When running the Core service in development mode, changing the name of the function used by a + task then running the application again would raise an error.
+ See [issue #743](https://github.com/Avaiga/taipy-core/issues/743). + +# Enterprise edition: 3.0 + +Published on 2023-10. + +This release contains all of [`taipy` 3.0](https://pypi.org/project/taipy/3.0.0) as well as +additional features. + +## New Features + +- Python functions including scenario management methods can be scheduled to run at a specific + time using the new `taipy.Scheduler^` API. For more information, refer to + [Schedule a method](../manuals/userman/scheduling/index.md). + +## Improvements and changes + +- The job recovery mechanism is now only available when the Core service is run. # Community edition: 2.3 diff --git a/docs/tutorials/fundamentals/5_rag_chatbot/index.md b/docs/tutorials/fundamentals/5_rag_chatbot/index.md index ced41f449..2a713fa3c 100644 --- a/docs/tutorials/fundamentals/5_rag_chatbot/index.md +++ b/docs/tutorials/fundamentals/5_rag_chatbot/index.md @@ -171,12 +171,13 @@ def create_conv(state): return conversation ``` -Notice that each `tgb.text` element (representing a chat bubble) also contains 2 `class_name`s: +Notice that each `text` element (representing a chat bubble) also contains two `class_name`s: 1. "*message_base*"; and 2. "*user_message*" or "*assistant_message*" (via `message['style']`) -These are CSS classes which we will define in a later step, which provide the look-and-feel of a chat UI. +These are CSS classes which we will define in a later step, which provide the look-and-feel of a +chat UI. # Step 5: Callback to query the LLM @@ -203,8 +204,9 @@ def send_message(state): state.query_message = "" ``` -This function calls the *create_conv* function **twice**: First to add the **user's message** to the chat UI, then a -second time shortly after the *query_llm* function finishes execution and returns the **LLM output**. +This function calls *create_conv()* **twice**: First to add the **user's message** to the chat UI, +then a second time shortly after the *query_llm()* function finishes execution and returns the +**LLM output**. Again, the "*style*" key take the values of "*user_message*" or "*assistant_message*" which correspond to CSS classes that we'll use to style each message as a chat bubble. diff --git a/tools/postprocess.py b/tools/postprocess.py index 4babd7c7c..7e346961c 100644 --- a/tools/postprocess.py +++ b/tools/postprocess.py @@ -116,7 +116,7 @@ def on_post_build(env): # If unspecified, the first xref will be used (the one with the shortests package) multi_xrefs[xref] = sorted(descs, key=lambda p: len(p[0])) manuals_files_path = os.path.join(site_dir, "manuals") - ref_files_path = os.path.join(manuals_files_path, "reference") + ref_files_path = os.path.join(manuals_files_path, "refmans", "reference") fixed_cross_refs = {} for root, _, file_list in os.walk(site_dir): for f in file_list: @@ -383,7 +383,22 @@ def on_post_build(env): if last_location: file_was_changed = True html_content = new_content + html_content[last_location:] - + # Change title of Python reference pages + # - Taipy.module.class -> taipy.module.class + # - Taipy.module.some function -> taipy.module.some_function + elif "refmans/reference" in filename or "refmans\\reference" in filename: + def rewrite_title(s: str, start: int, end: int) -> str: + return (html_content[:start] + "taipy." + + ".".join(map(lambda x: x.replace(" ", "_"), s.split("."))) + + html_content[end:]) + REF_TITLE_RE = re.compile(r"(?<=)(Taipy\.)(.*)(\s+-\s+Taipy)") + if m := REF_TITLE_RE.search(html_content): + html_content = rewrite_title(m[2], m.start(1), m.end(2)) + file_was_changed = True + REF_H1_RE = re.compile(r"(?<=

)(Taipy\.)(.*)

") + if m := REF_H1_RE.search(html_content): + html_content = rewrite_title(m[2], m.start(1), m.end(2)) + file_was_changed = True # Processing for visual element pages: # - Remove from title # - Add breadcrumbs to Taipy GUI's standard and scenario mgmt element pages @@ -457,11 +472,11 @@ def on_post_build(env): def code(s: str) -> str: return f"{s}" - fn_match = re.search(r"manuals(/|\\)reference\1pkg_taipy\1index.html", filename) + fn_match = re.search(r"manuals(/|\\)refmans\1reference\1pkg_taipy\1index.html", filename) if fn_match is not None: # The root 'taipy' package html_content = re.sub(r"(

)taipy(

)", f"\\1{code('taipy')}\\2", html_content) file_was_changed = True - fn_match = re.search(r"manuals(/|\\)reference\1pkg_taipy(\..*)\1index.html", filename) + fn_match = re.search(r"manuals(/|\\)refmans\1reference\1pkg_taipy(\..*)\1index.html", filename) if fn_match is not None: pkg = fn_match[2] sub_match = re.search(r"(\.\w+)(\..*)", pkg)