diff --git a/package.json b/package.json index d87c7d3..046ce7c 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "express-http-proxy": "^1.6.2", "faker": "^4.1.0", "knex": "^0.21.2", + "simplex-noise": "^2.4.0", "sqlite3": "^5.0.0", "vue": "^2.6.11", "vue-chartjs": "^3.5.0", diff --git a/seeds/fake.js b/seeds/fake.js index acf8d94..5ae17ce 100644 --- a/seeds/fake.js +++ b/seeds/fake.js @@ -1,12 +1,13 @@ 'use strict'; const faker = require ('faker'); +const sn = require ('simplex-noise'); -function create_log () { +function create_log (index, simplex) { const data = { num1: faker.random.number (), - num2: faker.random.number (), - num3: faker.random.number () + num2: simplex.noise2D (index * 0.1, 0), + num3: simplex.noise2D (index * 0.1, 1000) }; return { app: faker.random.word (), @@ -18,9 +19,10 @@ function create_log () { async function seed (knex) { console.log ('creating seeds'); + const simplex = (new sn); const log = (Array (20)) .fill (() => null) - .map (() => create_log ()); + .map ((a, index) => create_log (index, simplex)); await knex ('log') .del (); diff --git a/src/components/ChartView.vue b/src/components/ChartView.vue index 7f63d30..6c9fbdb 100644 --- a/src/components/ChartView.vue +++ b/src/components/ChartView.vue @@ -1,7 +1,8 @@