Skip to content

Commit eb7637d

Browse files
authored
Merge pull request #38 from AdityaSavara/minor-improvements
Minor improvements
2 parents f4aa7d0 + 8b82f1a commit eb7637d

40 files changed

+48
-405
lines changed

JSONGrapher/JSONRecordCreator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import JSONGrapher.styles.layout_styles_library
33
import JSONGrapher.styles.trace_styles_collection_library
4+
import JSONGrapher.version
45
#TODO: put an option to suppress warnings from JSONRecordCreator
56

67

@@ -607,6 +608,7 @@ def __init__(self, comments="", graph_title="", datatype="", data_objects_list =
607608

608609
self.fig_dict.update( {
609610
"comments": comments, # Top-level comments
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__,
610612
"datatype": datatype, # Top-level datatype (datatype)
611613
"data": data_objects_list if data_objects_list else [], # Data series list
612614
"layout": layout if layout else {

JSONGrapher/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#Try to do things a bit like https://github.com/python/cpython/blob/master/Lib/collections/__init__.py
22
#Except instead of putting things here directly in __init__, we'll import them so they are accessible by importing the module.
33
from JSONGrapher.JSONRecordCreator import *
4+
from JSONGrapher.version import *

JSONGrapher/test.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"comments": "Tree Growth Data collected from the US National Arboretum",
33
"datatype": "Tree_Growth_Curve",
4+
"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 4.1",
45
"data": [
56
{
67
"uid": "123",
78
"name": "Series A",
8-
"trace_type": "spline",
9+
"trace_style": "spline",
910
"x": [
1011
1,
1112
2,

JSONGrapher/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '4.1'

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/jsongrapher/badges/version.svg)](https://anaconda.org/conda-forge/jsongrapher) [![Anaconda-Server Badge](https://badge.fury.io/py/jsongrapher.svg)](https://badge.fury.io/py/jsongrapher)
22

33
# JSONGrapher (python)
4+
5+
Imagine a world where a person can simply drag a datafile into a graphing utility and a plot will be made, including scientific units, and more plots can be dragged in from data from other sources (and other units) to compare all of the data together, in an interactive graph.
6+
47
Create interactive plots just by drag-and-drop of JSON records. Share the json files for easy plotting by others. JSONGrapher automatically plots multiple records together, for comparison, and will automaticlaly convert units between records to plot the data sets together. For example, if one record is in kg/s and another in g/s, JSONGrapher will do the conversion automatically to plot both records together for comparison. Tools and examples are included for how to create JSON records.
58

69
To use python JSONGrapher, first install it using conda or pip:<br>

examples/example_10_bubble_plot/Rate_Constant_bubble.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"comments": "",
3+
"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 3.0",
34
"datatype": "Arrhenius_plot_3D",
45
"data": [
56
{

examples/example_10_bubble_plot/Rate_Constant_bubble_equation_only.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"comments": "",
3+
"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 3.0",
34
"datatype": "Arrhenius_plot_3D",
45
"data": [
56
{

examples/example_10_bubble_plot/example_10_bubble_plot_from_equation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
Record_for_bubble_plot = JSONRecordCreator.create_new_JSONGrapherRecord()
3030
#We'll keep the layout as the default, not default3d since the 3rd dimension doesn't come out of the page.
3131
Record_for_bubble_plot.set_layout_style("default")
32-
#As usual, it is a good practice to first set our graph title and axes labels.
32+
#As usual, it is a good practice to first set our datatype, graph title, and axes labels.
33+
Record_for_bubble_plot.set_datatype("Arrhenius_plot_3D")
3334
Record_for_bubble_plot.set_graph_title("Bubble plot for Ea vs Temperature Behavior for a Rate Constant")
3435
Record_for_bubble_plot.set_x_axis_label_including_units(example_equation_dict['x_variable'])
3536
Record_for_bubble_plot.set_y_axis_label_including_units(example_equation_dict['y_variable'])

examples/example_11_local_python_calls/343_equilibrium.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"comments": "// A JSON record can have any name, and any extension (such as .txt or .json). For example, CO2AdsorptionNaX.json. The datatype field defines which schema to use. The user can create custom fields to store additional information. Remember to add a comma at the end of any fields added.",
3+
"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 3.0",
34
"datatype": "CO2__Adsorption_Isotherm",
45
"data": [
56
{

examples/example_11_local_python_calls/343_kinetic.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"comments": "// A JSON record can have any name, and any extension (such as .txt or .json). For example, CO2AdsorptionNaX.json. The datatype field defines which schema to use. The user can create custom fields to store additional information. Remember to add a comma at the end of any fields added.",
3+
"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 3.0",
34
"datatype": "CO2__Adsorption_Isotherm",
45
"data": [
56
{

0 commit comments

Comments
 (0)