()
| 112 | } |
| 113 | |
| 114 | public build(): SpecResult { |
| 115 | const { globalSignals, specContext } = this; |
| 116 | const { facetLayout, specCapabilities } = this.props; |
| 117 | const { insight, specColumns, specViewOptions } = specContext; |
| 118 | const dataName = 'data_source'; |
| 119 | const { vegaSpec, groupMark } = this.initSpec(dataName); |
| 120 | const { topColorField, colorDataName } = addColor({ |
| 121 | scope: vegaSpec, |
| 122 | dataName, |
| 123 | specContext, |
| 124 | scaleName: ScaleNames.Color, |
| 125 | legendDataName: 'data_legend', |
| 126 | topLookupName: 'data_topcolorlookup', |
| 127 | colorReverseSignalName: SignalNames.ColorReverse, |
| 128 | }); |
| 129 | const globalScope = new GlobalScope({ |
| 130 | dataName: colorDataName, |
| 131 | markGroup: groupMark, |
| 132 | scope: vegaSpec, |
| 133 | signals: globalSignals, |
| 134 | }); |
| 135 | if (facetLayout) { |
| 136 | addSignals(vegaSpec, |
| 137 | { |
| 138 | name: SignalNames.FacetPaddingBottom, |
| 139 | update: `${facetLayout.facetPadding.bottom}`, |
| 140 | }, |
| 141 | { |
| 142 | name: SignalNames.FacetPaddingLeft, |
| 143 | update: `${facetLayout.facetPadding.left}`, |
| 144 | }, |
| 145 | { |
| 146 | name: SignalNames.FacetPaddingTop, |
| 147 | update: `${facetLayout.facetPadding.top}`, |
| 148 | }, |
| 149 | ); |
| 150 | globalSignals.plotOffsetTop.update = `${facetLayout.plotPadding.y}`; |
| 151 | globalSignals.plotOffsetRight.update = `${facetLayout.plotPadding.x}`; |
| 152 | } |
| 153 | const { |
| 154 | firstScope, |
| 155 | finalScope, |
| 156 | specResult, |
| 157 | allGlobalScales, |
| 158 | allEncodingRules, |
| 159 | } = this.iterateLayouts(globalScope, (i, innerScope) => { |
| 160 | if (facetLayout && i === 0) { |
| 161 | globalScope.zSize = innerScope.offsets.h; |
| 162 | } |
| 163 | }); |
| 164 | |
| 165 | if (specResult) { |
| 166 | return specResult; |
| 167 | } |
| 168 | if (allGlobalScales.length > 0) { |
| 169 | const plotHeightOut = globalSignals.plotHeightOut.name; |
| 170 | const plotWidthOut = globalSignals.plotWidthOut.name; |
| 171 |
no test coverage detected