aplotly 1.1.25__tar.gz → 1.1.27__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.
Files changed (39) hide show
  1. {aplotly-1.1.25/aplotly.egg-info → aplotly-1.1.27}/PKG-INFO +2 -2
  2. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly/colors.py +10 -9
  3. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly/plots.py +24 -12
  4. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly/style.py +17 -9
  5. {aplotly-1.1.25 → aplotly-1.1.27/aplotly.egg-info}/PKG-INFO +2 -2
  6. aplotly-1.1.27/aplotly.egg-info/requires.txt +2 -0
  7. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_multiple_performance.py +1 -1
  8. {aplotly-1.1.25 → aplotly-1.1.27}/pyproject.toml +3 -3
  9. aplotly-1.1.25/aplotly.egg-info/requires.txt +0 -2
  10. {aplotly-1.1.25 → aplotly-1.1.27}/LICENSE +0 -0
  11. {aplotly-1.1.25 → aplotly-1.1.27}/MANIFEST.in +0 -0
  12. {aplotly-1.1.25 → aplotly-1.1.27}/README.md +0 -0
  13. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly/__init__.py +0 -0
  14. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly/io.py +0 -0
  15. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly/utils/return_breakdown.py +0 -0
  16. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly.egg-info/SOURCES.txt +0 -0
  17. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly.egg-info/dependency_links.txt +0 -0
  18. {aplotly-1.1.25 → aplotly-1.1.27}/aplotly.egg-info/top_level.txt +0 -0
  19. {aplotly-1.1.25 → aplotly-1.1.27}/examples/fetch_deribit_data.py +0 -0
  20. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_bars.py +0 -0
  21. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_confidence_interval.py +0 -0
  22. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_correlation.py +0 -0
  23. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_exposure_tree.py +0 -0
  24. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_gauge.py +0 -0
  25. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_line.py +0 -0
  26. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_line_and_save.py +0 -0
  27. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_lines.py +0 -0
  28. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_lines_with_dist.py +0 -0
  29. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_market.py +0 -0
  30. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_participation.py +0 -0
  31. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_performance.py +0 -0
  32. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_performance_by_trade.py +0 -0
  33. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_return_side.py +0 -0
  34. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_returns_breakdown.py +0 -0
  35. {aplotly-1.1.25 → aplotly-1.1.27}/examples/plot_returns_tree.py +0 -0
  36. {aplotly-1.1.25 → aplotly-1.1.27}/setup.cfg +0 -0
  37. {aplotly-1.1.25 → aplotly-1.1.27}/tests/test_colors.py +0 -0
  38. {aplotly-1.1.25 → aplotly-1.1.27}/tests/test_io.py +0 -0
  39. {aplotly-1.1.25 → aplotly-1.1.27}/tests/test_style.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aplotly
3
- Version: 1.1.25
3
+ Version: 1.1.27
4
4
  License: MIT License
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: plotly>=5.18.0
18
+ Requires-Dist: plotly>=6.6.0
19
19
  Requires-Dist: pandas>=2.1.3
20
20
  Dynamic: license-file
21
21
 
@@ -111,16 +111,17 @@ def night():
111
111
 
112
112
  def dark_mode():
113
113
  line_colors = {
114
+ "pink": "#EA707E",
114
115
  "green": "#11A13C",
115
116
  "grey": "#6E6E73",
116
117
  "white": "#F5F5F7",
117
118
  }
118
119
 
119
120
  chart_colors = {
120
- "background": "#212121",
121
- "grid": "#3D3D3D",
122
- "text": "#F5F5F7",
123
- "axes": "#F5F5F7",
121
+ "background": "#241630",
122
+ "grid": "#eeeeee",
123
+ "text": "#ffffff",
124
+ "axes": "#eeeeee",
124
125
  }
125
126
 
126
127
  return line_colors, chart_colors
@@ -128,18 +129,18 @@ def dark_mode():
128
129
 
129
130
  def contrast():
130
131
  line_colors = {
131
- "orange": "#F26451",
132
+ "orange": "#EA707E",
132
133
  "yellow": "#FFD700",
133
134
  "purple": "#9B4F96",
134
135
  "teal": "#2A9D8F",
135
- "indigo": "#4B0082",
136
- "grey": "#CCCCCC",
137
- "blue": "#00BFFF",
136
+ "magenta": "#FF00FF",
138
137
  "mint": "#98FF98",
138
+ "grey": "#6E6E73",
139
+ "blue": "#022E9F",
139
140
  }
140
141
 
