(_, spec, config)
| 148547 | return LegendScales.reduce((count, type)=>count + (spec[type] ? 1 : 0), 0); |
| 148548 | } |
| 148549 | function buildLegendEncode(_, spec, config) { |
| 148550 | const encode = { |
| 148551 | enter: {}, |
| 148552 | update: {} |
| 148553 | }; |
| 148554 | addEncoders(encode, { |
| 148555 | orient: _("orient"), |
| 148556 | offset: _("offset"), |
| 148557 | padding: _("padding"), |
| 148558 | titlePadding: _("titlePadding"), |
| 148559 | cornerRadius: _("cornerRadius"), |
| 148560 | fill: _("fillColor"), |
| 148561 | stroke: _("strokeColor"), |
| 148562 | strokeWidth: config.strokeWidth, |
| 148563 | strokeDash: config.strokeDash, |
| 148564 | x: _("legendX"), |
| 148565 | y: _("legendY"), |
| 148566 | // accessibility support |
| 148567 | format: spec.format, |
| 148568 | formatType: spec.formatType |
| 148569 | }); |
| 148570 | return encode; |
| 148571 | } |
| 148572 | function sizeExpression(spec, scope, marks) { |
| 148573 | const size = deref(getChannel("size", spec, marks)), strokeWidth = deref(getChannel("strokeWidth", spec, marks)), fontSize = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle)); |
| 148574 | return (0, _vegaFunctions.parseExpression)(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize})`, scope); |
no test coverage detected