#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # Source: www.statista.com (Most used programming languages in 2022)  data = {      # List of programming languages      "Language": ["JavaScript", "HTML/CSS", "SQL", "Python", "Typescript", "Java", "Bash/Shell"],      # Percentage of usage, per language      "%": [65.36, 55.08, 49.43, 48.07, 34.83, 33.27, 29.07],  }    # Close the shape for a nice-looking stroke  # If the first point is *not* appended to the end of the list,  # then the shape does not look as it is closed.  data["%"].append(data["%"][0])  data["Language"].append(data["Language"][0])    layout = {      "polar": {          "radialaxis": {              # Force the radial range to 0-100              "range": [0, 100],          }      },      # Hide legend      "showlegend": False,  }    options = {      # Fill the trace      "fill": "toself"  }    md = """  # Radar - Simple    <|{data}|chart|type=scatterpolar|r=%|theta=Language|options={options}|layout={layout}|>  """    Gui(md).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # Initial data set. y = count_of(x)  samples = {"x": ["Apples", "Apples", "Apples", "Oranges", "Bananas", "Oranges"], "y": [5, 10, 3, 8, 5, 2]}    # Create a data set array to allow for two traces  data = [samples, samples]    # Gather those settings in a single dictionary  properties = {      # 'x' of the first trace is the 'x' data from the first element of data      "x[1]": "0/x",      # 'y' of the first trace is the 'y' data from the first element of data      "y[1]": "0/y",      # 'x' of the second trace is the 'x' data from the second element of data      "x[2]": "1/x",      # 'y' of the second trace is the 'y' data from the second element of data      "y[2]": "1/y",      # Data set colors      "color": ["#cd5c5c", "#505070"],      # Data set names (for the legend)      "name": ["Count", "Sum"],      # Configure the binning functions      "options": [          # First trace: count the bins          {"histfunc": "count"},          # Second trace: sum the bin occurences          {"histfunc": "sum"},      ],      # Set x axis name      "layout": {"xaxis": {"title": "Fruit"}},  }    page = """  # Histogram - Binning function    <|{data}|chart|type=histogram|properties={properties}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # Skill categories  skills = ["HTML", "CSS", "Java", "Python", "PHP", "JavaScript", "Photoshop"]  data = [      # Proportion of skills used for Backend development      {"Backend": [10, 10, 80, 70, 90, 30, 0], "Skills": skills},      # Proportion of skills used for Frontend development      {"Frontend": [90, 90, 0, 10, 20, 80, 60], "Skills": skills},  ]    # Append first elements to all arrays for a nice stroke  skills.append(skills[0])  data[0]["Backend"].append(data[0]["Backend"][0])  data[1]["Frontend"].append(data[1]["Frontend"][0])    layout = {      # Force the radial axis displayed range      "polar": {"radialaxis": {"range": [0, 100]}}  }    # Fill the trace  options = {"fill": "toself"}    # Reflected in the legend  names = ["Backend", "Frontend"]    # To shorten the chart control definition  r = ["0/Backend", "1/Frontend"]  theta = ["0/Skills", "1/Skills"]    page = """  # Radar - Multiple    <|{data}|chart|type=scatterpolar|name={names}|r={r}|theta={theta}|options={options}|layout={layout}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # x values are [-10..10]  x_range = range(-10, 11)    # The data set holds the _x_ series and two distinct series for _y_  data = {      "x": x_range,      # y1 = x*x      "y1": [x * x for x in x_range],      # y2 = 2-x*x/50      "y2": [(100 - x * x) / 50 for x in x_range],  }    layout = {      "yaxis2": {          # Second axis overlays with the first y axis          "overlaying": "y",          # Place the second axis on the right          "side": "right",          # and give it a title          "title": "Second y axis",      },      "legend": {          # Place the legend above chart          "yanchor": "bottom"      },  }    page = """  # Basics - Multiple axis    Shared axis:  <|{data}|chart|x=x|y[1]=y1|y[2]=y2|height=300px|>    With two axis:  <|{data}|chart|x=x|y[1]=y1|y[2]=y2|yaxis[2]=y2|layout={layout}|height=300px|>    """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # Source https://www.fao.org/faostat/en/#data/SDGB  data = {      "Country": [          "Rest of the world",          "Russian Federation",          "Brazil",          "Canada",          "United States of America",          "China",          "Australia",          "Democratic Republic of the Congo",          "Indonesia",          "Peru",      ],      "Area": [1445674.66, 815312, 496620, 346928, 309795, 219978, 134005, 126155, 92133.2, 72330.4],  }    page = """  # Pie - Simple    <|{data}|chart|type=pie|values=Area|label=Country|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # You may need to install the scikit-learn package as well.  # -----------------------------------------------------------------------------------------  from os.path import exists    from sklearn.datasets import make_regression  from sklearn.linear_model import LinearRegression  from taipy.gui import Gui    # Let scikit-learn generate a random regression problem  n_samples = 300  X, y, coef = make_regression(n_samples=n_samples, n_features=1, n_informative=1, n_targets=1, noise=25, coef=True)    model = LinearRegression().fit(X, y)    x_data = X.flatten()  y_data = y.flatten()  predict = model.predict(X)    data = {"x": x_data, "y": y_data, "Regression": predict}    page = """  # Scatter - Regression    <|{data}|chart|x=x|y[1]=y|mode[1]=markers|y[2]=Regression|mode[2]=line|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    data = {      "Temperatures": [          [17.2, 27.4, 28.6, 21.5],          [5.6, 15.1, 20.2, 8.1],          [26.6, 22.8, 21.8, 24.0],          [22.3, 15.5, 13.4, 19.6],      ],      "Cities": ["Hanoi", "Paris", "Rio", "Sydney"],      "Seasons": ["Winter", "Spring", "Summer", "Autumn"],  }    layout = {      # This array contains the information we want to display in the cells      # These are filled later      "annotations": [],      # No ticks on the x axis, show labels on top the of the chart      "xaxis": {"ticks": "", "side": "top"},      # No ticks on the y axis      # Add a space character for a small margin with the text      "yaxis": {"ticks": "", "ticksuffix": " "},  }    seasons = data["Seasons"]  cities = data["Cities"]  # Iterate over all cities  for city in range(len(cities)):      # Iterate over all seasons      for season in range(len(seasons)):          temperature = data["Temperatures"][city][season]          # Create the annotation          annotation = {              # The name of the season              "x": seasons[season],              # The name of the city              "y": cities[city],              # The temperature, as a formatted string              "text": f"{temperature}\N{DEGREE SIGN}C",              # Change the text color depending on the temperature              # so it results in a better contrast              "font": {"color": "white" if temperature < 14 else "black"},              # Remove the annotation arrow              "showarrow": False,          }          # Add the annotation to the layout's annotations array          layout["annotations"].append(annotation)    page = """  ## Heatmap - Annotated    <|{data}|chart|type=heatmap|z=Temperatures|x=Seasons|y=Cities|layout={layout}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    data = {      "Types": ["Website visit", "Downloads", "Prospects", "Invoice sent", "Closed"],      "Visits_us": [13873, 10533, 5443, 2703, 908],      "Visits_eu": [7063, 4533, 3443, 1003, 1208],      "Visits_ap": [6873, 2533, 3443, 1703, 508],  }    # Columns for each trace  x = ["Visits_us", "Visits_eu", "Visits_ap"]    # Legend text for each trace  names = ["US", "EU", "AP"]    page = """  # Funnel - Multiple traces    <|{data}|chart|type=funnel|x={x}|y=Types|name={names}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    data = {      "Temperatures": [          [17.2, 27.4, 28.6, 21.5],          [5.6, 15.1, 20.2, 8.1],          [26.6, 22.8, 21.8, 24.0],          [22.3, 15.5, 13.4, 19.6],      ],      "Cities": ["Hanoi", "Paris", "Rio", "Sydney"],      "Seasons": ["Winter", "Spring", "Summer", "Autumn"],  }    page = """  # Heatmap - Basic    <|{data}|chart|type=heatmap|z=Temperatures|x=Seasons|y=Cities|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import numpy  import pandas  from taipy.gui import Gui    # Largest cities: name, location and population  # Source: https://simplemaps.com/data/world-cities  cities = [      {"name": "Tokyo", "lat": 35.6839, "lon": 139.7744, "population": 39105000},      {"name": "Jakarta", "lat": -6.2146, "lon": 106.8451, "population": 35362000},      {"name": "Delhi", "lat": 28.6667, "lon": 77.2167, "population": 31870000},      {"name": "Manila", "lat": 14.6, "lon": 120.9833, "population": 23971000},      {"name": "São Paulo", "lat": -23.5504, "lon": -46.6339, "population": 22495000},      {"name": "Seoul", "lat": 37.56, "lon": 126.99, "population": 22394000},      {"name": "Mumbai", "lat": 19.0758, "lon": 72.8775, "population": 22186000},      {"name": "Shanghai", "lat": 31.1667, "lon": 121.4667, "population": 22118000},      {"name": "Mexico City", "lat": 19.4333, "lon": -99.1333, "population": 21505000},      {"name": "Guangzhou", "lat": 23.1288, "lon": 113.259, "population": 21489000},      {"name": "Cairo", "lat": 30.0444, "lon": 31.2358, "population": 19787000},      {"name": "Beijing", "lat": 39.904, "lon": 116.4075, "population": 19437000},      {"name": "New York", "lat": 40.6943, "lon": -73.9249, "population": 18713220},      {"name": "Kolkāta", "lat": 22.5727, "lon": 88.3639, "population": 18698000},      {"name": "Moscow", "lat": 55.7558, "lon": 37.6178, "population": 17693000},      {"name": "Bangkok", "lat": 13.75, "lon": 100.5167, "population": 17573000},      {"name": "Dhaka", "lat": 23.7289, "lon": 90.3944, "population": 16839000},      {"name": "Buenos Aires", "lat": -34.5997, "lon": -58.3819, "population": 16216000},      {"name": "Ōsaka", "lat": 34.752, "lon": 135.4582, "population": 15490000},      {"name": "Lagos", "lat": 6.45, "lon": 3.4, "population": 15487000},      {"name": "Istanbul", "lat": 41.01, "lon": 28.9603, "population": 15311000},      {"name": "Karachi", "lat": 24.86, "lon": 67.01, "population": 15292000},      {"name": "Kinshasa", "lat": -4.3317, "lon": 15.3139, "population": 15056000},      {"name": "Shenzhen", "lat": 22.535, "lon": 114.054, "population": 14678000},      {"name": "Bangalore", "lat": 12.9791, "lon": 77.5913, "population": 13999000},      {"name": "Ho Chi Minh City", "lat": 10.8167, "lon": 106.6333, "population": 13954000},      {"name": "Tehran", "lat": 35.7, "lon": 51.4167, "population": 13819000},      {"name": "Los Angeles", "lat": 34.1139, "lon": -118.4068, "population": 12750807},      {"name": "Rio de Janeiro", "lat": -22.9083, "lon": -43.1964, "population": 12486000},      {"name": "Chengdu", "lat": 30.66, "lon": 104.0633, "population": 11920000},      {"name": "Baoding", "lat": 38.8671, "lon": 115.4845, "population": 11860000},      {"name": "Chennai", "lat": 13.0825, "lon": 80.275, "population": 11564000},      {"name": "Lahore", "lat": 31.5497, "lon": 74.3436, "population": 11148000},      {"name": "London", "lat": 51.5072, "lon": -0.1275, "population": 11120000},      {"name": "Paris", "lat": 48.8566, "lon": 2.3522, "population": 11027000},      {"name": "Tianjin", "lat": 39.1467, "lon": 117.2056, "population": 10932000},      {"name": "Linyi", "lat": 35.0606, "lon": 118.3425, "population": 10820000},      {"name": "Shijiazhuang", "lat": 38.0422, "lon": 114.5086, "population": 10784600},      {"name": "Zhengzhou", "lat": 34.7492, "lon": 113.6605, "population": 10136000},      {"name": "Nanyang", "lat": 32.9987, "lon": 112.5292, "population": 10013600},      {"name": "Hyderābād", "lat": 17.3617, "lon": 78.4747, "population": 9840000},      {"name": "Wuhan", "lat": 30.5872, "lon": 114.2881, "population": 9729000},      {"name": "Handan", "lat": 36.6116, "lon": 114.4894, "population": 9549700},      {"name": "Nagoya", "lat": 35.1167, "lon": 136.9333, "population": 9522000},      {"name": "Weifang", "lat": 36.7167, "lon": 119.1, "population": 9373000},      {"name": "Lima", "lat": -12.06, "lon": -77.0375, "population": 8992000},      {"name": "Zhoukou", "lat": 33.625, "lon": 114.6418, "population": 8953172},      {"name": "Luanda", "lat": -8.8383, "lon": 13.2344, "population": 8883000},      {"name": "Ganzhou", "lat": 25.8292, "lon": 114.9336, "population": 8677600},      {"name": "Tongshan", "lat": 34.261, "lon": 117.1859, "population": 8669000},      {"name": "Kuala Lumpur", "lat": 3.1478, "lon": 101.6953, "population": 8639000},      {"name": "Chicago", "lat": 41.8373, "lon": -87.6862, "population": 8604203},      {"name": "Heze", "lat": 35.2333, "lon": 115.4333, "population": 8287693},      {"name": "Chongqing", "lat": 29.55, "lon": 106.5069, "population": 8261000},      {"name": "Hanoi", "lat": 21.0245, "lon": 105.8412, "population": 8246600},      {"name": "Fuyang", "lat": 32.8986, "lon": 115.8045, "population": 8200264},      {"name": "Changsha", "lat": 28.1987, "lon": 112.9709, "population": 8154700},      {"name": "Dongguan", "lat": 23.0475, "lon": 113.7493, "population": 8142000},      {"name": "Jining", "lat": 35.4, "lon": 116.5667, "population": 8081905},      {"name": "Jinan", "lat": 36.6667, "lon": 116.9833, "population": 7967400},      {"name": "Pune", "lat": 18.5196, "lon": 73.8553, "population": 7948000},      {"name": "Foshan", "lat": 23.0292, "lon": 113.1056, "population": 7905700},      {"name": "Bogotá", "lat": 4.6126, "lon": -74.0705, "population": 7743955},      {"name": "Ahmedabad", "lat": 23.03, "lon": 72.58, "population": 7717000},      {"name": "Nanjing", "lat": 32.05, "lon": 118.7667, "population": 7729000},      {"name": "Changchun", "lat": 43.9, "lon": 125.2, "population": 7674439},      {"name": "Tangshan", "lat": 39.6292, "lon": 118.1742, "population": 7577289},      {"name": "Cangzhou", "lat": 38.3037, "lon": 116.8452, "population": 7544300},      {"name": "Dar es Salaam", "lat": -6.8, "lon": 39.2833, "population": 7461000},      {"name": "Hefei", "lat": 31.8639, "lon": 117.2808, "population": 7457027},      {"name": "Hong Kong", "lat": 22.3069, "lon": 114.1831, "population": 7398000},      {"name": "Shaoyang", "lat": 27.2418, "lon": 111.4725, "population": 7370500},      {"name": "Zhanjiang", "lat": 21.1967, "lon": 110.4031, "population": 7332000},      {"name": "Shangqiu", "lat": 34.4259, "lon": 115.6467, "population": 7325300},      {"name": "Nantong", "lat": 31.9829, "lon": 120.8873, "population": 7283622},      {"name": "Yancheng", "lat": 33.3936, "lon": 120.1339, "population": 7260240},      {"name": "Nanning", "lat": 22.8192, "lon": 108.315, "population": 7254100},      {"name": "Hengyang", "lat": 26.8968, "lon": 112.5857, "population": 7243400},      {"name": "Zhumadian", "lat": 32.9773, "lon": 114.0253, "population": 7231234},      {"name": "Shenyang", "lat": 41.8039, "lon": 123.4258, "population": 7208000},      {"name": "Xingtai", "lat": 37.0659, "lon": 114.4753, "population": 7104103},      {"name": "Xi’an", "lat": 34.2667, "lon": 108.9, "population": 7090000},      {"name": "Santiago", "lat": -33.45, "lon": -70.6667, "population": 7026000},      {"name": "Yantai", "lat": 37.3997, "lon": 121.2664, "population": 6968202},      {"name": "Riyadh", "lat": 24.65, "lon": 46.71, "population": 6889000},      {"name": "Luoyang", "lat": 34.6587, "lon": 112.4245, "population": 6888500},      {"name": "Kunming", "lat": 25.0433, "lon": 102.7061, "population": 6850000},      {"name": "Shangrao", "lat": 28.4419, "lon": 117.9633, "population": 6810700},      {"name": "Hangzhou", "lat": 30.25, "lon": 120.1675, "population": 6713000},      {"name": "Bijie", "lat": 27.3019, "lon": 105.2863, "population": 6686100},      {"name": "Quanzhou", "lat": 24.9139, "lon": 118.5858, "population": 6480000},      {"name": "Miami", "lat": 25.7839, "lon": -80.2102, "population": 6445545},      {"name": "Wuxi", "lat": 31.5667, "lon": 120.2833, "population": 6372624},      {"name": "Huanggang", "lat": 30.45, "lon": 114.875, "population": 6333000},      {"name": "Maoming", "lat": 21.6618, "lon": 110.9178, "population": 6313200},      {"name": "Nanchong", "lat": 30.7991, "lon": 106.0784, "population": 6278614},      {"name": "Zunyi", "lat": 27.705, "lon": 106.9336, "population": 6270700},      {"name": "Qujing", "lat": 25.5102, "lon": 103.8029, "population": 6155400},      {"name": "Baghdad", "lat": 33.35, "lon": 44.4167, "population": 6107000},      {"name": "Xinyang", "lat": 32.1264, "lon": 114.0672, "population": 6109106},  ]    # Convert to Pandas DataFrame  data = pandas.DataFrame(cities)    # Add a column holding the bubble size:  #   Min(population) -> size =  5  #   Max(population) -> size = 60  solve = numpy.linalg.solve([[data["population"].min(), 1], [data["population"].max(), 1]], [5, 60])  data["size"] = data["population"].apply(lambda p: p * solve[0] + solve[1])    # Add a column holding the bubble hover texts  # Format is "<city name> [<population>]"  data["text"] = data.apply(lambda row: f"{row['name']} [{row['population']}]", axis=1)    marker = {      # Use the "size" column to set the bubble size      "size": "size"  }    layout = {"geo": {"showland": True, "landcolor": "4A4"}}    page = """  # Maps - Bubbles    <|{data}|chart|type=scattergeo|lat=lat|lon=lon|mode=markers|marker={marker}|text=text|layout={layout}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  # Face-to-face bar charts example  import numpy  from taipy.gui import Gui    n_years = 10    proportions_female = numpy.zeros(n_years)  proportions_male = numpy.zeros(n_years)    # Prepare the data set with random variations  proportions_female[0] = 0.4  proportions_male[0] = proportions_female[0] * (1 + numpy.random.normal(0, 0.1))    for i in range(1, n_years):      mean_i = (0.5 - proportions_female[i - 1]) / 5      new_value = proportions_female[i - 1] + numpy.random.normal(mean_i, 0.1)        new_value = min(max(0, new_value), 1)      proportions_female[i] = new_value      proportions_male[i] = proportions_female[i] * (1 + numpy.random.normal(0, 0.1))      data = {      "Hobbies": [          "Archery",          "Tennis",          "Football",          "Basket",          "Volley",          "Golf",          "Video-Games",          "Reading",          "Singing",          "Music",      ],      "Female": proportions_female,      # Negate these values so they appear to the left side      "Male": -proportions_male,  }    properties = {      # Shared y values      "y": "Hobbies",      # Bars for the female data set      "x[1]": "Female",      "color[1]": "#c26391",      # Bars for the male data set      "x[2]": "Male",      "color[2]": "#5c91de",      # Both data sets are represented with an horizontal orientation      "orientation": "h",      #      "layout": {          # This makes left and right bars aligned on the same y value          "barmode": "overlay",          # Set a relevant title for the x axis          "xaxis": {"title": "Gender"},          # Hide the legend          "showlegend": False,          "margin": {"l": 100},      },  }    page = """  # Bar - Facing    <|{data}|chart|type=bar|properties={properties}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import random    from taipy.gui import Gui    # Random data set  data = [random.random() for i in range(100)]    # Normalize to show bin probabilities  options = {"histnorm": "probability"}    page = """  # Histogram - Normalized    <|{data}|chart|type=histogram|options={options}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # You may need to install the scikit-learn package as well.  # -----------------------------------------------------------------------------------------  import numpy  import pandas  from sklearn.datasets import make_classification  from taipy.gui import Gui    # Let scikit-learn generate a random 2-class classification problem  features, label = make_classification(n_samples=1000, n_features=2, n_informative=2, n_redundant=0)    random_data = pandas.DataFrame({"x": features[:, 0], "y": features[:, 1], "label": label})    data_x = random_data["x"]  class_A = [random_data.loc[i, "y"] if random_data.loc[i, "label"] == 0 else numpy.nan for i in range(len(random_data))]  class_B = [random_data.loc[i, "y"] if random_data.loc[i, "label"] == 1 else numpy.nan for i in range(len(random_data))]    data = {"x": random_data["x"], "Class A": class_A, "Class B": class_B}    page = """  # Scatter - Classification    <|{data}|chart|mode=markers|x=x|y[1]=Class A|y[2]=Class B|width=60%|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from itertools import accumulate    import numpy as np  from taipy.gui import Gui    grid_size = 10  data = [      {          # z is set to:          # - 0 if row+col is a multiple of 4          # - 1 if row+col is a multiple of 2          # - 0.5 otherwise          "z": [              [0.0 if (row + col) % 4 == 0 else 1 if (row + col) % 2 == 0 else 0.5 for col in range(grid_size)]              for row in range(grid_size)          ]      },      {          # A series of coordinates, growing exponentially          "x": [0] + list(accumulate(np.logspace(0, 1, grid_size))),          # A series of coordinates, shrinking exponentially          "y": [0] + list(accumulate(np.logspace(1, 0, grid_size))),      },  ]    # Axis template used in the layout object  axis_template = {      # Don't show any line or tick or label      "showgrid": False,      "zeroline": False,      "ticks": "",      "showticklabels": False,      "visible": False,  }    layout = {"xaxis": axis_template, "yaxis": axis_template}    options = {      # Remove the color scale display      "showscale": False  }    page = """  ## Heatmap - Unequal block sizes    <|{data}|chart|type=heatmap|z=0/z|x=1/x|y=1/y|layout={layout}|options={options}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # 9-hole course  n_holes = 9    # Data set  # Each entry holds an array of values. One for each hole, plus one for th  data = {      # ["Hole1", "Hole2", ..., "Hole9"]      "Hole": [f"Hole{h}" for h in range(1, n_holes + 1)] + ["Score"],      # Par for each hole      "Par": [3, 4, 4, 5, 3, 5, 4, 5, 3] + [None],      # Score for each hole      "Score": [4, 4, 5, 4, 4, 5, 4, 5, 4] + [None],      # Represented as relative values except for the last one      "M": n_holes * ["relative"] + ["total"],  }    # Compute difference (Score-Par)  data["Diff"] = [data["Score"][i] - data["Par"][i] for i in range(0, n_holes)] + [None]    # Show positive values in red, and negative values in green  options = {"decreasing": {"marker": {"color": "green"}}, "increasing": {"marker": {"color": "red"}}}    page = """  # Waterfall - Styling    <|{data}|chart|type=waterfall|x=Hole|y=Diff|measure=M|options={options}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import random    from taipy.gui import Gui    # Common axis for all data: [1..10]  x = list(range(1, 11))  # Sample data  samples = [5, 7, 8, 4, 5, 9, 8, 8, 6, 5]    # Generate error data  # Error that adds to the input data  error_plus = [3 * random.random() + 0.5 for _ in x]  # Error substracted from to the input data  error_minus = [3 * random.random() + 0.5 for _ in x]    # Upper bound (y + error_plus)  error_upper = [y + e for (y, e) in zip(samples, error_plus)]  # Lower bound (y - error_minus)  error_lower = [y - e for (y, e) in zip(samples, error_minus)]    data = [      # Trace for samples      {"x": x, "y": samples},      # Trace for error range      {          # Roundtrip around the error bounds: onward then return          "x": x + list(reversed(x)),          # The two error bounds, with lower bound reversed          "y": error_upper + list(reversed(error_lower)),      },  ]    properties = {      # Error data      "x[1]": "1/x",      "y[1]": "1/y",      "options[1]": {          # Shows as filled area          "fill": "toself",          "fillcolor": "rgba(70,70,240,0.6)",          "showlegend": False,      },      # Don't show surrounding stroke      "color[1]": "transparent",      # Raw data (displayed on top of the error band)      "x[2]": "0/x",      "y[2]": "0/y",      "color[2]": "rgb(140,50,50)",      # Shown in the legend      "name[2]": "Input",  }    page = """  # Continuous Error - Simple    <|{data}|chart|properties={properties}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    data = {      "Products": [          "Nail polish",          "Eyebrow pencil",          "Rouge",          "Lipstick",          "Eyeshadows",          "Eyeliner",          "Foundation",          "Lip gloss",          "Mascara",      ],      "USA": [12814, 13012, 11624, 8814, 12998, 12321, 10342, 22998, 11261],      "China": [3054, 5067, 7004, 9054, 12043, 15067, 10119, 12043, 10419],      "EU": [4376, 3987, 3574, 4376, 4572, 3417, 5231, 4572, 6134],      "Africa": [4229, 3932, 5221, 9256, 3308, 5432, 13701, 4008, 18712],  }    # Order the different traces  ys = ["USA", "China", "EU", "Africa"]    options = [      # For the USA      {"stackgroup": "one", "groupnorm": "percent"},      # For China      {"stackgroup": "one"},      # For the EU      {"stackgroup": "one"},      # For Africa      {"stackgroup": "one"},  ]    layout = {      # Show all values when hovering on a data point      "hovermode": "x unified"  }    page = """  # Filled Area - Stacked Normalized    <|{data}|chart|mode=none|x=Products|y={ys}|options={options}|layout={layout}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import math    from taipy.gui import Gui    # One data point for each degree  theta = range(0, 360)      # Create a rose-like shaped radius-array  def create_rose(n_petals):      return [math.cos(math.radians(n_petals * angle)) for angle in theta]      data = {"theta": theta, "r1": create_rose(2), "r2": create_rose(3), "r3": create_rose(4)}    # We want three traces in the same chart  r = ["r1", "r2", "r3"]    layout = {      # Hide the legend      "showlegend": False,      "polar": {          # Hide the angular axis          "angularaxis": {"visible": False},          # Hide the radial axis          "radialaxis": {"visible": False},      },  }    page = """  # Polar - Multiple    <|{data}|chart|type=scatterpolar|mode=lines|r={r}|theta=theta|layout={layout}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # You may need to install the yfinance package as well.  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    data = {      "x": [1, 2, 3, 4, 5],      "y": [10, 7, 4, 1, 5],      "Sizes": [20, 30, 40, 50, 30],      "Symbols": ["circle-open", "triangle-up", "hexagram", "star-diamond", "circle-cross"],  }    marker = {      "color": "#77A",      "size": "Sizes",      "symbol": "Symbols",  }    page = """  # Bubble - Symbols    <|{data}|chart|mode=markers|x=x|y=y|marker={marker}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # You may need to install the yfinance package as well.  # -----------------------------------------------------------------------------------------  import yfinance  from taipy.gui import Gui    # Extraction of a few days of stock historical data for AAPL using  # the yfinance package (see https://pypi.org/project/yfinance/).  # The returned value is a Pandas DataFrame.  ticker = yfinance.Ticker("AAPL")  stock = ticker.history(interval="1d", start="2018-08-18", end="2018-09-10")  # Copy the DataFrame index to a new column  stock["Date"] = stock.index    options = {      # Candlesticks that show decreasing values are orange      "decreasing": {"line": {"color": "orange"}},      # Candlesticks that show decreasing values are blue      "increasing": {"line": {"color": "blue"}},  }    layout = {      "xaxis": {          # Hide the range slider          "rangeslider": {"visible": False}      }  }    page = """  # Candlestick - Styling    <|{stock}|chart|type=candlestick|x=Date|open=Open|close=Close|low=Low|high=High|options={options}|layout={layout}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    data = {      "Types": ["Website visit", "Downloads", "Prospects", "Invoice sent", "Closed"],      "Visits": [13873, 10533, 5443, 2703, 908],  }    marker = {      # Boxes are filled with a blue gradient color      "color": ["hsl(210,50%,50%)", "hsl(210,60%,60%)", "hsl(210,70%,70%)", "hsl(210,80%,80%)", "hsl(210,90%,90%)"],      # Lines get thicker, with an orange-to-green gradient color      "line": {"width": [1, 1, 2, 3, 4], "color": ["f5720a", "f39c1d", "f0cc3d", "aadb12", "8cb709"]},  }    options = {      # Lines connecting boxes are thick, dotted and green      "connector": {"line": {"color": "green", "dash": "dot", "width": 4}}  }    page = """  # Funnel Chart - Custom markers    <|{data}|chart|type=funnel|x=Visits|y=Types|marker={marker}|options={options}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import random    from taipy.gui import Gui    # Random data set  data = [random.random() for i in range(500)]    options = {      # Enable the cumulative histogram      "cumulative": {"enabled": True}  }    page = """  # Histogram - Cumulative    <|{data}|chart|type=histogram|options={options}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import numpy  import pandas  from taipy.gui import Gui    dates = pandas.date_range("2023-01-01", periods=365, freq="D")  temp = [      -11.33333333,      -6,      -0.111111111,      1.444444444,      2.388888889,      4.555555556,      4.333333333,      0.666666667,      9,      9.611111111,      -0.555555556,      1.833333333,      -0.444444444,      2.166666667,      -4,      -12.05555556,      -2.722222222,      5,      9.888888889,      6.611111111,      -2.833333333,      -3.277777778,      -1.611111111,      -1.388888889,      5.777777778,      2.166666667,      -1.055555556,      1.777777778,      1.5,      8.444444444,      6.222222222,      -2.5,      -0.388888889,      6.111111111,      -1.5,      2.666666667,      -2.5,      0.611111111,      8.222222222,      2.333333333,      -9.333333333,      -7.666666667,      -6.277777778,      -0.611111111,      7.722222222,      6.111111111,      -4,      3.388888889,      9.333333333,      -6.333333333,      -15,      -12.94444444,      -8.722222222,      -6.222222222,      -2.833333333,      -2.5,      1.5,      3.444444444,      2.666666667,      0.888888889,      7.555555556,      12.66666667,      12.83333333,      1.777777778,      -0.111111111,      -1.055555556,      4.611111111,      11.16666667,      8.5,      0.5,      2.111111111,      4.722222222,      8.277777778,      10.66666667,      5.833333333,      5.555555556,      6.944444444,      1.722222222,      2.444444444,      6.111111111,      12.11111111,      15.55555556,      9.944444444,      10.27777778,      5.888888889,      1.388888889,      3.555555556,      1.222222222,      4.055555556,      7.833333333,      0.666666667,      10.05555556,      6.444444444,      4.555555556,      11,      3.555555556,      -0.555555556,      11.83333333,      7.222222222,      10.16666667,      17.5,      14.55555556,      6.777777778,      3.611111111,      5.888888889,      10.05555556,      16.61111111,      5.5,      7.055555556,      10.5,      1.555555556,      6.166666667,      11.05555556,      5.111111111,      6.055555556,      11,      11.05555556,      14.72222222,      19.16666667,      16.5,      12.61111111,      8.277777778,      6.611111111,      10.38888889,      15.38888889,      17.22222222,      18.27777778,      18.72222222,      17.05555556,      19.72222222,      16.83333333,      12.66666667,      11.66666667,      12.88888889,      14.77777778,      18,      19.44444444,      16.5,      9.722222222,      7.888888889,      13.72222222,      17.55555556,      18.27777778,      20.11111111,      21.66666667,      23.38888889,      23.5,      16.94444444,      16.27777778,      18.61111111,      20.83333333,      24.61111111,      18.27777778,      17.88888889,      22.27777778,      25.94444444,      25.27777778,      24.72222222,      25.61111111,      23.94444444,      26.33333333,      22.05555556,      20.83333333,      24.5,      27.83333333,      25.61111111,      23.11111111,      19.27777778,      16.44444444,      19.44444444,      17.22222222,      19.44444444,      22.16666667,      21.77777778,      17.38888889,      17.22222222,      23.88888889,      28.44444444,      29.44444444,      29.61111111,      21.05555556,      18.55555556,      25.27777778,      26.55555556,      24.55555556,      23.38888889,      22.55555556,      27.05555556,      27.66666667,      26.66666667,      27.61111111,      26.66666667,      24.77777778,      23,      26.5,      23.11111111,      19.83333333,      22.27777778,      24.61111111,      27.05555556,      27.05555556,      27.94444444,      27.33333333,      22.05555556,      21.5,      22,      19.72222222,      20.27777778,      17.88888889,      18.55555556,      18.94444444,      20,      22.05555556,      23.22222222,      24.38888889,      24.5,      24.5,      21.22222222,      20.83333333,      20.61111111,      22.05555556,      23.77777778,      24.16666667,      24.22222222,      21.83333333,      21.33333333,      21.88888889,      22.44444444,      23.11111111,      20.44444444,      16.88888889,      15.77777778,      17.44444444,      17.72222222,      23.11111111,      24.55555556,      24.88888889,      25.11111111,      25.27777778,      19.5,      19.55555556,      24.05555556,      24.27777778,      21.05555556,      19.88888889,      20.66666667,      20.27777778,      17.66666667,      16.44444444,      15.88888889,      18.44444444,      22.44444444,      23,      24.72222222,      24.16666667,      25.94444444,      24.44444444,      23.33333333,      25.22222222,      25,      23.88888889,      23.72222222,      18.94444444,      16.22222222,      19.5,      21.22222222,      19.72222222,      13.22222222,      11.88888889,      16.55555556,      10.05555556,      12.16666667,      11.5,      10.22222222,      17.27777778,      21.72222222,      13.83333333,      13,      6.944444444,      6.388888889,      4.222222222,      2.5,      1.111111111,      3.055555556,      6.388888889,      10.44444444,      -2,      -2.222222222,      4.388888889,      8.333333333,      11.11111111,      12.66666667,      10.88888889,      12.83333333,      14.16666667,      12.55555556,      12.05555556,      11.22222222,      12.44444444,      14.38888889,      12,      15.83333333,      6.722222222,      2.5,      4.833333333,      7.5,      8.888888889,      4,      7.388888889,      3.888888889,      1.611111111,      -0.333333333,      -2,      4.833333333,      -1.055555556,      -5.611111111,      -2.388888889,      5.722222222,      8.444444444,      5.277777778,      0.5,      -2.5,      1.111111111,      2.111111111,      5.777777778,      7.555555556,      7.555555556,      4.111111111,      -0.388888889,      -1,      4.944444444,      9.444444444,      4.722222222,      -0.166666667,      0.5,      -2.444444444,      -2.722222222,      -2.888888889,      -1.111111111,      -4.944444444,      -3.111111111,      -1.444444444,      -0.833333333,      2.333333333,      6.833333333,      4.722222222,      0.888888889,      0.666666667,      4.611111111,      4.666666667,      4.444444444,      6.777777778,      5.833333333,      0.5,      4.888888889,      1.444444444,      -2.111111111,      2.444444444,      -0.111111111,      -2.555555556,      -4.611111111,      -8.666666667,      -8.055555556,      1.555555556,      -4.777777778,  ]  min = [      -14.33333333,      -12.9,      -3.311111111,      -4.955555556,      -3.611111111,      0.555555556,      1.133333333,      -5.133333333,      2.3,      3.911111111,      -7.055555556,      -1.366666667,      -4.844444444,      -3.333333333,      -6.1,      -17.15555556,      -4.822222222,      0.4,      3.488888889,      4.211111111,      -6.433333333,      -7.577777778,      -7.111111111,      -7.088888889,      1.577777778,      -3.433333333,      -4.355555556,      -0.722222222,      -2.1,      2.044444444,      2.222222222,      -4.7,      -2.388888889,      4.111111111,      -5,      -0.133333333,      -5.3,      -2.288888889,      6.022222222,      -1.766666667,      -15.53333333,      -13.46666667,      -9.277777778,      -3.211111111,      3.122222222,      1.411111111,      -6.8,      1.388888889,      5.333333333,      -9.833333333,      -22,      -19.74444444,      -14.62222222,      -9.622222222,      -8.433333333,      -8.5,      -2.8,      0.144444444,      -3.233333333,      -3.411111111,      5.355555556,      8.366666667,      7.333333333,      -0.322222222,      -6.911111111,      -4.955555556,      -1.588888889,      4.966666667,      2.5,      -4.3,      -1.888888889,      -1.777777778,      2.477777778,      3.766666667,      0.533333333,      1.755555556,      2.944444444,      -4.977777778,      -4.055555556,      1.711111111,      6.011111111,      13.15555556,      5.044444444,      6.577777778,      3.388888889,      -1.011111111,      -0.244444444,      -2.477777778,      -1.444444444,      2.533333333,      -6.333333333,      4.255555556,      1.944444444,      0.855555556,      5.4,      -1.244444444,      -2.855555556,      4.833333333,      2.722222222,      6.466666667,      14.5,      9.855555556,      2.277777778,      -3.188888889,      0.788888889,      4.155555556,      13.41111111,      2.3,      0.855555556,      8.4,      -0.444444444,      1.166666667,      7.755555556,      -0.288888889,      -0.244444444,      8.7,      5.555555556,      8.222222222,      16.26666667,      14.4,      5.711111111,      5.177777778,      4.511111111,      5.988888889,      10.08888889,      10.52222222,      15.37777778,      12.42222222,      14.95555556,      15.22222222,      11.93333333,      6.866666667,      6.866666667,      9.688888889,      11.57777778,      12,      13.34444444,      11.3,      6.222222222,      2.088888889,      8.322222222,      14.05555556,      13.77777778,      16.91111111,      16.86666667,      16.68888889,      18.5,      12.54444444,      12.27777778,      15.91111111,      15.03333333,      22.11111111,      15.77777778,      13.68888889,      17.87777778,      19.94444444,      18.57777778,      18.62222222,      20.11111111,      17.14444444,      20.43333333,      15.75555556,      17.33333333,      20,      23.03333333,      19.61111111,      18.51111111,      15.27777778,      11.44444444,      13.64444444,      11.42222222,      16.14444444,      19.76666667,      18.77777778,      11.88888889,      12.32222222,      20.78888889,      25.04444444,      25.34444444,      23.81111111,      18.35555556,      11.85555556,      18.37777778,      23.15555556,      21.55555556,      17.48888889,      19.05555556,      20.25555556,      23.86666667,      23.86666667,      21.41111111,      21.16666667,      18.67777778,      18.1,      24.4,      19.01111111,      17.13333333,      18.27777778,      21.71111111,      22.85555556,      22.65555556,      25.14444444,      24.13333333,      17.95555556,      14.7,      15.1,      16.02222222,      14.27777778,      11.18888889,      13.65555556,      16.74444444,      16.7,      17.65555556,      16.62222222,      21.68888889,      19.6,      18.6,      15.52222222,      18.53333333,      17.01111111,      17.75555556,      20.47777778,      17.76666667,      22.22222222,      18.23333333,      17.83333333,      15.38888889,      19.64444444,      17.81111111,      15.44444444,      14.88888889,      13.07777778,      15.24444444,      11.82222222,      20.81111111,      21.45555556,      18.98888889,      19.71111111,      19.27777778,      12.7,      15.05555556,      19.15555556,      20.77777778,      15.35555556,      17.68888889,      18.26666667,      15.47777778,      12.76666667,      10.54444444,      13.38888889,      12.54444444,      19.84444444,      19.5,      21.92222222,      17.86666667,      22.44444444,      19.64444444,      20.73333333,      22.02222222,      19,      20.48888889,      19.02222222,      16.44444444,      14.22222222,      16.3,      16.42222222,      17.22222222,      8.322222222,      8.288888889,      13.95555556,      5.555555556,      5.666666667,      7.7,      4.022222222,      11.77777778,      16.42222222,      11.83333333,      9.7,      0.044444444,      3.688888889,      -2.077777778,      0.1,      -5.388888889,      -3.244444444,      0.688888889,      5.744444444,      -7.7,      -7.022222222,      -0.211111111,      4.833333333,      8.111111111,      5.766666667,      7.888888889,      10.43333333,      11.56666667,      10.15555556,      7.155555556,      4.522222222,      7.144444444,      10.88888889,      9.5,      12.13333333,      4.022222222,      -3.9,      1.433333333,      0.7,      3.188888889,      -1.7,      3.588888889,      -0.111111111,      -2.788888889,      -7.133333333,      -5,      0.733333333,      -7.555555556,      -12.51111111,      -8.188888889,      3.122222222,      2.944444444,      0.477777778,      -3.2,      -9.2,      -4.788888889,      -0.288888889,      1.077777778,      4.755555556,      5.455555556,      0.511111111,      -3.888888889,      -7.4,      -1.355555556,      5.144444444,      0.122222222,      -5.166666667,      -5,      -5.144444444,      -8.822222222,      -6.388888889,      -6.811111111,      -8.944444444,      -10.11111111,      -7.144444444,      -5.133333333,      -1.166666667,      1.833333333,      -1.477777778,      -1.811111111,      -2.433333333,      -1.188888889,      -2.333333333,      0.744444444,      1.877777778,      1.333333333,      -1.7,      0.888888889,      -3.855555556,      -8.211111111,      -1.055555556,      -4.211111111,      -7.355555556,      -8.111111111,      -10.96666667,      -13.05555556,      -4.644444444,      -7.577777778,  ]  max = [      -7.233333333,      -1.6,      5.488888889,      7.744444444,      6.188888889,      6.555555556,      10.53333333,      6.766666667,      14.1,      14.11111111,      2.044444444,      4.633333333,      2.055555556,      8.666666667,      -1.4,      -5.555555556,      4.177777778,      11.8,      15.58888889,      12.31111111,      3.666666667,      -0.977777778,      1.288888889,      4.211111111,      9.377777778,      5.266666667,      2.144444444,      3.977777778,      7.2,      11.94444444,      11.32222222,      4,      6.611111111,      8.211111111,      3.5,      8.866666667,      3.6,      3.711111111,      13.12222222,      7.833333333,      -3.333333333,      -2.166666667,      -2.877777778,      5.188888889,      13.12222222,      12.11111111,      -0.7,      6.688888889,      14.03333333,      -2.433333333,      -8.6,      -8.244444444,      -2.122222222,      -2.722222222,      1.266666667,      2.8,      5.7,      6.944444444,      5.066666667,      5.688888889,      13.35555556,      16.66666667,      17.33333333,      7.277777778,      6.388888889,      1.344444444,      9.111111111,      17.96666667,      12.8,      5.8,      6.911111111,      6.822222222,      11.87777778,      13.16666667,      9.233333333,      8.655555556,      10.04444444,      7.022222222,      7.644444444,      8.311111111,      16.71111111,      18.85555556,      12.14444444,      13.27777778,      11.18888889,      7.088888889,      8.255555556,      7.522222222,      9.955555556,      9.933333333,      4.866666667,      15.25555556,      9.244444444,      9.755555556,      14,      8.955555556,      2.344444444,      17.43333333,      12.12222222,      13.46666667,      23,      18.45555556,      12.77777778,      7.211111111,      8.588888889,      14.35555556,      19.01111111,      12.4,      9.155555556,      15.6,      4.955555556,      8.966666667,      16.95555556,      9.511111111,      10.15555556,      16,      14.45555556,      21.02222222,      25.76666667,      20.5,      15.71111111,      11.67777778,      12.81111111,      12.88888889,      17.58888889,      23.12222222,      21.77777778,      24.42222222,      20.05555556,      24.32222222,      18.83333333,      19.56666667,      14.96666667,      19.68888889,      18.57777778,      23,      23.34444444,      20.7,      11.82222222,      11.48888889,      17.52222222,      22.55555556,      20.47777778,      23.01111111,      27.86666667,      30.28888889,      30.3,      22.94444444,      18.57777778,      25.51111111,      24.13333333,      30.01111111,      24.77777778,      20.28888889,      28.67777778,      32.74444444,      31.37777778,      28.52222222,      31.81111111,      27.24444444,      32.53333333,      26.15555556,      24.63333333,      28.3,      31.23333333,      32.21111111,      28.21111111,      23.07777778,      21.64444444,      24.34444444,      19.62222222,      25.14444444,      24.46666667,      23.87777778,      21.28888889,      20.22222222,      29.98888889,      32.04444444,      36.44444444,      36.01111111,      24.85555556,      23.45555556,      29.17777778,      32.25555556,      28.75555556,      30.28888889,      28.85555556,      30.45555556,      31.26666667,      28.86666667,      33.31111111,      30.66666667,      28.67777778,      27.4,      32.2,      25.41111111,      22.23333333,      26.67777778,      30.21111111,      29.15555556,      29.65555556,      31.94444444,      31.43333333,      28.35555556,      24.8,      25.5,      25.42222222,      24.17777778,      20.88888889,      24.35555556,      25.54444444,      22,      27.95555556,      29.42222222,      28.88888889,      26.8,      28.2,      26.92222222,      24.13333333,      22.61111111,      26.15555556,      30.57777778,      30.86666667,      29.92222222,      27.33333333,      23.43333333,      24.68888889,      26.94444444,      28.81111111,      25.54444444,      22.48888889,      21.67777778,      19.74444444,      23.82222222,      25.91111111,      30.85555556,      28.48888889,      29.21111111,      28.37777778,      22.4,      25.55555556,      27.35555556,      30.67777778,      27.95555556,      25.98888889,      23.46666667,      25.37777778,      20.46666667,      22.54444444,      20.18888889,      22.24444444,      26.84444444,      25.8,      29.62222222,      26.36666667,      32.24444444,      29.84444444,      28.33333333,      31.22222222,      29.9,      29.98888889,      27.42222222,      25.54444444,      20.22222222,      24,      24.52222222,      25.02222222,      16.12222222,      17.58888889,      23.25555556,      15.75555556,      18.66666667,      18.4,      12.52222222,      20.07777778,      28.62222222,      17.23333333,      16.6,      13.34444444,      10.98888889,      9.522222222,      5.8,      6.811111111,      6.555555556,      12.18888889,      12.64444444,      4.2,      3.577777778,      8.888888889,      15.23333333,      16.11111111,      18.36666667,      16.98888889,      15.63333333,      16.46666667,      15.55555556,      15.65555556,      17.42222222,      18.74444444,      19.48888889,      15.9,      19.73333333,      13.02222222,      8.1,      8.933333333,      11.3,      12.38888889,      8.3,      12.38888889,      6.388888889,      4.211111111,      4.666666667,      0.7,      7.133333333,      2.344444444,      1.088888889,      0.111111111,      11.62222222,      10.84444444,      8.777777778,      3.5,      3.4,      7.211111111,      5.711111111,      9.677777778,      12.25555556,      10.15555556,      6.511111111,      4.911111111,      1.5,      11.44444444,      15.54444444,      8.122222222,      6.233333333,      7,      4.355555556,      0.277777778,      3.711111111,      2.888888889,      1.555555556,      3.888888889,      4.555555556,      5.666666667,      7.833333333,      9.833333333,      10.02222222,      6.288888889,      5.366666667,      11.41111111,      9.566666667,      9.744444444,      13.57777778,      9.433333333,      3.1,      11.08888889,      3.844444444,      2.488888889,      7.544444444,      4.488888889,      -0.455555556,      -2.111111111,      -3.566666667,      -1.955555556,      3.955555556,      1.222222222,  ]  week_number = [f"W{i//7}" if i % 7 == 0 else None for i in range(0, 365)]    start = 50  size = 100  data = {      "Date": dates[start:size],      "Temp°C": temp[start:size],      "Week": numpy.array(max[start:size]) + 5,      "WeekN": week_number[start:size],  }    page = """  # Line - Texts    <|{data}|chart|x=Date|y[1]=Temp°C|y[2]=Week|mode[2]=text|text[2]=WeekN|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # Create a star shape  data = {"r": [3, 1] * 5 + [3], "theta": list(range(0, 360, 36)) + [0]}    options = [      # First plot is filled with a yellow-ish color      {"subplot": "polar", "fill": "toself", "fillcolor": "#E4FF87"},      # Second plot is filled with a blue-ish color      {"fill": "toself", "subplot": "polar2", "fillcolor": "#709BFF"},  ]    layout = {      "polar": {          # This actually is the default value          "angularaxis": {              "direction": "counterclockwise",          },      },      "polar2": {          "angularaxis": {              # Rotate the axis 180° (0 is on the left)              "rotation": 180,              # Orient the axis clockwise              "direction": "clockwise",              # Show the angles as radians              "thetaunit": "radians",          },      },      # Hide the legend      "showlegend": False,  }    page = """  # Polar Charts - Direction    <|{data}|chart|type=scatterpolar|layout={layout}|options={options}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    value = "XS"    page = """  # Slider - List of values    <|{value}|slider|lov=XXS;XS;S;M;L;XL;XXL|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import io  from decimal import Decimal, getcontext    from taipy.gui import Gui, download    # Initial precision  precision = 10      def pi(precision: int) -> list[int]:      """Compute Pi to the required precision.        Adapted from https://docs.python.org/3/library/decimal.html      """      saved_precision = getcontext().prec  # Save precision      getcontext().prec = precision      three = Decimal(3)  # substitute "three=3.0" for regular floats      lasts, t, s, n, na, d, da = 0, three, 3, 1, 0, 0, 24      while s != lasts:          lasts = s          n, na = n + na, na + 8          d, da = d + da, da + 32          t = (t * n) / d          s += t      digits = []      while s != 0:          integral = int(s)          digits.append(integral)          s = (s - integral) * 10      getcontext().prec = saved_precision      return digits      # Generate the digits, save them in a CSV file content, and trigger a download action  # so the user can retrieve them  def download_pi(state):      digits = pi(state.precision)      buffer = io.StringIO()      buffer.write("index,digit\n")      for i, d in enumerate(digits):          buffer.write(f"{i},{d}\n")      download(state, content=bytes(buffer.getvalue(), "UTF-8"), name="pi.csv")      page = """  # File Download - Dynamic content    Precision:    <|{precision}|slider|min=2|max=10000|>    <|{None}|file_download|on_action=download_pi|label=Download Pi digits|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    value = 9    page = """  # Slider - Custom range    <|{value}|slider|min=1|max=10|>    Value: <|{value}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from datetime import date, timedelta    from taipy.gui import Gui    # Create the list of dates (all year 2000)  all_dates = {}  all_dates_str = []  start_date = date(2000, 1, 1)  end_date = date(2001, 1, 1)  a_date = start_date  while a_date < end_date:      date_str = a_date.strftime("%Y/%m/%d")      all_dates_str.append(date_str)      all_dates[date_str] = a_date      a_date += timedelta(days=1)    # Initial selection: first and last day  dates = [all_dates_str[1], all_dates_str[-1]]  # These two variables are used in text controls  start_sel = all_dates[dates[0]]  end_sel = all_dates[dates[1]]      def on_change(state, _, var_value):      # Update the text controls      state.start_sel = all_dates[var_value[0]]      state.end_sel = all_dates[var_value[1]]      page = """  # Slider - Date range    <|{dates}|slider|lov={all_dates_str}|>    Start: <|{start_sel}|text|format=d MMM|>    End: <|{end_sel}|text|format=d MMM|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  import os  from decimal import Decimal, getcontext  from tempfile import NamedTemporaryFile    from taipy.gui import Gui, download    # Initial precision  precision = 10  # Stores the path to the temporary file  temp_path = None      def pi(precision: int) -> list[int]:      """Compute Pi to the required precision.        Adapted from https://docs.python.org/3/library/decimal.html      """      saved_precision = getcontext().prec  # Save precision      getcontext().prec = precision      three = Decimal(3)  # substitute "three=3.0" for regular floats      lasts, t, s, n, na, d, da = 0, three, 3, 1, 0, 0, 24      while s != lasts:          lasts = s          n, na = n + na, na + 8          d, da = d + da, da + 32          t = (t * n) / d          s += t      digits = []      while s != 0:          integral = int(s)          digits.append(integral)          s = (s - integral) * 10      getcontext().prec = saved_precision      return digits      # Remove the temporary file  def clean_up(state):      os.remove(state.temp_path)      # Generate the digits, save them in a CSV temporary file, then trigger a download action  # for that file.  def download_pi(state):      digits = pi(state.precision)      with NamedTemporaryFile("r+t", suffix=".csv", delete=False) as temp_file:          state.temp_path = temp_file.name          temp_file.write("index,digit\n")          for i, d in enumerate(digits):              temp_file.write(f"{i},{d}\n")      download(state, content=temp_file.name, name="pi.csv", on_action=clean_up)      page = """  # File Download - Dynamic content    Precision:    <|{precision}|slider|min=2|max=10000|>    <|{None}|file_download|on_action=download_pi|label=Download Pi digits|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    value = 50    page = """  # Slider - Simple    <|{value}|slider|>    Value: <|{value}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    value = 40    page = """  # Slider - Vertical    <|{value}|slider|orientation=v|>    Value: <|{value}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.  # -----------------------------------------------------------------------------------------  # To execute this script, make sure that the taipy-gui package is installed in your  # Python environment and run:  #     python <script>  # -----------------------------------------------------------------------------------------  from taipy.gui import Gui    # Initial values  values = [20, 40, 80]    page = """  # Slider - Range    <|{values}|slider|>    Selection: <|{values}|>  """    Gui(page).run()


#  # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with  # the License. You may obtain a copy of the License at  #  #        http://www.apache.org/licenses/LICENSE-2.0  #  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  # specific language governing permissions and limitations under the License.


import os  import sys    from taipy._cli._base_cli import _CLI  from taipy.core._core_cli import _CoreCLI  from taipy.core._entity._migrate_cli import _MigrateCLI  from taipy.core._version._cli._version_cli import _VersionCLI  from taipy.gui._gui_cli import _GuiCLI    from ._cli._help_cli import _HelpCLI  from ._cli._run_cli import _RunCLI  from ._cli._scaffold_cli import _ScaffoldCLI  from .version import _get_version      def _entrypoint():      # Add the current working directory to path to execute version command on FS repo      sys.path.append(os.path.normpath(os.getcwd()))        _CLI._parser.add_argument("-v", "--version", action="store_true", help="Print the current Taipy version and exit.")        _RunCLI.create_parser()      _GuiCLI.create_run_parser()      _CoreCLI.create_run_parser()        _VersionCLI.create_parser()      _ScaffoldCLI.create_parser()      _MigrateCLI.create_parser()      _HelpCLI.create_parser()        args = _CLI._parse()      if args.version:          print(f"Taipy {_get_version()}")          sys.exit(0)        _RunCLI.parse_arguments()      _HelpCLI.parse_arguments()      _VersionCLI.parse_arguments()      _MigrateCLI.parse_arguments()      _ScaffoldCLI.parse_arguments()        _CLI._remove_argument("help")      _CLI._parser.print_help()


import json  import os      def _get_version():      with open(f"{os.path.dirname(os.path.abspath(__file__))}{os.sep}version.json") as version_file:          version = json.load(version_file)          version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'          if vext := version.get("ext"):              version_string = f"{version_string}.{vext}"      return version_string


from importlib.util import find_spec    if find_spec("taipy"):      if find_spec("taipy.config"):          from taipy.config._init import *  # type: ignore        if find_spec("taipy.gui"):          from taipy.gui._init import *  # type: ignore        if find_spec("taipy.core"):          from taipy.core._init import *  # type: ignore        if find_spec("taipy.rest"):          from taipy.rest._init import *  # type: ignore        if find_spec("taipy.gui_core"):          from taipy.gui_core._init import *  # type: ignore        if find_spec("taipy.enterprise"):          from taipy.enterprise._init import *  # type: ignore        if find_spec("taipy._run"):          from taipy._run import _run as run  # type: ignore


import sys  import typing as t    from flask import Flask    from taipy.core import Core  from taipy.gui import Gui  from taipy.rest import Rest    if sys.version_info >= (3, 10):      from typing import TypeGuard    _AppType = t.Union[Gui, Rest, Core]  _AppTypeT = t.TypeVar("_AppTypeT", Gui, Rest, Core)      def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:      """Run one or multiple Taipy services.        A Taipy service is an instance of a class that runs code as a Web application.        Parameters:          *services (Union[`Gui^`, `Rest^`, `Core^`]): Services to run, as separate arguments.
              If several services are provided, all the services run simultaneously.
              If this is empty or set to None, this method does nothing.          **kwargs: Other parameters to provide to the services.      """        gui = __get_app(services, Gui)      rest = __get_app(services, Rest)      core = __get_app(services, Core)        if gui and core:          from taipy.core._core_cli import _CoreCLI          from taipy.gui._gui_cli import _GuiCLI            _CoreCLI.create_parser()          _GuiCLI.create_parser()        if rest or core:          if not core:              core = Core()          core.run()        if not rest and not gui:          return None        if gui and rest:          gui._set_flask(rest._app)  # type: ignore          return gui.run(**kwargs)      else:          app = rest or gui          assert app is not None  # Avoid pyright typing error          return app.run(**kwargs)      # Avoid black adding too many empty lines  # fmt: off  if sys.version_info >= (3, 10):      def __get_app(apps: t.Tuple[_AppType, ...], type_: t.Type[_AppTypeT]) -> t.Optional[_AppType]:          def filter_isinstance(tl: _AppType) -> TypeGuard[_AppTypeT]:              return isinstance(tl, type_)            return next(filter(filter_isinstance, apps), None)  else:      def __get_app(apps: t.Tuple[_AppType, ...], type_: t.Type[_AppTypeT]) -> t.Optional[_AppType]:          return next(filter(lambda a: isinstance(a, type_), apps), None)  # fmt: on


from ._core import Core  from ._entity.submittable import Submittable  from .cycle.cycle import Cycle  from .cycle.cycle_id import CycleId  from .data.data_node import DataNode  from .data.data_node_id import DataNodeId  from .job.job import Job  from .job.job_id import JobId  from .job.status import Status  from .scenario.scenario import Scenario  from .scenario.scenario_id import ScenarioId  from .sequence.sequence import Sequence  from .sequence.sequence_id import SequenceId  from .taipy import (      cancel_job,      clean_all_entities_by_version,      compare_scenarios,      create_global_data_node,      create_scenario,      delete,      delete_job,      delete_jobs,      exists,      export_scenario,      get,      get_cycles,      get_cycles_scenarios,      get_data_nodes,      get_entities_by_config_id,      get_jobs,      get_latest_job,      get_parents,      get_primary,      get_primary_scenarios,      get_scenarios,      get_sequences,      get_tasks,      is_deletable,      is_editable,      is_promotable,      is_readable,      is_submittable,      set,      set_primary,      submit,      subscribe_scenario,      subscribe_sequence,      tag,      unsubscribe_scenario,      unsubscribe_sequence,      untag,  )  from .task.task import Task  from .task.task_id import TaskId


"""# Taipy Core    The Taipy Core package is a Python library designed to build powerful, customized, data-driven back-end  applications. It provides the tools to help Python developers transform their algorithms into a  complete back-end application.  More details on the [Taipy Core](../../core/index.md) functionalities are available in the user manual.    To build a Taipy Core application, the first step consists of setting up the Taipy configuration to design  your application's characteristics and behaviors.  Import `Config^` from the `taipy.config^` module, then use the various methods of the `Config^` singleton class to  configure your core application. In particular, configure the  [data nodes](../../core/config/data-node-config.md), [tasks](../../core/config/task-config.md),  and [scenarios](../../core/config/scenario-config.md).  Please refer to the [Core configuration user manual](../../core/config/index.md) for more information and  detailed examples.    Once your application is configured, import module `import taipy as tp` so you can use any function described  in the following section on [Functionc](#functions). In particular, the most used functions are `tp.create_scenario()`,  `tp.get_scenarios()`, `tp.get_data_nodes()`, `tp.submit()`, used to get, create, and submit entities.    !!! Note        Taipy Core provides a runnable service, `Core^` that runs as a service in a dedicated thread. The purpose is to      have a dedicated thread responsible for dispatching the submitted jobs to an available executor for their execution.        In particular, this `Core^` service is automatically run when Core is used with Taipy REST or Taipy GUI. See the      [running services](../../run-deploy/run/running_services.md) page of the user manual for more details.  """    from ._init import *  from ._init_version import _read_version  from .common.mongo_default_document import MongoDefaultDocument  from .data.data_node_id import Edit  from .exceptions import exceptions    __version__ = _read_version()


import json  import os  from pathlib import Path      def _read_version():      with open(f"{Path(os.path.abspath(__file__)).parent}{os.sep}version.json") as version_file:          version = json.load(version_file)          version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'          if vext := version.get("ext"):              version_string = f"{version_string}.{vext}"      return version_string