MCPcopy Create free account
hub / github.com/microsoft/SandDance / build

Method build

docs/app/js/sanddance-app.js:2599–2766  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2597 return errors;
2598 }
2599 build() {
2600 const { specContext } = this;
2601 const { facetLayout , specCapabilities } = this.props;
2602 const { insight , specColumns , specViewOptions } = specContext;
2603 const dataName = "data_source";
2604 const { vegaSpec , groupMark } = this.initSpec(dataName);
2605 const { topColorField , colorDataName } = (0, _color.addColor)({
2606 scope: vegaSpec,
2607 dataName,
2608 specContext,
2609 scaleName: (0, _constants.ScaleNames).Color,
2610 legendDataName: "data_legend",
2611 topLookupName: "data_topcolorlookup",
2612 colorReverseSignalName: (0, _constants.SignalNames).ColorReverse
2613 });
2614 const globalScope = new (0, _globalScope.GlobalScope)({
2615 dataName: colorDataName,
2616 markGroup: groupMark,
2617 scope: vegaSpec,
2618 signals: this.globalSignals
2619 });
2620 if (facetLayout) {
2621 (0, _scope.addSignals)(vegaSpec, {
2622 name: (0, _constants.SignalNames).FacetPaddingBottom,
2623 update: `${facetLayout.facetPadding.bottom}`
2624 }, {
2625 name: (0, _constants.SignalNames).FacetPaddingLeft,
2626 update: `${facetLayout.facetPadding.left}`
2627 }, {
2628 name: (0, _constants.SignalNames).FacetPaddingTop,
2629 update: `${facetLayout.facetPadding.top}`
2630 });
2631 this.globalSignals.plotOffsetTop.update = `${facetLayout.plotPadding.y}`;
2632 this.globalSignals.plotOffsetRight.update = `${facetLayout.plotPadding.x}`;
2633 }
2634 const { firstScope , finalScope , specResult , allGlobalScales , allEncodingRules } = this.iterateLayouts(globalScope, (i, innerScope)=>{
2635 if (facetLayout && i === 0) globalScope.zSize = innerScope.offsets.h;
2636 });
2637 if (specResult) return specResult;
2638 if (allGlobalScales.length > 0) {
2639 const plotHeightOut = this.globalSignals.plotHeightOut.name;
2640 const plotWidthOut = this.globalSignals.plotWidthOut.name;
2641 const colTitleScale = {
2642 type: "linear",
2643 name: "scale_facet_col_title",
2644 domain: [
2645 0,
2646 1
2647 ],
2648 range: [
2649 0,
2650 {
2651 signal: plotWidthOut
2652 }
2653 ]
2654 };
2655 const rowTitleScale = {
2656 type: "linear",

Callers

nothing calls this directly

Calls 3

initSpecMethod · 0.95
iterateLayoutsMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected