jsongrapher 2.8__py3-none-any.whl → 3.8__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.
- JSONGrapher/JSONRecordCreator.py +2219 -376
- JSONGrapher/equation_creator.py +374 -0
- JSONGrapher/equation_evaluator.py +670 -0
- JSONGrapher/styles/__init__.py +0 -0
- JSONGrapher/styles/layout_styles_library.py +68 -0
- JSONGrapher/styles/trace_styles_collection_library.py +194 -0
- jsongrapher-3.8.data/data/LICENSE +9 -0
- jsongrapher-3.8.data/data/README.md +101 -0
- jsongrapher-3.8.dist-info/LICENSE +9 -0
- {jsongrapher-2.8.dist-info → jsongrapher-3.8.dist-info}/METADATA +30 -15
- jsongrapher-3.8.dist-info/RECORD +18 -0
- jsongrapher-2.8.data/data/LICENSE +0 -24
- jsongrapher-2.8.data/data/README.md +0 -88
- jsongrapher-2.8.dist-info/LICENSE +0 -24
- jsongrapher-2.8.dist-info/RECORD +0 -13
- {jsongrapher-2.8.dist-info → jsongrapher-3.8.dist-info}/WHEEL +0 -0
- {jsongrapher-2.8.dist-info → jsongrapher-3.8.dist-info}/top_level.txt +0 -0
@@ -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
|
+
}
|
@@ -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
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png) [](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/UAN_DTA_image.png)
|
19
|
+
|
20
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/SrTiO3_rainbow_image.png)
|
21
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_mesh3d.png)
|
22
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_Scatter3d_example10.png)
|
23
|
+
[](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
|
+
[](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
|
@@ -1,11 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: jsongrapher
|
3
|
-
Version:
|
3
|
+
Version: 3.8
|
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
|
7
7
|
Author-email: AditySavara2008@u.northwestern.edu
|
8
|
-
License:
|
8
|
+
License: BSD-3-Clause
|
9
9
|
Classifier: License :: OSI Approved :: BSD License
|
10
10
|
Classifier: Programming Language :: Python
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
@@ -15,38 +15,48 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
15
15
|
Requires-Python: >=3.0.0
|
16
16
|
Description-Content-Type: text/markdown
|
17
17
|
License-File: LICENSE
|
18
|
-
Requires-Dist: numpy
|
18
|
+
Requires-Dist: numpy>=1.26
|
19
19
|
Provides-Extra: complete
|
20
20
|
Requires-Dist: matplotlib; extra == "complete"
|
21
21
|
Requires-Dist: plotly; extra == "complete"
|
22
22
|
Requires-Dist: unitpy; extra == "complete"
|
23
23
|
Requires-Dist: tkinterdnd2; extra == "complete"
|
24
|
+
Requires-Dist: urllib; extra == "complete"
|
25
|
+
Requires-Dist: json-equationer; extra == "complete"
|
24
26
|
|
25
27
|
|
26
28
|
# JSONGrapher (python)
|
27
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.
|
28
30
|
|
29
|
-
|
30
|
-
<pre>
|
31
|
-
pip install JSONGrapher[COMPLETE]
|
32
|
-
</pre>
|
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).
|
33
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>
|
34
35
|
Alternatively, you can download the directory directly.<br>
|
35
36
|
|
36
37
|
## **0\. Plotting a JSON Record**
|
37
|
-
It's as simple as one line! Then drag
|
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.
|
38
40
|
<pre>
|
39
41
|
import JSONGrapher
|
40
42
|
JSONGrapher.launch()
|
41
43
|
</pre>
|
42
44
|
|
43
|
-
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png) [](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png) [](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/UAN_DTA_image.png)
|
46
|
+
|
47
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/SrTiO3_rainbow_image.png)
|
48
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_mesh3d.png)
|
49
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_Scatter3d_example10.png)
|
50
|
+
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1_drag_and_drop/Rate_Constant_bubble.png)
|
51
|
+
|
52
|
+
|
53
|
+
|
44
54
|
|
45
55
|
## **1\. Preparing to Create a Record**
|
46
56
|
|
47
|
-
The remainder of this landing page follows a json record tutorial [example file](https://github.com/AdityaSavara/
|
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>
|
48
58
|
|
49
|
-
Let's create an example where we plot the height of a pear tree over several years.
|
59
|
+
Let's create an example where we plot the height of a pear tree over several years.
|
50
60
|
<pre>
|
51
61
|
x_label_including_units = "Time (years)"
|
52
62
|
y_label_including_units = "Height (m)"
|
@@ -68,7 +78,7 @@ Record.set_graph_title("Pear Tree Growth Versus Time")
|
|
68
78
|
|
69
79
|
## **3\. Exporting to File**
|
70
80
|
|
71
|
-
We can export
|
81
|
+
We can export a record to a .json file, which can then be used with JSONGrapher.
|
72
82
|
<pre>
|
73
83
|
Record.export_to_json_file("ExampleFromTutorial.json")
|
74
84
|
Record.print_to_inspect()
|
@@ -99,15 +109,20 @@ JSONGrapher Record exported to, ./ExampleFromTutorial.json
|
|
99
109
|
|
100
110
|
## **4\. Plotting to Inspect**
|
101
111
|
|
102
|
-
We can
|
112
|
+
We can plot the data using Matplotlib and export the plot as a PNG file.
|
103
113
|
<pre>
|
104
114
|
Record.plot_with_matplotlib()
|
105
115
|
Record.export_to_matplotlib_png("image_from_tutorial_matplotlib_fig")
|
106
116
|
</pre>
|
107
117
|
|
108
|
-
|
118
|
+
We can create an interactive graph with python plotly:
|
109
119
|
<pre>
|
110
120
|
Record.plot_with_plotly() #Try hovering your mouse over points after this command!
|
111
121
|
</pre>
|
112
122
|
|
113
|
-
[](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=SFIYYNDpsUAx6vYA-I2ZGxNw7a1yA3yoIEE6oZtZWfc,205808
|
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.8.data/data/LICENSE,sha256=MroL1bQKoAHrMJv2KvABMmZX5j-DZ2EP_zaQacLUtj0,1465
|
13
|
+
jsongrapher-3.8.data/data/README.md,sha256=OntfAICB_uwfjoq8tMDYc_W7eXSC2N22X0udPIGb2Nw,5888
|
14
|
+
jsongrapher-3.8.dist-info/LICENSE,sha256=MroL1bQKoAHrMJv2KvABMmZX5j-DZ2EP_zaQacLUtj0,1465
|
15
|
+
jsongrapher-3.8.dist-info/METADATA,sha256=IZYNGMd9jbDyWIoyqhW1oUan16p04jf228OW4h7wMrk,6959
|
16
|
+
jsongrapher-3.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
17
|
+
jsongrapher-3.8.dist-info/top_level.txt,sha256=5f7Ui2hCKCPTQOjD540WKghKNYOvUDNfdpnDbIlAD3Y,12
|
18
|
+
jsongrapher-3.8.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>
|
@@ -1,88 +0,0 @@
|
|
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
|
-
To use python JSONGrapher, first install it using pip:
|
5
|
-
<pre>
|
6
|
-
pip install JSONGrapher[COMPLETE]
|
7
|
-
</pre>
|
8
|
-
|
9
|
-
Alternatively, you can download the directory directly.<br>
|
10
|
-
|
11
|
-
## **0\. Plotting a JSON Record**
|
12
|
-
It's as simple as one line! Then drag a json record into the window to plot.
|
13
|
-
<pre>
|
14
|
-
import JSONGrapher
|
15
|
-
JSONGrapher.launch()
|
16
|
-
</pre>
|
17
|
-
|
18
|
-
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/JSONGrapher/JSONGrapherWindowShortened.png) [](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_1/UAN_DTA_image.png)
|
19
|
-
|
20
|
-
## **1\. Preparing to Create a Record**
|
21
|
-
|
22
|
-
The remainder of this landing page follows a json record tutorial [example file](https://github.com/AdityaSavara/JSONGrapher/blob/main/examples/example_2/example_2_json_record_tutorial.py) which shows how to create graphable .json records and to plot them. The .json files can then be dragged into the python JSONgrapher or into www.jsongrapher.com<br>
|
23
|
-
|
24
|
-
Let's create an example where we plot the height of a pear tree over several years. Assuming a pear tree grows approximately 0.40 meters per year, we'll generate sample data with some variation.
|
25
|
-
<pre>
|
26
|
-
x_label_including_units = "Time (years)"
|
27
|
-
y_label_including_units = "Height (m)"
|
28
|
-
time_in_years = [0, 1, 2, 3, 4]
|
29
|
-
tree_heights = [0, 0.42, 0.86, 1.19, 1.45]
|
30
|
-
</pre>
|
31
|
-
|
32
|
-
## **2\. Creating and Populating a New JSONGrapher Record**
|
33
|
-
|
34
|
-
<pre>
|
35
|
-
Record = JSONRecordCreator.create_new_JSONGrapherRecord()
|
36
|
-
Record.set_comments("Tree Growth Data collected from the US National Arboretum")
|
37
|
-
Record.set_datatype("Tree_Growth_Curve")
|
38
|
-
Record.set_x_axis_label_including_units(x_label_including_units)
|
39
|
-
Record.set_y_axis_label_including_units(y_label_including_units)
|
40
|
-
Record.add_data_series(series_name="pear tree growth", x_values=time_in_years, y_values=tree_heights, plot_type="scatter_spline")
|
41
|
-
Record.set_graph_title("Pear Tree Growth Versus Time")
|
42
|
-
</pre>
|
43
|
-
|
44
|
-
## **3\. Exporting to File**
|
45
|
-
|
46
|
-
We can export it to a .json file, which can then be used with JSONGrapher.
|
47
|
-
<pre>
|
48
|
-
Record.export_to_json_file("ExampleFromTutorial.json")
|
49
|
-
Record.print_to_inspect()
|
50
|
-
</pre>
|
51
|
-
|
52
|
-
<p><strong>Expected Output:</strong></p>
|
53
|
-
<pre>
|
54
|
-
JSONGrapher Record exported to, ./ExampleFromTutorial.json
|
55
|
-
{
|
56
|
-
"comments": "Tree Growth Data collected from the US National Arboretum",
|
57
|
-
"datatype": "Tree_Growth_Curve",
|
58
|
-
"data": [
|
59
|
-
{
|
60
|
-
"name": "pear tree growth",
|
61
|
-
"x": [0, 1, 2, 3, 4],
|
62
|
-
"y": [0, 0.42, 0.86, 1.19, 1.45],
|
63
|
-
"type": "scatter",
|
64
|
-
"line": { "shape": "spline" }
|
65
|
-
}
|
66
|
-
],
|
67
|
-
"layout": {
|
68
|
-
"title": "Pear Tree Growth Versus Time",
|
69
|
-
"xaxis": { "title": "Time (year)" },
|
70
|
-
"yaxis": { "title": "Height (m)" }
|
71
|
-
}
|
72
|
-
}
|
73
|
-
</pre>
|
74
|
-
|
75
|
-
## **4\. Plotting to Inspect**
|
76
|
-
|
77
|
-
We can also plot the data using Matplotlib and export the plot as a PNG file.
|
78
|
-
<pre>
|
79
|
-
Record.plot_with_matplotlib()
|
80
|
-
Record.export_to_matplotlib_png("image_from_tutorial_matplotlib_fig")
|
81
|
-
</pre>
|
82
|
-
|
83
|
-
And we can create an interactive graph with plotly:
|
84
|
-
<pre>
|
85
|
-
Record.plot_with_plotly() #Try hovering your mouse over points after this command!
|
86
|
-
</pre>
|
87
|
-
|
88
|
-
[](https://raw.githubusercontent.com/AdityaSavara/JSONGrapher-py/main/examples/example_2/image_from_tutorial_matplotlib_fig.png)
|
@@ -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>
|