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

Function getLayers

docs/app/js/sanddance-app.js:7397–7434  ·  view source on GitHub ↗
(presenter, config, stage, lightSettings /*LightSettings*/ , lightingMix, interpolator, guideLines)

Source from the content-addressed store, hash-verified

7395var _cubeLayer = require("./cube-layer/cube-layer");
7396var _easing = require("./easing");
7397function getLayers(presenter, config, stage, lightSettings /*LightSettings*/ , lightingMix, interpolator, guideLines) {
7398 const cubeLayer = newCubeLayer(presenter, config, stage.cubeData, presenter.style.highlightColor, lightSettings, lightingMix, interpolator);
7399 const { x , y , z } = stage.axes;
7400 const lines = (0, _array.concat)(stage.gridLines, guideLines);
7401 const texts = [
7402 ...stage.textData
7403 ];
7404 [
7405 x,
7406 y,
7407 z
7408 ].forEach((axes)=>{
7409 axes.forEach((axis)=>{
7410 if (axis.domain) lines.push(axis.domain);
7411 if (axis.ticks) lines.push.apply(lines, axis.ticks);
7412 if (axis.tickText) texts.push.apply(texts, axis.tickText);
7413 if (axis.title) texts.push(axis.title);
7414 });
7415 });
7416 let characterSet;
7417 if (config.getCharacterSet) characterSet = config.getCharacterSet(stage);
7418 else //Basic symbols, numbers, and uppercase / lowercase alphabet
7419 characterSet = new Array(95).fill(1).map((_, i)=>String.fromCharCode(32 + i));
7420 if (stage.facets) stage.facets.forEach((f)=>{
7421 if (f.lines) lines.push.apply(lines, f.lines);
7422 });
7423 const lineLayer = newLineLayer((0, _constants.layerNames).lines, lines);
7424 const textLayer = newTextLayer(presenter, (0, _constants.layerNames).text, texts, config, presenter.style.fontFamily, characterSet);
7425 const pathLayer = newPathLayer((0, _constants.layerNames).paths, stage.pathData);
7426 const polygonLayer = newPolygonLayer((0, _constants.layerNames).polygons, stage.polygonData);
7427 return [
7428 textLayer,
7429 cubeLayer,
7430 lineLayer,
7431 pathLayer,
7432 polygonLayer
7433 ];
7434}
7435function newCubeLayer(presenter, config, cubeData, highlightColor, lightSettings /*LightSettings*/ , lightingMix, interpolator) {
7436 const getPosition = getTiming(config.transitionDurations.position, (0, _easing.easing));
7437 const getSize = getTiming(config.transitionDurations.size, (0, _easing.easing));

Callers

nothing calls this directly

Calls 7

newCubeLayerFunction · 0.70
newLineLayerFunction · 0.70
newTextLayerFunction · 0.70
newPathLayerFunction · 0.70
newPolygonLayerFunction · 0.70
forEachMethod · 0.45
getCharacterSetMethod · 0.45

Tested by

no test coverage detected