UI Panels

Contents

Time-Axis Plot (Time-Series)

XY Plot (Histograms & Graphs)

Canvas

User Canvas Configuration File

{
    "meta": {
        "name": "ATDS",
        "title": "",
        "description": "Atomic Tritium Demonstrator at UW Top Level"
    },

    "view_box": "0 -10 1600 700",
    
    "items": [
        {
            "type": "image",
            "attr": { "x": 50, "y": -2, "height": 554, "width": 1003, "href": "ATDS.png" }
        },
        {"_type": "grid"},
        
        {
            "type": "valve", 
            "attr": {
                "x": 135, "y": 235, "width": 30, "height": 30, "orientation": "horizontal",
                "data-dx": -10, "data-dy": 50
            },
            "metric": { "channel": "sccm.Alicat.Gas", "active-above": 0.1, "format": "%.1f sccm" },
            "action": { "form": "AlicatFlow" }
        },
        {
            "type": "circle",
            "attr": { "x": 185, "y": 85, "width": 30, "height": 30, "label": "P" },
            "metric": { "channel": "mbar.CC10.Gas", "active-below": 1, "format": "%.1e mbar" }
        },

        ...
    ],
    
    "forms": {
        "AlicatFlow": {
        ...
    }
}

Item Attributes

Metric Mapping

Example:
{
    "metric": { "channel": "mbar.CC10.Gas", "active-below": 1, "format": "%.1e mbar" },
    ...
}

Action Binding

Example: Opening a web page
{
    "action": { "open": "./slowplot.html?config=slowplot-ATDS.json" },
    ...
}
Example: Sending a command to server-side User Module
{
    "action": { "submit": { "action": "restart_IG" } },
    ...
}
Example: Sending a command to server-side User Module with parameters (“form”)
{
    "action": { "form": "AlicatFlow" },
    ...
}

Forms are defined separately in the same configuration file:

{
    "forms": {
        "AlicatFlow": {
            "title": " Injection Flow",
            "initial": {},
            "inputs": [
                { "name": "flow", "label": "Set-point (sccm)", "type": "number", "step": 0.1 "initial": 15 }
            ],
            "buttons": [
                { "name": "apply", "label": "Apply Set-point" },
                { "name": "close", "label": "Close Valve" }
            ]
        },
        ...
    },
    ...
}

The configuration above creates a form like this (bottom part of the panel):

Items

Base Image

{
    "href": null,
    "x": null, "y": null, "height": null, "width": null
}
Tips

Grid

Example: minimal Base Image and Grid
{
    "view_box": "0 -10 1600 700",
    "items": [
        {
            "type": "image",
            "attr": { "x": 50, "y": -2, "width": 1003, "height": 553, "href": "ATDS.png" }
        },
        {"type": "grid"},
    ]
}

Shape Items

Attributes common among Shape Items and the default values are:

{
    "x": null, "y": null, "height": null, "width": null,
    "label": null,
    "stroke": this.style.strokeColor,
    "fill": "none",
    "data-dx": null, "data-dy": null,
    "label-dx": null, "label-dy": null,
    "data-color": this.style.dataColor,
    "data-font-family": this.style.dataFontFamily,
    "data-font-weight": this.style.dataFontWeight,
    "data-font-size": this.style.dataFontSize,
    "data-dominant-baseline": undefined,
    "data-text-anchor": undefined,
    "label-font-family": this.style.labelFontFamily,
    "label-font-weight": this.style.labelFontWeight,
    "label-font-size": this.style.labelFontSize,
    "label-dominant-baseline": "central",
    "label-text-anchor": "middle",
}

Box Shape

mandatory attributes and default values are:

{ "x": null, "y": null, "width": 30, "height": 30 }

Circle Shape

Mandatory attributes and default values are:

{ "x": null, "y": null, "width": 30, "height": 30 }

Valve Shape

Mandatory attributes and default values are:

{ "x": null, "y": null, "width": 30, "height": 30, "orientation": "horizontal" }

Solenoid Shape

Mandatory attributes and default values are:

{ "x": null, "y": null, "width": 50, "height": 30, "fill": "none", "stroke-width": 3, "turns": 12 }

Invisible Shape

Mandatory attributes and default values are:

{ "x": null, "y": null }

Text

Mandatory attributes and default values are:

{
    "x": null, "y": null, "text": "",
    "font-family": this.style.fontFamily,
    "font-weight": this.style.fontWeight,
    "font-size": this.style.fontSize,
    "fill": this.style.strokeColor,
    "data-color": this.style.dataColor
}

Button

Mandatory attributes and default values are:

{
    "x": null, "y": null, "width": 120, "height": 30,
    "rx": 5, "ry": 5,
    "label": "",
}        

Embedded Plot

Mandatory attributes and default values for a plot are:

{
    "x": 0, "y": 0, "width": 100, "height": 100, "zoom": 0.8,
    "length": 3600, "dateFormat": null, "label": null,
    "ticksX": 5, "ticksY": 2, "grid": true,
    "min": null, "max": null, "logY": false,
    "marginTop": 0,
    "data-color": this.style.dataColor,
    "fill-opacity": 0, "fill-baseline": 1e-100,
    "timerange-margin-percent": 3,
}

micro_plot is a small box showing a data history plot without axis labels. This is basically the same as plot, with some different default values:

{
     "width": 50, "height": 30, "zoom": 0.2,
     "marker-opacity": 0, "fill-opacity": 0.3,
     "ticksX": 0, "ticksY": 0, 
     "marginTop": 0, "marginBotton": 0, "marginLeft": 0, "marginRight": 0,
     "label": ""
    "timerange-margin-percent": 0,
}

Map

User Map File

File Format

Example 1:

{
  "width": 1.0,
  "height": 1.0,
  "items": [
    {"index":1200,"shape":"circle","attr":{"cx":0.370000,"cy":0.822000,"r":0.015}},
    {"index":1201,"shape":"circle","attr":{"cx":0.403000,"cy":0.814000,"r":0.015}},
    {"index":1202,"shape":"circle","attr":{"cx":0.367000,"cy":0.780000,"r":0.015}},
    {"index":1203,"shape":"circle","attr":{"cx":0.400000,"cy":0.783000,"r":0.015}},
    ...
  ]
}

Example 2:

{
    "width": 1.000, 
    "height": 1.000,
    "items": [
        {
            "index": 0, 
            "shape": "path", 
            "attr": {
                "d": "M0.500,0.500 L0.580,0.500 A0.080,0.080 0 0,0 0.500,0.420 z"
            }
        }, 
        {
            "index": 1, 
            "shape": "path", 
            "attr": {
                "d": "M0.500,0.500 L0.500,0.420 A0.080,0.080 0 0,0 0.420,0.500 z"
            }
        }, 
    ...
  ]
}

Creator Tool

index,x,y
24,0.485,0.915
25,0.461,0.915
26,0.449,0.915
...
$ slowdash-xy2map.py NAME.csv > map-NAME.json

Table

Tree

Blob

Implementation

HTML / Form

Implementation
Restrictions

User HTML File

Example:
<h3>Crate Power Control</h3>
Temperature: <span sd-value="ch1->last()->format('%.1f degC')">---</span>
<p>  
<form>
  <input type="hidden" name="form" value="power_control">
  <div style="margin:10px;border:thin solid;padding:10px;width:30em">
    <label><input type="checkbox" name="crate1">Crate 1</label><br>
    <label><input type="checkbox" name="crate2">Crate 2</label><br>
    <label><input type="checkbox" name="crate3">Crate 3</label><br>
  </div>
  <p>
  <select name="action">
    <option value="turn_on">Turn On</option>
    <option value="turn_off">Turn Off</option>
  </select>
  <p>
  <input type="submit" value="Apply" style="font-size:x-large">
</form>

Data Binding

External Page

Implementation
Restrictions

External User Page with Slow-Dash data and controls

[ WRITE THIS ]