Grammar
The Netpanorama is specified in an abstracted code description adopted from (Ren et al., 2018) and (L’Yi et al., 2021).
spec := data+, network+, parameter*, grouping*, ordering*, table*, layout*, map*, scale*, vis*
data := name, (values | url | localStorage), format?, dataTransform*
parameter := name, bind?
network := name, (simpleNetwork | complexNetwork), networkTransform*
grouping := name, (dataName | networkName), common
ordering := name, (dataName | networkName), allowTies?, orderingCriterion+
map := name, tiles, center?, zoomLevel?, minZoom?, maxZoom?
layout := name, dataName, (attributeLayout | topologicalLayout), layoutTransform*
table := data, rowOrder, colOrder, group?, rowLabels?, colLabels?, dragToReorder?, symmetric?
scale := name, domain, range, scheme?, border?, layout?, drawAxes, overlapStrategy?
vis := entries, mark, vis?
Most of items such as data, networks, layouts, scales, orderings, and groupings are named with a name := string
property.
Many fields can also be expressed with fields or vega expression
field := string
expression := string
High-level parameters
A Netpanorama specification can also have have following high-level properties to define the padding and dimensions of the visualization:
x := number
y := number
width := number
height := number
and a zoom and pan specification:
zoom := boolean | zoomSpec
pan := boolean | panSpec
zoomSpec := minZoom, maxZoom
panSpec := minPan, maxPan
minZoom := number
maxZoom := number
minPan := [number, number]
maxPan := [number, number]
Data
A data specification is given by
data := name, (values | url | localStorage), format, dataTransform*
values := JSON
url := URL
localStorage := string
transform := dataTransform
dataTransform := type, parameters*
type := "lookup" | "geocode" | "calculate" | "bin" | "filter" | "sample" | "aggregate" | "flatten" | "fold" | "pivot"
where JSON
is a JSON formatted object, and URL
an url formatted string.
Networks
A network specification is given by
network := name, (simpleNetwork | complexNetwork), networkTransform*
Simple Network
simpleNetwork := nodes, links, directed, source_node, target_node, addReverseLinks?, ignoreDanglingLinks?
nodes := name
links := name
directed := boolean
source_node := [field, field]
target_node := [field, field]
addReverseLink := boolean
ignoreDanglingLinks := boolean
Complex Network
parts := complexNetworkSpecComponent
complexNetworkSpecComponent := yieldNodes*, yieldLinks*, mapYieldsLinks?*
yieldNodes := type?, id_field, data
yieldLinks := source_id, source_id_field?, source_node_type, target_id, target_id_field?, target_node_type?, data?, addReverseLinks?
data: field*
id_field := string
source_id := field
source_id_field := string
source_node_type := string
target_id := string
target_id_field := string
target_node_type := string,
addReverseLinks := boolean
Network Transforms
networkTansform := type, parameters*
type := "aggregateNodes" | "aggregateEdges" | "project" | "removeIsolated" | "filterNodes" | "filterEdges" | "connect" | "reverseEdge" | "setDirectness" | "swapNodesAndEdges" | "promote" | "calculate" | "connectivityBasedAttribute" | "metric" | "cluster"
Groupings
The definition of a grouping construct is
grouping := name, (dataName | networkName), common
dataName | networkName := name
common := field*
Ordering
The definition of an ordering construct is
ordering := name, (dataName | networkName), allowTies?, orderingCriterion+
dataName | networkName := name
allowTies := boolean
orderingCriterion := OrderingCriterionField | OrderingCriterionExpression | OrderingCriterionSeriation
orderingCriterionField := field, direction?, fn
orderingCriterionExpression := expression, direction?, fn
orderingCriterionSeriation := method, weightField?, distance?
direction := "ascending" | "descending"
method := "optimal-leaf-order" | "barycentre" | "bandwidth-reduction" | "pca"
weightField := field
distance := "euclidean" | "manhattan" | "minkowski" | "chebyshev" | "hamming" | "jaccard" | "braycurtis"
fn := expression
Layouts
The definition of a layout construct is
layout := name, (attributeLayout | topologicalLayout), layoutTransform*
attributeLayout := data, order, pattern, parameters*
data := name
order := name
pattern := "circle" | "spiral" | "cartesian" | "polar" | "rings" | "row-by-row" | "col-by-col" | "row-snake" | "col-snake" | "diagonal" | "diagonal-snake" | "z-curve" | "hilbert"
topologicalLayout := network, normalizeX?, normalizeY?, type, parameters*
network := name
normalizeX := [number, number]
normalizeY := [number, number]
type := "d3-force" | "web-cola" | "set-cola" | "cytoscape" | "grid" | "graphviz" | "bioFabric" | "bipartite"
Layout Transforms
layoutTransform := type, parameters*
type := "jitter" | "offset" | "beeswarm" | "set" | "orient"
Tables
The definition of a table construct is
table := data, rowOrder, colOrder, group?, rowLabels?, colLabels?, dragToReorder?, symmetric?
rowOrder := OrderingCriterion
colOrder := OrderingCriterion
data: name
group: name
rowLabels: label
colLabels: label
label: field , width?
width: number
dragToReorder: boolean
symmetric: boolan
Scales
The definition of a scale construct is
scale := name, domain, range, scheme?, rangeMapFunction?
domain := (number | string)*
range := (number | string)*
type := "ordinal" | "linear" | "time"
scheme := string
rangeMapFunction := expression
Visual Encodings
The definition of a vis construct is
vis := (entry | tableEntry)+
where an entry is given by
entry := mark+, layout?, drawAxes?, border?, ifInSelection?, if?, overlapRemoval?, action*, vis?
layout := name
drawAxes := boolean
border := boolean
ifInSelection := name
if := expression
overlapRemoval := priority?, density?, shrink?
priority := field | expression
density := number
shrink := boolean
and a tableEntry by
tableEntry := entry & table, rowLabels?, colLabels?, rowLines?, rowMidLines?, colLines?, colMidLines?
table := name
rowLabels := mark
colLabels := mark
rowLines := mark
colLines := mark
rowMidLines := mark
colMidLines := mark
Marks
A mark can be any vega mark or a linkpath mark.
mark := type, parameters*
type := "linkpath" | "circle" | "text" | ...
A linkpath mark have the following structure:
type := "linkpath"
start := field
end := field
shape := "curve" | "wedge" | "glyphs" | "line"
endMarker := shape, stepBack?, direction?, fill?, opacity?, stroke?, size?
where each shape have different parameters.
Interaction
[//]: # TODO: finish
Parameters
Parameters can be defined in the parameters global construct with an array of
parameter := variableParameter | selectionParameter
variableParameter := name, value?, bind?, animate?
value := number | string
bind := input, element?, label?, a?, paramaters*
input := "radio" | "checkbox" | "radio" | "select"
element := string
label := string
a := URL
animate := label?, min, max, values, stepTimes?, totalTime?, stepSize?, numSteps?, autoStart?, loop?, showPauseControl?, showSeepControl?, showJumpControl?, showValue?
selectionParameter := name, value?, type, network, dragging?, cleearOnBackgroundClick
Each type of inputs can have different parameters.
Maps
The definition of a map construct is
map := name, tiles, center?, zoomLevel?, minZoom?, maxZoom?
tiles := string
center := [number, number]
zoomLevel := number
minZoom := number
maxZoom := number