UNPKG

d3-view

Version:

View-model d3 plugin for building interactive data-driven web interfaces

14 lines (11 loc) • 331 B
export default function(field, wrappedEl) { var data = field.props; return field.wrapTemplate(wrappedEl, labelTpl(data)); } function labelTpl(data) { var label = data.label || data.name; return `<label for=${ data.id } class="control-label" d3-class="[srOnly ? 'sr-only' : null]">${label}</label> <slot></slot>`; }