src/ScaleSlider.js
/**
   * Places the pickers as a percentage of the max
   */
Places the pickers as a percentage of the max
Places the pickers as a percentage of the max
placePickers () {
    const max = this.props.abs
      ? this.props.stats.max
      : this.props.stats.max + Math.abs(this.props.stats.min)
    let positions = {}
    for (let i = 0; i < this.props.scale.length; i++) {
      const scaleValue = this.props.scale[i].value
        ? this.props.scale[i].value
        : this.props.stats[this.props.scale[i].type]
      const value = this.props.abs
        ? scaleValue
        : scaleValue + Math.abs(this.props.stats.min)
      positions[i] = value / max < 0.04
        ? 4
        : value / max > 0.8 && value / max < 0.95
        ? value / max * 100 - 18
        : value / max >= 0.95
        ? 77
        : value / max * 100
    }
    return positions
  }
placePickers ( ) { const max = this . props . abs ? this . props . stats . max : this . props . stats . max + Math . abs ( this . props . stats . min ) let positions = { } for ( let i = 0 ; i < this . props . scale . length ; i ++ ) { const scaleValue = this . props . scale [ i ] . value ? this . props . scale [ i ] . value : this . props . stats [ this . props . scale [ i ] . type ] const value = this . props . abs ? scaleValue : scaleValue + Math . abs ( this . props . stats . min ) positions [ i ] = value / max < 0.04 ? 4 : value / max > 0.8 && value / max < 0.95 ? value / max * 100 - 18 : value / max >= 0.95 ? 77 : value / max * 100 } return positions }
Places the pickers as a percentage of the max
Places the pickers as a percentage of the max