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

Function axisDomain

docs/app/js/sanddance-app.js:148932–148966  ·  view source on GitHub ↗
(spec, config, userEncode, dataRef)

Source from the content-addressed store, hash-verified

148930 return result;
148931}
148932function axisDomain(spec, config, userEncode, dataRef) {
148933 const _ = lookup(spec, config), orient = spec.orient;
148934 let enter, update;
148935 const encode = {
148936 enter: enter = {
148937 opacity: zero
148938 },
148939 update: update = {
148940 opacity: one
148941 },
148942 exit: {
148943 opacity: zero
148944 }
148945 };
148946 addEncoders(encode, {
148947 stroke: _("domainColor"),
148948 strokeCap: _("domainCap"),
148949 strokeDash: _("domainDash"),
148950 strokeDashOffset: _("domainDashOffset"),
148951 strokeWidth: _("domainWidth"),
148952 strokeOpacity: _("domainOpacity")
148953 });
148954 const pos0 = position(spec, 0);
148955 const pos1 = position(spec, 1);
148956 enter.x = update.x = ifX(orient, pos0, zero);
148957 enter.x2 = update.x2 = ifX(orient, pos1);
148958 enter.y = update.y = ifY(orient, pos0, zero);
148959 enter.y2 = update.y2 = ifY(orient, pos1);
148960 return guideMark({
148961 type: RuleMark,
148962 role: AxisDomainRole,
148963 from: dataRef,
148964 encode
148965 }, userEncode);
148966}
148967function position(spec, pos) {
148968 return {
148969 scale: spec.scale,

Callers 1

parseAxisFunction · 0.70

Calls 7

lookupFunction · 0.70
addEncodersFunction · 0.70
_Function · 0.70
positionFunction · 0.70
ifXFunction · 0.70
ifYFunction · 0.70
guideMarkFunction · 0.70

Tested by

no test coverage detected