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

Method transformXY

docs/app/js/sanddance-app.js:5081–5115  ·  view source on GitHub ↗
(gap, levelSize, squaresPerBand)

Source from the content-addressed store, hash-verified

5079 };
5080 }
5081 transformXY(gap, levelSize, squaresPerBand) {
5082 const { names , prefix } = this;
5083 const compartment = `(${names.bandWidth}) / ${squaresPerBand} * ((datum[${JSON.stringify(names.stack0)}]) % ${squaresPerBand})`;
5084 const level = `floor((datum[${JSON.stringify(names.stack0)}]) / ${squaresPerBand})`;
5085 const { fillDirection , parentScope } = this.props;
5086 const tx = {
5087 type: "formula",
5088 expr: null,
5089 as: `${prefix}_${(0, _constants.FieldNames).OffsetX}`
5090 };
5091 const ty = {
5092 type: "formula",
5093 expr: null,
5094 as: `${prefix}_${(0, _constants.FieldNames).OffsetY}`
5095 };
5096 switch(fillDirection){
5097 case "down-right":
5098 tx.expr = `${level} * (${levelSize} + ${gap})`;
5099 ty.expr = compartment;
5100 break;
5101 case "right-up":
5102 tx.expr = compartment;
5103 ty.expr = `${parentScope.offsets.h} - ${levelSize} - ${level} * (${levelSize} + ${gap})`;
5104 break;
5105 case "right-down":
5106 default:
5107 tx.expr = compartment;
5108 ty.expr = `${level} * (${levelSize} + ${gap})`;
5109 break;
5110 }
5111 return {
5112 tx,
5113 ty
5114 };
5115 }
5116}
5117
5118},{"./layout":"jm7Ki","../constants":"9PPhV","../expr":"f5d82","../scope":"91ogX","../selection":"c6vR2","../zBase":"7rdRN","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"7rdRN":[function(require,module,exports) {

Callers 1

buildMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected