jsongrapher 4.2__py3-none-any.whl → 4.3__py3-none-any.whl

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.
@@ -610,13 +610,13 @@ class JSONGrapherRecord:
610
610
  "comments": comments, # Top-level comments
611
611
  "jsongrapher": "To plot this file, go to www.jsongrapher.com and drag this file into your browser, or use the python version of JSONGrapher. File created with python Version " + JSONGrapher.version.__version__,
612
612
  "datatype": datatype, # Top-level datatype (datatype)
613
- "data": data_objects_list if data_objects_list else [], # Data series list
614
613
  "layout": layout if layout else {
615
614
  "title": {"text": graph_title},
616
615
  "xaxis": {"title": {"text": x_axis_label_including_units}},
617
616
  "yaxis": {"title": {"text": y_axis_label_including_units}}
618
- }
619
- }
617
+ },
618
+ "data": data_objects_list if data_objects_list else [] # Data series list
619
+ }
620
620
  )
621
621
 
622
622
  if plot_style !="":
@@ -1940,7 +1940,8 @@ def apply_plot_style_to_plotly_dict(fig_dict, plot_style=None):
1940
1940
  if str(plot_style["layout_style"]).lower() != 'none': #take no action if received "None" or NoneType
1941
1941
  if plot_style["layout_style"] == '': #in this case, we're going to use the default.
1942
1942
  plot_style["layout_style"] = 'default'
1943
- print("Warning: No layout_style provided and 'z' field found in first data series. For 'bubble' plots, it is recommended to set layout_style to 'default'. For 'mesh3d' graphs and 'scatter3d' graphs, it is recommended to set layout_style to 'default3d'. Set layout_style to 'none' or another layout_style to avoid this warning.")
1943
+ if "z" in fig_dict["data"][0]:
1944
+ print("Warning: No layout_style provided and 'z' field found in first data series. For 'bubble2d' plots, it is recommended to set layout_style to 'default'. For 'mesh3d' graphs and 'scatter3d' graphs, it is recommended to set layout_style to 'default3d'. Set layout_style to 'none' or another layout_style to avoid this warning.")
1944
1945
  fig_dict = remove_layout_style_from_plotly_dict(fig_dict=fig_dict)
1945
1946
  fig_dict = apply_layout_style_to_plotly_dict(fig_dict=fig_dict, layout_style_to_apply=plot_style["layout_style"])
1946
1947
  #Code logic for trace_styles_collection style.
