createRadioControl = (definition, prevValue) => {
  if (!('values' in definition)) {
    throw new Error('Definition of choice parameter (' + definition.name + ") should include a 'values' parameter")
  }
  const values = definition.values
  const captions = 'captions' in definition ? definition.captions : definition.values

  if (captions.length !== values.length) {
    throw new Error('Definition of choice parameter (' + definition.name + ") should have the same number of items for 'captions' and 'values'")
  }

  return captions.map((caption, index) => {
    const value = values[index]
    let selected = false
    if (prevValue !== undefined) {
      selected = (prevValue === value)
    } else if ('default' in definition) {
      selected = (definition.default === value)
    } else if ('initial' in definition) {
      selected = (definition.initial === value)
    }

    const control = html`
      <label>
        <input type='radio' value=${value} name=${definition.name} checked=${selected}/>
        ${caption}
      </label>
    `
    control.children[0].paramName = definition.name
    control.children[0].paramType = definition.type

    return control
  })
}
Creates the DOM elements for a group of radio buttons
@param definition
@param prevValue
@returns {*}