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

Function sizeExpression

docs/tests/v2/es6/js/sanddance.js:136212–136217  ·  view source on GitHub ↗
(spec, scope, marks)

Source from the content-addressed store, hash-verified

136210}
136211
136212function sizeExpression(spec, scope, marks) {
136213 var size = (0, _util.deref)(getChannel('size', spec, marks)),
136214 strokeWidth = (0, _util.deref)(getChannel('strokeWidth', spec, marks)),
136215 fontSize = (0, _util.deref)(getFontSize(marks[1].encode, scope, _constants.GuideLabelStyle));
136216 return (0, _expression.default)(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize})`, scope);
136217}
136218
136219function getChannel(name, spec, marks) {
136220 return spec[name] ? `scale("${spec[name]}",datum)` : (0, _guideUtil.getEncoding)(name, marks[0].encode);

Callers 1

_defaultFunction · 0.70

Calls 2

getChannelFunction · 0.70
getFontSizeFunction · 0.70

Tested by

no test coverage detected