nl_tokens: Returns a domain based on categories if they exist
pl_tokens: function getDomainFromCategories ( props , axis , categories ) { categories = categories || Data . getCategories ( props , axis ) ; const { polar , startAngle = 0 , endAngle = 360 } = props ; if ( ! categories ) { return undefined ; } const minDomain = getMinFromProps ( props , axis ) ; const maxDomain = getMaxFromProps ( props , axis ) ; const stringArray = Collection . containsStrings ( categories ) ? Data . getStringsFromCategories ( props , axis ) : [ ] ; const stringMap = stringArray . length === 0 ? null : stringArray . reduce ( ( memo , string , index ) => { memo [ string ] = index + 1 ; return memo ; } , { } ) ; const categoryValues = stringMap ? categories . map ( ( value ) => stringMap [ value ] ) : categories ; const min = minDomain !== undefined ? minDomain : Collection . getMinValue ( categoryValues ) ; const max = maxDomain !== undefined ? maxDomain : Collection . getMaxValue ( categoryValues ) ; const categoryDomain = getDomainFromMinMax ( min , max ) ; return polar && axis === "x" && Math . <mask> ( startAngle - endAngle ) === 360 ? getSymmetricDomain ( categoryDomain , categoryValues ) : categoryDomain ; }