Open Analyzer

Quick Start

Open Analyzer models are self-connecting, self-labelling networks defined by the equations defined for each node. They are great for your own analysis, team working, presentations and teaching.

Here we have a few models that I have created out of my own interest. You can create your own models with files on your own laptop and try them out. You can zoom in and out, pan across and grab nodes to re-position them to give you the best views of the parts of the network that interest you.

An Analyzer

Variable node size

You click on an input and select its value via the slider. You get instant feedback of how that change affects the different calculations throughout the chain of logic. Put your mouse over any node to get a Tooltip of information. Zoom in and out or pan with your mouse. Drag any node to re-arrange the layout. Full instructions are below the custom HTML that is loaded next.

Your custom HTML goes here

Public versus Private

Everything about the app itself and the files loadable from the combo box is fully public. But what about your own models, created as described below? Open Analyzer runs in your browser on your laptop. It sends zero information to the server. You load your models from your laptop and nothing is shared with anyone.

So what happens if you want to put your models on line? That is currently not possible. But if users wanted to have a public-domain deposit of models then I'm sure I will be able to create it. Just let me know

The inputs

You need an Excel .csv or .txt (tab separated or unicode) file containing the Nodes. If you click Copy Model on any of the datasets that interest you then paste into Excel, or if you click the Download Model, you will see that the format is relatively simple, though getting everything right is, I admit, tricky. Each node is identified by a unique id, then has a set of other properties. One key problem is that in the world of Javascript, everything is Case Sensitive. So when you specify an id you can't specify an Id or an ID. And if you have a node called MyNode you cannot have formulae based on myNode or Mynode (unless you confused yourself by creating different nodes with those id values!). If you have an optional file with the same name but with a .html extension then this assumed to be the HTML you wish to include on the page to help explain what is going on. If you write this in an ordinary text editor at the least provide an HTML headline using a few HTML tags <h3>This is your title</h3> and start a paragraph with the <p> tag.

Loading a Network

From the combobox you just select a model and the job is done. To load your own then (for obscure Javascript security reasons) you need to load the Nodes file first then, optionally, the .HTML file.

Sensitivity Analysis

Earlier versions provided an automatic sensitivy analysis based on your chosen node. However, for complex models this significantly slowed the performance so the function was removed. Just do your own analysis by sliding your chosen slider from minimum to maximum.

Your own input files

Do everything in native Excel then export your file as .csv or .txt. If you include symbols such as € make sure you save from Excel as "Unicode Text .txt". Here are what each of the inputs mean for Nodes:

  • id: The name of the node.
    • If this id = xxx or XXX or you start with a ! (e.g. !Temporary) then everything in that line will be ignored. This lets you add full-line comments to your .csv/.txt file
    • If this id = hierarchy then the label field should be UD, DU, LR, RL to describe up/down, down/up, left/right or right/left hierarchical layout. For this you need an extra column called "level" where you give numbers starting at 1 for the different hierarchical levels. The quality of the view is not guaranteed as hierarchies are complex to get right. Clone the HomeCompost-H example to check how it works
    • If the id starts with @ then the node is hidden, giving a much simpler layout. For example, if you have to add together a lot of nodes to give a necessary Total, calling it @Total allows the value {@Total} to be used in the calculations without cluttering up the network.
  • label: What appears in the box
  • units: Units (optional) that precede the value on the lower line of the label
  • title: Tooltip pop-up text. The column and individual tooltips are optional
  • color: Choose between blue, cyan, yellow, ivory, green, lime, pink, salmon, red, crimson, magenta, silver and white. There are complicated reasons why you can't just enter your own colours. My original convention, with a smaller colour choice, was pink for inputs, blue for simple intermediates, salmon for aggregated intermediates and yellow for stand-out conclusions. With a wider range you can quickly find a scheme that works for you.
  • val: The value of a known input. This must always be the actual number. So if something is 1 million, it must be 1000000. If this node produces calculated values, put a ?
  • conv: To use the number in the box, divide by this value. So if you are inputing as Mt and the value is 1.00, set conv to 0.000001 or 1e-6 so that the value in the calculation will be in t. Use M in the label to indicate to the user that the value is in millions
  • from:, to:, step: Most inputs make sense only over a range which you specify in converted units as from and to, with step showing the precision on the slider. So if you want to go from 100 thousand to 10 million in steps of 100 thousand and your units are in millions you would have from:0.1, to:10, step:0.1
  • equn: This is the trickiest, but not so hard. Suppose you have two inputs called Factor1 and Factor1 and you wanted the node to be their sum. You just put {Factor1}+{Factor2}, i.e. you type the sum, but put the names in curly brackets so the software can work out what is what. You can use any Javascript code you like1. With even the smallest amount of effort (and attention to brackets) you can easily tell the meaning of 3*(Math.sqrt({Factor1})+Math.pow(4.2+{Factor2},2))
  • comment: This comment is for your own use as a comment about that row. But if a comment is present it appears as a new line within the Tooltip, under the "title" text

Errors in your network

It is entirely normal (i.e. it has happened to me many times) to have some errors in your .csv/.txt file. For example if you have a node called MyNode you might include {Mynode} in a formula, or you might have typed (MyNode} with one curved and one curly bracket. When you load a model, the code attempts to alert you with messages that should make it easy to spot and fix the problem. You may get more messages than you might like (an error may have knock-on effects), but it is better to have too many than too few. When you correct the .csv/.txt, reload it and keep going till you get none of those sorts of errors. Of course, you will probably have other sorts of errors in your logic so you will need a few further cycles of refinement.

Capturing a different version of a model

You may have a model with one set of inputs then decide you want to keep a version with inputs you have just adjusted on screen. Click the Model → Clipboard button and the model is ready to paste into Excel and save as a new .csv. Or click Download Model → CSV if you prefer to have the file delivered directly to your download directory.

A database of input values?

Those in the green biotech world who want to use Open Analyzer to model their processes would love to have a set of standard values for many of the common processes. I could easily create a Standard Values database if I had the data. But I'm not a biotech expert. If anyone wishes to help create a database of values I will be happy to do the coding and, of course, their contribution would be fully acknowledged.

These networks are based around Vis.js which is an awesome bit of code, acknowledged with many thanks.

Creative Commons BYThe Javascript code is Copyright © 2019 Prof Steven Abbott and is distributed under the Creative Commons BY Attribution license. Users are encouraged to examine the code themselves and create or suggest improvements.

1It is possible to invoke Javascript functions within these formulae and I can do it in my own specific network apps. I've not yet worked out how to implement it more generally as there are many complications in such a system.