@@ -2260,7 +2261,7 @@ def apply_trace_style_to_single_data_series(data_series, trace_styles_collection
2260
2261
  #Block of code to clean color values for 3D plots and 2D plots. It can't be just from the style dictionary because we need to point to data.
2261
2262
  def clean_color_values(list_of_values, variable_string_for_warning):
2262
2263
  if None in list_of_values:
2263
- print("Warning: A colorscale based on" + variable_string_for_warning + "was requested. None values were found. They are being replaced with 0 values. It is recommended to provide data without None values.")
2264
+ print("Warning: A colorscale based on " + variable_string_for_warning + " was requested. None values were found. They are being replaced with 0 values. It is recommended to provide data without None values.")
2264
2265
  color_values = [0 if value is None else value for value in list_of_values]
2265
2266
  else:
2266
2267
  color_values = list_of_values
@@ -2338,7 +2339,7 @@ def prepare_bubble_sizes(data_series):
2338
2339
  if "max_bubble_size" in data_series:
2339
2340
  max_bubble_size = data_series["max_bubble_size"]
2340
2341
  else:
2341
- max_bubble_size = 10
2342
+ max_bubble_size = 100
2342
2343
  scaled_sizes = normalized_sizes*max_bubble_size
2343
2344
  data_series["marker"]["size"] = scaled_sizes.tolist() #from numpy array back to list.
2344
2345
 
@@ -3101,11 +3102,10 @@ def convert_to_3d_layout(layout):
3101
3102
  new_layout = copy.deepcopy(layout)
3102
3103
 
3103
3104
  # Add the axis fields inside `scene` first
3104
- new_layout["scene"] = {
3105
- "xaxis": layout.get("xaxis", {}),
3106
- "yaxis": layout.get("yaxis", {}),
3107
- "zaxis": layout.get("zaxis", {})
3108
- }
3105
+ scene = new_layout.setdefault("scene", {}) #Create a new dict if not present, otherwise use existing one.
3106
+ scene["xaxis"] = layout.get("xaxis", {})
3107
+ scene["yaxis"] = layout.get("yaxis", {})
3108
+ scene["zaxis"] = layout.get("zaxis", {})
3109
3109
 
3110
3110
  # Remove the original axis fields from the top-level layout
3111
3111
  new_layout.pop("xaxis", None)
@@ -17,6 +17,7 @@ styles_library = {
17
17
  },
18
18
  "default3d": {
19
19
  "layout": {
20
+ "scene": {"aspectmode":"cube"},
20
21
  "title": {"font": {"size": 32}, "x": 0.5},
21
22
  "xaxis": {"title": {"font": {"size": 12}}, "tickfont": {"size": 12}},
22
23
  "yaxis": {"title": {"font": {"size": 12}}, "tickfont": {"size": 12}},
JSONGrapher/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '4.2'
1
+ __version__ = '4.3'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jsongrapher
3
- Version: 4.2
3
+ Version: 4.3
4
4
  Summary: The python version of JSONGrapher with tools for creating JSONGrapher Records.
5
5
  Home-page: https://github.com/AdityaSavara/jsongrapher-py
6
6
  Author: Aditya Savara
@@ -1,4 +1,4 @@
1
- JSONGrapher/JSONRecordCreator.py,sha256=Wu5gCafri9g4bAAcyAJwlAoTLkExx7ssxjnQYcuGPUg,215343
1
+ JSONGrapher/JSONRecordCreator.py,sha256=aH8BGgBP62IiFaapvazQrw3QQMOYpieHSPC3DSG7hYU,215493
2
2
  JSONGrapher/UnitPytesting.py,sha256=xizJ-2fg9C5oNMFJyfavbBLMusayE9KWQiYIRrQQd4A,4363
3
3
  JSONGrapher/UnitpyCustomUnitsTesting.py,sha256=Rwq5p8HXN0FP54lRFgLTV0kgJ9TpcFaD3_C0MEOoEzw,1297
4
4
  JSONGrapher/__init__.py,sha256=fA3R6paWq3uskiLe3OglQZY_uJOejZHMFKdyX0dXWjo,310
@@ -6,14 +6,14 @@ JSONGrapher/drag_and_drop_gui.py,sha256=-7QJHLhzadHotWhONH4inerMaZ_xuwoTQSMRF_MP
6
6
  JSONGrapher/equation_creator.py,sha256=VFu6dFo-C0wDf1N3e0CyCBI-53cCUrp3oe0umdMLofs,17968
7
7
  JSONGrapher/equation_evaluator.py,sha256=Cm7UK5vWa6fT0OylD9f22_eR8zUvxY_Sy_W6n6N9bew,37012
8
8
  JSONGrapher/units_list.py,sha256=ROrlAsD66oPozZmOaE65xjNUEg3CxkSmA8iPE2_ihYI,34438
9
- JSONGrapher/version.py,sha256=bUff73G-qXNfPT8kDpDG9cWR4Adm49E9fp682pqJfbI,19
9
+ JSONGrapher/version.py,sha256=33TCwzu1vLlcE-5NggQ3w1vpfrXmhHEq1sI09FQrr5w,19
10
10
  JSONGrapher/styles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- JSONGrapher/styles/layout_styles_library.py,sha256=vGb1tE_ETY-Blj2frt8ddHA976ADFSCoabjzKn2ZNYU,3051
11
+ JSONGrapher/styles/layout_styles_library.py,sha256=adGZNVAj_VysYX-9x1NqxDnhIQFtKsMW8swGaY30ocs,3100
12
12
  JSONGrapher/styles/trace_styles_collection_library.py,sha256=DUbbO8jTlhn2q-lOY1XYGkHV1RbJX-P5Z1SUCM0qo6M,5952
13
- jsongrapher-4.2.data/data/LICENSE.txt,sha256=7Guw_pmj_H4sApnM7fld2L4HH6CP-3ZYdFoOXtHFx0Y,1489
14
- jsongrapher-4.2.data/data/README.md,sha256=u9uRPF0T12Pl6M6qjEleXZoB41ye0VTQPCJpEdldwNU,8157
15
- jsongrapher-4.2.dist-info/LICENSE.txt,sha256=7Guw_pmj_H4sApnM7fld2L4HH6CP-3ZYdFoOXtHFx0Y,1489
16
- jsongrapher-4.2.dist-info/METADATA,sha256=SmJRCR_Mh6cYNpdGZnB1AsA8C-k-iBD8Cvd_PcFojCo,9231
17
- jsongrapher-4.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
18
- jsongrapher-4.2.dist-info/top_level.txt,sha256=5f7Ui2hCKCPTQOjD540WKghKNYOvUDNfdpnDbIlAD3Y,12
19
- jsongrapher-4.2.dist-info/RECORD,,
13
+ jsongrapher-4.3.data/data/LICENSE.txt,sha256=7Guw_pmj_H4sApnM7fld2L4HH6CP-3ZYdFoOXtHFx0Y,1489
14
+ jsongrapher-4.3.data/data/README.md,sha256=u9uRPF0T12Pl6M6qjEleXZoB41ye0VTQPCJpEdldwNU,8157
15
+ jsongrapher-4.3.dist-info/LICENSE.txt,sha256=7Guw_pmj_H4sApnM7fld2L4HH6CP-3ZYdFoOXtHFx0Y,1489
16
+ jsongrapher-4.3.dist-info/METADATA,sha256=Toe-dZLjejoifd3cJbHOxsd7hlKTO7ZAWjc3osxyqME,9231
17
+ jsongrapher-4.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
18
+ jsongrapher-4.3.dist-info/top_level.txt,sha256=5f7Ui2hCKCPTQOjD540WKghKNYOvUDNfdpnDbIlAD3Y,12
19
+ jsongrapher-4.3.dist-info/RECORD,,