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

Method build

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

Source from the content-addressed store, hash-verified

5169 };
5170 }
5171 build() {
5172 const { names , props } = this;
5173 const { globalScope , groupings , parentScope , sort } = props;
5174 const { sizeSignals } = parentScope;
5175 (0, _scope.addTransforms)(globalScope.data, {
5176 type: "joinaggregate",
5177 groupby: (0, _scope.getGroupBy)(groupings).map((0, _expr.safeFieldName)),
5178 ops: [
5179 "count"
5180 ],
5181 as: [
5182 names.count
5183 ]
5184 }, {
5185 type: "extent",
5186 field: names.count,
5187 signal: names.globalExtent
5188 }, Object.assign({
5189 type: "stack",
5190 groupby: (0, _scope.getGroupBy)(groupings).map((0, _expr.safeFieldName)),
5191 as: [
5192 names.stack0,
5193 names.stack1
5194 ]
5195 }, sort && {
5196 sort: {
5197 field: (0, _expr.safeFieldName)(sort.name),
5198 order: "ascending"
5199 }
5200 }));
5201 (0, _scope.addData)(globalScope.scope, {
5202 name: names.sequence,
5203 transform: [
5204 {
5205 type: "sequence",
5206 start: 1,
5207 stop: {
5208 signal: `max(sqrt(${names.globalExtent}[1]),2)`
5209 }
5210 },
5211 {
5212 type: "formula",
5213 expr: "datum.data * datum.data",
5214 as: "squared"
5215 },
5216 {
5217 type: "formula",
5218 expr: `ceil(${names.globalExtent}[1] / datum.squared)`,
5219 as: "maxlevels"
5220 },
5221 {
5222 type: "formula",
5223 expr: `(${names.size} - (datum.data - 1) * datum.data) / datum.data`,
5224 as: "side"
5225 },
5226 {
5227 type: "formula",
5228 expr: "datum.side * datum.maxlevels + datum.maxlevels - 1",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected