44app = marimo .App (width = "medium" )
55
66
7- app ._unparsable_cell (
8- r"""
9- oimport marimo as mo
10- """ ,
11- name = "_" ,
12- )
13-
14-
157@app .cell
16- def _ (
17- ui_color_costs ,
18- ui_fixed_cost ,
19- ui_quantity ,
20- ui_selling_price ,
21- ui_unit_cost ,
22- ):
8+ def _ ():
239 import matplotlib .pyplot as plt
10+ import marimo as mo
11+ return mo , plt
12+
2413
14+ @app .cell
15+ def _ (ui_fixed_cost , ui_quantity , ui_selling_price , ui_unit_cost ):
2516 fixed_cost = int (ui_fixed_cost .value )
2617 unit_cost = ui_unit_cost .value
2718 selling_price = float (ui_selling_price .value )
2819 upper_production_quantity = ui_quantity .value
20+ return fixed_cost , selling_price , unit_cost , upper_production_quantity
21+
2922
23+ @app .cell
24+ def _ (
25+ fixed_cost ,
26+ plt ,
27+ selling_price ,
28+ ui_color_costs ,
29+ unit_cost ,
30+ upper_production_quantity ,
31+ ):
3032 break_even_quantity = fixed_cost / (selling_price - unit_cost )
3133 break_even_income = break_even_quantity * selling_price
3234
@@ -58,28 +60,22 @@ def _(
5860 return (
5961 break_even_income ,
6062 break_even_quantity ,
61- fixed_cost ,
62- plt ,
6363 sales_income ,
64- selling_price ,
65- unit_cost ,
6664 unit_costs ,
6765 units ,
68- upper_production_quantity ,
6966 )
7067
7168
7269@app .cell
7370def _ (mo ):
74- options = ["40000" , "50000" ]
75- ui_fixed_cost = mo .ui .radio (options = options , value = "50000" )
71+ ui_fixed_cost = mo .ui .radio (options = ["40000" , "50000" ], value = "50000" )
7672
7773 ui_unit_cost = mo .ui .slider (start = 2 , stop = 5 , step = 1 )
7874
7975 ui_selling_price = mo .ui .text (value = "10" )
8076
8177 ui_quantity = mo .ui .dropdown (
82- options = {"10000" : 10000 , "12000" : 12000 , "15000" : 15000 }, value = "10000"
78+ options = {"10000" : 10000 , "12000" : 12000 , "15000" : 15000 }, value = "10000" ,
8379 )
8480
8581 ui_disply_break_even = mo .ui .switch ()
@@ -90,17 +86,16 @@ def _(mo):
9086
9187 mo .md (
9288 f"""
93- Select Fixed Costs: { ui_fixed_cost }
89+ Fixed Costs: { ui_fixed_cost }
9490
95- Select Unit Cost Price: { ui_unit_cost }
91+ Unit Cost Price: { ui_unit_cost }
9692
97- Enter Selling Price: { ui_selling_price }
93+ Selling Price: { ui_selling_price }
9894
99- Select a Maximum Production Quantity: { ui_quantity }
95+ Maximum Production Quantity: { ui_quantity }
10096 """
10197 )
10298 return (
103- options ,
10499 ui_color_costs ,
105100 ui_disply_break_even ,
106101 ui_fixed_cost ,
0 commit comments