- 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
Data visualization generated with datarepgen.py:
- 3D bar chart as in samples/eco/settings.json
- 3D scatter plot as in samples/iris/settings.json
- 3D cluster: min-max cluster per category with median
- 3D pie chart: mixed 2D/3D pie/donut chart as in samples/fruits/settings.json
- 3D map: grouped bar chart on map as in samples/geo/settings.json using
georepgen.py
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
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:
- Auto-Placing of geo chart using Spatial Reasoning: https://youtube.com/shorts/6w4DJwMHewY
- Level of Detail (LOD) controlled by Proximity: https://youtu.be/UL8XRe5luu8
- Time Series controlled by Animation: https://youtube.com/shorts/PjelVMMz4Dk
- Narrative Data Storytelling using Interaction: https://youtube.com/shorts/85cTH27r540
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 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)
- shape of marker: 3D representation and equivalent 2D mark, with the goal of being recognizable view-independent in 3D and in 2D
- 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)
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 axiszy: zy grid and axes-zy: opposite zy plane with inverse z axisxz: 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 legendlm: 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:
vbottom^top- default: mid
- z position:
_front-mid
- x position:
- Examples of Legend Panel specifications:
"lc", "lc=_", "lc=_<", "LC", "LC=_", "lg=_>", ...
- Samples of generated legend images:
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"
},- 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.jsonfile as input
- the python script reads the
- Find generated output in
samples/irisfolder:- 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)
The presentation of SAXR data reps is supported by:
- ARchi VR App: iOS AR application
- ARchi Composer: macOS AR editor
- USDZ 3D samples: iris.usdz, eco.usdz, fruits.usdz, geo.usdz
- glTF 3D samples: iris.glb, eco.glb, fruits.glb, geo.glb
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
- Select planes with texture images using opacity/transparency
- Delete Camera and Light from Scene
- Export to usdz and glb format (does embed textures)
- geoSPATIAL: https://youtube.com/shorts/6w4DJwMHewY
- irisLOD: https://youtu.be/UL8XRe5luu8
- ecoANIM: https://youtube.com/shorts/PjelVMMz4Dk
- salesSTORY: https://youtube.com/shorts/85cTH27r540
- Optomancy: https://github.com/Wizualization/optomancy
- Vega-lite: https://github.com/vega/vega-lite
- Datasets: https://github.com/vega/vega-datasets
- Colormaps: https://matplotlib.org/stable/gallery/color/colormap_reference.html
- ARchi VR App: https://archi.metason.net









