Skip to content

metason/SAXR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAXR: Situated Analytics in eXtended Reality

systemarchitecture

Features

  • Situated Analytics in XR/AR/VR: Immersive data exploration in eXtended Reality
  • 2D and 3D Plots: Mix of 2D and 3D data plots in combined charts
  • 2D Plot → 3D Stage: Spatial domain-range scaling aligned in 2D and 3D
  • Image Panels: Panels for stage boundaries and legends
  • Data Reps: List of simple data representations for visual XR front-ends
  • Grammar of 3D Graphics: Generation of aligned 2D/3D plots controlled by declarative JSON specification
  • Data Prep: Use of Numpy, Pandas and GeoPandas as most common tools for data processing
  • Python-based: Scripts for generation of data reps using Matplotlib for chart layouting
  • Data Import: Inline data specification or loading of data files in json/xlsx/csv format

3D Plot Layouts

Data visualization generated with datarepgen.py:

Data Viz Scenery

In SAXR 2D and 3D elements are arranged in a Data Viz Scenery consisting of:

  • Data Viz Stage with consistent dimensions in 2D and 3D
    • Stage Set with global panels and spatial encodings
  • Data Viz Scenes as indexed sequence of:
    • Data Viz Scene with local panels and encodings
    • Data Reps as visual representations of data

Behavior of Situated Analytics in AR/XR Front-end

List of scenes (containing DataReps) are interpreted as level of details, time series, or sequence in narrative 3D data viz. They become interactive by embedding SAXR data visualization into dynamic AR experiences controlled by declarative scripts.

See declarations of behavior and screen recoding videos run within the ARchi VR app. The behavior of SAXR data viz in the ARchi VR App is documented as Event-Condition-Action (ECA) diagrams:

Declarative Specification with Grammar of Graphics

SAXR is supporting a high-level grammar of graphics to define 2D and 3D sceneries in a JSON settings file. It is heavily inspired by Vega-Lite and Optomancy. The specifications in the JSON settings file serves as input to the datarepgen.pyscript that generates data reps and corresponding images used as assets for panels.

Example of a settings.json file:

{
    "description": "3D data viz of Iris data set.",
    "title": "Iris",
    "stage": {
        "width": 0.8,
        "height": 0.8,
        "depth": 0.8
    },
    "data": {
        "url": "../data/iris.json"
    },
    "assetURL": "$SERVER/run/vis/",
    "output": "viz.json",
    "background": "#FFFFFF",
    "gridColor": "#DDDE00",
    "plot": "scatter",
    "mark": "sphere",
    "encoding": {
        "x": {
            "field": "sepal width"
        },
        "y": {
            "field": "petal length"
        },
        "z": {
            "field": "petal width"
        },
        "size": {
            "value": 0.022
        },
        "color": {
            "field": "class",
            "title": "Iris Classes"
        }
    },
    "panels": [
        "xy",
        "-xy",
        "zy",
        "-zy",
        "xz",
        "lc=_"
    ]
}

Data Reps

Data Reps are a collection of simple representations of data elements that will be visualized in the XR front-end application. They are encoded as JSON file, such as:

[
  {
    "type": "-XY",
    "x": 0.0, "y": -0.014, "z": 0.319,
    "w": 1.193, "d": 0, "h": 0.567,
    "asset": "$SERVER/run/vis/-xy.png"
  },
  {
    "type": "cylinder",
    "x": 0.0707, "y": 0.0834, "z": -0.2028,
    "w": 0.0151, "h": 0.1669, "d": 0.015,
    "color": "blue"
  }
]

The data fields of Data Reps are:

  • type: visual shape or panel type
    • shape of marker: 3D representation and equivalent 2D mark, with the goal of being recognizable view-independent in 3D and in 2D
      • 3D: sphere, box, pyramid, pyramid_down, octahedron, plus, cross
      • 2D: circle, square, triangle_up, triangle_down, diamond, plus, cross
      • plt: o, s, ^, v, D, P, X (Matplotlib symbols for 2D marks)
    • shape of chart element
      • cylinder: for bar plots (instead of box)
      • plane: for flat overlays on panels
      • image: for placing any icon or image
      • text: for labels
    • panel type (see next chapter)
  • x,y,z: position
  • w,h,d: bbox size of shape
    • if h == 0 and d > 0 then shape is flat
    • if d == 0 and h > 0 then shape is upright
  • color: color of shape
    • hex-encoded RGB color (e.g., "#FF0000"), with support for transparency (e.g.,"#FF0000AA")
    • color name (e..g., "blue")
  • asset: type-specific resources
    • URL to file (e.g., to image file)
    • text (for labels)
    • attributes (e.g, "angle:45;start:90" for arc)

Panels

Panel types are encoded by their name. If panel name is uppercase it will be presented as stage element, if lowercase as scene element.

  • Data Stage Panels
    • xy: xy grid and axes
    • -xy: opposite xy plane with inverse x axis
    • zy: zy grid and axes
    • -zy: opposite zy plane with inverse z axis
    • xz: floor grid and axes
  • Data Stage Panels + plotting
    • +s: scatter plot
    • +p: pie/donut chart
  • Examples of Data Stage Panel specifications:
    • "xy", "-xy", "xy+s", "XY", "ZY", "XZ+p"...
  • Samples of generated image plots (from the samples/iris project):

Legends are panels as well. The legend name additionally encodes its pose and position.

  • Legend Panels
    • lc: color legend
    • lm: marker legend (shape categories)
    • ls: size legend (size categories)
    • lg: group legend (group fields mapped to colors)
  • Legend Panels pose
    • = flat
    • | upright
    • ! upright and billboarding
  • Legend Panels position
    • x position:
      • < leftside
      • > rightside
      • default: mid
    • y position:
      • v bottom
      • ^ top
      • default: mid
    • z position:
      • _ front
      • - mid
  • Examples of Legend Panel specifications:
    • "lc", "lc=_", "lc=_<", "LC", "LC=_", "lg=_>", ...
  • Samples of generated legend images:

Color Palettes

Predefined Color Palettes:

  • nominal: categorial color palette without ranking; default: tab10
  • ordinal: categorial and sortable color palette; default: Oranges
  • quantitative: quantitative and interpolatable color palette; default: Blues
  • temporal: quantitative and interpolatable color palette; default: Greys

The color palettes may be overwritten in the settings.json file. All colormaps defined by Matplotlib can be used in SAXR settings.

    "palette": {
        "nominal": "tab10",
        "ordinal": "Oranges",
        "quantitative": "Blues",
        "temporal": "Greys"
    },

Installation

  • Prerequisite: Python 3.X
  • Install Pandas and Matplotlib (and optionally GeoPandas)
  • Download repository
  • In project folder run: python3 datarepgen.py samples/iris
    • the python script reads the samples/iris/settings.json file as input
  • Find generated output in samples/iris folder:
    • several 2D images in png format (used for panels)
    • encoding.json
    • a list of data reps in viz.json (used as input for XR viewer)

SAXR Front-ends

The presentation of SAXR data reps is supported by:

Hints

How to fix transparency in USDZ/glTF export:

  • Export USD from ARchi Composer
  • Import file into Blender
    • Select planes with texture images using opacity/transparency
      • In Shading editor connect alpha from image to Principled BSDF
      • In Material tab
        • set Settings->Blend Mode to "Alpha Clip"
        • set Backface Culling on
  • Delete Camera and Light from Scene
  • Export to usdz and glb format (does embed textures)

Screen Recording Videos

References

About

SAXR: Situated Analytics in eXtended Reality

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages