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

Function markStager

docs/app/js/sanddance-app.js:8587–8608  ·  view source on GitHub ↗
(options, stage, scene, x, y, groupType)

Source from the content-addressed store, hash-verified

8585var _defaults = require("../defaults");
8586var _zaxis = require("../zaxis");
8587const markStager = (options, stage, scene, x, y, groupType)=>{
8588 (0, _base.base).vega.sceneVisit(scene, function(item) {
8589 const x1 = item.x || 0;
8590 const y1 = item.y || 0;
8591 const x2 = item.x2 != null ? item.x2 : x1;
8592 const y2 = item.y2 != null ? item.y2 : y1;
8593 const lineItem = styledLine(x1 + x, y1 + y, x2 + x, y2 + y, item.stroke, item.strokeWidth);
8594 if (item.mark.role === "axis-tick") {
8595 if (options.currAxis.role === "z") {
8596 (0, _zaxis.zSwap)(lineItem.sourcePosition);
8597 (0, _zaxis.zSwap)(lineItem.targetPosition);
8598 }
8599 options.currAxis.ticks.push(lineItem);
8600 } else if (item.mark.role === "axis-domain") {
8601 if (options.currAxis.role === "z") {
8602 (0, _zaxis.zSwap)(lineItem.sourcePosition);
8603 (0, _zaxis.zSwap)(lineItem.targetPosition);
8604 }
8605 options.currAxis.domain = lineItem;
8606 } else stage.gridLines.push(lineItem);
8607 });
8608};
8609function styledLine(x1, y1, x2, y2, stroke, strokeWidth) {
8610 const line = {
8611 sourcePosition: [

Callers 1

mainStagerFunction · 0.70

Calls 6

styledLineFunction · 0.70
fnFunction · 0.70
convertBaselineFunction · 0.70
convertAngleFunction · 0.70
convertAlignmentFunction · 0.70
forEachMethod · 0.45

Tested by

no test coverage detected