# Display df_selection in an expandable
<|Sales Table|expandable|expanded=False|


# Create a Generate text button
<|Generate text|button|on_action=generate_text|label=Generate text|>


# Create a text input for the tweet
<|{tweet}|input|multiline|label=Resulting tweet|class_name=fullwidth|>


# Break line
<br/>


# Display image
<|{image}|image|height=400px|>


# Display image from path
<|{path}|image|width=500px|height=500px|class_name=img|>


# Create a slider to select iterations
<|{iterations}|slider|min=10|max=50|continuous=False|on_change=generate|>


# Slider dx_start
<|{dx_start}|slider|min=0|max=100|continuous=False|on_change=generate|>


# Create a toggle button
<|{value}|toggle|lov=Item 1;Item 2;Item 3|>


# Create a dropdown to select between A B and C
<|{value}|selector|lov=A;B;C|dropdown|>


# Create a date selector
<|{dt}|date|>


# Date selection
<|{dt}|date|>


# Create a gauge to visualize progress
<|message|indicator|value={progress}|min=0|max=100|>


# Create and register a page:
from taipy import Gui
Gui("# This is my page title")


# Create a page variable and register it:
md = "# This is my page title"
Gui(md)


# Create 2 pages and register them:
pages = {
  'page1': Markdown("# My first page"),
  'page2': Markdown("# My second page")
}
Gui(pages=pages)


# Create a multi-page application:
from taipy import Gui

   root_md="# Multi-page application"
   page1_md="# This is page 1"
   page2_md="# This is page 2"

   pages = {
     "/": root_md,
     "page1": page1_md,
     "page2": page2_md
   }
   Gui(pages=pages).run()


# Create a multi-page application with content placeholder:
   from taipy import Gui

   root_md="""#
   Multi-page application

   This application was created with [Taipy](http://taipy.avaiga.com).
   """
   page1_md="# This is page 1"
   page2_md="# This is page 2"

   pages = {
     "/": root_md,
     "page1": page1_md,
     "page2": page2_md
   }
   Gui(pages=pages).run()


# Create a dialog in Markdown content:
   page="""
   <|{dialog_is_visible}|dialog|
   Enter a name:
   <|{name}|input|>
   |>"""
   Gui(page).run()


# Create a partial page:
    gui = Gui()
    prompt_user = gui.add_partial(
     """
     Enter a name:
     <|{name}|input|>
     """
   )
   gui.run()


# Display a value:
<|{value}|>


# Format the value with 2 decimal places:
<|{value}|text|format=%.2f|>


# Create a button with Button Label:
<|Button Label|button|>


# Create a Save button:
<|Button Label|button|>


# Create a Cancel button and button_action_function_name:
<|Cancel|button|on_action=button_action_function_name|>


# Create a Cancel button with cancel function:
<|Cancel|button|on_action=cancel|>


# Create input field for name:
<|{name}|input|>


# Create input field for address:
<|{address}|input|>


# Create number field for age:
<|{age}|number|>


# Create a slider for value between 1 and 10:
<|{value}|slider|min=1|max=10|>


# Create a list of toggle buttons for Item 1, Item 2, Item 3:
<|{value}|toggle|lov=Item 1;Item 2;Item 3|>


# Create a toggle control that lets you pick a specific user:
<|{user_sel}|toggle|lov={users}|type=User|adapter={lambda u: (u.id, u.name)}|>


# Create a date selector:
<|{dt}|date|>


# Create a date selector without time:
<|{dt}|date|not with_time|>


# Create a date selector with only date:
<|{dt}|date|not with_time|>


# Create a file download:
<|{content}|file_download|>


# Create a file download with action:
<|{content}|file_download|label=Download File|on_action=function_name|name=filename|>


# Create a file download with no review:
<|{content}|file_download|bypass_preview=False|>


# Create an auto download file download:
<|{content}|file_download|auto|>


# Create a file selector:
<|{content}|file_selector|>


# Create a file selector with label and action:
<|{content}|file_selector|label=Download File|on_action=function_name|extensions=.csv,.xlsx|drop_message=Drop Message|>


# Create a multiple file uploader:
<|{content}|file_selector|multiple|>


# Show an image:
<|{content}|image|>


# Show an image with label and callback:
<|{content}|image|label=this is an image|on_action=function_name|>


# Defining a simple static menu:
<|menu|lov=menu 1;menu 2|>


# Show a table:
<|{data}|table|>


# Display a list of string:
<|{value}|tree|lov=Item 1;Item 2;Item 3|>


# Display df_display in an expandable
<|Display Table|expandable|expanded=False|


# Create a text input for the note
<|{note}|input|multiline|label=Note|class_name=fullwidth|>


# Insert a line break
<br/>


# Display plot
<|{plot}|image|height=400px|>


# Display plot from file location
<|{file_location}|image|width=500px|height=500px|class_name=img|>


# Create a slider to adjust volume
<|{volume}|slider|min=0|max=100|continuous=False|on_change=adjust_volume|>


# Slider dx_threshold
<|{dx_threshold}|slider|min=0|max=10|continuous=False|on_change=update_threshold|>


# Create a toggle button
<|{is_enabled}|toggle|lov=Off;On|>


# Create a dropdown to select between Option X, Option Y, and Option Z
<|{option}|selector|lov=Option X;Option Y;Option Z|dropdown|>


# Create a date picker
<|{selected_date}|date|>


# Date picker
<|{selected_date}|date|>


# Create a Cancel button with cancel_handler function:
<|Cancel|button|on_action=cancel_handler|>


# Create an input field for username:
<|{username}|input|>


# Create an input field for location:
<|{location}|input|>


# Create a numeric field for age:
<|{age}|number|>


# Create a slider for value between 1 and 10:
<|{rating}|slider|min=1|max=10|>


# Create a set of toggle buttons for Option 1, Option 2, Option 3:
<|{choice}|toggle|lov=Option 1;Option 2;Option 3|>


# Create a toggle control to select a specific category:
<|{category_sel}|toggle|lov={categories}|type=Category|adapter={lambda c: (c.id, c.name)}|>


# Create a date picker:
<|{event_date}|date|>


# Create a date picker without time:
<|{event_date}|date|not with_time|>


# Create a date picker with only date:
<|{event_date}|date|not with_time|>


# Create a file download link:
<|{document}|file_download|>


# Create a file download link with action:
<|{document}|file_download|label=Download Document|on_action=download_file|name=file_name|>


# Create a file download link without preview:
<|{document}|file_download|bypass_preview=False|>


# Create an auto download file link:
<|{document}|file_download|auto|>


# Create a file selector:
<|{selected_file}|file_selector|>


# Create a file selector with label and action:
<|{selected_file}|file_selector|label=Select File|on_action=file_selected|extensions=.csv,.xlsx|drop_message=Drop file here|>


# Create a multiple file uploader:
<|{selected_files}|file_selector|multiple|>


# Show an illustration:
<|{illustration}|image|>


# Show an image with description and callback:
<|{picture}|image|label=This is a picture|on_action=image_clicked|>


# Display a message at a specified position between min and max:
<|status|indicator|value={percentage}|min=0|max=100|>


# Define a basic static menu:
<|menu|lov=menu_item1;menu_item2|>


# Display df_results in an expandable
<|Results Table|expandable|expanded=False|


# Create a Generate summary button
<|Generate summary|button|on_action=generate_summary|label=Generate summary|>


# Create a text input for the article
<|{article}|input|multiline|label=Resulting article|class_name=fullwidth|>


# Insert a line break
<br/>


# Display chart
<|{chart}|image|height=400px|>


# Display chart from file path
<|{file_path}|image|width=500px|height=500px|class_name=img|>


# Create a slider to adjust zoom level
<|{zoom_level}|slider|min=1|max=5|continuous=False|on_change=adjust_zoom|>


# Slider dx_threshold
<|{dx_threshold}|slider|min=0|max=10|continuous=False|on_change=update_threshold|>


# Create a toggle switch
<|{state}|toggle|lov=Off;On;Auto|>


# Create a dropdown to select between X, Y, and Z
<|{axis}|selector|lov=X;Y;Z|dropdown|>


# Date picker
<|{selected_date}|date|>


# Create a gauge to visualize value
<|status|indicator|value={progress}|min=0|max=100|>


# Define a page variable and initialize it:
md_content = "# My Page Title"
Gui(md_content)


# Define 2 pages and set them up:
content_pages = {
 'first_page': Markdown("# Introduction"),
 'second_page': Markdown("# Advanced Topics")
}
Gui(pages=content_pages)


# Set up a multi-page application:
from taipy import Gui

 root_content="# Welcome to the App"
 page1_content="# This is Page 1"
 page2_content="# This is Page 2"

 pages_dict = {
 "/": root_content,
 "page1": page1_content,
 "page2": page2_content
 }
 Gui(pages=pages_dict).run()


# Set up a multi-page application with content placeholder:
 from taipy import Gui

 root_content="""#
 Multi-page application

 This app was built using Taipy.
 """
 page1_content="# Page 1"
 page2_content="# Page 2"

 pages_dict = {
 "/": root_content,
 "page1": page1_content,
 "page2": page2_content
 }
 Gui(pages=pages_dict).run()


# Create a dialog with Markdown content:
 dialog_content="""
 <|{is_visible}|dialog|
 Please enter your name:
 <|{user_name}|input|>
 |>"""
 Gui(dialog_content).run()


# Set up a partial page:
 gui_instance = Gui()
 user_prompt = gui_instance.add_partial(
 """
 Please enter your name:
 <|{user_name}|input|>
 """
 )
 gui_instance.run()


# Display a calculated result:
<|{result}|>


# Format the value with 2 decimal points:
<|{value}|text|format=%.2f|>


# Create a button with the label 'Click Me':
<|Click Me|button|>


# Create a Save button:
<|Save|button|>


# Create a Cancel button with cancel_handler function:
<|Cancel|button|on_action=cancel_handler|>


# Create an input field for username:
<|{username}|input|>


# Create an input field for location:
<|{location}|input|>


# Create a numeric field for age:
<|{age}|number|>


# Create a slider for value between 1 and 10:
<|{rating}|slider|min=1|max=10|>


# Create a set of toggle buttons for Option 1, Option 2, Option 3:
<|{choice}|toggle|lov=Option 1;Option 2;Option 3|>


# Create a toggle control to select a specific category:
<|{category_sel}|toggle|lov={categories}|type=Category|adapter={lambda c: (c.id, c.name)}|>


# Create a date picker:
<|{event_date}|date|>


# Create a date picker without time:
<|{event_date}|date|not with_time|>


# Create a date picker with only date:
<|{event_date}|date|not with_time|>


# Create a file download link:
<|{document}|file_download|>


# Create a file download link with action:
<|{document}|file_download|label=Download Document|on_action=download_file|name=file_name|>


# Create a file download link without preview:
<|{document}|file_download|bypass_preview=False|>


# Create an auto download file link:
<|{document}|file_download|auto|>


# Create a file selector:
<|{selected_file}|file_selector|>


# Create a file selector with label and action:
<|{selected_file}|file_selector|label=Select File|on_action=file_selected|extensions=.csv,.xlsx|drop_message=Drop file here|>


# Show an illustration:
<|{illustration}|image|>


# Show an image with description and callback:
<|{picture}|image|label=This is a picture|on_action=image_clicked|>


# Display a message at a specified position between min and max:
<|status|indicator|value={percentage}|min=0|max=100|>


# Define a basic static menu:
<|menu|lov=menu_item1;menu_item2|>


# Display df_output in an expandable
<|Output Table|expandable|expanded=False|


# Create a Visualize button
<|Visualize|button|on_action=visualize_data|label=Visualize|>


# Create a text input for the description
<|{description}|input|multiline|label=Description|class_name=fullwidth|>


# Insert a line break
<br/>


# Display diagram
<|{diagram}|image|height=400px|>


# Display diagram from file path
<|{diagram_path}|image|width=500px|height=500px|class_name=img|>


# Create a slider to adjust brightness
<|{brightness}|slider|min=0|max=100|continuous=False|on_change=adjust_brightness|>


# Slider threshold
<|{threshold}|slider|min=0|max=10|continuous=False|on_change=update_threshold|>


# Create a toggle button
<|{is_enabled}|toggle|lov=Off;On|>


# Create a dropdown to select between Choice A, Choice B, and Choice C
<|{choice}|selector|lov=Choice A;Choice B;Choice C|dropdown|>


# Create a date picker
<|{selected_date}|date|>


# Date picker
<|{selected_date}|date|>


# Create a gauge to visualize value
<|status|indicator|value={progress}|min=0|max=100|>


# Create and initialize a page:
from taipy import Gui
Gui("# Dashboard")


# Define a page variable and initialize it:
md_content = "# Dashboard"
Gui(md_content)


# Define 2 pages and set them up:
content_pages = {
 'overview': Markdown("# Overview"),
 'details': Markdown("# Details")
}
Gui(pages=content_pages)


# Set up a multi-page application:
from taipy import Gui

 root_content="# Welcome to the App"
 page1_content="# Page 1"
 page2_content="# Page 2"

 pages_dict = {
 "/": root_content,
 "page1": page1_content,
 "page2": page2_content
 }
 Gui(pages=pages_dict).run()


# Set up a multi-page application with content placeholder:
 from taipy import Gui

 root_content="""#
 Multi-page application

 This app was built using Taipy.
 """
 page1_content="# Page 1"
 page2_content="# Page 2"

 pages_dict = {
 "/": root_content,
 "page1": page1_content,
 "page2": page2_content
 }
 Gui(pages=pages_dict).run()


# Create a dialog with Markdown content:
 dialog_content="""
 <|{is_visible}|dialog|
 Please enter your name:
 <|{user_name}|input|>
 |>"""
 Gui(dialog_content).run()


# Set up a partial page:
 gui_instance = Gui()
 user_prompt = gui_instance.add_partial(
 """
 Please enter your name:
 <|{user_name}|input|>
 """
 )
 gui_instance.run()


# Display a calculated result:
<|{result}|>


# Format the value with 2 decimal points:
<|{value}|text|format=%.2f|>


# Create a button with the label 'Click Me':
<|Click Me|button|>


# Create a Save button:
<|Save|button|>


# Create a Cancel button and set the action function name:
<|Cancel|button|on_action=cancel_action_function|>


# Create a Cancel button with cancel_handler function:
<|Cancel|button|on_action=cancel_handler|>


# Create an input field for username:
<|{username}|input|>


# Create an input field for location:
<|{location}|input|>


# Create a numeric field for age:
<|{age}|number|>


# Create a slider for value between 1 and 10:
<|{rating}|slider|min=1|max=10|>


# Create a set of toggle buttons for Option 1, Option 2, Option 3:
<|{choice}|toggle|lov=Option 1;Option 2;Option 3|>


# Create a toggle control to select a specific category:
<|{category_sel}|toggle|lov={categories}|type=Category|adapter={lambda c: (c.id, c.name)}|>


# Create a date picker:
<|{event_date}|date|>


# Create a date picker without time:
<|{event_date}|date|not with_time|>


# Create a date picker with only date:
<|{event_date}|date|not with_time|>


# Create a file download link:
<|{document}|file_download|>


# Create a file download link with action:
<|{document}|file_download|label=Download Document|on_action=download_file|name=file_name|>


# Create a file download link without preview:
<|{document}|file_download|bypass_preview=False|>


# Create an auto download file link:
<|{document}|file_download|auto|>


# Create a file selector:
<|{selected_file}|file_selector|>


# Create a file selector with label and action:
<|{selected_file}|file_selector|label=Select File|on_action=file_selected|extensions=.csv,.xlsx|drop_message=Drop file here|>


# Create a multiple file uploader:
<|{selected_files}|file_selector|multiple|>


# Show an illustration:
<|{illustration}|image|>


# Show an image with description and callback:
<|{picture}|image|label=This is a picture|on_action=image_clicked|>


# Display a message at a specified position between min and max:
<|status|indicator|value={percentage}|min=0|max=100|>


# Define a basic static menu:
<|menu|lov=menu_item1;menu_item2|>


# Display df_display in an expandable
<|Display Data|expandable|expanded=False|


# Create an Explore button
<|Explore|button|on_action=explore_data|label=Explore|>


# Create a text input for the notes
<|{notes}|input|multiline|label=Notes|class_name=fullwidth|>


# Insert a line break
<br/>


# Display visualization
<|{visualization}|image|height=400px|>


# Display visualization from file path
<|{file_path}|image|width=500px|height=500px|class_name=img|>


# Create a slider to adjust contrast
<|{contrast}|slider|min=0|max=100|continuous=False|on_change=adjust_contrast|>


# Slider threshold
<|{threshold}|slider|min=0|max=10|continuous=False|on_change=update_threshold|>


# Create and initialize a page:
from taipy import Gui
Gui("# Data Overview")


# Define a page variable and initialize it:
md_content = "# Data Overview"
Gui(md_content)


# Define 2 pages and set them up:
content_pages = {
 'overview': Markdown("# Overview"),
 'details': Markdown("# Details")
}
Gui(pages=content_pages)


# Set up a multi-page application:
from taipy import Gui

 root_content="# Welcome to the App"
 page1_content="# Page 1"
 page2_content="# Page 2"

 pages_dict = {
 "/": root_content,
 "page1": page1_content,
 "page2": page2_content
 }
 Gui(pages=pages_dict).run()


# Set up a multi-page application with content placeholder:
 from taipy import Gui

 root_content="""#
 Multi-page application

 This app was built using Taipy.
 """
 page1_content="# Page 1"
 page2_content="# Page 2"

 pages_dict = {
 "/": root_content,
 "page1": page1_content,
 "page2": page2_content
 }
 Gui(pages=pages_dict).run()


# Create a dialog with Markdown content:
 dialog_content="""
 <|{is_visible}|dialog|
 Please enter your name:
 <|{user_name}|input|>
 |>"""
 Gui(dialog_content).run()


# Set up a partial page:
 gui_instance = Gui()
 user_prompt = gui_instance.add_partial(
 """
 Please enter your name:
 <|{user_name}|input|>
 """
 )
 gui_instance.run()


# Display a calculated result:
<|{result}|>


# Format the value with 2 decimal points:
<|{value}|text|format=%.2f|>


# Create a button with the label 'Click Me':
<|Click Me|button|>


# Create a Save button:
<|Save|button|>


# Create a Cancel button and set the action function name:
<|Cancel|button|on_action=cancel_action_function|>


# Create a Cancel button with cancel_handler function:
<|Cancel|button|on_action=cancel_handler|>


# Create an input field for username:
<|{username}|input|>


# Create an input field for location:
<|{location}|input|>


# Create a numeric field for age:
<|{age}|number|>


# Create a slider for value between 1 and 10:
<|{rating}|slider|min=1|max=10|>


# Create a set of toggle buttons for Option 1, Option 2, Option 3:
<|{choice}|toggle|lov=Option 1;Option 2;Option 3|>


# Create a toggle control to select a specific category:
<|{category_sel}|toggle|lov={categories}|type=Category|adapter={lambda c: (c.id, c.name)}|>


# Create a date picker:
<|{event_date}|date|>


# Create a date picker without time:
<|{event_date}|date|not with_time|>


# Create a date picker with only date:
<|{event_date}|date|not with_time|>


# Create a file download link:
<|{document}|file_download|>


# Create a file download link with action:
<|{document}|file_download|label=Download Document|on_action=download_file|name=file_name|>


# Create a file download link without preview:
<|{document}|file_download|bypass_preview=False|>


# Create an auto download file link:
<|{document}|file_download|auto|>


# Create a file selector:
<|{selected_file}|file_selector|>


# Create a file selector with label and action:
<|{selected_file}|file_selector|label=Select File|on_action=file_selected|extensions=.csv,.xlsx|drop_message=Drop file here|>


# Create a multiple file uploader:
<|{selected_files}|file_selector|multiple|>


# Show an illustration:
<|{illustration}|image|>


# Show an image with description and callback:
<|{picture}|image|label=This is a picture|on_action=image_clicked|>


# Display a message at a specified position between min and max:
<|status|indicator|value={percentage}|min=0|max=100|>


# Define a basic static menu:
<|menu|lov=menu_item1;menu_item2|>


# Plot Sales according to Date in a line chart:
<|{data}|chart|type=lines|x=DATE|y=SALES|>


# Plot Sales according to Date in a line chart titled "Sales according to Revenue":
<|{data}|chart|type=lines|x=DATE|x=SALES|title=SALES according to Revenue|>


# Plot Sales and Revenue according to Date:
<|{data}|chart|type=lines|x=DATE|y[1]=SALES|y[2]=REVENUE|>


# Plot Sales according to Date on a Dashed line:
<|{data}|chart|type=lines|x=DATE|x=SALES|line=dash|>


# Plot Revenue by Date on a dotted line:
<|{data}|chart|type=lines|x=DATE|x=SALES|line=dot|>


# Plot Sales by Date in Red:
<|{data}|chart|type=lines|x=DATE|x=SALES|color=Red|>


# Plot Revenue according to Date in yellow:
<|{data}|chart|type=lines|x=DATE|x=SALES|color=Yellow|>


# Plot Revenue according to Date in yellow titled Revenue Plot:
<|{data}|chart|type=lines|x=DATE|x=SALES|color=Yellow|title=REVENUE Plot>


# Plot Sales in blue and Revenue in green according to Date:
<|{data}|chart|type=lines|x=DATE|y[1]=SALES|y[2]=REVENUE|color[1]=blue|color[2]=green|>


# Plot Revenue by Date in a red dashed line and Sales in a yellow Dotted line:
<|{data}|chart|type=lines|x=DATE|y[1]=REVENUE|y[2]=SALES|line[1]=dash|line[2]=dot|color[1]=red|color[2]=yellow|>


# Display Date according to Sales:
<|{data}|chart|type=lines|x=DATE|x=SALES|>


# Plot in a bar chart the Sales according to Date:
<|{data}|chart|type=bar|x=DATE|x=SALES|>


# Plot in a bar chart the Sales according to Date and Revenue according to Date:
<|{data}|chart|type=bar|x=DATE|y[1]=SALES|y[2]=REVENUE|>


# Plot Sales and Revenue by Date in a bar chart:
<|{data}|chart|type=bar|x=DATE|y[1]=SALES|y[2]=REVENUE|>


# Plot in a bar chart the Sales according to Date and Revenue according to Date titled Finance:
<|{data}|chart|type=bar|x=DATE|y[1]=SALES|y[2]=REVENUE|title=Finance|>


# Plot in a scatter plot Sales according to Date:
<|{data}|chart|type=scatter|mode=markers|x=DATE|x=SALES|>


# Draw Sales and Revenue by Date in a scatter plot:
<|{data}|chart|type=scatter|mode=markers|x=DATE|y[1]=SALES|y[2]=REVENUE|>


# Plot Revenue in green points and Sales in yellow points by Date:
<|{data}|chart|type=scatter|mode=markers|x=DATE|y[1]=REVENUE|y[2]=SALES|color[1]=green|color[2]=yellow|>


# Plot a histogram of Sales:
<|{data}|chart|type=histogram|x=SALES|>


# Display a horizontal histogram of Sales:
<|{data}|chart|type=histogram|x=SALES|>


# Plot the distribution of Sales and Revenue:
<|{data}|chart|type=histogram|x[1]=SALES|x[2]=REVENUE|>


# Plot the distribution of Sales and Revenue titled "Sales and Revenue Distribution":
<|{data}|chart|type=histogram|x[1]=SALES|x[2]=REVENUE|title=SALES and Revenue Distribution|>


# Display a horizontal distribution of Sales and Revenue titled "Sales and Revenue Distribution":
<|{data}|chart|type=histogram|y[1]=SALES|y[2]=REVENUE|title=SALES and Revenue Distribution|>


# Plot a pie chart of Sales by Date:
<|{data}|chart|type=pie|values=SALES|labels=Date|>


# Draw a pie chart of Sales by Date titled "Sales Pie Chart":
<|{data}|chart|type=pie|values=SALES|labels=Date|title=SALES Pie Chart|>


# Plot a pie chart of Revenue by Date:
<|{data}|chart|type=pie|values=REVENUE|labels=Date|>


# Visualize Profit over Time in a line chart:
<|{data}|chart|type=lines|x=TIME|y=PROFIT|>


# Showcase Profit over Time in a line chart titled "Profit Trend":
<|{data}|chart|type=lines|x=TIME|y=PROFIT|title=Profit Trend|>


# Depict Profit and Loss over Time:
<|{data}|chart|type=lines|x=TIME|y[1]=PROFIT|y[2]=LOSS|>


# Illustrate Profit over Time with a Dashed line:
<|{data}|chart|type=lines|x=TIME|y=PROFIT|line=dash|>


# Present Loss by Time on a Dotted line:
<|{data}|chart|type=lines|x=TIME|y=LOSS|line=dot|>


# Plot Profit over Time in Red:
<|{data}|chart|type=lines|x=TIME|y=PROFIT|color=Red|>


# Exhibit Loss over Time in yellow:
<|{data}|chart|type=lines|x=TIME|y=LOSS|color=Yellow|>


# Show Profit over Time in yellow titled Profit Overview:
<|{data}|chart|type=lines|x=TIME|y=PROFIT|color=Yellow|title=Profit Overview|>


# Display Profit in blue and Loss in green over Time:
<|{data}|chart|type=lines|x=TIME|y[1]=PROFIT|y[2]=LOSS|color[1]=blue|color[2]=green|>


# Visualize Loss by Time in a red dashed line and Profit in a yellow Dotted line:
<|{data}|chart|type=lines|x=TIME|y[1]=LOSS|y[2]=PROFIT|line[1]=dash|line[2]=dot|color[1]=red|color[2]=yellow|>


# Highlight Time according to Profit:
<|{data}|chart|type=lines|x=TIME|y=PROFIT|>


# Depict in a bar chart the Profit over Time:
<|{data}|chart|type=bar|x=TIME|y=PROFIT|>


# Depict in a bar chart the Profit over Time and Loss over Time:
<|{data}|chart|type=bar|x=TIME|y[1]=PROFIT|y[2]=LOSS|>


# Showcase Profit and Loss by Time in a bar chart:
<|{data}|chart|type=bar|x=TIME|y[1]=PROFIT|y[2]=LOSS|>


# Depict in a bar chart the Profit over Time and Loss over Time titled Financial Overview:
<|{data}|chart|type=bar|x=TIME|y[1]=PROFIT|y[2]=LOSS|title=Financial Overview|>


# Depict in a scatter plot Profit over Time:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y=PROFIT|>


# Illustrate Profit and Loss by Time in a scatter plot:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y[1]=PROFIT|y[2]=LOSS|>


# Plot Loss in green points and Profit in yellow points by Time:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y[1]=LOSS|y[2]=PROFIT|color[1]=green|color[2]=yellow|>


# Display a histogram of Profit:
<|{data}|chart|type=histogram|x=PROFIT|>


# Showcase a horizontal histogram of Profit:
<|{data}|chart|type=histogram|x=PROFIT|>


# Illustrate the distribution of Profit and Loss:
<|{data}|chart|type=histogram|x[1]=PROFIT|x[2]=LOSS|>


# Illustrate the distribution of Profit and Loss titled "Profit and Loss Distribution":
<|{data}|chart|type=histogram|x[1]=PROFIT|x[2]=LOSS|title=Profit and Loss Distribution|>


# Present a horizontal distribution of Profit and Loss titled "Profit and Loss Distribution":
<|{data}|chart|type=histogram|y[1]=PROFIT|y[2]=LOSS|title=Profit and Loss Distribution|>


# Depict a pie chart of Profit by Time:
<|{data}|chart|type=pie|values=PROFIT|labels=Time|>


# Illustrate a pie chart of Profit by Time titled "Profit Pie Chart":
<|{data}|chart|type=pie|values=PROFIT|labels=Time|title=Profit Pie Chart|>


# Depict a pie chart of Loss by Time:
<|{data}|chart|type=pie|values=LOSS|labels=Time|>


# Visualize Quantity over Time in a line chart:
<|{data}|chart|type=lines|x=TIME|y=QUANTITY|>


# Showcase Quantity over Time in a line chart titled "Quantity Trend":
<|{data}|chart|type=lines|x=TIME|y=QUANTITY|title=Quantity Trend|>


# Depict Quantity and Price over Time:
<|{data}|chart|type=lines|x=TIME|y[1]=QUANTITY|y[2]=PRICE|>


# Illustrate Quantity over Time with a Dashed line:
<|{data}|chart|type=lines|x=TIME|y=QUANTITY|line=dash|>


# Present Price by Time on a Dotted line:
<|{data}|chart|type=lines|x=TIME|y=PRICE|line=dot|>


# Plot Quantity over Time in Green:
<|{data}|chart|type=lines|x=TIME|y=QUANTITY|color=Green|>


# Exhibit Price over Time in Blue:
<|{data}|chart|type=lines|x=TIME|y=PRICE|color=Blue|>


# Show Price over Time in Blue titled Price Overview:
<|{data}|chart|type=lines|x=TIME|y=PRICE|color=Blue|title=Price Overview|>


# Display Quantity in Red and Price in Yellow over Time:
<|{data}|chart|type=lines|x=TIME|y[1]=QUANTITY|y[2]=PRICE|color[1]=Red|color[2]=Yellow|>


# Visualize Price by Time in a Green dashed line and Quantity in a Yellow Dotted line:
<|{data}|chart|type=lines|x=TIME|y[1]=PRICE|y[2]=QUANTITY|line[1]=dash|line[2]=dot|color[1]=Green|color[2]=Yellow|>


# Highlight Time according to Quantity:
<|{data}|chart|type=lines|x=TIME|y=QUANTITY|>


# Depict in a bar chart the Quantity over Time:
<|{data}|chart|type=bar|x=TIME|y=QUANTITY|>


# Depict in a bar chart the Quantity over Time and Price over Time:
<|{data}|chart|type=bar|x=TIME|y[1]=QUANTITY|y[2]=PRICE|>


# Showcase Quantity and Price by Time in a bar chart:
<|{data}|chart|type=bar|x=TIME|y[1]=QUANTITY|y[2]=PRICE|>


# Depict in a bar chart the Quantity over Time and Price over Time titled Product Overview:
<|{data}|chart|type=bar|x=TIME|y[1]=QUANTITY|y[2]=PRICE|title=Product Overview|>


# Depict in a scatter plot Quantity over Time:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y=QUANTITY|>


# Illustrate Quantity and Price by Time in a scatter plot:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y[1]=QUANTITY|y[2]=PRICE|>


# Plot Price in Green points and Quantity in Yellow points by Time:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y[1]=PRICE|y[2]=QUANTITY|color[1]=Green|color[2]=Yellow|>


# Display a histogram of Quantity:
<|{data}|chart|type=histogram|x=QUANTITY|>


# Showcase a horizontal histogram of Quantity:
<|{data}|chart|type=histogram|x=QUANTITY|>


# Illustrate the distribution of Quantity and Price:
<|{data}|chart|type=histogram|x[1]=QUANTITY|x[2]=PRICE|>


# Illustrate the distribution of Quantity and Price titled "Quantity and Price Distribution":
<|{data}|chart|type=histogram|x[1]=QUANTITY|x[2]=PRICE|title=Quantity and Price Distribution|>


# Present a horizontal distribution of Quantity and Price titled "Quantity and Price Distribution":
<|{data}|chart|type=histogram|y[1]=QUANTITY|y[2]=PRICE|title=Quantity and Price Distribution|>


# Depict a pie chart of Quantity by Time:
<|{data}|chart|type=pie|values=QUANTITY|labels=Time|>


# Illustrate a pie chart of Quantity by Time titled "Quantity Pie Chart":
<|{data}|chart|type=pie|values=QUANTITY|labels=Time|title=Quantity Pie Chart|>


# Depict a pie chart of Price by Time:
<|{data}|chart|type=pie|values=PRICE|labels=Time|>


# Plot Temperature against Time in a line chart:
<|{data}|chart|type=lines|x=TIME|y=TEMPERATURE|>


# Showcase Temperature against Time in a line chart titled "Temperature Trend":
<|{data}|chart|type=lines|x=TIME|y=TEMPERATURE|title=Temperature Trend|>


# Depict Temperature and Humidity against Time:
<|{data}|chart|type=lines|x=TIME|y[1]=TEMPERATURE|y[2]=HUMIDITY|>


# Illustrate Temperature against Time with a Dashed line:
<|{data}|chart|type=lines|x=TIME|y=TEMPERATURE|line=dash|>


# Present Humidity by Time on a Dotted line:
<|{data}|chart|type=lines|x=TIME|y=HUMIDITY|line=dot|>


# Plot Temperature against Time in Blue:
<|{data}|chart|type=lines|x=TIME|y=TEMPERATURE|color=Blue|>


# Exhibit Humidity against Time in Green:
<|{data}|chart|type=lines|x=TIME|y=HUMIDITY|color=Green|>


# Show Humidity against Time in Green titled Humidity Overview:
<|{data}|chart|type=lines|x=TIME|y=HUMIDITY|color=Green|title=Humidity Overview|>


# Display Temperature in Red and Humidity in Yellow against Time:
<|{data}|chart|type=lines|x=TIME|y[1]=TEMPERATURE|y[2]=HUMIDITY|color[1]=Red|color[2]=Yellow|>


# Visualize Humidity against Time in a Red dashed line and Temperature in a Yellow Dotted line:
<|{data}|chart|type=lines|x=TIME|y[1]=HUMIDITY|y[2]=TEMPERATURE|line[1]=dash|line[2]=dot|color[1]=Red|color[2]=Yellow|>


# Highlight Time according to Temperature:
<|{data}|chart|type=lines|x=TIME|y=TEMPERATURE|>


# Depict in a bar chart the Temperature against Time:
<|{data}|chart|type=bar|x=TIME|y=TEMPERATURE|>


# Depict in a bar chart the Temperature against Time and Humidity against Time:
<|{data}|chart|type=bar|x=TIME|y[1]=TEMPERATURE|y[2]=HUMIDITY|>


# Showcase Temperature and Humidity against Time in a bar chart:
<|{data}|chart|type=bar|x=TIME|y[1]=TEMPERATURE|y[2]=HUMIDITY|>


# Depict in a bar chart the Temperature against Time and Humidity against Time titled Climate Overview:
<|{data}|chart|type=bar|x=TIME|y[1]=TEMPERATURE|y[2]=HUMIDITY|title=Climate Overview|>


# Depict in a scatter plot Temperature against Time:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y=TEMPERATURE|>


# Illustrate Temperature and Humidity against Time in a scatter plot:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y[1]=TEMPERATURE|y[2]=HUMIDITY|>


# Plot Humidity in Green points and Temperature in Yellow points against Time:
<|{data}|chart|type=scatter|mode=markers|x=TIME|y[1]=HUMIDITY|y[2]=TEMPERATURE|color[1]=Green|color[2]=Yellow|>


# Display a histogram of Temperature:
<|{data}|chart|type=histogram|x=TEMPERATURE|>


# Showcase a horizontal histogram of Temperature:
<|{data}|chart|type=histogram|x=TEMPERATURE|>


# Illustrate the distribution of Temperature and Humidity:
<|{data}|chart|type=histogram|x[1]=TEMPERATURE|x[2]=HUMIDITY|>


# Illustrate the distribution of Temperature and Humidity titled "Temperature and Humidity Distribution":
<|{data}|chart|type=histogram|x[1]=TEMPERATURE|x[2]=HUMIDITY|title=Temperature and Humidity Distribution|>


# Present a horizontal distribution of Temperature and Humidity titled "Temperature and Humidity Distribution":
<|{data}|chart|type=histogram|y[1]=TEMPERATURE|y[2]=HUMIDITY|title=Temperature and Humidity Distribution|>


# Depict a pie chart of Temperature against Time:
<|{data}|chart|type=pie|values=TEMPERATURE|labels=Time|>


# Illustrate a pie chart of Temperature against Time titled "Temperature Pie Chart":
<|{data}|chart|type=pie|values=TEMPERATURE|labels=Time|title=Temperature Pie Chart|>


# Depict a pie chart of Humidity against Time:
<|{data}|chart|type=pie|values=HUMIDITY|labels=Time|>


# Plot Sales against Region in a line chart:
<|{data}|chart|type=lines|x=REGION|y=SALES|>


# Showcase Sales against Region in a line chart titled "Sales by Region":
<|{data}|chart|type=lines|x=REGION|y=SALES|title=Sales by Region|>


# Depict Sales and Profit against Region:
<|{data}|chart|type=lines|x=REGION|y[1]=SALES|y[2]=PROFIT|>


# Illustrate Sales against Region with a Dashed line:
<|{data}|chart|type=lines|x=REGION|y=SALES|line=dash|>


# Present Profit by Region on a Dotted line:
<|{data}|chart|type=lines|x=REGION|y=PROFIT|line=dot|>


# Plot Sales against Region in Blue:
<|{data}|chart|type=lines|x=REGION|y=SALES|color=Blue|>


# Exhibit Profit against Region in Green:
<|{data}|chart|type=lines|x=REGION|y=PROFIT|color=Green|>


# Show Profit against Region in Green titled Profit Overview:
<|{data}|chart|type=lines|x=REGION|y=PROFIT|color=Green|title=Profit Overview|>


# Display Sales in Red and Profit in Yellow against Region:
<|{data}|chart|type=lines|x=REGION|y[1]=SALES|y[2]=PROFIT|color[1]=Red|color[2]=Yellow|>


# Visualize Profit by Region in a Red dashed line and Sales in a Yellow Dotted line:
<|{data}|chart|type=lines|x=REGION|y[1]=PROFIT|y[2]=SALES|line[1]=dash|line[2]=dot|color[1]=Red|color[2]=Yellow|>


# Highlight Region according to Sales:
<|{data}|chart|type=lines|x=REGION|y=SALES|>


# Depict in a bar chart the Sales against Region:
<|{data}|chart|type=bar|x=REGION|y=SALES|>


# Depict in a bar chart the Sales against Region and Profit against Region:
<|{data}|chart|type=bar|x=REGION|y[1]=SALES|y[2]=PROFIT|>


# Showcase Sales and Profit against Region in a bar chart:
<|{data}|chart|type=bar|x=REGION|y[1]=SALES|y[2]=PROFIT|>


# Depict in a bar chart the Sales against Region and Profit against Region titled Financial Overview:
<|{data}|chart|type=bar|x=REGION|y[1]=SALES|y[2]=PROFIT|title=Financial Overview|>


# Depict in a scatter plot Sales against Region:
<|{data}|chart|type=scatter|mode=markers|x=REGION|y=SALES|>


# Illustrate Sales and Profit against Region in a scatter plot:
<|{data}|chart|type=scatter|mode=markers|x=REGION|y[1]=SALES|y[2]=PROFIT|>


# Plot Profit in Green points and Sales in Yellow points against Region:
<|{data}|chart|type=scatter|mode=markers|x=REGION|y[1]=PROFIT|y[2]=SALES|color[1]=Green|color[2]=Yellow|>


# Display a histogram of Sales against Region:
<|{data}|chart|type=histogram|x=SALES|>


# Showcase a horizontal histogram of Sales against Region:
<|{data}|chart|type=histogram|x=SALES|>


# Illustrate the distribution of Sales and Profit against Region:
<|{data}|chart|type=histogram|x[1]=SALES|x[2]=PROFIT|>


# Illustrate the distribution of Sales and Profit against Region titled "Sales and Profit Distribution":
<|{data}|chart|type=histogram|x[1]=SALES|x[2]=PROFIT|title=Sales and Profit Distribution|>


# Present a horizontal distribution of Sales and Profit against Region titled "Sales and Profit Distribution":
<|{data}|chart|type=histogram|y[1]=SALES|y[2]=PROFIT|title=Sales and Profit Distribution|>


# Depict a pie chart of Sales against Region:
<|{data}|chart|type=pie|values=SALES|labels=Region|>


# Illustrate a pie chart of Sales against Region titled "Sales Pie Chart":
<|{data}|chart|type=pie|values=SALES|labels=Region|title=Sales Pie Chart|>


# Depict a pie chart of Profit against Region:
<|{data}|chart|type=pie|values=PROFIT|labels=Region|>


# Visualize Productivity against Employee in a line chart:
<|{data}|chart|type=lines|x=EMPLOYEE|y=PRODUCTIVITY|>


# Showcase Productivity against Employee in a line chart titled "Employee Productivity Trend":
<|{data}|chart|type=lines|x=EMPLOYEE|y=PRODUCTIVITY|title=Employee Productivity Trend|>


# Depict Productivity and Satisfaction against Employee:
<|{data}|chart|type=lines|x=EMPLOYEE|y[1]=PRODUCTIVITY|y[2]=SATISFACTION|>


# Illustrate Productivity against Employee with a Dashed line:
<|{data}|chart|type=lines|x=EMPLOYEE|y=PRODUCTIVITY|line=dash|>


# Present Satisfaction by Employee on a Dotted line:
<|{data}|chart|type=lines|x=EMPLOYEE|y=SATISFACTION|line=dot|>


# Plot Productivity against Employee in Blue:
<|{data}|chart|type=lines|x=EMPLOYEE|y=PRODUCTIVITY|color=Blue|>


# Exhibit Satisfaction against Employee in Green:
<|{data}|chart|type=lines|x=EMPLOYEE|y=SATISFACTION|color=Green|>


# Show Satisfaction against Employee in Green titled Satisfaction Overview:
<|{data}|chart|type=lines|x=EMPLOYEE|y=SATISFACTION|color=Green|title=Satisfaction Overview|>


# Display Productivity in Red and Satisfaction in Yellow against Employee:
<|{data}|chart|type=lines|x=EMPLOYEE|y[1]=PRODUCTIVITY|y[2]=SATISFACTION|color[1]=Red|color[2]=Yellow|>


# Visualize Satisfaction by Employee in a Red dashed line and Productivity in a Yellow Dotted line:
<|{data}|chart|type=lines|x=EMPLOYEE|y[1]=SATISFACTION|y[2]=PRODUCTIVITY|line[1]=dash|line[2]=dot|color[1]=Red|color[2]=Yellow|>


# Highlight Employee according to Productivity:
<|{data}|chart|type=lines|x=EMPLOYEE|y=PRODUCTIVITY|>


# Depict in a bar chart the Productivity against Employee:
<|{data}|chart|type=bar|x=EMPLOYEE|y=PRODUCTIVITY|>


# Depict in a bar chart the Productivity against Employee and Satisfaction against Employee:
<|{data}|chart|type=bar|x=EMPLOYEE|y[1]=PRODUCTIVITY|y[2]=SATISFACTION|>


# Showcase Productivity and Satisfaction against Employee in a bar chart:
<|{data}|chart|type=bar|x=EMPLOYEE|y[1]=PRODUCTIVITY|y[2]=SATISFACTION|>


# Depict in a bar chart the Productivity against Employee and Satisfaction against Employee titled Work Overview:
<|{data}|chart|type=bar|x=EMPLOYEE|y[1]=PRODUCTIVITY|y[2]=SATISFACTION|title=Work Overview|>


# Depict in a scatter plot Productivity against Employee:
<|{data}|chart|type=scatter|mode=markers|x=EMPLOYEE|y=PRODUCTIVITY|>


# Illustrate Productivity and Satisfaction against Employee in a scatter plot:
<|{data}|chart|type=scatter|mode=markers|x=EMPLOYEE|y[1]=PRODUCTIVITY|y[2]=SATISFACTION|>


# Plot Satisfaction in Green points and Productivity in Yellow points against Employee:
<|{data}|chart|type=scatter|mode=markers|x=EMPLOYEE|y[1]=SATISFACTION|y[2]=PRODUCTIVITY|color[1]=Green|color[2]=Yellow|>


# Display a histogram of Productivity against Employee:
<|{data}|chart|type=histogram|x=PRODUCTIVITY|>


# Showcase a horizontal histogram of Productivity against Employee:
<|{data}|chart|type=histogram|x=PRODUCTIVITY|>


# Illustrate the distribution of Productivity and Satisfaction against Employee:
<|{data}|chart|type=histogram|x[1]=PRODUCTIVITY|x[2]=SATISFACTION|>


# Illustrate the distribution of Productivity and Satisfaction against Employee titled "Productivity and Satisfaction Distribution":
<|{data}|chart|type=histogram|x[1]=PRODUCTIVITY|x[2]=SATISFACTION|title=Productivity and Satisfaction Distribution|>


# Present a horizontal distribution of Productivity and Satisfaction against Employee titled "Productivity and Satisfaction Distribution":
<|{data}|chart|type=histogram|y[1]=PRODUCTIVITY|y[2]=SATISFACTION|title=Productivity and Satisfaction Distribution|>


# Depict a pie chart of Productivity against Employee:
<|{data}|chart|type=pie|values=PRODUCTIVITY|labels=Employee|>


# Illustrate a pie chart of Productivity against Employee titled "Productivity Pie Chart":
<|{data}|chart|type=pie|values=PRODUCTIVITY|labels=Employee|title=Productivity Pie Chart|>


# Depict a pie chart of Satisfaction against Employee:
<|{data}|chart|type=pie|values=SATISFACTION|labels=Employee|>


# Plot Population against Country in a line chart:
<|{data}|chart|type=lines|x=COUNTRY|y=POPULATION|>


# Showcase Population against Country in a line chart titled "Population Trends":
<|{data}|chart|type=lines|x=COUNTRY|y=POPULATION|title=Population Trends|>


# Depict Population and GDP against Country:
<|{data}|chart|type=lines|x=COUNTRY|y[1]=POPULATION|y[2]=GDP|>


# Illustrate Population against Country with a Dashed line:
<|{data}|chart|type=lines|x=COUNTRY|y=POPULATION|line=dash|>


# Present GDP by Country on a Dotted line:
<|{data}|chart|type=lines|x=COUNTRY|y=GDP|line=dot|>


# Plot Population against Country in Blue:
<|{data}|chart|type=lines|x=COUNTRY|y=POPULATION|color=Blue|>


# Exhibit GDP against Country in Green:
<|{data}|chart|type=lines|x=COUNTRY|y=GDP|color=Green|>


# Show GDP against Country in Green titled GDP Overview:
<|{data}|chart|type=lines|x=COUNTRY|y=GDP|color=Green|title=GDP Overview|>


# Display Population in Red and GDP in Yellow against Country:
<|{data}|chart|type=lines|x=COUNTRY|y[1]=POPULATION|y[2]=GDP|color[1]=Red|color[2]=Yellow|>


# Visualize GDP by Country in a Red dashed line and Population in a Yellow Dotted line:
<|{data}|chart|type=lines|x=COUNTRY|y[1]=GDP|y[2]=POPULATION|line[1]=dash|line[2]=dot|color[1]=Red|color[2]=Yellow|>


# Highlight Country according to Population:
<|{data}|chart|type=lines|x=COUNTRY|y=POPULATION|>


# Depict in a bar chart the Population against Country:
<|{data}|chart|type=bar|x=COUNTRY|y=POPULATION|>


# Depict in a bar chart the Population against Country and GDP against Country:
<|{data}|chart|type=bar|x=COUNTRY|y[1]=POPULATION|y[2]=GDP|>


# Showcase Population and GDP against Country in a bar chart:
<|{data}|chart|type=bar|x=COUNTRY|y[1]=POPULATION|y[2]=GDP|>


# Depict in a bar chart the Population against Country and GDP against Country titled Economic Overview:
<|{data}|chart|type=bar|x=COUNTRY|y[1]=POPULATION|y[2]=GDP|title=Economic Overview|>


# Depict in a scatter plot Population against Country:
<|{data}|chart|type=scatter|mode=markers|x=COUNTRY|y=POPULATION|>


# Illustrate Population and GDP against Country in a scatter plot:
<|{data}|chart|type=scatter|mode=markers|x=COUNTRY|y[1]=POPULATION|y[2]=GDP|>


# Plot GDP in Green points and Population in Yellow points against Country:
<|{data}|chart|type=scatter|mode=markers|x=COUNTRY|y[1]=GDP|y[2]=POPULATION|color[1]=Green|color[2]=Yellow|>


# Display a histogram of Population against Country:
<|{data}|chart|type=histogram|x=POPULATION|>


# Showcase a horizontal histogram of Population against Country:
<|{data}|chart|type=histogram|x=POPULATION|>


# Illustrate the distribution of Population and GDP against Country:
<|{data}|chart|type=histogram|x[1]=POPULATION|x[2]=GDP|>


# Illustrate the distribution of Population and GDP against Country titled "Population and GDP Distribution":
<|{data}|chart|type=histogram|x[1]=POPULATION|x[2]=GDP|title=Population and GDP Distribution|>


# Present a horizontal distribution of Population and GDP against Country titled "Population and GDP Distribution":
<|{data}|chart|type=histogram|y[1]=POPULATION|y[2]=GDP|title=Population and GDP Distribution|>


# Depict a pie chart of Population against Country:
<|{data}|chart|type=pie|values=POPULATION|labels=Country|>


# Illustrate a pie chart of Population against Country titled "Population Pie Chart":
<|{data}|chart|type=pie|values=POPULATION|labels=Country|title=Population Pie Chart|>


# Depict a pie chart of GDP against Country:
<|{data}|chart|type=pie|values=GDP|labels=Country|>


# **Worldwide**{: .color-primary} Health and Fitness Trends

<|layout|columns=1 1 1 1|gap=50px|
<|card|
**Average Life Expectancy**{: .color-primary}
<|{'{:.1f}'.format(np.average(data_world_health['Life Expectancy']))}|text|class_name=h2|>
|>

<|card|
**Obesity Rate**{: .color-primary}
<|{'{:.2f}%'.format(np.average(data_world_health['Obesity Rate']))}|text|class_name=h2|>
|>

<|part|class_name=card|
**Gym Memberships**{: .color-primary}
<|{'{:,}'.format(int(np.sum(data_world_health['Gym Memberships']))).replace(',', ' ')}|text|class_name=h2|>
|>
|>

<|{selected_health_metric}|toggle|lov={health_metric_selector}|>

<|part|render={selected_health_metric=='Absolute'}|
<|layout|columns=1 2|
<|{data_world_health_pie_absolute}|chart|type=pie|labels=Country|values=Life Expectancy|title=Global Life Expectancy Distribution|>

<|{data_world_health_evolution_absolute}|chart|properties={data_world_health_evolution_properties}|title=Health and Fitness Evolution Worldwide|>
|>
|>

<|part|render={selected_health_metric=='Relative'}|
<|layout|columns=1 2|
<|{data_world_health_pie_relative}|chart|type=pie|labels=Country|values=Obesity Rate|>

<|{data_world_health_evolution_relative}|chart|properties={data_world_health_evolution_relative_properties}|>
|>
|>


from taipy.gui import Gui
import pandas as pd

# Load task data
task_data = pd.read_csv("task_data.csv")

# Initialize variables
priorities = list(task_data["Priority"].unique())
categories = list(task_data["Category"].unique())
priority = priorities
category = categories

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Tasks:

<|{priority}|selector|lov={priorities}|multiple|label=Select Priority|dropdown|on_change=on_filter|width=100%|>

<|{category}|selector|lov={categories}|multiple|label=Select Category|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Task Management System

<|layout|columns=1 1 1|
<total_tasks|
## Total Tasks:
### <|{len(df_selection)}|>
|total_tasks>

<average_completion_time|
## Average Completion Time:
### <|{round(df_selection["Completion Time"].mean(), 2)}|> hours
|average_completion_time>

<task_table|
Display df_selection in an expandable
<|Task Table|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|task_table>
|main_page>
|>

Code adapted from [Task Management](https://github.com/task_management_app)

Get the Taipy Code [here](https://github.com/Avaiga/task-management-app)


from taipy.gui import Gui
import pandas as pd
from PIL import Image
import io

image_data = None
image_path = ""

def image_upload(state):
    if state.image_path:
        with open(state.image_path, "rb") as file:
            state.image_data = Image.open(io.BytesIO(file.read()))

image_page = """
<|{image_path}|file_selector|accept=image/*|on_action=image_upload|>
<|{image_data}|image|>
"""

Gui(image_page).run()


<|{all_reservations}|table|columns={reservation_columns}|width='100%'|on_action={on_reservation_select}|style=reservation_style|>
<|Create Reservation|button|on_action={open_create_reservation_dialog}|>
<|Refresh Reservations|button|on_action={refresh_reservation_list}|>

<|{show_create_reservation_dialog}|dialog|title=Create Reservation|
<|{customer_name}|input|placeholder='Customer Name'|
<|{reservation_date}|datetime_picker|>
<|{table_number}|number_input|min=1|placeholder='Table Number'|
<|Create|button|on_action={create_reservation}|>
<|Cancel|button|on_action={close_create_reservation_dialog}|>
|>

<|{show_reservation_details}|pane|

# Reservation Details <|Edit|button|on_action=edit_selected_reservation|> <|Cancel|button|on_action=cancel_selected_reservation|>

<|layout|columns=1|
<|part|class_name=card|
## Customer Name
<|{selected_reservation.customer_name}|>
|>

<|part|class_name=card|
## Date and Time
<|{selected_reservation.date.strftime("%b %d, %Y at %H:%M")}|>
|>

<|part|class_name=card|
## Table Number
<|{selected_reservation.table_number}|>
|>

----
|>


<|layout|columns=1 1|
<|part|class_name=card|
### Select Product Category

<|{product_category_selected}|selector|lov=category_electronics;category_clothing;category_food|dropdown|on_change=on_product_category_change|>
|>

<|part|class_name=card|
### Select Store Location

<|{store_location_selected}|selector|lov=location_downtown;location_suburb;location_rural|dropdown|on_change=on_store_location_change|>
|>

|>

<|Inventory Data Overview|expandable|expanded=True|
Display category_data and location_data
<|layout|columns=1 1|
<|{category_data}|table|page_size=5|>

<|{location_data}|table|page_size=5|>
|>
|>

<|layout|columns=1 1|
<|part|class_name=card|
<|{stock_levels_chart}|chart|type=bar|x=Product|y=Stock Level|title=Stock Levels by Category|>
|>

<|part|class_name=card|
<|{sales_by_location_chart}|chart|type=pie|options={sales_options}|layout={sales_layout}|title=Sales by Location|>
|>
|>

### Analyze Inventory Efficiency:
<|{inventory_efficiency_analysis}|scenario|on_submission_change=on_inventory_efficiency_status_change|expandable=False|expanded=False|>

<|{inventory_efficiency_analysis}|scenario_dag|>

### View inventory efficiency results:
<|{inventory_efficiency_analysis.results if inventory_efficiency_analysis else None}|data_node|>


from taipy import Gui

import numpy as np
from PIL import Image
import matplotlib.pyplot as plt

WINDOW_SIZE = 500

cm = plt.cm.get_cmap("viridis")

def generate_mandelbrot(
    center: int = WINDOW_SIZE / 2,
    dx_range: int = 1000,
    dx_start: float = -0.12,
    dy_range: float = 1000,
    dy_start: float = -0.82,
    iterations: int = 50,
    max_value: int = 200,
    i: int = 0,
) -> str:
    mat = np.zeros((WINDOW_SIZE, WINDOW_SIZE))
    for y in range(WINDOW_SIZE):
        for x in range(WINDOW_SIZE):
            dx = (x - center) / dx_range + dx_start
            dy = (y - center) / dy_range + dy_start
            a = dx
            b = dy
            for t in range(iterations):
                d = (a * a) - (b * b) + dx
                b = 2 * (a * b) + dy
                a = d
                h = d > max_value
                if h is True:
                    mat[x, y] = t

    colored_mat = cm(mat / mat.max())
    im = Image.fromarray((colored_mat * 255).astype(np.uint8))
    path = f"mandelbrot_{i}.png"
    im.save(path)

    return path

def generate(state):
    state.i = state.i + 1
    state.path = generate_mandelbrot(
        dx_start=-state.dx_start / 100,
        dy_start=(state.dy_start - 100) / 100,
        iterations=state.iterations,
        i=state.i,
    )

i = 0
dx_start = 11
dy_start = 17
iterations = 50

path = generate_mandelbrot(
    dx_start=-dx_start / 100,
    dy_start=(dy_start - 100) / 100,
)

page = """
# Mandelbrot Art Generator

<|layout|columns=35 65|
Display Mandelbrot Art from path
<|{path}|image|width=500px|height=500px|class_name=img|>

Iterations:

Create a slider to select iterations
<|{iterations}|slider|min=10|max=50|continuous=False|on_change=generate|>

X Position:

<|{dy_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

Y Position:

Slider dx_start
<|{dx_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

|>
"""

Gui(page).run(title="Mandelbrot Art Generator")


<|layout|columns=1 1|
<|part|class_name=card|
### Select Stock

<|{stock_selected}|selector|lov=stock_apple;stock_google;stock_amazon|dropdown|on_change=on_stock_change|>
|>

<|part|class_name=card|
### Select Comparison Market Index

<|{market_index_selected}|selector|lov=index_nasdaq;index_s&p500;index_dowjones|dropdown|on_change=on_market_index_change|>
|>

|>

<|Stock and Market Data|expandable|expanded=True|
Display stock_data and market_index_data
<|layout|columns=1 1|
<|{stock_data}|table|page_size=5|>

<|{market_index_data}|table|page_size=5|>
|>
|>

<|layout|columns=1 1|
<|part|class_name=card|
<|{stock_price_chart}|chart|type=line|x=Date|y=Price|title=Stock Price Trend|>
|>

<|part|class_name=card|
<|{market_index_chart}|chart|type=line|x=Date|y=Index Value|title=Market Index Trend|>
|>
|>

### Run Financial Analysis:
<|{financial_analysis}|scenario|on_submission_change=on_financial_analysis_status_change|expandable=False|expanded=False|>

<|{financial_analysis}|scenario_dag|>

### View financial analysis results:
<|{financial_analysis.results if financial_analysis else None}|data_node|>


from taipy.gui import Gui
import pandas as pd

# Load sales data
sales_data = pd.read_csv("sales_data.csv")

# Initialize variables
regions = list(sales_data["Region"].unique())
products = list(sales_data["Product"].unique())
region = regions
product = products

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Sales Data:

<|{region}|selector|lov={regions}|multiple|label=Select Region|dropdown|on_change=on_filter|width=100%|>

<|{product}|selector|lov={products}|multiple|label=Select Product|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Sales Analysis Dashboard

<|layout|columns=1 1 1|
<total_sales|
## Total Sales:
### US $ <|{int(df_selection["Sales"].sum())}|>
|total_sales>

<average_profit|
## Average Profit:
### US $ <|{round(df_selection["Profit"].mean(), 2)}|>
|average_profit>

<sales_chart|
<|{sales_by_month}|chart|x=Month|y=Sales|type=line|title=Sales by Month|color=#ff462b|width=100%|>

<|{profit_chart}|chart|x=Month|y=Profit|type=line|title=Profit by Month|color=#ff462b|width=100%|>
|sales_chart>
|main_page>
|>

Code adapted from [Sales Analysis](https://github.com/sales_analysis_app)

Get the Taipy Code [here](https://github.com/Avaiga/sales-analysis-app)


<|{all_events}|table|columns={event_columns}|width='100%'|on_action={on_event_click}|style=event_style|>
<|Create Event|button|on_action={open_create_event_dialog}|>
<|Refresh Events|button|on_action={refresh_event_list}|>

<|{show_create_event_dialog}|dialog|title=Create New Event|
<|{event_title}|input|placeholder='Event Title'|
<|{event_date}|date_picker|>
<|Create Event|button|on_action={create_event}|>
<|Cancel|button|on_action={close_create_event_dialog}|>
|>

<|{show_event_details}|pane|

# Event Details <|Edit|button|on_action=edit_selected_event|> <|Cancel|button|on_action=cancel_selected_event|>

<|layout|columns=1|
<|part|class_name=card|
## Title
<|{selected_event.title}|>
|>

<|part|class_name=card|
## Date
<|{selected_event.date.strftime("%b %d, %Y")}|>
|>

<|part|class_name=card|
## Description
<|{selected_event.description}|textarea|disabled=True|>
|>

----
|>


# **Country**{: .color-primary} Energy Consumption

<|layout|columns=1 1 1|
<|{selected_country_energy}|selector|lov={selector_country_energy}|on_change=on_change_country_energy|dropdown|label=Country|>

<|{selected_energy_source}|toggle|lov={energy_source_selector}|on_change=update_energy_source_display|>
|>

<|layout|columns=1 1 1 1|gap=50px|
<|card|
**Total Consumption**{: .color-primary}
<|{'{:,}'.format(int(energy_data.iloc[-1]['Total']))}|text|class_name=h2|>
|>

<|card|
**Renewable Sources**{: .color-primary}
<|{'{:,}'.format(int(energy_data.iloc[-1]['Renewable']))}|text|class_name=h2|>
|>

<|card|
**Non-Renewable Sources**{: .color-primary}
<|{'{:,}'.format(int(energy_data.iloc[-1]['Non-Renewable']))}|text|class_name=h2|>
|>
|>

<|layout|columns=2 1|
<|{energy_data}|chart|type=line|x=Year|y[3]=Total|y[2]=Renewable|y[1]=Non-Renewable|layout={layout}|options={options}|title=Energy Consumption Trends|>

<|{energy_source_distribution_chart}|chart|type=pie|values=energy_source_values|labels=energy_source_labels|title=Energy Source Distribution|>
|>


<|{inventory_items}|table|columns={inventory_columns}|width='100%'|on_action={on_inventory_item_select}|style=inventory_style|>
<|Add Item|button|on_action={open_add_item_dialog}|>
<|Refresh Inventory|button|on_action={refresh_inventory}|>

<|{show_add_item_dialog}|dialog|title=Add Inventory Item|
<|{item_name}|input|placeholder='Item Name'|
<|{item_quantity}|number_input|min=0|>
<|Add Item|button|on_action={add_inventory_item}|>
<|Cancel|button|on_action={close_add_item_dialog}|>
|>

<|{show_item_details}|pane|

# Item Details <|Remove|button|on_action=remove_selected_item|> <|Update|button|on_action=update_selected_item|>

<|layout|columns=2|
<|part|class_name=card|
## Name
<|{selected_item.name}|>
|>

<|part|class_name=card|
## Quantity
<|{selected_item.quantity}|>
|>

<|part|class_name=card|
## ID
<|{selected_item.id}|>
|>

<|part|class_name=card|
## Last Updated
<|{selected_item.last_updated.strftime("%b %d, %Y at %H:%M:%S")}|>
|>

----
|>


if __name__ == "__main__":
    # Initialize with custom sector-related values
    topic = "Technology"
    mood = "tech"
    style = "techexpert"

    # Create a GUI page with custom settings
    page = """
    <|container|
    # **Generate**{: .color-primary} Technology Tweets

    This mini-app generates Tweets related to Technology using OpenAI's GPT-3 based [Davinci model](https://beta.openai.com/docs/models/overview) for texts and [DALL·E](https://beta.openai.com/docs/guides/images) for images. You can find the code on [GitHub](https://github.com/Avaiga/demo-tweet-generation) and the original author on [Twitter](https://twitter.com/kinosal).

    <|layout|columns=1 1 1|gap=30px|class_name=card|
    <topic|
    ## **Topic**{: .color-primary} (or hashtag)

    <|{topic}|input|label=Technology Topic (or hashtag)|>
    |topic>

    <mood|
    ## **Mood**{: .color-primary}

    <|{mood}|input|label=Mood (e.g. tech, innovation, gadgets) (optional)|>
    |mood>


from taipy.gui import Gui
import pandas as pd

# Load event registration data
event_data = pd.read_csv("event_registration_data.csv")

# Initialize variables
events = list(event_data["Event"].unique())
registrants = list(event_data["Registrant"].unique())
event = events
registrant = registrants

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Event Registration:

<|{event}|selector|lov={events}|multiple|label=Select Event|dropdown|on_change=on_filter|width=100%|>

<|{registrant}|selector|lov={registrants}|multiple|label=Select Registrant|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Event Registration System

<|layout|columns=1 1 1|
<total_registrations|
## Total Registrations:
### <|{len(df_selection)}|>
|total_registrations>

<average_attendance|
## Average Attendance:
### <|{round(df_selection["Attendance"].mean(), 2)}|> attendees
|average_attendance>

<event_registration_table|
Display df_selection in an expandable
<|Event Registration Table|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|event_registration_table>
|main_page>
|>

Code adapted from [Event Registration](https://github.com/event_registration_app)

Get the Taipy Code [here](https://github.com/Avaiga/event-registration-app)


<|{all_courses}|table|columns={course_columns}|width='100%'|on_action={on_course_select}|style=course_style|>
<|Add Course|button|on_action={open_add_course_dialog}|>
<|Refresh Courses|button|on_action={refresh_course_list}|>

<|{show_add_course_dialog}|dialog|title=Add New Course|
<|{course_title}|input|placeholder='Course Title'|
<|{course_instructor}|input|placeholder='Instructor Name'|
<|{course_duration}|number_input|placeholder='Duration in Hours'|
<|{course_category}|selector|lov={get_all_categories()}|>
<|Add Course|button|on_action={add_course}|>
<|Cancel|button|on_action={close_add_course_dialog}|>
|>

<|{show_course_details}|pane|

# Course Details <|Edit|button|on_action=edit_selected_course|> <|Remove|button|on_action=remove_selected_course|>

<|layout|columns=1|
<|part|class_name=card|
## Title
<|{selected_course.title}|>
|>

<|part|class_name=card|
## Instructor
<|{selected_course.instructor}|>
|>

<|part|class_name=card|
## Duration
<|{selected_course.duration}|>
|>

<|part|class_name=card|
## Category
<|{selected_course.category}|>
|>

----
|>


<|{all_itineraries}|table|columns={itinerary_columns}|width='100%'|on_action={on_itinerary_select}|style=itinerary_style|>
<|Create Itinerary|button|on_action={open_create_itinerary_dialog}|>
<|Refresh Itineraries|button|on_action={refresh_itinerary_list}|>

<|{show_create_itinerary_dialog}|dialog|title=Create Travel Itinerary|
<|{destination}|input|placeholder='Destination'|
<|{start_date}|date_picker|>
<|{end_date}|date_picker|>
<|Create Itinerary|button|on_action={create_itinerary}|>
<|Cancel|button|on_action={close_create_itinerary_dialog}|>
|>

<|{show_itinerary_details}|pane|

# Itinerary Details <|Edit|button|on_action=edit_selected_itinerary|> <|Remove|button|on_action=remove_selected_itinerary|>

<|layout|columns=1|
<|part|class_name=card|
## Destination
<|{selected_itinerary.destination}|>
|>

<|part|class_name=card|
## Start Date
<|{selected_itinerary.start_date.strftime("%b %d, %Y")}|>
|>

<|part|class_name=card|
## End Date
<|{selected_itinerary.end_date.strftime("%b %d, %Y")}|>
|>

----
|>


<|{all_exhibits}|table|columns={exhibit_columns}|width='100%'|on_action={on_exhibit_select}|style=exhibit_style|>
<|Add Exhibit|button|on_action={open_add_exhibit_dialog}|>
<|Refresh Exhibits|button|on_action={refresh_exhibit_list}|>

<|{show_add_exhibit_dialog}|dialog|title=Add New Exhibit|
<|{exhibit_name}|input|placeholder='Exhibit Name'|
<|{exhibit_artist}|input|placeholder='Artist Name'|
<|{exhibit_start_date}|date_picker|>
<|{exhibit_end_date}|date_picker|>
<|Add Exhibit|button|on_action={add_exhibit}|>
<|Cancel|button|on_action={close_add_exhibit_dialog}|>
|>

<|{show_exhibit_details}|pane|

# Exhibit Details <|Edit|button|on_action=edit_selected_exhibit|> <|Remove|button|on_action=remove_selected_exhibit|>

<|layout|columns=1|
<|part|class_name=card|
## Name
<|{selected_exhibit.name}|>
|>

<|part|class_name=card|
## Artist
<|{selected_exhibit.artist}|>
|>

<|part|class_name=card|
## Start Date
<|{selected_exhibit.start_date.strftime("%b %d, %Y")}|>
|>

<|part|class_name=card|
## End Date
<|{selected_exhibit.end_date.strftime("%b %d, %Y")}|>
|>

----
|>


from taipy.gui import Gui
import pandas as pd

# Load employee data
employee_data = pd.read_csv("employee_data.csv")

# Initialize variables
departments = list(employee_data["Department"].unique())
positions = list(employee_data["Position"].unique())
department = departments
position = positions

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Employees:

<|{department}|selector|lov={departments}|multiple|label=Select Department|dropdown|on_change=on_filter|width=100%|>

<|{position}|selector|lov={positions}|multiple|label=Select Position|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Employee Management System

<|layout|columns=1 1 1|
<total_employees|
## Total Employees:
### <|{len(df_selection)}|>
|total_employees>

<average_salary|
## Average Salary:
### US $ <|{round(df_selection["Salary"].mean(), 2)}|>
|average_salary>

<employee_table|
Display df_selection in an expandable
<|Employee Table|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|employee_table>
|main_page>
|>

Code adapted from [Employee Management](https://github.com/employee_management_app)

Get the Taipy Code [here](https://github.com/Avaiga/employee-management-app)
"""

def filter(department, position):
    df_selection = employee_data[
        employee_data["Department"].isin(department)
        & employee_data["Position"].isin(position)
    ]
    return df_selection

def on_filter(state):
    state.df_selection = filter(state.department, state.position)

if __name__ == "__main__":
    # Initialize dataframe
    df_selection = filter(department, position)

    # Run the app
    Gui(page).run()


from taipy.gui import Gui
import pandas as pd

# Load customer feedback data
feedback_data = pd.read_csv("customer_feedback_data.csv")

# Initialize variables
products = list(feedback_data["Product"].unique())
ratings = list(feedback_data["Rating"].unique())
product = products
rating = ratings

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Customer Feedback:

<|{product}|selector|lov={products}|multiple|label=Select Product|dropdown|on_change=on_filter|width=100%|>

<|{rating}|selector|lov={ratings}|multiple|label=Select Rating|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Customer Feedback System

<|layout|columns=1 1 1|
<total_feedback|
## Total Feedback Entries:
### <|{len(df_selection)}|>
|total_feedback>

<average_rating|
## Average Rating:
### <|{round(df_selection["Rating"].mean(), 1)}|>
|average_rating>

<feedback_table|
Display df_selection in an expandable
<|Feedback Table|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|feedback_table>
|main_page>
|>

Code adapted from [Customer Feedback](https://github.com/customer_feedback_app)

Get the Taipy Code [here](https://github.com/Avaiga/customer-feedback-app)


from taipy.gui import Gui
import taipy as tp

# Import pages related to the finance sector (replace with actual imports)
from pages.finance.finance import finance_md

# Define the pages
pages = {
    '/': root,  # Replace with the root page if you have one
    "Finance": finance_md,
}

# Create a Gui instance with the pages
gui_multi_pages = Gui(pages=pages)

if __name__ == '__main__':
    tp.Core().run()

    # Run the multi-page app
    gui_multi_pages.run(title="Finance Dashboard")


from taipy.gui import Gui
import pandas as pd

# Load inventory data
inventory_data = pd.read_csv("inventory_data.csv")

# Initialize variables
categories = list(inventory_data["Category"].unique())
locations = list(inventory_data["Location"].unique())
category = categories
location = locations

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Inventory Management:

<|{category}|selector|lov={categories}|multiple|label=Select Category|dropdown|on_change=on_filter|width=100%|>

<|{location}|selector|lov={locations}|multiple|label=Select Location|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Inventory Management System

<|layout|columns=1 1 1|
<total_items|
## Total Items:
### <|{len(df_selection)}|>
|total_items>

<average_quantity|
## Average Quantity:
### <|{round(df_selection["Quantity"].mean(), 2)}|> units
|average_quantity>

<inventory_table|
Display df_selection in an expandable
<|Inventory Table|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|inventory_table>
|main_page>
|>

Code adapted from [Inventory Management](https://github.com/inventory_management_app)

Get the Taipy Code [here](https://github.com/Avaiga/inventory-management-app)


<|layout|columns=2 9|gap=50px|
<sidebar|sidebar|
**Market Analysis** Setup

<|{selected_market_analysis}|market_analysis_selector|>
|sidebar>

<market_analysis|part|render={selected_market_analysis}|
# **Real Estate Trends**{: .color-primary} page

<|1 1|layout|
<date|
#### Analysis **Start Date**{: .color-primary}

<|{analysis_start_date}|date|on_change=on_change_market_analysis_params|>
|date>

<region|
#### **Region**{: .color-primary} for Analysis

<|{selected_region}|selector|lov={selector_region}|dropdown|on_change=on_change_market_analysis_params|label=Region|>
|region>
|>

<|{selected_market_analysis}|market_analysis|on_submission_change=on_submission_change_market_analysis|not expanded|>

---------------------------------------

## **Market Predictions**{: .color-primary} and Data Exploration

<|{selected_market_analysis.result.read() if selected_market_analysis and selected_market_analysis.result.read() is not None else default_market_result}|chart|x=Date|y[1]=Average Price|y[2]=Volume|y[3]=Trend Analysis|type[1]=line|title=Real Estate Market Trends|>

<|Data Nodes|expandable|
<|1 5|layout|
<|{selected_data_node}|data_node_selector|>

<|{selected_data_node}|data_node|>
|>
|>

|market_analysis>
|>


from taipy.gui import Gui
import pandas as pd

# Load product inventory data
product_inventory = pd.read_csv("product_inventory.csv")

# Initialize variables
categories = list(product_inventory["Category"].unique())
brands = list(product_inventory["Brand"].unique())
category = categories
brand = brands

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Products:

<|{category}|selector|lov={categories}|multiple|label=Select Category|dropdown|on_change=on_filter|width=100%|>

<|{brand}|selector|lov={brands}|multiple|label=Select Brand|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Product Inventory System

<|layout|columns=1 1 1|
<total_products|
## Total Products:
### <|{len(df_selection)}|>
|total_products>

<average_price|
## Average Price:
### US $ <|{round(df_selection["Price"].mean(), 2)}|>
|average_price>

<product_table|
Display df_selection in an expandable
<|Product Table|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|product_table>
|main_page>
|>

Code adapted from [Product Inventory](https://github.com/product_inventory_app)

Get the Taipy Code [here](https://github.com/Avaiga/product-inventory-app)


# **Country**{: .color-primary} Agricultural Production

<|layout|columns=1 1 1|
<|{selected_country_agriculture}|selector|lov={selector_country_agriculture}|on_change=on_change_country_agriculture|dropdown|label=Country|>

<|{selected_crop}|toggle|lov={crop_selector}|on_change=update_crop_display|>
|>

<|layout|columns=1 1 1 1|gap=50px|
<|card|
**Total Production**{: .color-primary}
<|{'{:,}'.format(int(agriculture_data.iloc[-1]['Total']))}|text|class_name=h2|>
|>

<|card|
**Crop Yield**{: .color-primary}
<|{'{:,}'.format(int(agriculture_data.iloc[-1]['Yield']))}|text|class_name=h2|>
|>

<|card|
**Export Volume**{: .color-primary}
<|{'{:,}'.format(int(agriculture_data.iloc[-1]['Export']))}|text|class_name=h2|>
|>
|>

<|layout|columns=2 1|
<|{agriculture_data}|chart|type=area|x=Year|y[3]=Total|y[2]=Yield|y[1]=Export|layout={layout}|options={options}|title=Agricultural Trends|>

<|{crop_distribution_chart}|chart|type=pie|values=crop_values|labels=crop_labels|title=Crop Distribution|>
|>


from taipy.gui import Gui
import taipy as tp

# Import pages related to the e-commerce sector (replace with actual imports)
from pages.ecommerce.ecommerce import ecommerce_md

# Define the pages
pages = {
    '/': root,  # Replace with the root page if you have one
    "E-commerce": ecommerce_md,
}

# Create a Gui instance with the pages
gui_multi_pages = Gui(pages=pages)

if __name__ == '__main__':
    tp.Core().run()

    # Run the multi-page app
    gui_multi_pages.run(title="E-commerce Dashboard")


<|{all_users}|table|columns={user_columns}|width='100%'|on_action={on_user_table_click}|style=user_style|>
<|Add User|button|on_action={open_add_user_dialog}|>
<|Refresh Users|button|on_action={refresh_user_list}|>

<|{show_dialog_add_user}|dialog|title=Add new user|
<|{new_user_name}|input|placeholder='Enter user name'|
<|{new_user_role}|selector|lov={get_all_roles()}|>
<|Add|button|on_action={add_user}|>
<|Cancel|button|on_action={close_add_user_dialog}|>
|>

<|{show_user_details}|pane|

# User Details <|Delete|button|on_action=delete_selected_user|> <|Disable|button|on_action=disable_selected_user|>

<|layout|columns=1 1|
<|part|class_name=card|
## Name
<|{selected_user.name}|>
|>

<|part|class_name=card|
## Role
<|{selected_user.role}|>
|>

<|part|class_name=card|
## ID
<|{selected_user.id}|>
|>

<|part|class_name=card|
## Creation Date
<|{selected_user.creation_date.strftime("%b %d %y %H:%M:%S")}|>
|>

<|part|class_name=card|
## Status
<|{get_status(selected_user)}|>
|>

----
|>


from taipy.gui import Gui
import pandas as pd

# Load sales data
sales_data = pd.read_csv("sales_data.csv")

# Initialize variables
regions = list(sales_data["Region"].unique())
categories = list(sales_data["Category"].unique())
region = regions
category = categories

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Sales Performance:

<|{region}|selector|lov={regions}|multiple|label=Select Region|dropdown|on_change=on_filter|width=100%|>

<|{category}|selector|lov={categories}|multiple|label=Select Category|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Sales Performance Dashboard

<|layout|columns=1 1 1|
<total_sales|
## Total Sales:
### US $ <|{int(df_selection["Sales"].sum())}|>
|total_sales>

<average_profit|
## Average Profit:
### US $ <|{round(df_selection["Profit"].mean(), 2)}|>
|average_profit>

<sales_dashboard|
Display df_selection in an expandable
<|Sales Dashboard|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|sales_dashboard>
|main_page>
|>

Code adapted from [Sales Performance Dashboard](https://github.com/sales_performance_app)

Get the Taipy Code [here](https://github.com/Avaiga/sales-performance-dashboard-app)


<|{all_resources}|table|columns={resource_columns}|width='100%'|on_action={on_resource_select}|style=resource_style|>
<|Allocate Resource|button|on_action={open_allocate_resource_dialog}|>
<|Refresh Resources|button|on_action={refresh_resource_list}|>

<|{show_allocate_resource_dialog}|dialog|title=Allocate Resource|
<|{resource_name}|selector|lov={get_all_resources()}|>
<|{resource_quantity}|number_input|min=0|placeholder='Quantity'|
<|Allocate|button|on_action={allocate_resource}|>
<|Cancel|button|on_action={close_allocate_resource_dialog}|>
|>

<|{show_resource_details}|pane|

# Resource Details <|Release|button|on_action=release_selected_resource|> <|Update|button|on_action=update_selected_resource|>

<|layout|columns=2|
<|part|class_name=card|
## Name
<|{selected_resource.name}|>
|>

<|part|class_name=card|
## Allocated Quantity
<|{selected_resource.allocated_quantity}|>
|>

<|part|class_name=card|
## Total Quantity
<|{selected_resource.total_quantity}|>
|>

<|part|class_name=card|
## Last Allocation Date
<|{selected_resource.last_allocation_date.strftime("%b %d, %Y")}|>
|>

----
|>


from taipy import Gui
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt

WINDOW_SIZE = 500

cm = plt.cm.get_cmap("viridis")

def generate_mandelbrot(
    center: int = WINDOW_SIZE / 2,
    dx_range: int = 1000,
    dx_start: float = -0.12,
    dy_range: float = 1000,
    dy_start: float = -0.82,
    iterations: int = 50,
    max_value: int = 200,
    i: int = 0,
) -> str:
    mat = np.zeros((WINDOW_SIZE, WINDOW_SIZE))
    for y in range(WINDOW_SIZE):
        for x in range(WINDOW_SIZE):
            dx = (x - center) / dx_range + dx_start
            dy = (y - center) / dy_range + dy_start
            a = dx
            b = dy
            for t in range(iterations):
                d = (a * a) - (b * b) + dx
                b = 2 * (a * b) + dy
                a = d
                h = d > max_value
                if h is True:
                    mat[x, y] = t

    colored_mat = cm(mat / mat.max())
    im = Image.fromarray((colored_mat * 255).astype(np.uint8))
    path = f"mandelbrot_{i}.png"
    im.save(path)

    return path

def generate(state):
    state.i = state.i + 1
    state.path = generate_mandelbrot(
        dx_start=-state.dx_start / 100,
        dy_start=(state.dy_start - 100) / 100,
        iterations=state.iterations,
        i=state.i,
    )

i = 0
dx_start = 11
dy_start = 17
iterations = 50

path = generate_mandelbrot(
    dx_start=-dx_start / 100,
    dy_start=(dy_start - 100) / 100,
)

page = """
# Mandelbrot Fractal Education

<|layout|columns=35 65|
Display Mandelbrot Fractal for Educational Purposes
<|{path}|image|width=500px|height=500px|class_name=img|>

Iterations:

Create a slider to select iterations
<|{iterations}|slider|min=10|max=50|continuous=False|on_change=generate|>

X Position:

<|{dy_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

Y Position:

Slider dx_start
<|{dx_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

|>
"""

Gui(page).run(title="Mandelbrot Fractal Education")


if __name__ == "__main__":
    # Initialize with custom sector-related values
    topic = "Economics"
    mood = "economicanalysis"
    style = "economicspro"

    # Create a GUI page with custom settings
    page = """
    <|container|
    # **Generate**{: .color-primary} Economics Tweets

    This mini-app generates Tweets related to Economics using OpenAI's GPT-3 based [Davinci model](https://beta.openai.com/docs/models/overview) for texts and [DALL·E](https://beta.openai.com/docs/guides/images) for images. You can find the code on [GitHub](https://github.com/Avaiga/demo-tweet-generation) and the original author on [Twitter](https://twitter.com/kinosal).

    <|layout|columns=1 1 1|gap=30px|class_name=card|
    <topic|
    ## **Topic**{: .color-primary} (or hashtag)

    <|{topic}|input|label=Economics Topic (or hashtag)|>
    |topic>

    <mood|
    ## **Mood**{: .color-primary}

    <|{mood}|input|label=Mood (e.g. economicanalysis, finance, markets) (optional)|>
    |mood>


<|layout|columns=1 1|
<|part|class_name=card|
### Select Traffic Zone

<|{traffic_zone_selected}|selector|lov=zone_downtown;zone_suburbs;zone_industrial|dropdown|on_change=on_traffic_zone_change|>
|>

<|part|class_name=card|
### Select Time of Day

<|{time_of_day_selected}|selector|lov=time_morning;time_afternoon;time_evening|dropdown|on_change=on_time_of_day_change|>
|>

|>

<|Traffic Data Overview|expandable|expanded=True|
Display traffic_zone_data and time_of_day_data
<|layout|columns=1 1|
<|{traffic_zone_data}|table|page_size=5|>

<|{time_of_day_data}|table|page_size=5|>
|>
|>

<|layout|columns=1 1|
<|part|class_name=card|
<|{traffic_volume_chart}|chart|type=bar|x=Zone|y=Traffic Volume|title=Traffic Volume by Zone|>
|>

<|part|class_name=card|
<|{peak_hours_chart}|chart|type=line|x=Time|y=Vehicles|title=Peak Traffic Hours|>
|>
|>

### Analyze Traffic Patterns:
<|{traffic_pattern_analysis}|scenario|on_submission_change=on_traffic_pattern_status_change|expandable=False|expanded=False|>

<|{traffic_pattern_analysis}|scenario_dag|>

### View traffic pattern analysis results:
<|{traffic_pattern_analysis.results if traffic_pattern_analysis else None}|data_node|>


from taipy.gui import Gui
import pandas as pd

text_data = ""
text_path = ""

def text_upload(state):
    if state.text_path:
        with open(state.text_path, "r") as file:
            state.text_data = file.read()

text_page = """
<|{text_path}|file_selector|accept=.txt|on_action=text_upload|>
<|{text_data}|textarea|rows=10|>
"""

Gui(text_page).run()


from taipy import Gui
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt

WINDOW_SIZE = 500

cm = plt.cm.get_cmap("viridis")

def generate_mandelbrot(
    center: int = WINDOW_SIZE / 2,
    dx_range: int = 1000,
    dx_start: float = -0.12,
    dy_range: float = 1000,
    dy_start: float = -0.82,
    iterations: int = 50,
    max_value: int = 200,
    i: int = 0,
) -> str:
    mat = np.zeros((WINDOW_SIZE, WINDOW_SIZE))
    for y in range(WINDOW_SIZE):
        for x in range(WINDOW_SIZE):
            dx = (x - center) / dx_range + dx_start
            dy = (y - center) / dy_range + dy_start
            a = dx
            b = dy
            for t in range(iterations):
                d = (a * a) - (b * b) + dx
                b = 2 * (a * b) + dy
                a = d
                h = d > max_value
                if h is True:
                    mat[x, y] = t

    colored_mat = cm(mat / mat.max())
    im = Image.fromarray((colored_mat * 255).astype(np.uint8))
    path = f"mandelbrot_{i}.png"
    im.save(path)

    return path

def generate(state):
    state.i = state.i + 1
    state.path = generate_mandelbrot(
        dx_start=-state.dx_start / 100,
        dy_start=(state.dy_start - 100) / 100,
        iterations=state.iterations,
        i=state.i,
    )

i = 0
dx_start = 11
dy_start = 17
iterations = 50

path = generate_mandelbrot(
    dx_start=-dx_start / 100,
    dy_start=(dy_start - 100) / 100,
)

page = """
# Mandelbrot Fractal for Agriculture Visualization

<|layout|columns=35 65|
Visualize Complex Patterns with Mandelbrot Fractals
<|{path}|image|width=500px|height=500px|class_name=img|>

Iterations:

Select the number of iterations to explore fractal patterns
<|{iterations}|slider|min=10|max=50|continuous=False|on_change=generate|>

X Position:

<|{dy_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

Y Position:

Slider dx_start
<|{dx_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

|>
"""

Gui(page).run(title="Mandelbrot Fractal for Agriculture Visualization")


<|layout|columns=2 9|gap=50px|
<sidebar|sidebar|
**Demand Forecasting** Initialization

<|{selected_demand_forecast}|demand_forecast_selector|>
|sidebar>

<demand_forecast|part|render={selected_demand_forecast}|
# **Energy Demand Prediction**{: .color-primary} page

<|1 1|layout|
<date|
#### Forecast **Target Date**{: .color-primary}

<|{forecast_target_date}|date|on_change=on_change_demand_forecast_params|>
|date>

<energy_type|
#### **Energy Type**{: .color-primary} for Forecasting

<|{selected_energy_type}|selector|lov={selector_energy_type}|dropdown|on_change=on_change_demand_forecast_params|label=Energy Type|>
|energy_type>
|>

<|{selected_demand_forecast}|demand_forecast|on_submission_change=on_submission_change_demand_forecast|not expanded|>

---------------------------------------

## **Energy Demand Projections**{: .color-primary} and Data Analysis

<|{selected_demand_forecast.result.read() if selected_demand_forecast and selected_demand_forecast.result.read() is not None else default_demand_result}|chart|x=Date|y[1]=Projected Demand|y[2]=Historical Demand|type[1]=bar|title=Energy Demand Forecast|>

<|Data Nodes|expandable|
<|1 5|layout|
<|{selected_data_node}|data_node_selector|>

<|{selected_data_node}|data_node|>
|>
|>

|demand_forecast>
|>


# **Country**{: .color-primary} Economic Indicators

<|layout|columns=1 1 1|
<|{selected_country_economy}|selector|lov={selector_country_economy}|on_change=on_change_country_economy|dropdown|label=Country|>

<|{selected_economic_indicator}|toggle|lov={economic_indicator_selector}|on_change=update_economic_indicator|>
|>

<|layout|columns=1 1 1 1|gap=50px|
<|card|
**GDP**{: .color-primary}
<|{'${:,.2f}'.format(economy_data.iloc[-1]['GDP'])}|text|class_name=h2|>
|>

<|card|
**Inflation Rate**{: .color-primary}
<|{'{:.2f}%'.format(economy_data.iloc[-1]['Inflation Rate'])}|text|class_name=h2|>
|>

<|card|
**Unemployment Rate**{: .color-primary}
<|{'{:.2f}%'.format(economy_data.iloc[-1]['Unemployment Rate'])}|text|class_name=h2|>
|>
|>

<|layout|columns=2 1|
<|{economy_data}|chart|type=line|x=Year|y[3]=GDP|y[2]=Inflation Rate|y[1]=Un


<|layout|columns=1 1|
<|part|class_name=card|
### Select Energy Source

<|{energy_source_selected}|selector|lov=source_solar;source_wind;source_hydro|dropdown|on_change=on_energy_source_change|>
|>

<|part|class_name=card|
### Select Region

<|{region_selected}|selector|lov=region_north;region_south;region_east;region_west|dropdown|on_change=on_region_change|>
|>

|>

<|Energy Data Overview|expandable|expanded=True|
Display energy_data and region_data
<|layout|columns=1 1|
<|{energy_data}|table|page_size=5|>

<|{region_data}|table|page_size=5|>
|>
|>

<|layout|columns=1 1|
<|part|class_name=card|
<|{consumption_chart}|chart|type=bar|x=Month|y=Consumption|title=Energy Consumption by Source|>
|>

<|part|class_name=card|
<|{region_comparison_chart}|chart|type=line|x=Month|y=Region Consumption|title=Regional Energy Consumption|>
|>
|>

### Analyze Energy Trends:
<|{energy_trend_analysis}|scenario|on_submission_change=on_energy_trend_status_change|expandable=False|expanded=False|>

<|{energy_trend_analysis}|scenario_dag|>

### View energy trend analysis results:
<|{energy_trend_analysis.results if energy_trend_analysis else None}|data_node|>


from taipy.gui import Gui
import taipy as tp

from pages.country.country import country_md
from pages.world.world import world_md
from pages.map.map import map_md
from pages.predictions.predictions import predictions_md, selected_scenario
from pages.root import root, selected_country, selector_country

from config.config import Config

# Define the pages
pages = {
    '/': root,
    "Country": country_md,
    "World": world_md,
    "Map": map_md,
    "Predictions": predictions_md
}

# Create a Gui instance with the pages
gui_multi_pages = Gui(pages=pages)

if __name__ == '__main__':
    tp.Core().run()

    # Run the multi-page app
    gui_multi_pages.run(title="Covid Dashboard")


<|layout|columns=1 1|
<|part|class_name=card|
### Select Research Area

<|{research_area_selected}|selector|lov=area_physics;area_chemistry;area_biology|dropdown|on_change=on_research_area_change|>
|>

<|part|class_name=card|
### Select Year

<|{publication_year_selected}|selector|lov=year_2020;year_2021;year_2022|dropdown|on_change=on_publication_year_change|>
|>

|>

<|Research Publications Overview|expandable|expanded=True|
Display research_data and year_data
<|layout|columns=1 1|
<|{research_data}|table|page_size=5|>

<|{year_data}|table|page_size=5|>
|>
|>

<|layout|columns=1 1|
<|part|class_name=card|
<|{publication_count_chart}|chart|type=bar|x=Research Area|y=Publications|title=Publications Count|>
|>

<|part|class_name=card|
<|{citation_chart}|chart|type=line|x=Year|y=Citations|title=Citation Trends|>
|>
|>

### Analyze Research Impact:
<|{research_impact_analysis}|scenario|on_submission_change=on_research_impact_status_change|expandable=False|expanded=False|>

<|{research_impact_analysis}|scenario_dag|>

### View research impact results:
<|{research_impact_analysis.results if research_impact_analysis else None}|data_node|>


<|layout|columns=1 1|
<|part|class_name=card|
### Select Department

<|{department_selected}|selector|lov=dept_sales;dept_marketing;dept_technical|dropdown|on_change=on_department_change|>
|>

<|part|class_name=card|
### Select Time Period

<|{time_period_selected}|selector|lov=period_this_month;period_last_month;period_this_quarter|dropdown|on_change=on_time_period_change|>
|>

|>

<|Employee Performance Overview|expandable|expanded=True|
Display department_data and time_period_data
<|layout|columns=1 1|
<|{department_data}|table|page_size=5|>

<|{time_period_data}|table|page_size=5|>
|>
|>

<|layout|columns=1 1|
<|part|class_name=card|
<|{performance_chart}|chart|type=bar|x=Employee|y=Performance Score|title=Department Performance|>
|>

<|part|class_name=card|
<|{attendance_chart}|chart|type=line|options={attendance_options}|layout={attendance_layout}|>
|>
|>

### Run Employee Analysis:
<|{employee_analysis}|scenario|on_submission_change=on_employee_analysis_status_change|expandable=False|expanded=False|>

<|{employee_analysis}|scenario_dag|>

### View the employee analysis results:
<|{employee_analysis.results if employee_analysis else None}|data_node|>


from taipy.gui import Gui, notify, state
import random
import re
import logging
import taipy

# Import OpenAI module
import oai

# Configure logger
logging.basicConfig(format="\n%(asctime)s\n%(message)s", level=logging.INFO, force=True)

# Define functions
def error_prompt_flagged(state, prompt):
    """Notify user that a prompt has been flagged."""
    notify(state, "error", "Prompt flagged as inappropriate.")
    logging.info(f"Prompt flagged as inappropriate: {prompt}")

def error_too_many_requests(state):
    """Notify user that too many requests have been made."""
    notify(
        state,
        "error",
        "Too many requests. Please wait a few seconds before generating another text or image.",
    )
    logging.info(f"Session request limit reached: {state.n_requests}")
    state.n_requests = 1

def generate_text(state):
    """Generate Tweet text."""
    state.tweet = ""
    state.image = None

    # Check the number of requests done by the user
    if state.n_requests >= 5:
        error_too_many_requests(state)
        return

    # Check if the user has put a topic
    if state.topic == "":
        notify(state, "error", "Please enter a topic")
        return

    # Create the prompt and add a style or not
    if state.style == "":
        state.prompt = (
            f"Write a {state.mood}Tweet about {state.topic} in less than 120 characters "
            f"and with the style of {state.style}:\n\n\n\n"
        )
    else:
        state.prompt = f"Write a {state.mood}Tweet about {state.topic} in less than 120 characters:\n\n"

    # openai configured and check if text is flagged
    openai = oai.Openai()
    flagged = openai.moderate(state.prompt)

    if flagged:
        error_prompt_flagged(state, f"Prompt: {state.prompt}\n")
        return
    else:
        # Generate the tweet
        state.n_requests += 1
        state.tweet = openai.complete(state.prompt).strip().replace('"', "")

        # Notify the user in console and in the GUI
        logging.info(
            f"Topic: {state.prompt}{state.mood}{state.style}\n" f"Tweet: {state.tweet}"
        )
        notify(state, "success", "Tweet created!")

def generate_image(state):
    """Generate Tweet image."""
    notify(state, "info", "Generating image...")

    # Check the number of requests done by the user
    if state.n_requests >= 5:
        error_too_many_requests(state)
        return

    state.image = None

    # Creates the prompt
    prompt_wo_hashtags = re.sub("#[A-Za-z0-9_]+", "", state.prompt)
    processing_prompt = (
        "Create a detailed but brief description of an image that captures "
        f"the essence of the following text:\n{prompt_wo_hashtags}\n\n"
    )

    # Openai configured and check if text is flagged
    openai = oai.Openai()
    flagged = openai.moderate(processing_prompt)

    if flagged:
        error_prompt_flagged(state, processing_prompt)
        return
    else:
        state.n_requests += 1
        # Generate the prompt that will create the image
        processed_prompt = (
            openai.complete(prompt=processing_prompt, temperature=0.5, max_tokens=40)
            .strip()
            .replace('"', "")
            .split(".")[0]
            + "."
        )

        # Generate the image
        state.image = openai.image(processed_prompt)

        # Notify the user in console and in the GUI
        logging.info(f"Tweet: {state.prompt}\nImage prompt: {processed_prompt}")
        notify(state, "success", f"Image created!")

def feeling_lucky(state):
    """Generate a feeling-lucky tweet."""
    with open("moods.txt") as f:
        sample_moods = f.read().splitlines()
    state.topic = "an interesting topic"
    state.mood = random.choice(sample_moods)
    state.style = ""
    generate_text(state)

# Variables
tweet = ""
prompt = ""
n_requests = 0

topic = "AI"
mood = "inspirational"
style = "elonmusk"

image = None

# Called whenever there is a problem
def on_exception(state, function_name: str, ex: Exception):
    logging.error(f"Problem {ex} \nin {function_name}")
    notify(state, "error", f"Problem {ex} \nin {function_name}")

# Markdown for the entire page
page = """
<|container|
# **Generate**{: .color-primary} Tweets

This mini-app generates Tweets using OpenAI's GPT-3 based [Davinci model](https://beta.openai.com/docs/models/overview) for texts and [DALL·E](https://beta.openai.com/docs/guides/images) for images. You can find the code on [GitHub](https://github.com/Avaiga/demo-tweet-generation) and the original author on [Twitter](https://twitter.com/kinosal).

<|layout|columns=1 1 1|gap=30px|class_name=card|
<topic|
## **Topic**{: .color-primary} (or hashtag)

<|{topic}|input|label=Topic (or hashtag)|>
|topic>

<mood|
## **Mood**{: .color-primary}

<|{mood}|input|label=Mood (e.g. inspirational, funny, serious) (optional)|>
|mood>


from taipy import Gui
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt

WINDOW_SIZE = 500

cm = plt.cm.get_cmap("viridis")

def generate_mandelbrot(
    center: int = WINDOW_SIZE / 2,
    dx_range: int = 1000,
    dx_start: float = -0.12,
    dy_range: float = 1000,
    dy_start: float = -0.82,
    iterations: int = 50,
    max_value: int = 200,
    i: int = 0,
) -> str:
    mat = np.zeros((WINDOW_SIZE, WINDOW_SIZE))
    for y in range(WINDOW_SIZE):
        for x in range(WINDOW_SIZE):
            dx = (x - center) / dx_range + dx_start
            dy = (y - center) / dy_range + dy_start
            a = dx
            b = dy
            for t in range(iterations):
                d = (a * a) - (b * b) + dx
                b = 2 * (a * b) + dy
                a = d
                h = d > max_value
                if h is True:
                    mat[x, y] = t

    colored_mat = cm(mat / mat.max())
    im = Image.fromarray((colored_mat * 255).astype(np.uint8))
    path = f"mandelbrot_{i}.png"
    im.save(path)

    return path

def generate(state):
    state.i = state.i + 1
    state.path = generate_mandelbrot(
        dx_start=-state.dx_start / 100,
        dy_start=(state.dy_start - 100) / 100,
        iterations=state.iterations,
        i=state.i,
    )

i = 0
dx_start = 11
dy_start = 17
iterations = 50

path = generate_mandelbrot(
    dx_start=-dx_start / 100,
    dy_start=(dy_start - 100) / 100,
)

page = """
# Mandelbrot Fractal for Scientific Visualization

<|layout|columns=35 65|
Visualize Complex Patterns with Mandelbrot Fractals
<|{path}|image|width=500px|height=500px|class_name=img|>

Iterations:

Select the number of iterations to explore fractal patterns
<|{iterations}|slider|min=10|max=50|continuous=False|on_change=generate|>

X Position:

<|{dy_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

Y Position:

Slider dx_start
<|{dx_start}|slider|min=0|max=100|continuous=False|on_change=generate|>

|>
"""

Gui(page).run(title="Mandelbrot Fractal for Scientific Visualization")


from taipy.gui import Gui
import taipy as tp

# Import pages related to the automotive sector (replace with actual imports)
from pages.automotive.automotive import automotive_md

# Define the pages
pages = {
    '/': root,  # Replace with the root page if you have one
    "Automotive": automotive_md,
}

# Create a Gui instance with the pages
gui_multi_pages = Gui(pages=pages)

if __name__ == '__main__':
    tp.Core().run()

    # Run the multi-page app
    gui_multi_pages.run(title="Automotive Dashboard")


from taipy.gui import Gui
import pandas as pd
import json

json_data = []
json_path = ""

def json_upload(state):
    with open(state.json_path, 'r') as file:
        state.json_data = pd.read_json(file)

json_page = """
<|{json_path}|file_selector|accept=.json|on_action=json_upload|>
<|{json_data}|table|>
"""

Gui(json_page).run()


<|layout|columns=1 1|
<|part|class_name=card|
### Select Primary City for Weather Data

<|{primary_city_selected}|selector|lov=city_new_york;city_london;city_tokyo|dropdown|on_change=on_primary_city_change|>
|>

<|part|class_name=card|
### Select City to Compare

<|{compare_city_selected}|selector|lov=city_new_york;city_london;city_tokyo|dropdown|on_change=on_compare_city_change|>
|>

|>

<|Weather Data Overview|expandable|expanded=True|
Display primary_city_data and compare_city_data
<|layout|columns=1 1|
<|{primary_city_data}|table|page_size=5|>

<|{compare_city_data}|table|page_size=5|>
|>
|>

<|layout|columns=1 1|
<|part|class_name=card|
<|{temperature_chart}|chart|type=line|x=Day|y[1]=Primary City Temp|y[2]=Compare City Temp|title=Temperature Comparison|>
|>

<|part|class_name=card|
<|{humidity_chart}|chart|type=bar|x=Day|y[1]=Primary City Humidity|y[2]=Compare City Humidity|title=Humidity Comparison|>
|>
|>

### Analyze Weather Patterns:
<|{weather_pattern_analysis}|scenario|on_submission_change=on_weather_pattern_status_change|expandable=False|expanded=False|>

<|{weather_pattern_analysis}|scenario_dag|>

### View weather analysis results:
<|{weather_pattern_analysis.results if weather_pattern_analysis else None}|data_node|>


from taipy.gui import Gui
import taipy as tp

# Import pages for the logistics sector
from pages.logistics.dashboard import dashboard_md
from pages.logistics.orders import orders_md
from pages.logistics.inventory import inventory_md
from pages.logistics.shipping import shipping_md

# Define your pages dictionary
pages = {
    '/dashboard': dashboard_md,
    '/orders': orders_md,
    '/inventory': inventory_md,
    '/shipping': shipping_md
}

# Create a Gui with your pages
gui_logistics = Gui(pages=pages)

if __name__ == '__main__':
    tp.Core().run()

    # Run the multi-page app
    gui_logistics.run(title="Logistics Dashboard")


<|{all_projects}|table|columns={project_columns}|width='100%'|on_action={on_project_table_click}|style=project_style|>
<|Create Project|button|on_action={open_create_project_dialog}|>
<|Refresh Projects|button|on_action={refresh_project_list}|>

<|{show_dialog_create_project}|dialog|title=Create new project|
<|{project_name}|input|placeholder='Enter project name'|
<|Create|button|on_action={create_project}|>
<|Cancel|button|on_action={close_create_project_dialog}|>
|>

<|{show_project_details}|pane|

# Project Details <|Delete|button|on_action=delete_selected_project|> <|Archive|button|on_action=archive_selected_project|>

<|layout|columns=1 1|
<|part|class_name=card|
## Project Name
<|{selected_project.name}|>
|>

<|part|class_name=card|
## Project Manager
<|{selected_project.manager}|>
|>

<|part|class_name=card|
## ID
<|{selected_project.id}|>
|>

<|part|class_name=card|
## Start Date
<|{selected_project.start_date.strftime("%b %d %y")}|>
|>

<|part|class_name=card|
## Status
<|{get_project_status(selected_project)}|>
|>

----
|>


from taipy.gui import Gui
import pandas as pd

# Load employee time tracking data
time_tracking_data = pd.read_csv("time_tracking_data.csv")

# Initialize variables
employees = list(time_tracking_data["Employee"].unique())
projects = list(time_tracking_data["Project"].unique())
employee = employees
project = projects

# Markdown for the entire page
page = """<|toggle|theme|>

<|layout|columns=20 80|gap=30px|
<sidebar|
## **Filter**{: .orange} Time Tracking:

<|{employee}|selector|lov={employees}|multiple|label=Select Employee|dropdown|on_change=on_filter|width=100%|>

<|{project}|selector|lov={projects}|multiple|label=Select Project|dropdown|on_change=on_filter|width=100%|>
|sidebar>

<main_page|
# Employee Time Tracking System

<|layout|columns=1 1 1|
<total_entries|
## Total Entries:
### <|{len(df_selection)}|>
|total_entries>

<average_hours|
## Average Hours Worked:
### <|{round(df_selection["Hours"].mean(), 2)}|> hours
|average_hours>

<time_tracking_table|
Display df_selection in an expandable
<|Time Tracking Table|expandable|expanded=False|
<|{df_selection}|table|width=100%|page_size=10|rebuild|class_name=table|>
|time_tracking_table>
|main_page>
|>

Code adapted from [Employee Time Tracking](https://github.com/time_tracking_app)

Get the Taipy Code [here](https://github.com/Avaiga/employee-time-tracking-app)