141
142
  chart_colors = {
142
- "background": "#000000",
143
+ "background": "#241630",
143
144
  "grid": "#333333",
144
145
  "text": "#E5E5E5",
145
146
  "axes": "#E5E5E5",
@@ -135,7 +135,7 @@ def plot_multiple_lines(
135
135
  color_palette (str, optional): name of the color palette to use. Defaults to "" (default color palette).
136
136
  group_title (str, optional): name of the legend group. Defaults to "" (no group name).
137
137
  plot_title (str, optional): title for the plot. Defaults to "" (no title).
138
- fade_secondary_lines (bool, optional): if True, all lines after the first one will have 40% transparency. Defaults to False.
138
+ fade_secondary_lines (bool, optional): if True, all lines after the first one will have washed out colors. Defaults to False.
139
139
 
140
140
  Returns:
141
141
  go.Figure: plotly figure containing the line charts.
@@ -157,13 +157,13 @@ def plot_multiple_lines(
157
157
 
158
158
  configure_plotly(subplots=1, color_palette=color_palette)
159
159
  fig = go.Figure()
160
-
160
+
161
161
  # Plot first line first with Scattergl
162
162
  if series and labels and visible and styles and colors:
163
163
  if colors[0] is not None:
164
164
  styles[0] = styles[0].copy() if styles[0] is not None else {}
165
165
  styles[0]["color"] = colors[0]
166
-
166
+
167
167
  fig.add_trace(
168
168
  go.Scattergl(
169
169
  x=series[0].index,
@@ -174,13 +174,12 @@ def plot_multiple_lines(
174
174
  legendgrouptitle_text=group_title,
175
175
  visible=visible[0],
176
176
  line=styles[0],
177
- opacity=1.0,
178
177
  )
179
178
  )
180
-
179
+
181
180
  # Update colors to ensure consistency
182
181
  fig.for_each_trace(lambda trace: trace.update(line=dict(color=trace.marker.color)))
183
-
182
+
184
183
  # Plot secondary lines after
185
184
  for i, (data, label, visibility, style, color) in enumerate(
186
185
  zip(series[1:], labels[1:], visible[1:], styles[1:], colors[1:])
@@ -188,10 +187,24 @@ def plot_multiple_lines(
188
187
  if color is not None:
189
188
  style = style.copy() if style is not None else {}
190
189
  style["color"] = color
191
-
192
- # Set opacity based on whether this is the first line and if fading is enabled
193
- opacity = 0.4 if fade_secondary_lines else 1.0
194
-
190
+
191
+ # If fading is enabled, wash out the color by mixing with white
192
+ if fade_secondary_lines:
193
+ style = style.copy() if style is not None else {}
194
+ if "color" in style:
195
+ # Convert color to RGB and mix with white (255, 255, 255)
196
+ import re
197
+ color = style["color"]
198
+ if isinstance(color, str) and color.startswith('rgb'):
199
+ # Extract RGB values
200
+ rgb = re.findall(r'\d+', color)
201
+ if len(rgb) == 3:
202
+ # Mix with white (60% original color, 40% white)
203
+ r = int(0.6 * int(rgb[0]) + 0.4 * 255)
204
+ g = int(0.6 * int(rgb[1]) + 0.4 * 255)
205
+ b = int(0.6 * int(rgb[2]) + 0.4 * 255)
206
+ style["color"] = f'rgb({r},{g},{b})'
207
+
195
208
  fig.add_trace(
196
209
  go.Scatter(
197
210
  x=data.index,
@@ -202,10 +215,9 @@ def plot_multiple_lines(
202
215
  legendgrouptitle_text=group_title,
203
216
  visible=visibility,
204
217
  line=style,
205
- opacity=opacity,
206
218
  )
207
219
  )
208
-
220
+
209
221
  fig.update_xaxes(title_text=xlabel)
210
222
  fig.update_yaxes(title_text=ylabel)
211
223
  fig.update_layout(showlegend=legend, title_text=plot_title)
@@ -6,12 +6,13 @@ import plotly.io as pio
6
6
  from .colors import select_palette
7
7
 
8
8
 
9
- def configure_plotly(subplots=1, color_palette=""):
9
+ def configure_plotly(subplots=1, color_palette="", document=False):
10
10
  """Configure plotly
11
11
 
12
12
  Args:
13
13
  subplots (int, optional): number of subplots. Defaults to 1.
14
14
  color_palette (str, optional): name of the color palette. Defaults to "" (default palette).
15
+ document (bool, optional): if the plot is for a document. Defaults to False.
15
16
 
16
17
  Returns:
17
18
  dict, dict: line_colors, chart_colors
@@ -28,15 +29,20 @@ def configure_plotly(subplots=1, color_palette=""):
28
29
 
29
30
  pio.templates["style"] = go.layout.Template(
30
31
  layout=go.Layout(
31
- title=dict(font=dict(size=20, color=chart_colors["text"])),
32
+ title=dict(
33
+ font=dict(size=20, color=chart_colors["text"]),
34
+ text="" if document else None
35
+ ),
32
36
  colorway=colorway,
33
37
  font=dict(size=15, color=chart_colors["text"]),
34
38
  paper_bgcolor=chart_colors["background"],
35
39
  plot_bgcolor=chart_colors["background"],
36
40
  margin=dict(l=80, r=10, t=50, b=80),
41
+ width=800,
42
+ height=400,
37
43
  hovermode="closest",
38
44
  legend=dict(
39
- font=dict(size=10, color=chart_colors["text"]),
45
+ font=dict(size=14, color=chart_colors["text"]),
40
46
  title_font=dict(size=15, color=chart_colors["text"]),
41
47
  groupclick="toggleitem",
42
48
  ),
@@ -45,30 +51,32 @@ def configure_plotly(subplots=1, color_palette=""):
45
51
  gridcolor=chart_colors["grid"],
46
52
  gridwidth=1,
47
53
  zeroline=False,
48
- showline=True,
54
+ showline=False,
49
55
  linecolor=chart_colors["axes"],
50
56
  linewidth=1,
51
- mirror=True,
57
+ mirror=False,
52
58
  ticks="outside",
53
59
  tickcolor=chart_colors["axes"],
54
60
  tickwidth=1,
55
61
  ticklen=5,
56
- tickfont=dict(size=10, color=chart_colors["text"]),
62
+ tickfont=dict(size=14, color=chart_colors["text"]),
63
+ title=dict(text="" if document else None),
57
64
  ),
58
65
  yaxis=dict(
59
66
  showgrid=True,
60
67
  gridcolor=chart_colors["grid"],
61
68
  gridwidth=1,
62
69
  zeroline=False,
63
- showline=True,
70
+ showline=False,
64
71
  linecolor=chart_colors["axes"],
65
72
  linewidth=1,
66
- mirror=True,
73
+ mirror=False,
67
74
  ticks="outside",
68
75
  tickcolor=chart_colors["axes"],
69
76
  tickwidth=1,
70
77
  ticklen=5,
71
- tickfont=dict(size=10, color=chart_colors["text"]),
78
+ tickfont=dict(size=14, color=chart_colors["text"]),
79
+ title=dict(text="" if document else None),
72
80
  ),
73
81
  )
74
82
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aplotly
3
- Version: 1.1.25
3
+ Version: 1.1.27
4
4
  License: MIT License
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: plotly>=5.18.0
18
+ Requires-Dist: plotly>=6.6.0
19
19
  Requires-Dist: pandas>=2.1.3
20
20
  Dynamic: license-file
21
21
 
@@ -0,0 +1,2 @@
1
+ plotly>=6.6.0
2
+ pandas>=2.1.3
@@ -8,6 +8,6 @@ fig = plot_multiple_performance(
8
8
  [pd.Series(np.random.rand(100), index=np.arange(100)) for _ in range(3)],
9
9
  labels=["Test 1", "Test 2", "Test 3"],
10
10
  xlabel="X",
11
- color_palette="contrast",
11
+ color_palette="washed_out",
12
12
  )
13
13
  fig.show()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aplotly"
7
- version = "1.1.25"
7
+ version = "1.1.27"
8
8
  readme = "README.md"
9
9
  license = { file = "LICENSE" }
10
10
  classifiers = [
@@ -13,13 +13,13 @@ classifiers = [
13
13
  "Programming Language :: Python :: 3",
14
14
  ]
15
15
  dependencies = [
16
- "plotly >= 5.18.0",
16
+ "plotly >= 6.6.0",
17
17
  "pandas >= 2.1.3"
18
18
  ]
19
19
  requires-python = ">=3.10"
20
20
 
21
21
  [tool.bumpver]
22
- current_version = "1.1.25"
22
+ current_version = "1.1.27"
23
23
  version_pattern = "MAJOR.MINOR.PATCH"
24
24
  commit_message = "Bump version {old_version} -> {new_version}"
25
25
  commit = true
@@ -1,2 +0,0 @@
1
- plotly>=5.18.0
2
- pandas>=2.1.3
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes