-visualization :=
+visualization := [creator date id? lang name style type version]
extension?
userSource
(sourceVariable | derivedVariable)+
layerController?
extension :=
-
-userSource :=
-
- sourceVariable := extension* (format | stringFormat)?
-derivedVariable := extension* (format | stringFormat valueMapEntry*)?
-
-format := (affix+ | relabel)?
+ [(combinedFootnotes
+ | from helpId
+ | minWidthSet maxWidthSet
+ | showGridline)?
+ numRows?
+ id?]
+
+userSource := [id missing?]
+
+sourceVariable :=
+ [id categorical source sourceName dependsOn? label? labelVariable?]
+ extension* (format | stringFormat)?
+derivedVariable :=
+ [id categorical value dependsOn?]
+ extension* (format | stringFormat valueMapEntry*)?
+valueMapEntry := [id? from to]
+
+format :=
+ [errorCharacter?
+ (minimumFractionDigits maximumFractionDigits)? /* maybe not for baseFormat=dateTime */
+ baseFormat?
+ (baseFormat=dateTime or baseFormat=elapsedTime:
+ dayPadding hourFormat hourPadding minutePadding showDay showSecond)
+ (baseFormat=dateTime only:
+ dayOfMonthPadding dayType monthFormat showMonth showYear yearAbbreviation separatorChars mdyOrder)
+ (baseFormat=elapsedTime only:
+ secondPadding showMillis useGrouping)]
+ (affix+ | relabel)?
dateTimeFormat :=
-numberFormat := affix?
+ [baseFormat
+ (baseFormat=dateTime:
+ dayOfMonthPadding dayPadding dayType hourFormat hourPadding mdyOrder minutePadding monthFormat separatorChars showDay showHour showMinute showMonth showSecond showYear yearAbbreviation)
+ (baseFormat=time:
+ hourFormat hourPadding minutePadding secondPadding showHour showMillis showMinute showSecond)]
+numberFormat :=
+ [minimumIntegerDigits minimumFractionDigits maximumFractionDigits
+ (scientific small | suffix) useGrouping]
+ affix?
stringFormat := (affix | relabel+)?
-affix :=
-relabel :=
-
-valueMapEntry :=
-
-graph := location+ coordinates faceting facetLayout interval
-
-location :=
-
-coordinates :=
-faceting := cross layer*
-interval := labeling footnotes?
-labeling := (format | formatting | footnotes)*
-formatting := formatMapping*
-formatMapping := format
-footnotes := footnoteMapping+
-footnoteMapping :=
-
-cross := nest+
-nest := variableReference+
-variableReference :=
-
-facetLayout := tableLayout facetLevel+ setCellProperties*
-tableLayout :=
-facetLevel := axis
-
-axis := label? majorTicks
-label := descriptionGroup | text+
-majorTicks := gridline?
-gridline :=
-
-descriptionGroup := description+ text
-description :=
-text := <text>
-paragraph :=
-
-setCellProperties := setMetadata setStyle* setFormat+ union?
-setMetadata :=
-setStyle :=
-setFormat := dateTimeFormat | format | numberFormat | stringFormat+
-
-labelFrame := location+ label paragraph?
-container := extension? location+ labelFrame+
+affix := [id? definesReference position suffix value]
+relabel := [from to]
+
+graph :=
+ [id cellStyle style]
+ location+ coordinates faceting facetLayout interval
+
+location := [id? method part (min | target | value)?]
+
+coordinates := [id]
+faceting := [id] cross layer*
+interval := [id style] labeling footnotes?
+labeling := [id? style? variable] (format | formatting | footnotes)*
+formatting := [id? variable] formatMapping*
+formatMapping := [id? from] format
+footnotes := [id? superscript variable] footnoteMapping+
+footnoteMapping := [id? from to definesReference]
+
+cross := [id?] nest nest
+nest := [id?] variableReference+
+variableReference := [ref]
+
+facetLayout := [id?] tableLayout facetLevel+ setCellProperties*
+tableLayout := [(id style)? fitCells? verticalTitlesInCorner]
+facetLevel := [id gap level] axis
+
+axis := [id? style] label? majorTicks
+label :=
+ [id? style (purpose | textFrameStyle | purpose textFrameStyle)]
+ descriptionGroup | text+
+majorTicks := [id labelAngle length style tickFrameStyle] gridline?
+gridline := [id style zOrder]
+
+descriptionGroup := [id? separator target] description+ text
+description := [id? name]
+text := [id? (usesReference | definesReference position)?] <text>
+paragraph := [id? hangingIndent]
+
+setCellProperties :=
+ [id? applyToConverse]
+ setMetaData setStyle* setFormat+ union?
+setMetaData := [id? key target value]
+setStyle := [id? style target]
+setFormat :=
+ [id? target reset?]
+ dateTimeFormat | format | numberFormat | stringFormat+
+
+labelFrame := [id style] location+ label paragraph?
+container := [id style] extension? location+ labelFrame+
style :=
-
-layer :=
-layerController :=
-
-union := intersect+
-intersect := intersectWhere | where+
-intersectWhere :=
-where :=
+ [id
+ (border-bottom border-bottom-color?)?
+ (border-left border-left-color?)?
+ (border-right border-right-color?)?
+ (border-top border-top-color?)
+ (color? color2)?
+ width?]
+style :=
+ [id
+ font-family?
+ font-size?
+ font-style?
+ font-weight?
+ labelAngle?
+ labelLocationHorizontal?
+ (labelLocationVertical
+ margin-bottom margin-left margin-right margin-top
+ textAlignment
+ size?)?
+ visible?
+ color? color2?]
+
+layer := [id? value variable method? visible?]
+layerController := [id? source target]
+
+union := [id] intersect+
+intersect := [id?] intersectWhere | where+
+intersectWhere := [id variable variable2]
+where := [id? include variable]