MCPcopy Index your code
hub / github.com/microsoft/SandDance / opacity_

Function opacity_

docs/app/js/sanddance-app.js:131573–131585  ·  view source on GitHub ↗
(opacity, _)

Source from the content-addressed store, hash-verified

131571 return f;
131572} // get image opacity function
131573function opacity_(opacity, _) {
131574 let f;
131575 if ((0, _vegaUtil.isFunction)(opacity)) {
131576 f = (obj)=>opacity(obj, _);
131577 f.dep = dependency(opacity);
131578 } else if (opacity) f = (0, _vegaUtil.constant)(opacity);
131579 else {
131580 // default to [0, max] opacity gradient
131581 f = (obj)=>obj.$value / obj.$max || 0;
131582 f.dep = true;
131583 }
131584 return f;
131585} // check if function depends on individual pixel data
131586function dependency(f) {
131587 if (!(0, _vegaUtil.isFunction)(f)) return false;
131588 const set3 = (0, _vegaUtil.toSet)((0, _vegaUtil.accessorFields)(f));

Callers 1

transformFunction · 0.70

Calls 2

opacityFunction · 0.70
dependencyFunction · 0.70

Tested by

no test coverage detected