MUIs 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- muis-0.1.0/PKG-INFO +36 -0
- muis-0.1.0/README.md +22 -0
- muis-0.1.0/pyproject.toml +29 -0
- muis-0.1.0/setup.cfg +4 -0
- muis-0.1.0/src/MUIs/__init__.py +0 -0
- muis-0.1.0/src/MUIs/mui.py +103 -0
- muis-0.1.0/src/MUIs.egg-info/PKG-INFO +36 -0
- muis-0.1.0/src/MUIs.egg-info/SOURCES.txt +9 -0
- muis-0.1.0/src/MUIs.egg-info/dependency_links.txt +1 -0
- muis-0.1.0/src/MUIs.egg-info/requires.txt +2 -0
- muis-0.1.0/src/MUIs.egg-info/top_level.txt +1 -0
muis-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: MUIs
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: My Python package related to creating material ui version of python
|
|
5
|
+
Author-email: Prakhar Gandhi <gprakhar0@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: dash
|
|
13
|
+
Requires-Dist: dash-mui-charts
|
|
14
|
+
|
|
15
|
+
# MUIs
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Python package related to creating mui charts
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
import MUIs
|
|
22
|
+
from MUIs import mui
|
|
23
|
+
from pprint import pprint
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
if __name__ == '__main__':
|
|
27
|
+
list_of_types = ["line","bar","candlestick","pie","scatter","composite","heatmap","sparkline","livetrading","unknown_type"]
|
|
28
|
+
series_lists = [[1, 4, 2, 5, 7],[1, 2, 2, 5, 7]]
|
|
29
|
+
xAxis_list = [1, 2, 3, 4, 5]
|
|
30
|
+
yAxis_list = [11,22,33,44,55]
|
|
31
|
+
check_which_charts_are_available = True
|
|
32
|
+
charts_app = mui.get_charts(list_of_types,series_lists,xAxis_list,yAxis_list,check_which_charts_are_available)
|
|
33
|
+
run_app(charts_app)
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
|
muis-0.1.0/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# MUIs
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Python package related to creating mui charts
|
|
5
|
+
|
|
6
|
+
```python
|
|
7
|
+
import MUIs
|
|
8
|
+
from MUIs import mui
|
|
9
|
+
from pprint import pprint
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if __name__ == '__main__':
|
|
13
|
+
list_of_types = ["line","bar","candlestick","pie","scatter","composite","heatmap","sparkline","livetrading","unknown_type"]
|
|
14
|
+
series_lists = [[1, 4, 2, 5, 7],[1, 2, 2, 5, 7]]
|
|
15
|
+
xAxis_list = [1, 2, 3, 4, 5]
|
|
16
|
+
yAxis_list = [11,22,33,44,55]
|
|
17
|
+
check_which_charts_are_available = True
|
|
18
|
+
charts_app = mui.get_charts(list_of_types,series_lists,xAxis_list,yAxis_list,check_which_charts_are_available)
|
|
19
|
+
run_app(charts_app)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "MUIs"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "My Python package related to creating material ui version of python"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "Prakhar Gandhi", email = "gprakhar0@gmail.com"}
|
|
13
|
+
]
|
|
14
|
+
requires-python = ">=3.9"
|
|
15
|
+
|
|
16
|
+
dependencies = [
|
|
17
|
+
"dash",
|
|
18
|
+
"dash-mui-charts"
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["src"]
|
muis-0.1.0/setup.cfg
ADDED
|
File without changes
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from dash import Dash, html
|
|
2
|
+
from dash_mui_charts import LineChart, BarChart, CandlestickChart, ScatterChart,SparklineChart
|
|
3
|
+
|
|
4
|
+
def create_app(list_of_charts):
|
|
5
|
+
app = Dash(__name__)
|
|
6
|
+
app.layout = html.Div(list_of_charts)
|
|
7
|
+
return app
|
|
8
|
+
|
|
9
|
+
def get_line_chart(series_list,xAxis_list):
|
|
10
|
+
cv = LineChart(
|
|
11
|
+
id='my-line-chart',
|
|
12
|
+
height=400,
|
|
13
|
+
series=[{'data': series, 'label': f'Series {i}'} for i,series in enumerate(series_list)],
|
|
14
|
+
xAxis=[{'data': xAxis_list}],
|
|
15
|
+
)
|
|
16
|
+
return cv
|
|
17
|
+
|
|
18
|
+
def get_bar_chart(series_list,xAxis_list):
|
|
19
|
+
cv = BarChart(
|
|
20
|
+
id='my-bar',
|
|
21
|
+
series=[{'data': series, 'label': 'Bar Chart', 'color': '#1976d2'} for series in series_list],
|
|
22
|
+
xAxis=[{'data': xAxis_list, 'scaleType': 'band'}],
|
|
23
|
+
height=350,
|
|
24
|
+
)
|
|
25
|
+
return cv
|
|
26
|
+
|
|
27
|
+
def get_candlestick_chart(series_list,xAxis_list):
|
|
28
|
+
cv = CandlestickChart(
|
|
29
|
+
id='my-candles',
|
|
30
|
+
series=[{
|
|
31
|
+
'data': [
|
|
32
|
+
series_list
|
|
33
|
+
],
|
|
34
|
+
'upColor': '#4caf50', # close >= open
|
|
35
|
+
'downColor': '#f44336', # close < open
|
|
36
|
+
}],
|
|
37
|
+
xAxis=[{'data': xAxis_list}],
|
|
38
|
+
)
|
|
39
|
+
return cv
|
|
40
|
+
|
|
41
|
+
def get_scatter_chart(xAxis_list,yAxis_list):
|
|
42
|
+
cv = ScatterChart(
|
|
43
|
+
series=[
|
|
44
|
+
{
|
|
45
|
+
'id': 'group-a',
|
|
46
|
+
'label': 'Group A',
|
|
47
|
+
'data': [{'x': xAxis_list[i], 'y': yAxis_list[i], 'id': i} for i in range(len(xAxis_list))],
|
|
48
|
+
'color': '#1976d2',
|
|
49
|
+
'markerSize': 6,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
voronoiMaxRadius=30, # proximity-based hover/click
|
|
53
|
+
height=400,
|
|
54
|
+
)
|
|
55
|
+
return cv
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def get_sparkline_chart(series_list,xAxis_list):
|
|
60
|
+
cv = SparklineChart(
|
|
61
|
+
data=xAxis_list,
|
|
62
|
+
plotType='line', # or 'bar'
|
|
63
|
+
color='#1976d2',
|
|
64
|
+
area=True,
|
|
65
|
+
height=40,
|
|
66
|
+
width=150,
|
|
67
|
+
)
|
|
68
|
+
return cv
|
|
69
|
+
|
|
70
|
+
def get_available_charts():
|
|
71
|
+
available_charts = ["line","bar","candlestick","scatter","sparkline"]
|
|
72
|
+
return available_charts
|
|
73
|
+
|
|
74
|
+
def get_list_of_charts(list_of_types,series_lists,xAxis_list,yAxis_list,check_which_charts_are_available):
|
|
75
|
+
if check_which_charts_are_available==True:
|
|
76
|
+
available_charts = get_available_charts()
|
|
77
|
+
print(f"Only these charts are available! {available_charts}")
|
|
78
|
+
|
|
79
|
+
results = []
|
|
80
|
+
for chart_type in list_of_types:
|
|
81
|
+
cv = None
|
|
82
|
+
if chart_type=="line":
|
|
83
|
+
cv = get_line_chart(series_lists,xAxis_list)
|
|
84
|
+
elif chart_type=="bar":
|
|
85
|
+
cv = get_bar_chart(series_lists,xAxis_list)
|
|
86
|
+
elif chart_type=="candlestick":
|
|
87
|
+
cv = get_candlestick_chart(series_lists,xAxis_list)
|
|
88
|
+
elif chart_type=="scatter":
|
|
89
|
+
cv = get_scatter_chart(xAxis_list,yAxis_list)
|
|
90
|
+
elif chart_type=="sparkline":
|
|
91
|
+
cv = get_sparkline_chart(series_lists,xAxis_list)
|
|
92
|
+
if cv!=None:
|
|
93
|
+
results.append(cv)
|
|
94
|
+
|
|
95
|
+
return results
|
|
96
|
+
|
|
97
|
+
def get_charts(list_of_types,series_lists,xAxis_list,yAxis_list,check_which_charts_are_available):
|
|
98
|
+
list_of_charts = get_list_of_charts(list_of_types,series_lists,xAxis_list,yAxis_list,check_which_charts_are_available)
|
|
99
|
+
app = create_app(list_of_charts)
|
|
100
|
+
return app
|
|
101
|
+
|
|
102
|
+
def run_app(app):
|
|
103
|
+
app.run(debug=True, use_reloader=False)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: MUIs
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: My Python package related to creating material ui version of python
|
|
5
|
+
Author-email: Prakhar Gandhi <gprakhar0@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: dash
|
|
13
|
+
Requires-Dist: dash-mui-charts
|
|
14
|
+
|
|
15
|
+
# MUIs
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Python package related to creating mui charts
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
import MUIs
|
|
22
|
+
from MUIs import mui
|
|
23
|
+
from pprint import pprint
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
if __name__ == '__main__':
|
|
27
|
+
list_of_types = ["line","bar","candlestick","pie","scatter","composite","heatmap","sparkline","livetrading","unknown_type"]
|
|
28
|
+
series_lists = [[1, 4, 2, 5, 7],[1, 2, 2, 5, 7]]
|
|
29
|
+
xAxis_list = [1, 2, 3, 4, 5]
|
|
30
|
+
yAxis_list = [11,22,33,44,55]
|
|
31
|
+
check_which_charts_are_available = True
|
|
32
|
+
charts_app = mui.get_charts(list_of_types,series_lists,xAxis_list,yAxis_list,check_which_charts_are_available)
|
|
33
|
+
run_app(charts_app)
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MUIs
|