Home Reference Source

Variable

Static Public Summary
public

flag: Quality

If value is true, some text appears.

public

fudgeAdjective: Quality

Shortcut for wordScale with a word list of 'terrible', 'poor', 'mediocre', 'fair', 'good', 'great', 'superb' where -3 = terrible, 0 = fair, and 3 = superb.

public

integer: Quality

Decimals are truncated from the value when displaying.

public

namedChoice: Quality

Simple transform of one value to another.

public

nonZeroInteger: Quality

Same as integer, but doesn't appear in sidebar if equal to zero.

public

onOff: Quality

Displays on/off based on value truthiness (if no words provided), or words[0]/words[1] (falsey word comes first)

public

Object containing all qualities indexed by key.

public

raw: Quality

Displays the value unchanged.

public

wordScale: Quality

Map an integer value to a word list, with optional offset.

public

yesNo: Quality

Same oas onOf, but defaults to yes / no.

Static Public

public flag: Quality source

If value is true, some text appears. Otherwise, no text appears.

Example:

{
   initialValue: true|false,
   name: 'This text appears in the sidebar if true, otherwise nothing'
}

public fudgeAdjective: Quality source

Shortcut for wordScale with a word list of 'terrible', 'poor', 'mediocre', 'fair', 'good', 'great', 'superb' where -3 = terrible, 0 = fair, and 3 = superb.

Example:

{
   initialValue: 0,  // a number
}

public integer: Quality source

Decimals are truncated from the value when displaying.

Example:

{
   initialValue: 0,  // a number
}

public namedChoice: Quality source

Simple transform of one value to another.

Example:

{
   initialValue: 'foo',  // anything
   labelMap: {'foo': 'bar'},  // renders 'foo' as 'bar'
}

public nonZeroInteger: Quality source

Same as integer, but doesn't appear in sidebar if equal to zero.

Example:

{
   initialValue: 0,  // a number
}

public onOff: Quality source

Displays on/off based on value truthiness (if no words provided), or words[0]/words[1] (falsey word comes first)

Example:

{
   initialValue: true|false,
   words: ['nope', 'yep']
}

public qualities: object source

import qualities from 'jumbogrove/src/jg/qualities/index.js'

Object containing all qualities indexed by key.

public raw: Quality source

Displays the value unchanged.

Example:

{
   initialValue: 'whatever',
}

public wordScale: Quality source

Map an integer value to a word list, with optional offset.

Example:

{
   initialValue: 0,  // a number
   words: ['bad', 'ok', 'good'],
   offset: 0  // rendered text = words[value + offset]
}

public yesNo: Quality source

Same oas onOf, but defaults to yes / no.

Example:

{
   initialValue: true|false,
}