<commit_before>
Foundation = require 'art-foundation'
Events = require 'art-events'
EasingFunctions = require './easing_functions'
PersistantAnimator = require './persistant_animator'

{
  log, BaseObject
  isFunction, isString, isNumber
  min, max
} = Foundation
{EventedObject} = Events
{interpolate} = PersistantAnimator

module.exports = class EasingPersistantAnimator extends PersistantAnimator

  @getter "duration easingFunction"

  @getter animationPos: ->
    min 1, @getAnimationSeconds() / @_duration

  @setter
    duration: (d) ->
      @_duration = if isNumber(d) then max .001, d else .25

    easingFunction: (f) ->
      @_easingFunction = f
      if isString f
        unless @_easingFunction = EasingFunctions[f]
          console.warn "invalid easing easingFunction: #{f}"

      @_easingFunction ||= EasingFunctions.linear
<commit_msg>default easingFunction: 'easeInQuad'<commit_after>
Foundation = require 'art-foundation'
Events = require 'art-events'
EasingFunctions = require './easing_functions'
PersistantAnimator = require './persistant_animator'

{
  log, BaseObject
  isFunction, isString, isNumber
  min, max
} = Foundation
{EventedObject} = Events
{interpolate} = PersistantAnimator

module.exports = class EasingPersistantAnimator extends PersistantAnimator

  @getter "duration easingFunction"

  @getter animationPos: ->
    min 1, @getAnimationSeconds() / @_duration

  @setter
    duration: (d) ->
      @_duration = if isNumber(d) then max .001, d else .25

    easingFunction: (f) ->
      @_easingFunction = f
      if isString f
        unless @_easingFunction = EasingFunctions[f]
          console.warn "invalid easing easingFunction: #{f}"

      @_easingFunction ||= EasingFunctions.easeInQuad

{'fraction_non_alphanumeric': 0.09948246118458884, 'fraction_numerical': 0.006900517538815411, 'mean_word_length': 3.9572649572649574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6034303', 'n_tokens_mistral': 548, 'n_tokens_neox': 529, 'n_words': 138}