jsongrapher 1.6__py3-none-any.whl → 3.7__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.
@@ -0,0 +1,68 @@
1
+ #This is a simple file for storing the automatically loaded trace_styles_collection dictionary for JSONGrapher.
2
+ #It is not recommended that a person overwrite this file.
3
+
4
+ #each dictionary below, like "default" or "Nature" is one 'layout_style'.
5
+ #Currently, the style names are case sensitive. In the future, it is likely they will not be case sensitive.
6
+ styles_library = {
7
+ "default": {
8
+ "layout": {
9
+ "title": {"font": {"size": 32}, "x": 0.5},
10
+ "xaxis": {"title": {"font": {"size": 27}}, "tickfont": {"size": 23}},
11
+ "yaxis": {"title": {"font": {"size": 27}}, "tickfont": {"size": 23}},
12
+ "legend": {
13
+ "title": {"font": {"size": 22}},
14
+ "font": {"size": 22}
15
+ }
16
+ }
17
+ },
18
+ "default3d": {
19
+ "layout": {
20
+ "title": {"font": {"size": 32}, "x": 0.5},
21
+ "xaxis": {"title": {"font": {"size": 12}}, "tickfont": {"size": 12}},
22
+ "yaxis": {"title": {"font": {"size": 12}}, "tickfont": {"size": 12}},
23
+ "zaxis": {"title": {"font": {"size": 12}}, "tickfont": {"size": 12}},
24
+ "legend": {
25
+ "title": {"font": {"size": 22}},
26
+ "font": {"size": 22}
27
+ }
28
+ }
29
+ },
30
+ "Nature": {
31
+ "layout": {
32
+ "title": {"font": {"size": 32, "family": "Times New Roman", "color": "black"}},
33
+ "font": {"size": 25, "family": "Times New Roman"},
34
+ "paper_bgcolor": "white",
35
+ "plot_bgcolor": "white",
36
+ "xaxis": {
37
+ "showgrid": True, "gridcolor": "#ddd", "gridwidth": 1,
38
+ "linecolor": "black", "linewidth": 2, "ticks": "outside",
39
+ "tickwidth": 2, "tickcolor": "black"
40
+ },
41
+ "yaxis": {
42
+ "showgrid": True, "gridcolor": "#ddd", "gridwidth": 1,
43
+ "linecolor": "black", "linewidth": 2, "ticks": "outside",
44
+ "tickwidth": 2, "tickcolor": "black"
45
+ }
46
+ }
47
+ },
48
+ "Science": {
49
+ "layout": {
50
+ "title": {"font": {"size": 32, "family": "Arial", "color": "black"}},
51
+ "font": {"size": 25, "family": "Arial"},
52
+ "paper_bgcolor": "white",
53
+ "plot_bgcolor": "white",
54
+ "xaxis": {
55
+ "showgrid": True, "gridcolor": "#ccc", "gridwidth": 1,
56
+ "linecolor": "black", "linewidth": 2, "ticks": "outside",
57
+ "tickwidth": 2, "tickcolor": "black"
58
+ },
59
+ "yaxis": {
60
+ "showgrid": True, "gridcolor": "#ccc", "gridwidth": 1,
61
+ "linecolor": "black", "linewidth": 2, "ticks": "outside",
62
+ "tickwidth": 2, "tickcolor": "black"
63
+ }
64
+ }
65
+ }
66
+ }
67
+
68
+
@@ -0,0 +1,194 @@
1
+ #This is a simple file for storing the automatically loaded trace_styles_collection dictionary for JSONGrapher.
2
+ #It is not recommended that a person overwrite this file.
3
+
4
+ #each dictionary below is one 'trace_styles_collection'. "default" is the first one.
5
+ styles_library = {
6
+ "default": {
7
+ "scatter_spline": {
8
+ "type": "scatter",
9
+ "mode": "lines+markers",
10
+ "line": {"shape": "spline", "width": 2},
11
+ "marker": {"size": 10},
12
+ },
13
+ "scatter_line": {
14
+ "type": "scatter",
15
+ "mode": "lines+markers",
16
+ "line": {"shape": "linear", "width": 2},
17
+ "marker": {"size": 10},
18
+ },
19
+ "line": {
20
+ "type": "scatter",
21
+ "mode": "lines",
22
+ "line": {"shape": "linear", "width": 2},
23
+ "marker": {"size": 10},
24
+ },
25
+ "lines": {
26
+ "type": "scatter",
27
+ "mode": "lines",
28
+ "line": {"shape": "linear", "width": 2},
29
+ "marker": {"size": 10},
30
+ },
31
+ "scatter": {
32
+ "type": "scatter",
33
+ "mode": "markers",
34
+ "marker": {"size": 10},
35
+ },
36
+ "bubble": {
37
+ "type": "scatter",
38
+ "mode": "markers",
39
+ "marker": {
40
+ "color": "auto",
41
+ "colorscale": "viridis_r",
42
+ "showscale": True
43
+ }
44
+ },
45
+ "spline": {
46
+ "type": "scatter",
47
+ "mode": "lines",
48
+ "line": {"shape": "spline", "width": 2},
49
+ "marker": {"size": 0}, # Hide markers for smooth curves
50
+ },
51
+ "bar": {
52
+ "type": "bar",
53
+ "marker": {
54
+ "color": "blue",
55
+ "opacity": 0.8,
56
+ "line": {
57
+ "color": "black",
58
+ "width": 2
59
+ }
60
+ },
61
+ },
62
+ "default": {
63
+ "type": "scatter",
64
+ "mode": "lines+markers",
65
+ "line": {"shape": "spline", "width": 2},
66
+ "marker": {"size": 10},
67
+ },
68
+ "scatter3d": {
69
+ "mode": "markers",
70
+ "type": "scatter3d",
71
+ "marker": {"color" : "","colorscale":"rainbow", "showscale":True}
72
+ },
73
+ "mesh3d": {
74
+ "type": "mesh3d",
75
+ "intensity" : [],
76
+ "colorscale":"rainbow",
77
+ "showscale":True
78
+ },
79
+ "heatmap": {
80
+ "type": "heatmap",
81
+ "colorscale": "Viridis",
82
+ }
83
+ },
84
+ "minimalist": {
85
+ "scatter_spline": {
86
+ "type": "scatter",
87
+ "mode": "lines+markers",
88
+ "line": {"shape": "spline", "width": 1},
89
+ "marker": {"size": 6},
90
+ },
91
+ "scatter": {
92
+ "type": "scatter",
93
+ "mode": "lines",
94
+ "line": {"shape": "linear", "width": 1},
95
+ "marker": {"size": 0},
96
+ },
97
+ "spline": {
98
+ "type": "scatter",
99
+ "mode": "lines",
100
+ "line": {"shape": "spline", "width": 1},
101
+ "marker": {"size": 0},
102
+ },
103
+ "bar": {
104
+ "type": "bar",
105
+ },
106
+ "heatmap": {
107
+ "type": "heatmap",
108
+ "colorscale": "Greys",
109
+ }
110
+ },
111
+ "bold": {
112
+ "scatter_spline": {
113
+ "type": "scatter",
114
+ "mode": "lines+markers",
115
+ "line": {"shape": "spline", "width": 4},
116
+ "marker": {"size": 10},
117
+ },
118
+ "scatter": {
119
+ "type": "scatter",
120
+ "mode": "lines+markers",
121
+ "line": {"shape": "spline", "width": 4},
122
+ "marker": {"size": 12},
123
+ },
124
+ "spline": {
125
+ "type": "scatter",
126
+ "mode": "lines",
127
+ "line": {"shape": "spline", "width": 4},
128
+ "marker": {"size": 0},
129
+ },
130
+ "bar": {
131
+ "type": "bar",
132
+ },
133
+ "heatmap": {
134
+ "type": "heatmap",
135
+ "colorscale": "Jet",
136
+ }
137
+ },
138
+ "scatter": { #this style forces all traces into scatter.
139
+ "scatter_spline": {
140
+ "type": "scatter",
141
+ "mode": "markers",
142
+ "marker": {"size": 10},
143
+ },
144
+ "scatter": {
145
+ "type": "scatter",
146
+ "mode": "markers",
147
+ "marker": {"size": 10},
148
+ },
149
+ "spline": {
150
+ "type": "scatter",
151
+ "mode": "markers",
152
+ "marker": {"size": 10},
153
+ },
154
+ "bar": {
155
+ "type": "scatter",
156
+ "mode": "markers",
157
+ "marker": {"size": 10},
158
+ },
159
+ "heatmap": {
160
+ "type": "heatmap",
161
+ "colorscale": "Viridis",
162
+ }
163
+ },
164
+ "scatter_spline": { #this style forces all traces into spline only
165
+ "scatter_spline": {
166
+ "type": "scatter",
167
+ "mode": "lines+markers",
168
+ "line": {"shape": "spline", "width": 2},
169
+ "marker": {"size": 0},
170
+ },
171
+ "scatter": {
172
+ "type": "scatter",
173
+ "mode": "lines+markers",
174
+ "line": {"shape": "spline", "width": 2},
175
+ "marker": {"size": 0},
176
+ },
177
+ "spline": {
178
+ "type": "scatter",
179
+ "mode": "lines+markers",
180
+ "line": {"shape": "spline", "width": 2},
181
+ "marker": {"size": 0},
182
+ },
183
+ "bar": {
184
+ "type": "scatter",
185
+ "mode": "lines+markers",
186
+ "line": {"shape": "spline", "width": 2},
187
+ "marker": {"size": 0},
188
+ },
189
+ "heatmap": {
190
+ "type": "heatmap",
191
+ "colorscale": "Viridis",
192
+ }
193
+ }
194
+ }
JSONGrapher/units_list.py CHANGED
@@ -2,6 +2,8 @@
2
2
  '''
3
3
  #This units list came from the UUC units list. https://github.com/Lemonexe/UUC/blob/master/app/data.js
4
4
  # it has been converted to python and contains all of the program constants, the unit database, and database of prefixes
5
+ #In the python JSONGrapher repository, this is used (as of May 2025) simply to remove "plural" units.
6
+ # In python JSONGrapher, the unitpy package is what is used for unit conversion.
5
7
  # 'en' is for English, 'cz' is for Czech, and "ae" is for American English.
6
8
 
7
9
  metre → meter
@@ -14,6 +16,31 @@
14
16
  tonne → metric ton (often written as ton in American English)
15
17
  cubic centimetre → cubic centimeter
16
18
 
19
+ This file is adapted from UUC and is covered by the MIT License
20
+
21
+ MIT License
22
+
23
+ Copyright (c) 2017 Jiri Zbytovsky
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining a copy
26
+ of this software and associated documentation files (the "Software"), to deal
27
+ in the Software without restriction, including without limitation the rights
28
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
+ copies of the Software, and to permit persons to whom the Software is
30
+ furnished to do so, subject to the following conditions:
31
+
32
+ The above copyright notice and this permission notice shall be included in all
33
+ copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
+ SOFTWARE.
42
+
43
+
17
44
  '''
18
45
  import math as Math
19
46
  #program constants
@@ -0,0 +1,9 @@
1
+ Copyright 2025 Aditya Savara
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7
+ Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8
+
9
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
@@ -0,0 +1,101 @@
1
+ # JSONGrapher (python)
2
+ This is the python version of JSONGrapher with JSONRecordCreator. This package is for plotting JSON records with drag and drop and has tools for creating the JSON records.
3
+
4
+ The software will automatically plot multiple records together, for comparison, and will automaticlaly converting units between records as needed to plot them for comparison (like kg/s and g/s).
5
+
6
+ To use python JSONGrapher, first install it using conda or pip:<br>
7
+ `pip install JSONGrapher[COMPLETE]` or `conda install conda-forge::jsongrapher` <br>
8
+ Alternatively, you can download the directory directly.<br>
9
+
10
+ ## **0\. Plotting a JSON Record**
11
+ It's as simple as one line! Then drag an [example](https://github.com/AdityaSavara/jsongrapher-py/tree/main/examples/example_1_drag_and_drop) JSONGrapher record into the window to plot!
12
+ Below shows several plot types for 2D and 3D plots, followed by a simple example of how to use python JSONGrapher to create your own records.
13
+ <pre>
14
+ import JSONGrapher
15
+ JSONGrapher.launch()
16
+ </pre>
17
+
18
+ [![JSONGRapher window](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png) [![JSONGRapher plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/UAN_DTA_image.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/UAN_DTA_image.png)
19
+
20
+ [![rainbow plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/SrTiO3_rainbow_image.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/SrTiO3_rainbow_image.png)
21
+ [![mesh3d plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_mesh3d.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_mesh3d.png)
22
+ [![scatter3d plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_Scatter3d_example10.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_Scatter3d_example10.png)
23
+ [![bubble plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_bubble.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_bubble.png)
24
+
25
+
26
+
27
+
28
+ ## **1\. Preparing to Create a Record**
29
+
30
+ The remainder of this landing page follows a json record tutorial [example file](https://github.com/AdityaSavara/jsongrapher-py/blob/main/examples/example_2_creating_records_and_using_styles/example_2_json_record_tutorial.py) which shows how to create graphable .json records. The records can then be plotted with python JSONGrapher or with jsongrapher.com<br>
31
+
32
+ Let's create an example where we plot the height of a pear tree over several years.
33
+ <pre>
34
+ x_label_including_units = "Time (years)"
35
+ y_label_including_units = "Height (m)"
36
+ time_in_years = [0, 1, 2, 3, 4]
37
+ tree_heights = [0, 0.42, 0.86, 1.19, 1.45]
38
+ </pre>
39
+
40
+ ## **2\. Creating and Populating a New JSONGrapher Record**
41
+
42
+ <pre>
43
+ Record = JSONRecordCreator.create_new_JSONGrapherRecord()
44
+ Record.set_comments("Tree Growth Data collected from the US National Arboretum")
45
+ Record.set_datatype("Tree_Growth_Curve")
46
+ Record.set_x_axis_label_including_units(x_label_including_units)
47
+ Record.set_y_axis_label_including_units(y_label_including_units)
48
+ Record.add_data_series(series_name="pear tree growth", x_values=time_in_years, y_values=tree_heights, plot_type="scatter_spline")
49
+ Record.set_graph_title("Pear Tree Growth Versus Time")
50
+ </pre>
51
+
52
+ ## **3\. Exporting to File**
53
+
54
+ We can export a record to a .json file, which can then be used with JSONGrapher.
55
+ <pre>
56
+ Record.export_to_json_file("ExampleFromTutorial.json")
57
+ Record.print_to_inspect()
58
+ </pre>
59
+
60
+ <p><strong>Expected Output:</strong></p>
61
+ <pre>
62
+ JSONGrapher Record exported to, ./ExampleFromTutorial.json
63
+ {
64
+ "comments": "Tree Growth Data collected from the US National Arboretum",
65
+ "datatype": "Tree_Growth_Curve",
66
+ "data": [
67
+ {
68
+ "name": "pear tree growth",
69
+ "x": [0, 1, 2, 3, 4],
70
+ "y": [0, 0.42, 0.86, 1.19, 1.45],
71
+ "type": "scatter",
72
+ "line": { "shape": "spline" }
73
+ }
74
+ ],
75
+ "layout": {
76
+ "title": "Pear Tree Growth Versus Time",
77
+ "xaxis": { "title": "Time (year)" },
78
+ "yaxis": { "title": "Height (m)" }
79
+ }
80
+ }
81
+ </pre>
82
+
83
+ ## **4\. Plotting to Inspect**
84
+
85
+ We can plot the data using Matplotlib and export the plot as a PNG file.
86
+ <pre>
87
+ Record.plot_with_matplotlib()
88
+ Record.export_to_matplotlib_png("image_from_tutorial_matplotlib_fig")
89
+ </pre>
90
+
91
+ We can create an interactive graph with python plotly:
92
+ <pre>
93
+ Record.plot_with_plotly() #Try hovering your mouse over points after this command!
94
+ </pre>
95
+
96
+ [![JSONGRapher record plotted using matplotlib](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_2_creating_records_and_using_styles/image_from_tutorial_matplotlib_fig.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_2_creating_records_and_using_styles/image_from_tutorial_matplotlib_fig.png)
97
+
98
+ You can also see more examples: https://github.com/AdityaSavara/jsongrapher-py/tree/main/examples
99
+
100
+ Additionally, json records you send to others can be plotted by them at www.jsongrapher.com
101
+ This 'see the plot using a browser' capability is intended to facilitate including JSONGrapher records in supporting information of scientific publications.
@@ -0,0 +1,9 @@
1
+ Copyright 2025 Aditya Savara
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7
+ Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8
+
9
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.1
2
+ Name: jsongrapher
3
+ Version: 3.7
4
+ Summary: The python version of JSONGrapher with tools for creating JSONGrapher Records.
5
+ Home-page: https://github.com/AdityaSavara/jsongrapher-py
6
+ Author: Aditya Savara
7
+ Author-email: AditySavara2008@u.northwestern.edu
8
+ License: Unlicense
9
+ Classifier: License :: OSI Approved :: BSD License
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.6
13
+ Classifier: Programming Language :: Python :: Implementation :: CPython
14
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
15
+ Requires-Python: >=3.0.0
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: numpy>=1.26
19
+ Provides-Extra: complete
20
+ Requires-Dist: matplotlib; extra == "complete"
21
+ Requires-Dist: plotly; extra == "complete"
22
+ Requires-Dist: unitpy; extra == "complete"
23
+ Requires-Dist: tkinterdnd2; extra == "complete"
24
+ Requires-Dist: urllib; extra == "complete"
25
+ Requires-Dist: json-equationer; extra == "complete"
26
+
27
+
28
+ # JSONGrapher (python)
29
+ This is the python version of JSONGrapher with JSONRecordCreator. This package is for plotting JSON records with drag and drop and has tools for creating the JSON records.
30
+
31
+ The software will automatically plot multiple records together, for comparison, and will automaticlaly converting units between records as needed to plot them for comparison (like kg/s and g/s).
32
+
33
+ To use python JSONGrapher, first install it using conda or pip:<br>
34
+ `pip install JSONGrapher[COMPLETE]` or `conda install conda-forge::jsongrapher` <br>
35
+ Alternatively, you can download the directory directly.<br>
36
+
37
+ ## **0\. Plotting a JSON Record**
38
+ It's as simple as one line! Then drag an [example](https://github.com/AdityaSavara/jsongrapher-py/tree/main/examples/example_1_drag_and_drop) JSONGrapher record into the window to plot!
39
+ Below shows several plot types for 2D and 3D plots, followed by a simple example of how to use python JSONGrapher to create your own records.
40
+ <pre>
41
+ import JSONGrapher
42
+ JSONGrapher.launch()
43
+ </pre>
44
+
45
+ [![JSONGRapher window](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png) [![JSONGRapher plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/UAN_DTA_image.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/UAN_DTA_image.png)
46
+
47
+ [![rainbow plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/SrTiO3_rainbow_image.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/SrTiO3_rainbow_image.png)
48
+ [![mesh3d plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_mesh3d.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_mesh3d.png)
49
+ [![scatter3d plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_Scatter3d_example10.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_Scatter3d_example10.png)
50
+ [![bubble plot](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_bubble.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_bubble.png)
51
+
52
+
53
+
54
+
55
+ ## **1\. Preparing to Create a Record**
56
+
57
+ The remainder of this landing page follows a json record tutorial [example file](https://github.com/AdityaSavara/jsongrapher-py/blob/main/examples/example_2_creating_records_and_using_styles/example_2_json_record_tutorial.py) which shows how to create graphable .json records. The records can then be plotted with python JSONGrapher or with jsongrapher.com<br>
58
+
59
+ Let's create an example where we plot the height of a pear tree over several years.
60
+ <pre>
61
+ x_label_including_units = "Time (years)"
62
+ y_label_including_units = "Height (m)"
63
+ time_in_years = [0, 1, 2, 3, 4]
64
+ tree_heights = [0, 0.42, 0.86, 1.19, 1.45]
65
+ </pre>
66
+
67
+ ## **2\. Creating and Populating a New JSONGrapher Record**
68
+
69
+ <pre>
70
+ Record = JSONRecordCreator.create_new_JSONGrapherRecord()
71
+ Record.set_comments("Tree Growth Data collected from the US National Arboretum")
72
+ Record.set_datatype("Tree_Growth_Curve")
73
+ Record.set_x_axis_label_including_units(x_label_including_units)
74
+ Record.set_y_axis_label_including_units(y_label_including_units)
75
+ Record.add_data_series(series_name="pear tree growth", x_values=time_in_years, y_values=tree_heights, plot_type="scatter_spline")
76
+ Record.set_graph_title("Pear Tree Growth Versus Time")
77
+ </pre>
78
+
79
+ ## **3\. Exporting to File**
80
+
81
+ We can export a record to a .json file, which can then be used with JSONGrapher.
82
+ <pre>
83
+ Record.export_to_json_file("ExampleFromTutorial.json")
84
+ Record.print_to_inspect()
85
+ </pre>
86
+
87
+ <p><strong>Expected Output:</strong></p>
88
+ <pre>
89
+ JSONGrapher Record exported to, ./ExampleFromTutorial.json
90
+ {
91
+ "comments": "Tree Growth Data collected from the US National Arboretum",
92
+ "datatype": "Tree_Growth_Curve",
93
+ "data": [
94
+ {
95
+ "name": "pear tree growth",
96
+ "x": [0, 1, 2, 3, 4],
97
+ "y": [0, 0.42, 0.86, 1.19, 1.45],
98
+ "type": "scatter",
99
+ "line": { "shape": "spline" }
100
+ }
101
+ ],
102
+ "layout": {
103
+ "title": "Pear Tree Growth Versus Time",
104
+ "xaxis": { "title": "Time (year)" },
105
+ "yaxis": { "title": "Height (m)" }
106
+ }
107
+ }
108
+ </pre>
109
+
110
+ ## **4\. Plotting to Inspect**
111
+
112
+ We can plot the data using Matplotlib and export the plot as a PNG file.
113
+ <pre>
114
+ Record.plot_with_matplotlib()
115
+ Record.export_to_matplotlib_png("image_from_tutorial_matplotlib_fig")
116
+ </pre>
117
+
118
+ We can create an interactive graph with python plotly:
119
+ <pre>
120
+ Record.plot_with_plotly() #Try hovering your mouse over points after this command!
121
+ </pre>
122
+
123
+ [![JSONGRapher record plotted using matplotlib](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_2_creating_records_and_using_styles/image_from_tutorial_matplotlib_fig.png)](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_2_creating_records_and_using_styles/image_from_tutorial_matplotlib_fig.png)
124
+
125
+ You can also see more examples: https://github.com/AdityaSavara/jsongrapher-py/tree/main/examples
126
+
127
+ Additionally, json records you send to others can be plotted by them at www.jsongrapher.com
128
+ This 'see the plot using a browser' capability is intended to facilitate including JSONGrapher records in supporting information of scientific publications.
@@ -0,0 +1,18 @@
1
+ JSONGrapher/JSONRecordCreator.py,sha256=bRyQPYr2TJZEtjMUF-idDO6mfRm3Rp_775iangiuRf8,204822
2
+ JSONGrapher/UnitPytesting.py,sha256=xizJ-2fg9C5oNMFJyfavbBLMusayE9KWQiYIRrQQd4A,4363
3
+ JSONGrapher/UnitpyCustomUnitsTesting.py,sha256=Rwq5p8HXN0FP54lRFgLTV0kgJ9TpcFaD3_C0MEOoEzw,1297
4
+ JSONGrapher/__init__.py,sha256=cc5qXQidP_ABPXdnXy_DTdgPanHuR7ya45LV-BdWVh8,277
5
+ JSONGrapher/drag_and_drop_gui.py,sha256=-7QJHLhzadHotWhONH4inerMaZ_xuwoTQSMRF_MPVe0,5632
6
+ JSONGrapher/equation_creator.py,sha256=VFu6dFo-C0wDf1N3e0CyCBI-53cCUrp3oe0umdMLofs,17968
7
+ JSONGrapher/equation_evaluator.py,sha256=coNVkZDRmEti3wYOc9NBY2Z1fRz3ei9ZxFd-ST-bOWc,36020
8
+ JSONGrapher/units_list.py,sha256=ROrlAsD66oPozZmOaE65xjNUEg3CxkSmA8iPE2_ihYI,34438
9
+ JSONGrapher/styles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ JSONGrapher/styles/layout_styles_library.py,sha256=vGb1tE_ETY-Blj2frt8ddHA976ADFSCoabjzKn2ZNYU,3051
11
+ JSONGrapher/styles/trace_styles_collection_library.py,sha256=DUbbO8jTlhn2q-lOY1XYGkHV1RbJX-P5Z1SUCM0qo6M,5952
12
+ jsongrapher-3.7.data/data/LICENSE,sha256=MroL1bQKoAHrMJv2KvABMmZX5j-DZ2EP_zaQacLUtj0,1465
13
+ jsongrapher-3.7.data/data/README.md,sha256=OntfAICB_uwfjoq8tMDYc_W7eXSC2N22X0udPIGb2Nw,5888
14
+ jsongrapher-3.7.dist-info/LICENSE,sha256=MroL1bQKoAHrMJv2KvABMmZX5j-DZ2EP_zaQacLUtj0,1465
15
+ jsongrapher-3.7.dist-info/METADATA,sha256=1gml4jeoRaUaS8IMQfHaftk8Q0hXTLnsUM7dGi_9qfM,6956
16
+ jsongrapher-3.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
17
+ jsongrapher-3.7.dist-info/top_level.txt,sha256=5f7Ui2hCKCPTQOjD540WKghKNYOvUDNfdpnDbIlAD3Y,12
18
+ jsongrapher-3.7.dist-info/RECORD,,
@@ -1,24 +0,0 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <https://unlicense.org>