separated definition of euqledian distance metric into src/js/metrics.js