ProximityConstraint Function

Produce a point only if events are triggered within a certain period of each other. This constraint only works in conjunction with other constraints like OrderConstraint, TypeConstraint or FrequencyConstraint.

This constraint could be useful to look into repetition behavior. Perhaps we want to know whether users are trying to add notes one after another but we know the UI is clunky in how it lets you add notes and we want to improve that if it's worth it.

Considering the period between each time the user adds a note could be a way to glean into that, although it may not be fully reliable since we don't know how long it takes them to write each note.

import { OrderConstraint, ProximityConstraint } from 'full-metal-alchemy'

{
  name: 'Repeatedly left notes',
  events: [ 'note-added' ],
  constraints: [
    ProximityConstraint({ period: Period.minutes(1) }),
    FrequencyConstraint(3)
  ]
}

Signature

ProximityConstraint(config: Object) -> Constraint