diff --git a/Dockerfile b/Dockerfile index 2db1bf5..f1425f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM tiangolo/uwsgi-nginx-flask:python3.6 +RUN apt-get update && apt-get install -y redis-server python3-celery python-celery-common python3-redis + + COPY ./ /app COPY ./requirements.txt /tmp/ @@ -14,5 +17,10 @@ RUN pip3 install pyflux RUN pip3 install pyramid-arima RUN pip3 install tensorflow RUN pip3 install -U statsmodels +RUN pip3 install celery +RUN pip install redis +RUN service redis-server start + COPY ./config/timeout.conf /etc/nginx/conf.d/ +RUN chmod -R g=u /etc/passwd /app diff --git a/Timecop_models.db b/Timecop_models.db deleted file mode 100644 index 3c67c3c..0000000 Binary files a/Timecop_models.db and /dev/null differ diff --git a/app.py b/app.py new file mode 100644 index 0000000..bbe3633 --- /dev/null +++ b/app.py @@ -0,0 +1,435 @@ +from flask import request, Flask, jsonify, abort +from flask_cors import CORS +import json + +import engines.functions_timeseries as ft +import engines.BBDD as db +import os +from celery import Celery + + + +# import engines functions_timeseries +from engines.helpers import merge_two_dicts +from engines.var import anomaly_VAR, univariate_anomaly_VAR,univariate_forecast_VAR +from engines.holtwinter import anomaly_holt,forecast_holt +from engines.auto_arima import anomaly_AutoArima +from engines.lstm import anomaly_LSTM, anomaly_uni_LSTM + +from struct import * + + +app = Flask(__name__) +CORS(app) + + +app.config.from_pyfile(os.path.join(".", "config/app.cfg"), silent=False) + +db.init_database() + +DB_NAME= app.config.get("DB_NAME") +PORT = app.config.get("PORT") + +# Celery configuration +app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379/0' +app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379/0' + +# Initialize Celery +celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL']) +#broker=main.config['CELERY_BROKER_URL']) + +celery.conf.update(app.config) + + +@app.route('/univariate', methods=['POST']) +def univariate_engine(): + db.init_database() + + if not request.json: + abort(400) + + + timedata = request.get_json() + print (timedata) + lista=timedata['data'] + + num_fut = int(timedata.get('num_future', 5)) + desv_mae = int(timedata.get('desv_metric', 2)) + name = timedata.get('name', 'NA') + train = timedata.get('train', True) + restart = timedata.get('restart', False) + + print ("train?"+ str(train)) + print ("restart?" + str(restart)) + print ("Received TS") + + + if(name != 'NA'): + filename= './lst/'+name+'.lst' + try: + # with open(filename, 'r') as filehandle: + # previousList = json.load(filehandle) + previousList=db.get_ts(name).split(',') + previousList = list(map(int, previousList)) + except Exception: + previousList=[] + print ("previous list" ) + + if not restart : + print ("Lista append") + lista = previousList + lista + # with open(filename, 'w') as filehandle: + # json.dump(lista,filehandle) + str_lista= ",".join(str(v) for v in lista) + db.set_ts(name,str_lista) + + #desv_mse = 0 + print ("la lista al final es "+ str(type(lista))) + print (lista) + + salida = ft.model_univariate(lista,num_fut,desv_mae,train,name) + + return jsonify(salida), 201 + + +@app.route('/back_univariate', methods=['POST']) +def back_univariate_engine(): + db.init_database() + + if not request.json: + abort(400) + + timedata = request.get_json() + print (timedata) + lista=timedata['data'] + + num_fut = int(timedata.get('num_future', 5)) + desv_mae = int(timedata.get('desv_metric', 2)) + name = timedata.get('name', 'NA') + train = timedata.get('train', True) + restart = timedata.get('restart', False) + + print ("train?"+ str(train)) + print ("restart?" + str(restart)) + print ("Received TS") + + + if(name != 'NA'): + filename= './lst/'+name+'.lst' + try: + # with open(filename, 'r') as filehandle: + # previousList = json.load(filehandle) + previousList=db.get_ts(name).split(',') + previousList = list(map(int, previousList)) + except Exception: + previousList=[] + print ("previous list" ) + + if not restart : + print ("Lista append") + lista = previousList + lista + # with open(filename, 'w') as filehandle: + # json.dump(lista,filehandle) + str_lista= ",".join(str(v) for v in lista) + db.set_ts(name,str_lista) + + #desv_mse = 0 + print ("la lista al final es "+ str(type(lista))) + print (lista) + print (name ) + + print ("invoco el backend") + salida = back_model_univariate.s(lista_datos=lista,num_fut=num_fut,desv_mse=desv_mae,train=train,name=name).apply_async() + + print (salida.id) + + #task = long_task.apply_async() + valor = {'task_id': salida.id} + return jsonify(valor), 200 + #return jsonify(salida), 201 + +@app.route('/back_univariate_status/') +def univariate_taskstatus(task_id): + task = back_model_univariate.AsyncResult(task_id) + print ("llega aqui") + print (task) + + if task.state == 'PENDING': + response = { + 'state': task.state, + 'current': 0, + 'total': 1, + 'status': 'Pending...' + } + if task.state == 'PROGRESS': + response = { + 'state': task.state, + 'current': 0, + 'total': 1, + 'status': task.info.get('status', 'Running...') + } + if task.state == 'SUCCESS': + response = { + 'state': task.state, + 'current': 4, + 'total': 4, + 'result': task.info.get('result', ''), + 'status': task.info.get('status', 'Sucessfully'), + 'task_dump': str(task) + } + if 'result' in task.info: + print ("el result aparece en el SUCCESS") + response['result'] = task.info['result'] + else: + print ("el result NO aparece en el SUCCESS") + + + elif task.state != 'FAILURE': + response = { + 'state': task.state, + 'current': task.info.get('current', 0), + 'total': task.info.get('total', 1), + 'status': task.info.get('status', ''), + 'result': task.info.get('result', ''), + 'response': task.info + } + else: + + # something went wrong in the background job + response = { + 'state': task.state, + 'current': 1, + 'total': 1, + 'status': str(task.info), # this is the exception raised + 'result': task.info + } + print (task.state) + print(task.info) + return jsonify(response) + + + + +############################backen functions + + +@celery.task(bind=True) +def back_model_univariate(self, lista_datos,num_fut,desv_mse,train,name): + engines_output={} + debug = {} + + temp_info = {} + + self.update_state(state='PROGRESS', + meta={'running': 'LSTM', + 'status': '', + 'total': 4, + 'finish': 0 }) + if not train: + + (model_name,model,params)=db.get_best_model('winner_'+name) + # print ("recupero el motor " ) + winner= model_name + if winner == 'LSTM': + try: + engines_output['LSTM'] = anomaly_uni_LSTM(lista_datos,num_fut,desv_mse,train,name) + debug['LSTM'] = engines_output['LSTM']['debug'] + except Exception as e: + print(e) + print ('ERROR: exception executing LSTM univariate') + elif winner == 'VAR': + engines_output['VAR'] = univariate_forecast_VAR(lista_datos,num_fut,name) + debug['VAR'] = engines_output['VAR']['debug'] + elif winner == 'Holtwinters': + engines_output['Holtwinters'] = forecast_holt(lista_datos,num_fut,desv_mse,name) + debug['Holtwinters'] = engines_output['Holtwinters']['debug'] + else: + print ("Error") + + else: + + try: + engines_output['LSTM'] = anomaly_uni_LSTM(lista_datos,num_fut,desv_mse,train,name) + debug['LSTM'] = engines_output['LSTM']['debug'] + temp_info['LSTM']=engines_output['LSTM'] + self.update_state(state='PROGRESS', + meta={'running': 'anomaly_AutoArima', + 'status': temp_info, + 'total': 4, + 'finish': 1}) + except Exception as e: + print(e) + print ('ERROR: exception executing LSTM univariate') + + + try: + if (len(lista_datos) > 100): + #new_length= + lista_datos_ari=lista_datos[len(lista_datos)-100:] + engines_output['arima'] = anomaly_AutoArima(lista_datos_ari,num_fut,len(lista_datos),desv_mse) + debug['arima'] = engines_output['arima']['debug'] + temp_info['arima']=engines_output['arima'] + self.update_state(state='PROGRESS', + meta={'running': 'VAR', + 'status': temp_info, + 'total': 4, + 'finish': 2}) + except Exception as e: + print(e) + print ('ERROR: exception executing Autoarima') + + try: + if (train): + engines_output['VAR'] = univariate_anomaly_VAR(lista_datos,num_fut,name) + debug['VAR'] = engines_output['VAR']['debug'] + else: + engines_output['VAR'] = univariate_forecast_VAR(lista_datos,num_fut,name) + debug['VAR'] = engines_output['VAR']['debug'] + temp_info['VAR'] = engines_output['VAR'] + self.update_state(state='PROGRESS', + meta={'running': 'Holtwinters', + 'status': temp_info, + 'total': 4, + 'finish': 3}) + + except Exception as e: + print(e) + print ('ERROR: exception executing VAR') + + try: + if (train ): + engines_output['Holtwinters'] = anomaly_holt(lista_datos,num_fut,desv_mse,name) + debug['Holtwinters'] = engines_output['Holtwinters']['debug'] + else: + print ("entra en forecast") + engines_output['Holtwinters'] = forecast_holt(lista_datos,num_fut,desv_mse,name) + debug['Holtwinters'] = engines_output['Holtwinters']['debug'] + + temp_info['Holtwinters'] = engines_output['Holtwinters'] + self.update_state(state='PROGRESS', + meta={'running': 'Holtwinters', + 'status': temp_info, + 'total': 4, + 'finish': 4}) + + except Exception as e: + print(e) + print ('ERROR: exception executing Holtwinters') + + + best_mae=999999999 + winner='VAR' + print ('The size is: ') + print (len(engines_output)) + for key, value in engines_output.items(): + print (key + " " + str(value['mae'])) + + if value['mae'] < best_mae: + best_mae=value['mae'] + winner=key + print(winner) + + db.new_model('winner_'+name, winner, pack('N', 365),'',0) + + + print (winner) + + print ("el ganador es " + str(winner)) + print (engines_output[winner]) + temp= {} + temp['debug']=debug + +# return merge_two_dicts(engines_output[winner] , temp) + salida = merge_two_dicts(engines_output[winner], temp_info) + salida['winner'] = winner + salida_temp= {} + salida_temp['status'] = salida + salida_temp['current'] = 100 + salida_temp['total']=4 + salida_temp['finish'] =4 + salida_temp['result'] ='Task completed' + + return salida_temp + + + + + +@app.route('/multivariate', methods=['POST']) +def multivariate_engine(): + if not request.json: + abort(400) + + + timedata = request.get_json() + items = timedata['timeseries'] + name = timedata.get('name', 'NA') + list_var=[] + for item in items: + data = item['data'] + if(name != 'NA'): + sub_name = item['name'] + + filename= './lst/'+name + '_' + sub_name +'.lst' + try: + with open(filename, 'r') as filehandle: + previousList = json.load(filehandle) + except Exception: + previousList=[] + + lista = previousList + data + with open(filename, 'w') as filehandle: + json.dump(lista,filehandle) + + + list_var.append(data) + + + + lista = timedata['main'] + if(name != 'NA'): + filename= './lst/'+name+'.lst' + try: + with open(filename, 'r') as filehandle: + previousList = json.load(filehandle) + except Exception: + previousList=[] + + lista = previousList + lista + with open(filename, 'w') as filehandle: + json.dump(lista,filehandle) + + list_var.append(lista) + + num_fut = int(timedata.get('num_future', 5)) + desv_mae = int(timedata.get('desv_metric', 2)) + + + desv_mse = 0 + + salida = ft.model_multivariate(list_var,num_fut,desv_mae) + #print(salida) + return jsonify(salida), 201 + + +@app.route('/monitoring') +def monitoring(): + model_name = request.args.get('model_name', default = '%', type = str) + data_models= db.get_all_models(model_name) + return jsonify(data_models.to_dict(orient='record')),201 + + +@app.route('/monitoring_winners') +def monitoring_winners(): + model_name = request.args.get('model_name', default = '%', type = str) + data_models= db.get_winners(model_name) + return jsonify(data_models.to_dict(orient='record')),201 + + +@app.route('/') +def index(): + return "Timecop ready to play" + +if __name__ == '__main__': + db.init_database() + app.run(host = '0.0.0.0',port=PORT) diff --git a/engines/BBDD.py b/engines/BBDD.py index 963141a..c05f52e 100644 --- a/engines/BBDD.py +++ b/engines/BBDD.py @@ -8,6 +8,13 @@ from struct import * from sqlalchemy.sql import * import datetime +import pandas as pd + +from collections import defaultdict + +from sqlalchemy.inspection import inspect + + Base = declarative_base() @@ -113,3 +120,47 @@ def get_best_model(name): salida = session.query(Model).filter(Model.TS_name == name).filter(Model.TS_winner_name == winner_model_type.TS_winner_name).order_by(desc('TS_update')).first() return ( salida.TS_winner_name,salida.TS_model,salida.TS_model_params) + + +def query_to_dict(rset): + result = defaultdict(list) + for obj in rset: + instance = inspect(obj) + for key, x in instance.attrs.items(): + result[key].append(x.value) + return result + + +def get_all_models(name): + DB_NAME = 'sqlite:///Timecop_modelsv1.db' + engine = create_engine(DB_NAME) + + DBSession = sessionmaker(bind=engine) + session = DBSession() + + query = session.query(Model).filter(Model.TS_name.like(name)).all() + df = pd.DataFrame(query_to_dict(query)) + df.drop('TS_model',axis=1,inplace=True) + return (df[['TS_name', 'TS_winner_name','TS_update']]) + + + +def get_winners(name): + DB_NAME = 'sqlite:///Timecop_modelsv1.db' + engine = create_engine(DB_NAME) + + DBSession = sessionmaker(bind=engine) + session = DBSession() + + query = session.query(Model) + # for mt in query.all(): + # print (unpack('H',(mt.TS_model))) + # print (mt.TS_name) + # print (mt.TS_winner_name) + # print (mt.TS_update) + #filter(Note.message.like("%somestr%") + winner_model_type = session.query(Model).filter(Model.TS_name.like(name)).filter(Model.TS_name.like('winner%')).order_by(desc('TS_update')).all() + + df = pd.DataFrame(query_to_dict(winner_model_type)) + df.drop('TS_model',axis=1,inplace=True) + return (df[['TS_name', 'TS_winner_name','TS_update']]) diff --git a/engines/holtwinter.py b/engines/holtwinter.py index 9708b37..a9b2f9c 100644 --- a/engines/holtwinter.py +++ b/engines/holtwinter.py @@ -70,7 +70,7 @@ def anomaly_holt(lista_datos,num_fut,desv_mse=0,name='NA'): #list_trend=['add','mul','additive','multiplicative'] list_trend=['add'] for trend in list_trend: - for period in range(2,18): + for period in range(4,18): print ('Periodo', period) list_forecast_camb = [] tam_train = int(len(df)*0.7) diff --git a/engines/lstm.py b/engines/lstm.py index c22995c..4b0fabd 100644 --- a/engines/lstm.py +++ b/engines/lstm.py @@ -6,6 +6,7 @@ from keras.models import Sequential from keras.layers.recurrent import LSTM from keras.layers.core import Dense +from keras import backend as K import math #import helpers as h from keras.layers import Dropout @@ -18,6 +19,9 @@ from keras.models import Sequential from keras.layers.recurrent import LSTM from keras.layers.core import Dense + +import gc + import math from matplotlib import pyplot from numpy.random import seed @@ -57,26 +61,29 @@ def define_model(n_nodes, n_hlayers, dropout, input_data, output_shape): model.add(LSTM(output_dim =int(n_nodes), activation='relu', input_shape =(input_data.shape[1], input_data.shape[2]), return_sequences=False)) else: - model.add(LSTM(output_dim =int(n_nodes), activation='relu', input_shape =(input_data.shape[1], input_data.shape[2]), - return_sequences=True)) + #model.add(LSTM(output_dim =int(n_nodes), activation='relu', input_shape =(input_data.shape[1], input_data.shape[2]),return_sequences=True)) + model.add(LSTM(activation='relu', input_shape =(input_data.shape[1], input_data.shape[2]),return_sequences=True,units =int(n_nodes) )) model.add(Dropout(dropout)) #print(n_hlayers) for i in range(n_hlayers-1): #print(i) if i == n_hlayers-2: - add_hlayer(model, n_nodes, return_sequences=False) + #add_hlayer(model, n_nodes, return_sequences=False) + model.add(LSTM(n_nodes, return_sequences=False)) model.add(Dropout(dropout)) model.add(BatchNormalization()) else: - add_hlayer(model, n_nodes, return_sequences=True) + #add_hlayer(model, n_nodes, return_sequences=True) + model.add(LSTM(n_nodes, return_sequences=True)) model.add(Dropout(dropout)) model.add(BatchNormalization()) model.add(Dense(int(n_nodes/2), activation='relu')) model.add(Dropout(dropout)) - model.add(Dense(output_dim=int(output_shape))) + #model.add(Dense(output_dim=int(output_shape))) + model.add(Dense(units=int(output_shape))) model.compile(loss='mse', optimizer='adam', metrics=['accuracy']) return model @@ -162,71 +169,124 @@ def anomaly_uni_LSTM(lista_datos,num_forecast=10,desv_mse=2,train='True',name='t #n_nodes = [500] #n_dropout = [0.15] - models_dict = hyperparameter_opt(n_hlayers, n_nodes, n_dropout, win_train_x, num_forecast) + # models_dict = hyperparameter_opt(n_hlayers, n_nodes, n_dropout, win_train_x, num_forecast) + # + # for model in models_dict: + # print(model) + # print(models_dict[model].summary()) + # + # print ('Numero de modelos',len(models_dict)) + + + + +########################################################################################## +#############################################################################################3 + best_mae = 999999999 + best_model='' + for hlayer in n_hlayers: + for nodes in n_nodes: + for drop in n_dropout: + K.clear_session() + gc.collect() + model = define_model(nodes, hlayer, drop, win_train_x, num_forecast) + model_name = 'model_nlayers_{}_nnodes_{}_dropout_{}'.format(hlayer, nodes, drop) + model.fit(win_train_x, win_train_y, epochs=65, verbose=0, shuffle=False) + + #models_dict[name] = model + print(model_name) + yhat = model.predict(new_test_x) + yhat_test = yhat[:,0] + + temp_res= pd.DataFrame(yhat_test,columns=['values']) + temp_res = np.array(temp_res) + y_yhat_inv = scaler_x.inverse_transform(temp_res) + y_yhat_inv= y_yhat_inv[:,0] + + temp_x_test= pd.DataFrame(x_test,columns=['values']) + temp_x_test = np.array(temp_x_test) + x_test_inv = scaler_x.inverse_transform(temp_x_test) + + mse = (mean_squared_error(x_test_inv, y_yhat_inv)) + rmse = np.sqrt(mse) + mae = mean_absolute_error(x_test_inv, y_yhat_inv) + print ('mse', mse) + print ('rmse', rmse) + print ('mae', mae) + if mae < best_mae: + best_model=model + + + + - for model in models_dict: - print(model) - print(models_dict[model].summary()) - print ('Numero de modelos',len(models_dict)) #####getting best model - dict_eval_models = {} - dict_mse_models = {} - for model in models_dict: - # print 'fit model {}'.format(model) - try: - seed(69) - name_model = models_dict[model].fit(win_train_x, win_train_y, epochs=25, verbose=0, shuffle=False) - dict_eval_models[model] = name_model - except: - dict_eval_models[model] = 'Error' - - - print(model) - yhat = models_dict[model].predict(new_test_x) - yhat_test = yhat[:,0] - - temp_res= pd.DataFrame(yhat_test,columns=['values']) - temp_res = np.array(temp_res) - y_yhat_inv = scaler_x.inverse_transform(temp_res) - y_yhat_inv= y_yhat_inv[:,0] - - temp_x_test= pd.DataFrame(x_test,columns=['values']) - temp_x_test = np.array(temp_x_test) - x_test_inv = scaler_x.inverse_transform(temp_x_test) - - mse = (mean_squared_error(x_test_inv, y_yhat_inv)) - rmse = np.sqrt(mse) - mae = mean_absolute_error(x_test_inv, y_yhat_inv) - print ('mse', mse) - print ('rmse', rmse) - print ('mae', mae) - dict_mse_models[model] = mae - #if mae != min(dict_mse_models, key = dict_mse_models.get): - #del dict_mse_models[model] - - best_model = min(dict_mse_models, key = dict_mse_models.get) - - - print('best_model',best_model) - - models_dict[best_model].save('./models_temp/lstm.model'+name) + # #dict_eval_models = {} + # dict_mse_models = {} + # for model in models_dict: + # # print 'fit model {}'.format(model) + # try: + # seed(69) + # #name_model = models_dict[model].fit(win_train_x, win_train_y, epochs=25, verbose=0, shuffle=False) + # models_dict[model].fit(win_train_x, win_train_y, epochs=25, verbose=0, shuffle=False) + # #dict_eval_models[model] = name_model + # except: + # dict_eval_models[model] = 'Error' + # + # + # print(model) + # yhat = models_dict[model].predict(new_test_x) + # yhat_test = yhat[:,0] + # + # temp_res= pd.DataFrame(yhat_test,columns=['values']) + # temp_res = np.array(temp_res) + # y_yhat_inv = scaler_x.inverse_transform(temp_res) + # y_yhat_inv= y_yhat_inv[:,0] + # + # temp_x_test= pd.DataFrame(x_test,columns=['values']) + # temp_x_test = np.array(temp_x_test) + # x_test_inv = scaler_x.inverse_transform(temp_x_test) + # + # mse = (mean_squared_error(x_test_inv, y_yhat_inv)) + # rmse = np.sqrt(mse) + # mae = mean_absolute_error(x_test_inv, y_yhat_inv) + # print ('mse', mse) + # print ('rmse', rmse) + # print ('mae', mae) + # dict_mse_models[model] = mae + # # if mae != min(dict_mse_models, key = dict_mse_models.get): + # # del dict_mse_models[model] + # # del models_dict[model] + # + # best_model = min(dict_mse_models, key = dict_mse_models.get) + + + #print('best_model',best_model) + #K.clear_session() + # for model in models_dict: + # if model != best_model: + # del models_dict[model] + # print ("Model "+ model +" erased") + gc.collect() + + best_model.save('./models_temp/lstm.model'+name) print ("insertando modelo LSTM") with open('./models_temp/lstm.model'+name,'rb') as f: mymodel = f.read() - new_model(name, 'LSTM', bytearray(mymodel),'',dict_mse_models[best_model]) + new_model(name, 'LSTM', bytearray(mymodel),'',best_mae) f.close() - actual_model= models_dict[best_model] + actual_model= best_model else: print ("Adquiring best LSTM model") (model_name,mymodel,params)=get_best_model(name) - print("el modelo es") - print(model_name) - print (mymodel) + #print("el modelo es") + #print(model_name) + #print (mymodel) with open('./models_temp/lstm.model'+name, "wb") as newFile: newFile.write(mymodel) newFile.close() @@ -386,7 +446,11 @@ def anomaly_uni_LSTM(lista_datos,num_forecast=10,desv_mse=2,train='True',name='t testing_data['step']=testing_data.index engine_output['debug'] = testing_data.fillna(0).to_dict(orient='record') - + K.clear_session() + for model in models_dict: + del models_dict[model] + print ("Models erased") + gc.collect() return engine_output diff --git a/functions_timeseries.py b/functions_timeseries.py new file mode 100644 index 0000000..94f99a1 --- /dev/null +++ b/functions_timeseries.py @@ -0,0 +1,163 @@ +from engines.helpers import merge_two_dicts +from engines.var import anomaly_VAR, univariate_anomaly_VAR,univariate_forecast_VAR +from engines.holtwinter import anomaly_holt,forecast_holt +from engines.auto_arima import anomaly_AutoArima +from engines.lstm import anomaly_LSTM, anomaly_uni_LSTM +import traceback + +#from .server import app,celery +#from server import app +from server import celery + +from engines.BBDD import new_model, get_best_model + +from struct import * + + + + + + +@celery.task +def model_univariate(self,lista_datos,num_fut,desv_mse,train,name): + engines_output={} + debug = {} + + + if not train: + # filename = './models_temp/'+name + # with open(filename,'r') as f: + # winner = f.read() + # f.close() + + (model_name,model,params)=get_best_model('winner_'+name) + # print ("recupero el motor " ) + winner= model_name + if winner == 'LSTM': + try: + engines_output['LSTM'] = anomaly_uni_LSTM(lista_datos,num_fut,desv_mse,train,name) + debug['LSTM'] = engines_output['LSTM']['debug'] + except Exception as e: + print(e) + print ('ERROR: exception executing LSTM univariate') + elif winner == 'VAR': + engines_output['VAR'] = univariate_forecast_VAR(lista_datos,num_fut,name) + debug['VAR'] = engines_output['VAR']['debug'] + elif winner == 'Holtwinters': + engines_output['Holtwinters'] = forecast_holt(lista_datos,num_fut,desv_mse,name) + debug['Holtwinters'] = engines_output['Holtwinters']['debug'] + else: + print ("Error") + + else: + try: + engines_output['LSTM'] = anomaly_uni_LSTM(lista_datos,num_fut,desv_mse,train,name) + debug['LSTM'] = engines_output['LSTM']['debug'] + except Exception as e: + print(e) + print ('ERROR: exception executing LSTM univariate') + + #try: + #if (len(lista_datos) > 100): + ##new_length= + #lista_datos_ari=lista_datos[len(lista_datos)-100:] + #engines_output['arima'] = anomaly_AutoArima(lista_datos_ari,num_fut,len(lista_datos),desv_mse) + #debug['arima'] = engines_output['arima']['debug'] + #except Exception as e: + #print(e) + #print ('ERROR: exception executing Autoarima') + + try: + if (train): + engines_output['VAR'] = univariate_anomaly_VAR(lista_datos,num_fut,name) + debug['VAR'] = engines_output['VAR']['debug'] + else: + engines_output['VAR'] = univariate_forecast_VAR(lista_datos,num_fut,name) + debug['VAR'] = engines_output['VAR']['debug'] + except Exception as e: + print(e) + print ('ERROR: exception executing VAR') + + try: + if (train ): + engines_output['Holtwinters'] = anomaly_holt(lista_datos,num_fut,desv_mse,name) + debug['Holtwinters'] = engines_output['Holtwinters']['debug'] + else: + print ("entra en forecast") + engines_output['Holtwinters'] = forecast_holt(lista_datos,num_fut,desv_mse,name) + debug['Holtwinters'] = engines_output['Holtwinters']['debug'] + except Exception as e: + print(e) + print ('ERROR: exception executing Holtwinters') + + + best_mae=999999999 + winner='VAR' + print ('The size is: ') + print (len(engines_output)) + for key, value in engines_output.items(): + print (key + " " + str(value['mae'])) + + if value['mae'] < best_mae: + best_mae=value['mae'] + winner=key + print(winner) + + # filename = './models_temp/'+name + # with open(filename,'w') as f: + # f.write(winner) + # f.close() + new_model('winner_'+name, winner, pack('N', 365),'',0) + + + print (winner) + + print ("el ganador es " + str(winner)) + print (engines_output[winner]) + temp= {} + temp['debug']=debug + return merge_two_dicts(engines_output[winner] , temp) + + + +def model_multivariate(list_var,num_fut,desv_mse): + + + engines_output={} + debug = {} + + try: + engines_output['LSTM'] = anomaly_LSTM(list_var,num_fut,desv_mse) + debug['LSTM'] = engines_output['LSTM']['debug'] + print (engines_output['LSTM']) + except Exception as e: + print(e) + print ('ERROR: exception executing LSTM') + + try: + engines_output['VAR'] = anomaly_VAR(list_var,num_fut) + debug['VAR'] = engines_output['VAR']['debug'] + print (engines_output['VAR']) + except Exception as e: + print(Exception) + print("type error: " + str(e)) + print(traceback.format_exc()) + print ('ERROR: exception executing VAR') + + best_mae=999999999 + winner='LSTM' + print ('The size is ') + print (len(engines_output)) + print (debug) + for key, value in engines_output.items(): + print (key) + print(str(value['mae'])) + if value['mae'] < best_mae: + print (key + " " + str(value['mae']) + " best:" + str(best_mae) ) + best_mae=value['mae'] + winner=key + + print ("el ganador es " + winner) + temp= {} + temp['debug']=debug + return merge_two_dicts(engines_output[winner] , temp) diff --git a/main.py b/main.py deleted file mode 120000 index 48c45cb..0000000 --- a/main.py +++ /dev/null @@ -1 +0,0 @@ -server.py \ No newline at end of file diff --git a/prestart.sh b/prestart.sh new file mode 100644 index 0000000..cce814d --- /dev/null +++ b/prestart.sh @@ -0,0 +1,19 @@ +#! /usr/bin/env bash + + +echo "Initializing" +if ! whoami &> /dev/null; then + echo "User not configured" + if [ -w /etc/passwd ]; then + echo "Updating /etc/passwd" + echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd + fi +fi +echo "Running timecop" + + +service redis-server start +sleep 10; + + +cd /app; celery worker -A app.celery --concurrency=1 --loglevel=info & diff --git a/server.py b/server.py deleted file mode 100644 index 73f7705..0000000 --- a/server.py +++ /dev/null @@ -1,134 +0,0 @@ -from flask import request, Flask, jsonify, abort -from flask_cors import CORS -import json - -import engines.functions_timeseries as ft -import engines.BBDD as db -import os - - -app = Flask(__name__) -CORS(app) - - -app.config.from_pyfile(os.path.join(".", "config/app.cfg"), silent=False) - -db.init_database() - -DB_NAME= app.config.get("DB_NAME") -PORT = app.config.get("PORT") - -@app.route('/univariate', methods=['POST']) -def univariate_engine(): - db.init_database() - - if not request.json: - abort(400) - - - timedata = request.get_json() - print (timedata) - lista=timedata['data'] - - num_fut = int(timedata.get('num_future', 5)) - desv_mae = int(timedata.get('desv_metric', 2)) - name = timedata.get('name', 'NA') - train = timedata.get('train', True) - restart = timedata.get('restart', False) - - print ("train?"+ str(train)) - print ("restart?" + str(restart)) - print ("Received TS") - - - if(name != 'NA'): - filename= './lst/'+name+'.lst' - try: - # with open(filename, 'r') as filehandle: - # previousList = json.load(filehandle) - previousList=db.get_ts(name).split(',') - previousList = list(map(int, previousList)) - except Exception: - previousList=[] - print ("previous list" ) - - if not restart : - print ("Lista append") - lista = previousList + lista - # with open(filename, 'w') as filehandle: - # json.dump(lista,filehandle) - str_lista= ",".join(str(v) for v in lista) - db.set_ts(name,str_lista) - - #desv_mse = 0 - print ("la lista al final es "+ str(type(lista))) - print (lista) - - salida = ft.model_univariate(lista,num_fut,desv_mae,train,name) - - return jsonify(salida), 201 - - -@app.route('/multivariate', methods=['POST']) -def multivariate_engine(): - if not request.json: - abort(400) - - - timedata = request.get_json() - items = timedata['timeseries'] - name = timedata.get('name', 'NA') - list_var=[] - for item in items: - data = item['data'] - if(name != 'NA'): - sub_name = item['name'] - - filename= './lst/'+name + '_' + sub_name +'.lst' - try: - with open(filename, 'r') as filehandle: - previousList = json.load(filehandle) - except Exception: - previousList=[] - - lista = previousList + data - with open(filename, 'w') as filehandle: - json.dump(lista,filehandle) - - - list_var.append(data) - - - - lista = timedata['main'] - if(name != 'NA'): - filename= './lst/'+name+'.lst' - try: - with open(filename, 'r') as filehandle: - previousList = json.load(filehandle) - except Exception: - previousList=[] - - lista = previousList + lista - with open(filename, 'w') as filehandle: - json.dump(lista,filehandle) - - list_var.append(lista) - - num_fut = int(timedata.get('num_future', 5)) - desv_mae = int(timedata.get('desv_metric', 2)) - - - desv_mse = 0 - - salida = ft.model_multivariate(list_var,num_fut,desv_mae) - #print(salida) - return jsonify(salida), 201 - - -@app.route('/') -def index(): - return "Timecop ready to play" - -if __name__ == '__main__': - app.run(host = '0.0.0.0',port=PORT) diff --git a/static/index.html b/static/index.html index 6e349ba..f818542 100644 --- a/static/index.html +++ b/static/index.html @@ -1 +1 @@ -timecop
\ No newline at end of file +timecop
\ No newline at end of file diff --git a/static/static/github.svg b/static/static/github.svg new file mode 100644 index 0000000..18e9450 --- /dev/null +++ b/static/static/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/static/js/app.0245fe33db97b048ba4f.js b/static/static/js/app.0245fe33db97b048ba4f.js new file mode 100644 index 0000000..490bb0b --- /dev/null +++ b/static/static/js/app.0245fe33db97b048ba4f.js @@ -0,0 +1,2 @@ +webpackJsonp([1],{0:function(t,e){},"7zck":function(t,e){},"F/Vp":function(t,e){},NHnr:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("/5sW"),r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-app",{attrs:{dark:t.dark}},[a("v-content",[a("router-view",{on:{toggleTheme:function(e){t.dark=e}}})],1)],1)},staticRenderFns:[]};var s=a("VU/8")({name:"App",data:function(){return{dark:!1}}},r,!1,function(t){a("F/Vp")},null,null).exports,n=a("/ocq"),o=a("fZjL"),l=a.n(o),c=a("mvHQ"),d=a.n(c),h={name:"csvLoader",data:function(){return{selectHeaderDialog:{selectedHeaders:{},value:!1,data:{}},mainKey:null}},methods:{loadCSVFile:function(t){var e=this,a=t.target.files[0],i=new FileReader,r={};i.onload=function(t){for(var a=t.target.result.split("\n"),i=a[0].split(","),s=0;s1&&this.$emit("serie",!0)}},computed:{amountSelectedData:function(){return l()(this.selectHeaderDialog.selectedHeaders).length}}},u={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("v-btn",{attrs:{outline:"",color:"blue"},on:{click:function(e){t.$refs.csvFile.click()}}},[t._v("load csv")]),t._v(" "),a("input",{ref:"csvFile",attrs:{type:"file",hidden:"",accept:".csv, text/plain"},on:{change:t.loadCSVFile}}),t._v(" "),a("v-dialog",{attrs:{persistent:"","max-width":"500"},model:{value:t.selectHeaderDialog.value,callback:function(e){t.$set(t.selectHeaderDialog,"value",e)},expression:"selectHeaderDialog.value"}},[a("v-card",{attrs:{dark:""}},[a("v-card-title",[a("div",[a("h3",{staticClass:"headline"},[t._v("What column do you want to process?")]),t._v(" "),t.amountSelectedData>0?a("small",[t._v("data type: "+t._s(t.amountSelectedData>1?"Multivariate":"Univariate"))]):t._e()])]),t._v(" "),a("v-card-text",[a("v-list",t._l(t.selectHeaderDialog.data,function(e,i){return a("v-list-tile",{key:i,on:{click:function(a){!e||t.addToProcessList(e,i)}}},[i===t.mainKey?a("v-list-tile-action",[a("v-icon",{attrs:{color:"yellow"}},[t._v("star")])],1):t._e(),t._v(" "),a("v-list-tile-content",[a("v-list-tile-title",[t._v(t._s(i))]),t._v(" "),a("v-list-tile-sub-title",{staticClass:"blue--text text--lighten-2"},[t._v(t._s(e||"it is not a valid data, a number is needed"))])],1),t._v(" "),t.selectHeaderDialog.selectedHeaders[i]?a("v-list-tile-action",[a("v-icon",{attrs:{color:"green"}},[t._v("check_circle")])],1):t._e()],1)}))],1),t._v(" "),a("v-card-actions",[a("small",[a("v-icon",{attrs:{small:"",color:"yellow"}},[t._v("star")]),t._v(" data to forecast")],1),t._v(" "),a("v-spacer"),t._v(" "),a("v-btn",{attrs:{flat:""},on:{click:t.reset}},[t._v("cancel")]),t._v(" "),a("v-btn",{attrs:{disabled:0===t.amountSelectedData,flat:""},on:{click:t.dataFileToDataSet}},[t._v("process")])],1)],1)],1)],1)},staticRenderFns:[]},v={name:"Tform",components:{csvLoader:a("VU/8")(h,u,!1,null,null,null).exports},data:function(){return{url:"http://localhost:3000/back_univariate",dataToProcess:"",loading:!1,future:5,rules:{json:function(t){try{JSON.parse(t)}catch(t){return"Data is not a valid json"}return!0},url:function(t){return!!/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\\/]))?/.test(t)||"Url is not a valid"}},errorDialog:{value:!1,text:""},parametersDialog:{active:!1,data:[]},parametersList:[{title:"Name",subtitle:"Stores the list of points sent with that name and concatenates them to the existing ones before starting the prediction",value:"",type:"s",key:"name"},{title:"Future",subtitle:"Steps in the future that you want to predict",value:5,type:"n",key:"num_future"},{title:"Deviation metric",subtitle:"Anomaly sensitivity number",value:2,type:"n",key:"desv_metric"},{title:"Train",subtitle:"",value:!0,type:"boolean",key:"train"},{title:"Restart",subtitle:"",value:!0,type:"boolean",key:"restart"}],selectHeaderDialog:{selectedHeaders:{},value:!1,data:{}},multivariateData:{timeseries:[],main:[]},mainKey:null,state:"",info:{finish:"",running:"",total:"not yet"}}},methods:{formatData:function(){var t=this.parametersDialog.data,e={};t.length>0&&(1===t.length?e.data=t[0].data:(e.main=t[0].data,e.timeseries=[],t.map(function(t,a){a>1&&e.timeseries.push(t)})),this.parametersList.map(function(t){""!==t.value&&(e[t.key]=t.value)}),this.dataToProcess=d()(e),this.resetParametersDialog(),this.getUrlToken())},processCSV:function(t){this.parametersDialog.active=!0,this.parametersDialog.data=t},getUrlToken:function(){var t=this;this.loading=!0,this.$http.post(this.url,this.dataSet).then(function(e){var a=t.url+"_status/"+e.body.task_id,i=setInterval(function(){"SUCCESS"===t.state&&(t.loading=!1,clearInterval(i)),t.getUrl(a)},2e3)})},getUrl:function(t){var e=this;this.$http.get(t).then(function(t){console.log(t.body),e.state=t.body.state;var a=t.body.response;e.info.finish=a.finish,e.info.running=a.running,e.info.total=a.total,e.$emit("response",{dataToProcess:e.dataSet,result:t.body.status})}).catch(function(t){e.loading=!1,e.errorDialog.value=!0,e.errorDialog.text=t,console.log(t),e.state="SUCCESS"})},changeUrl:function(t){this.url=t?this.url.replace(/univariate/gi,"multivariate"):this.url.replace(/multivariate/gi,"univariate")},resetParametersDialog:function(){this.parametersDialog.active=!1,this.parametersDialog.data=[]}},computed:{dataSet:function(){return JSON.parse(this.dataToProcess)},amountSelectedData:function(){return l()(this.selectHeaderDialog.selectedHeaders).length}}},g={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-flex",{attrs:{xs12:""}},[a("v-card",[a("v-card-text",[a("v-flex",{attrs:{xs12:""}},[a("v-text-field",{attrs:{label:"Url",rules:[t.rules.url],outline:""},model:{value:t.url,callback:function(e){t.url=e},expression:"url"}})],1),t._v(" "),a("v-flex",{attrs:{xs12:""}},[a("v-textarea",{attrs:{hint:"Paste your data or load CSV file","persistent-hint":"",outline:"",label:"DatatSet",rules:[t.rules.json]},model:{value:t.dataToProcess,callback:function(e){t.dataToProcess=e},expression:"dataToProcess"}})],1)],1),t._v(" "),a("v-card-actions",[a("v-spacer"),t._v(" "),a("csv-loader",{on:{loaded:t.processCSV,serie:t.changeUrl}})],1)],1),t._v(" "),a("v-dialog",{attrs:{persistent:"",width:"550"},model:{value:t.parametersDialog.active,callback:function(e){t.$set(t.parametersDialog,"active",e)},expression:"parametersDialog.active"}},[a("v-card",[a("v-card-title",{staticClass:"headline"},[t._v("Parameters")]),t._v(" "),a("v-card-text",[a("v-list",{attrs:{"three-line":""}},t._l(t.parametersList,function(e){return a("v-list-tile",{key:e.key},[a("v-list-tile-content",[a("v-list-tile-title",[t._v(t._s(e.title))]),t._v(" "),a("v-list-tile-sub-title",[t._v(t._s(e.subtitle))])],1),t._v(" "),a("v-list-tile-action",["n"===e.type||"s"===e.type?a("v-text-field",{style:{width:"n"===e.type?"48px":"260px"},attrs:{"single-line":"","persistent-hint":"","full-width":"",outline:""},model:{value:e.value,callback:function(a){t.$set(e,"value",a)},expression:"item.value"}}):a("v-switch",{model:{value:e.value,callback:function(a){t.$set(e,"value",a)},expression:"item.value"}})],1)],1)}))],1),t._v(" "),a("v-card-actions",[a("v-spacer"),t._v(" "),a("v-btn",{attrs:{flat:""},on:{click:t.resetParametersDialog}},[t._v("cancel")]),t._v(" "),a("v-btn",{attrs:{flat:"",color:"green"},on:{click:t.formatData}},[t._v("submit")])],1)],1)],1),t._v(" "),t.loading?a("v-card",[a("v-card-text",[t._v("\n Processing... this may take a while\n "),a("v-progress-linear",{staticClass:"mb-0",attrs:{indeterminate:""}})],1),t._v(" "),t._l(t.info,function(e,i){return a("v-card-text",{key:i},[t._v("\n "+t._s(i)+": "),a("strong",[t._v(t._s(e))])])})],2):t._e(),t._v(" "),a("v-dialog",{attrs:{"hide-overlay":"",persistent:"",width:"500"},model:{value:t.errorDialog.value,callback:function(e){t.$set(t.errorDialog,"value",e)},expression:"errorDialog.value"}},[a("v-card",{attrs:{color:"red",dark:"","max-width":"500"}},[a("v-card-text",[a("pre",[t._v(t._s(t.errorDialog.text))])]),t._v(" "),a("v-card-actions",[a("v-spacer"),t._v(" "),a("v-btn",{attrs:{flat:""},on:{click:function(e){t.errorDialog.value=!1}}},[t._v("ok")])],1)],1)],1)],1)},staticRenderFns:[]},f=a("VU/8")(v,g,!1,null,null,null).exports,p=a("pFYg"),m=a.n(p),x={name:"jsonViewer",props:["json"],data:function(){return{items:[],hightLevel:0}},methods:{addItems:function(t,e,a){for(var i in t)this.items.splice(e,0,{name:i,type:m()(t[i]),data:t[i],level:a,open:!0});this.hightLevel=a},toggle:function(t,e,a,i){i?this.addItems(t,e,a):this.deleteItems(t,e,a)},deleteItems:function(t,e,a){this.hightLeve--;for(var i=this.items.filter(function(t){return t.level>=a}).length,r=l()(t).length,s=a!==this.hightLevel?i:r,n=0;n0)for(var e=t.offsetX-this.marginLeft,a=0;aa?t:a}return t},globalMin:function(){var t=1e11;for(var e in this.toGraph)if(this.toGraph[e].visible){var a=this.$utils.getMin(this.toGraph[e].data,"y");t=t0?a("g",{attrs:{transform:"translate("+t.marginLeft+", "+t.marginTop+")"}},[a("defs",[a("clipPath",{attrs:{id:"clip-rect"}},[a("rect",{attrs:{width:t.chartWidth,height:t.height,y:-this.marginTop}})])]),t._v(" "),a("g",{attrs:{"clip-path":"url(#clip-rect)"}},[t._l(t.toGraph,function(e,i){return e.visible?a("g",{key:i},[a("c-path",{attrs:{dasharray:e.debug?"5,5":"",transform:"translate("+-t.offsetX+", 0)",color:e.color,rangeX:[t.zoomMin,t.zoomMax],rangeY:[t.globalMin,t.globalMax],dataset:e.data,y:"y",x:"x",height:t.chartHeight,width:t.chartWidth}})],1):t._e()}),t._v(" "),t.markPos.pos>0?a("line",{attrs:{x1:t.markPos.pos,x2:t.markPos.pos,y2:t.chartHeight,"stroke-width":"2",stroke:"#0eff0e78",fill:"none"}}):t._e(),t._v(" "),t.markPos.pos>0?a("text",{attrs:{fill:"#0eff0e78","text-anchor":"middle",dy:"-5px",transform:"translate("+t.markPos.pos+" 0)"}},[t._v("\n "+t._s(t.markPos.val)+"\n ")]):t._e(),t._v(" "),t._l(t.anomalies,function(e,i){return a("circle",{key:i,attrs:{cx:e-t.offsetX,cy:t.chartHeight,r:"7",stroke:"white","stroke-width":"1",fill:"red"}})}),t._v(" "),a("c-axis-x",{attrs:{transform:"translate("+-t.offsetX+" "+t.chartHeight+")",range:[t.zoomMin,t.zoomMax],dataset:t.total,x:"x",ticks:25,fixed:1,height:t.chartHeight,width:t.chartWidth,strokeColor:this.$vuetify.dark?"white":"#6d6d6d"}})],2),t._v(" "),a("c-axis-y",{attrs:{transform:"translate("+(t.chartWidth-t.marginLeft-t.marginRight)+" 0)",range:[t.globalMin,t.globalMax],ticks:5,fixed:3,height:t.chartHeight,strokeColor:this.$vuetify.dark?"white":"#6d6d6d"}})],1):t._e(),t._v(" "),t.extendedArea.active?a("g",{attrs:{transform:"translate("+t.extendedArea.el.x+", "+t.extendedArea.el.y+")"}},[a("rect",{attrs:{fill:"#ffffff17",width:t.extendedArea.el.w,height:t.extendedArea.el.h},on:{mousemove:t.moveExtendedArea,mousedown:function(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return null;t.extendedArea.el.draggable=!0},mouseup:function(e){t.extendedArea.el.draggable=!1},mouseout:function(e){t.extendedArea.el.draggable=!1}}}),t._v(" "),a("circle",{attrs:{cx:t.extendedArea.el.w,cy:t.extendedArea.el.h/2,r:"15",stroke:"black",fill:"grey"},on:{mousemove:function(e){t.extendedArea.el.w+=e.movementX}}}),t._v(" "),a("circle",{attrs:{cx:t.extendedArea.el.w/2,cy:t.extendedArea.el.h,r:"15",stroke:"black",fill:"grey"},on:{mousemove:function(e){t.extendedArea.el.h+=e.movementY}}})]):t._e()]),t._v(" "),a("svg",{class:t.background,attrs:{viewBox:t.extendedArea.el.x+" "+t.extendedArea.el.y+" "+t.extendedArea.el.w+" "+t.extendedArea.el.h,width:"100%",height:"300",preserveAspectRatio:"xMidYMid slice"},domProps:{innerHTML:t._s(t.extendedArea.value)}})],1)},staticRenderFns:[]};var w={name:"homeView",components:{tForm:f,tJson:_,tGraph2d:a("VU/8")(b,k,!1,function(t){a("ghvX")},null,null).exports},data:function(){return{response:{},toggleDataVisibility:!0,dark:!0}},mounted:function(){this.$emit("toggleTheme",this.dark)},methods:{toggleData:function(){this.toggleDataVisibility=!0},showResponse:function(t){this.response={toPredict:t.dataToProcess,prediction:t.result}}}},D={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-container",{attrs:{fluid:"","grid-list-md":""}},[a("v-toolbar",{attrs:{dense:"",app:""}},[a("span",{staticClass:"mt-3"},[a("v-switch",{on:{change:function(e){t.$emit("toggleTheme",t.dark)}},model:{value:t.dark,callback:function(e){t.dark=e},expression:"dark"}})],1),t._v(" "),t.dark?a("img",{staticClass:"pa-1",attrs:{src:"static/img/logo_dark.svg",height:"70%",alt:"Time Cop"}}):a("img",{staticClass:"pa-1",attrs:{src:"static/img/logo.svg",height:"70%",alt:"Time Cop"}}),t._v(" "),a("v-spacer"),t._v(" "),a("v-btn",{attrs:{light:"",target:"new",href:"https://github.com/BBVA/timecop"}},[a("img",{staticClass:"mr-2",attrs:{src:"static/github.svg",height:"26px",alt:"github"}}),t._v(" "),a("span",[t._v("github")])]),t._v(" "),a("v-btn",{attrs:{flat:"",color:"blue"},on:{click:function(e){t.toggleDataVisibility=!t.toggleDataVisibility}}},[t._v("\n data\n "),t.toggleDataVisibility?a("v-icon",{attrs:{right:""}},[t._v("visibility")]):a("v-icon",{attrs:{right:""}},[t._v("visibility_off")])],1)],1),t._v(" "),a("v-layout",{attrs:{wrap:""}},[a("v-flex",{class:t.toggleDataVisibility?"xs8":"xs12"},[a("t-graph-2d",{attrs:{dataSet:t.response,toggleSize:t.toggleDataVisibility,height:350,"margin-left":5,background:t.dark?"grey darken-3":"grey lighten-3"}})],1),t._v(" "),a("v-flex",{directives:[{name:"show",rawName:"v-show",value:t.toggleDataVisibility,expression:"toggleDataVisibility"}],attrs:{xs4:""}},[a("t-form",{staticClass:"mb-4",on:{response:t.showResponse}}),t._v(" "),a("t-json",{attrs:{json:t.response.prediction}})],1)],1)],1)},staticRenderFns:[]};var S=a("VU/8")(w,D,!1,function(t){a("VyuB")},null,null).exports;i.default.use(n.a);var $=new n.a({routes:[{path:"/",name:"home",component:S}]}),A=a("3EgV"),C=a.n(A),H=a("8+8L"),M=a("wmFm");a("7zck");i.default.use(C.a),i.default.config.productionTip=!1,i.default.use(H.a),i.default.http.headers.common["content-type"]="application/json",i.default.use(M.a),new i.default({el:"#app",router:$,render:function(t){return t(s)}})},NvMd:function(t,e,a){"use strict";var i={name:"cAxisY",props:{range:{type:Array,required:!0},ticks:{type:Number},height:{type:Number,required:!0},label:{type:String},fixed:{type:Number},strokeColor:{type:String,default:"white"}},computed:{ticksList:function(){if(this.range&&this.range.length>0){var t=[],e=this.range[0],a=(this.range[1]-e)/(this.ticks-1),i=e;t.push(this.fixed?i.toFixed(this.fixed):i);for(var r=1;r0){for(var t=this.rangeY?this.rangeY[0]:this.$utils.getMin(this.dataset,this.y),e=this.rangeY?this.rangeY[1]:this.$utils.getMax(this.dataset,this.y),a=this.rangeX?this.rangeX[0]:this.$utils.getMin(this.dataset,this.x),i=this.rangeX?this.rangeX[1]:this.$utils.getMax(this.dataset,this.x),r=[],s=[],n=0;n0){for(var t=this.range?this.range[0]:this.$utils.getMin(this.dataset,this.x),e=this.range?this.range[1]:this.$utils.getMax(this.dataset,this.x),a=[],i=0;i0?a("line",{attrs:{x1:t.ticksList[0].position,x2:t.ticksList[t.ticksList.length-1].position}}):t._e(),t._v(" "),t._l(t.ticksList,function(e,i){return a("g",{key:"tick"+i,attrs:{transform:"translate("+e.position+", 0)"}},[a("line",{attrs:{y2:"6"}}),t._v(" "),a("text",{attrs:{"stroke-width":"0.1",y:"9",dy:"0.71em"}},[t._v(t._s(e.value))])])}),t._v(" "),a("text",{attrs:{x:t.ticksList[0].position,y:"-25",dx:"-0.71em",dy:"0.71em","stroke-width":"0.1"}},[t._v(t._s(t.label))])],2)},staticRenderFns:[]},s=a("VU/8")(i,r,!1,null,null,null);e.a=s.exports},o3Cr:function(t,e,a){"use strict";var i={name:"bars",props:{dataset:{type:Array,required:!0},column:{type:String,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0}},computed:{list:function(){for(var t=[],e=this.$utils.getMax(this.dataset,this.column),a=this.$utils.getMin(this.dataset,this.column),i=0;i\r\n\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/App.vue","\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/csvLoader.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('v-btn',{attrs:{\"outline\":\"\",\"color\":\"blue\"},on:{\"click\":function($event){_vm.$refs.csvFile.click()}}},[_vm._v(\"load csv\")]),_vm._v(\" \"),_c('input',{ref:\"csvFile\",attrs:{\"type\":\"file\",\"hidden\":\"\",\"accept\":\".csv, text/plain\"},on:{\"change\":_vm.loadCSVFile}}),_vm._v(\" \"),_c('v-dialog',{attrs:{\"persistent\":\"\",\"max-width\":\"500\"},model:{value:(_vm.selectHeaderDialog.value),callback:function ($$v) {_vm.$set(_vm.selectHeaderDialog, \"value\", $$v)},expression:\"selectHeaderDialog.value\"}},[_c('v-card',{attrs:{\"dark\":\"\"}},[_c('v-card-title',[_c('div',[_c('h3',{staticClass:\"headline\"},[_vm._v(\"What column do you want to process?\")]),_vm._v(\" \"),(_vm.amountSelectedData > 0)?_c('small',[_vm._v(\"data type: \"+_vm._s(_vm.amountSelectedData > 1 ? 'Multivariate' : 'Univariate'))]):_vm._e()])]),_vm._v(\" \"),_c('v-card-text',[_c('v-list',_vm._l((_vm.selectHeaderDialog.data),function(data,i){return _c('v-list-tile',{key:i,on:{\"click\":function($event){!data || _vm.addToProcessList(data, i)}}},[(i === _vm.mainKey)?_c('v-list-tile-action',[_c('v-icon',{attrs:{\"color\":\"yellow\"}},[_vm._v(\"star\")])],1):_vm._e(),_vm._v(\" \"),_c('v-list-tile-content',[_c('v-list-tile-title',[_vm._v(_vm._s(i))]),_vm._v(\" \"),_c('v-list-tile-sub-title',{staticClass:\"blue--text text--lighten-2\"},[_vm._v(_vm._s(data || 'it is not a valid data, a number is needed'))])],1),_vm._v(\" \"),(_vm.selectHeaderDialog.selectedHeaders[i])?_c('v-list-tile-action',[_c('v-icon',{attrs:{\"color\":\"green\"}},[_vm._v(\"check_circle\")])],1):_vm._e()],1)}))],1),_vm._v(\" \"),_c('v-card-actions',[_c('small',[_c('v-icon',{attrs:{\"small\":\"\",\"color\":\"yellow\"}},[_vm._v(\"star\")]),_vm._v(\" data to forecast\")],1),_vm._v(\" \"),_c('v-spacer'),_vm._v(\" \"),_c('v-btn',{attrs:{\"flat\":\"\"},on:{\"click\":_vm.reset}},[_vm._v(\"cancel\")]),_vm._v(\" \"),_c('v-btn',{attrs:{\"disabled\":_vm.amountSelectedData === 0,\"flat\":\"\"},on:{\"click\":_vm.dataFileToDataSet}},[_vm._v(\"process\")])],1)],1)],1)],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-18598eb5\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/csvLoader.vue\n// module id = null\n// module chunks = ","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/form.vue","var normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./csvLoader.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./csvLoader.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-18598eb5\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./csvLoader.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/csvLoader.vue\n// module id = null\n// module chunks = ","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-flex',{attrs:{\"xs12\":\"\"}},[_c('v-card',[_c('v-card-text',[_c('v-flex',{attrs:{\"xs12\":\"\"}},[_c('v-text-field',{attrs:{\"label\":\"Url\",\"rules\":[_vm.rules.url],\"outline\":\"\"},model:{value:(_vm.url),callback:function ($$v) {_vm.url=$$v},expression:\"url\"}})],1),_vm._v(\" \"),_c('v-flex',{attrs:{\"xs12\":\"\"}},[_c('v-textarea',{attrs:{\"hint\":\"Paste your data or load CSV file\",\"persistent-hint\":\"\",\"outline\":\"\",\"label\":\"DatatSet\",\"rules\":[_vm.rules.json]},model:{value:(_vm.dataToProcess),callback:function ($$v) {_vm.dataToProcess=$$v},expression:\"dataToProcess\"}})],1)],1),_vm._v(\" \"),_c('v-card-actions',[_c('v-spacer'),_vm._v(\" \"),_c('csv-loader',{on:{\"loaded\":_vm.processCSV,\"serie\":_vm.changeUrl}})],1)],1),_vm._v(\" \"),_c('v-dialog',{attrs:{\"persistent\":\"\",\"width\":\"550\"},model:{value:(_vm.parametersDialog.active),callback:function ($$v) {_vm.$set(_vm.parametersDialog, \"active\", $$v)},expression:\"parametersDialog.active\"}},[_c('v-card',[_c('v-card-title',{staticClass:\"headline\"},[_vm._v(\"Parameters\")]),_vm._v(\" \"),_c('v-card-text',[_c('v-list',{attrs:{\"three-line\":\"\"}},_vm._l((_vm.parametersList),function(item){return _c('v-list-tile',{key:item.key},[_c('v-list-tile-content',[_c('v-list-tile-title',[_vm._v(_vm._s(item.title))]),_vm._v(\" \"),_c('v-list-tile-sub-title',[_vm._v(_vm._s(item.subtitle))])],1),_vm._v(\" \"),_c('v-list-tile-action',[(item.type === 'n' || item.type === 's')?_c('v-text-field',{style:({width: item.type === 'n' ? '48px' : '260px'}),attrs:{\"single-line\":\"\",\"persistent-hint\":\"\",\"full-width\":\"\",\"outline\":\"\"},model:{value:(item.value),callback:function ($$v) {_vm.$set(item, \"value\", $$v)},expression:\"item.value\"}}):_c('v-switch',{model:{value:(item.value),callback:function ($$v) {_vm.$set(item, \"value\", $$v)},expression:\"item.value\"}})],1)],1)}))],1),_vm._v(\" \"),_c('v-card-actions',[_c('v-spacer'),_vm._v(\" \"),_c('v-btn',{attrs:{\"flat\":\"\"},on:{\"click\":_vm.resetParametersDialog}},[_vm._v(\"cancel\")]),_vm._v(\" \"),_c('v-btn',{attrs:{\"flat\":\"\",\"color\":\"green\"},on:{\"click\":_vm.formatData}},[_vm._v(\"submit\")])],1)],1)],1),_vm._v(\" \"),(_vm.loading)?_c('v-card',[_c('v-card-text',[_vm._v(\"\\n Processing... this may take a while\\n \"),_c('v-progress-linear',{staticClass:\"mb-0\",attrs:{\"indeterminate\":\"\"}})],1),_vm._v(\" \"),_vm._l((_vm.info),function(item,i){return _c('v-card-text',{key:i},[_vm._v(\"\\n \"+_vm._s(i)+\": \"),_c('strong',[_vm._v(_vm._s(item))])])})],2):_vm._e(),_vm._v(\" \"),_c('v-dialog',{attrs:{\"hide-overlay\":\"\",\"persistent\":\"\",\"width\":\"500\"},model:{value:(_vm.errorDialog.value),callback:function ($$v) {_vm.$set(_vm.errorDialog, \"value\", $$v)},expression:\"errorDialog.value\"}},[_c('v-card',{attrs:{\"color\":\"red\",\"dark\":\"\",\"max-width\":\"500\"}},[_c('v-card-text',[_c('pre',[_vm._v(_vm._s(_vm.errorDialog.text))])]),_vm._v(\" \"),_c('v-card-actions',[_c('v-spacer'),_vm._v(\" \"),_c('v-btn',{attrs:{\"flat\":\"\"},on:{\"click\":function($event){_vm.errorDialog.value = false}}},[_vm._v(\"ok\")])],1)],1)],1)],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-6e79d064\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/form.vue\n// module id = null\n// module chunks = ","var normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./form.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./form.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6e79d064\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./form.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/form.vue\n// module id = null\n// module chunks = ","\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/jsonViewer.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-flex',{attrs:{\"xs12\":\"\"}},_vm._l((_vm.items),function(item,i){return _c('div',{key:i,style:({'margin-left': item.level * 10 + 'px', cursor: item.type === 'object' && item.data.length !== 0 ? 'pointer' : 'auto'}),on:{\"click\":function($event){item.type !== 'object' || _vm.toggle(item.data, i + 1, item.level + 1, item.open), item.open = !item.open}}},[_c('span',{class:{'font-weight-bold': item.type === 'object' && item.data.length !== 0}},[_vm._v(_vm._s(item.name)+\":\")]),_vm._v(\" \"),_c('span',{class:_vm.getColor(item.type)},[_vm._v(_vm._s(item.type === 'object' && item.data.length !== 0 ? '{...}' : item.data))])])}))}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-d44f50fe\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/jsonViewer.vue\n// module id = null\n// module chunks = ","var normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./jsonViewer.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./jsonViewer.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-d44f50fe\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./jsonViewer.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/jsonViewer.vue\n// module id = null\n// module chunks = ","\r\n\r\n\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/graph.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-flex',{directives:[{name:\"resize\",rawName:\"v-resize\",value:(_vm.calculateSize),expression:\"calculateSize\"}],attrs:{\"xs12\":\"\"}},[_c('v-toolbar',{attrs:{\"dense\":\"\"}},[_c('v-toolbar-items',_vm._l((_vm.toGraph),function(g,i){return _c('v-btn',{key:'btn' + i,class:{'graph-inactive-btn': !g.visible},attrs:{\"color\":g.color,\"disabled\":_vm.extendedArea.active,\"flat\":\"\"},on:{\"click\":function($event){g.visible = !g.visible}}},[_vm._v(\"\\n \"+_vm._s(g.name)+\"\\n \"),(g.name === _vm.dataSet.prediction.engine)?_c('span',{staticClass:\"winner\"},[_vm._v(\"♕\")]):_vm._e()])})),_vm._v(\" \"),_c('v-spacer'),_vm._v(\" \"),_c('v-tooltip',{attrs:{\"bottom\":\"\"}},[_c('v-btn',{attrs:{\"slot\":\"activator\",\"disabled\":_vm.extendedArea.active,\"flat\":\"\",\"icon\":\"\"},on:{\"click\":_vm.randomizeColors},slot:\"activator\"},[_c('v-icon',[_vm._v(\"brush\")])],1),_vm._v(\" \"),_c('span',[_vm._v(\"Randomize Colors\")])],1),_vm._v(\" \"),_c('v-tooltip',{attrs:{\"bottom\":\"\"}},[_c('v-btn',{attrs:{\"slot\":\"activator\",\"disabled\":_vm.total.length === 0,\"flat\":\"\",\"icon\":\"\"},on:{\"click\":function($event){_vm.extendedArea.active = !_vm.extendedArea.active}},slot:\"activator\"},[_c('v-icon',[_vm._v(\"crop_free\")])],1),_vm._v(\" \"),_c('span',[_vm._v(\"extend area\")])],1)],1),_vm._v(\" \"),_c('svg',{ref:\"graph-container\",class:_vm.background,attrs:{\"width\":\"100%\",\"height\":_vm.height},on:{\"wheel\":function($event){$event.preventDefault();return _vm.zoom($event)},\"mousedown\":function($event){if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }_vm.panEnabled = true},\"mouseup\":function($event){_vm.panEnabled = false},\"mousemove\":_vm.pan}},[(_vm.total.length > 0)?_c('g',{attrs:{\"transform\":(\"translate(\" + _vm.marginLeft + \", \" + _vm.marginTop + \")\")}},[_c('defs',[_c('clipPath',{attrs:{\"id\":\"clip-rect\"}},[_c('rect',{attrs:{\"width\":_vm.chartWidth,\"height\":_vm.height,\"y\":-this.marginTop}})])]),_vm._v(\" \"),_c('g',{attrs:{\"clip-path\":\"url(#clip-rect)\"}},[_vm._l((_vm.toGraph),function(g,i){return (g.visible)?_c('g',{key:i},[_c('c-path',{attrs:{\"dasharray\":g.debug ? '5,5' : '',\"transform\":(\"translate(\" + (- _vm.offsetX) + \", 0)\"),\"color\":g.color,\"rangeX\":[_vm.zoomMin, _vm.zoomMax],\"rangeY\":[_vm.globalMin, _vm.globalMax],\"dataset\":g.data,\"y\":\"y\",\"x\":\"x\",\"height\":_vm.chartHeight,\"width\":_vm.chartWidth}})],1):_vm._e()}),_vm._v(\" \"),(_vm.markPos.pos > 0)?_c('line',{attrs:{\"x1\":_vm.markPos.pos,\"x2\":_vm.markPos.pos,\"y2\":_vm.chartHeight,\"stroke-width\":\"2\",\"stroke\":\"#0eff0e78\",\"fill\":\"none\"}}):_vm._e(),_vm._v(\" \"),(_vm.markPos.pos > 0)?_c('text',{attrs:{\"fill\":\"#0eff0e78\",\"text-anchor\":\"middle\",\"dy\":\"-5px\",\"transform\":(\"translate(\" + (_vm.markPos.pos) + \" 0)\")}},[_vm._v(\"\\n \"+_vm._s(_vm.markPos.val)+\"\\n \")]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.anomalies),function(line,i){return _c('circle',{key:i,attrs:{\"cx\":line - _vm.offsetX,\"cy\":_vm.chartHeight,\"r\":\"7\",\"stroke\":\"white\",\"stroke-width\":\"1\",\"fill\":\"red\"}})}),_vm._v(\" \"),_c('c-axis-x',{attrs:{\"transform\":(\"translate(\" + (-_vm.offsetX) + \" \" + _vm.chartHeight + \")\"),\"range\":[_vm.zoomMin, _vm.zoomMax],\"dataset\":_vm.total,\"x\":\"x\",\"ticks\":25,\"fixed\":1,\"height\":_vm.chartHeight,\"width\":_vm.chartWidth,\"strokeColor\":this.$vuetify.dark ? 'white' : '#6d6d6d'}})],2),_vm._v(\" \"),_c('c-axis-y',{attrs:{\"transform\":(\"translate(\" + (_vm.chartWidth - _vm.marginLeft - _vm.marginRight) + \" 0)\"),\"range\":[_vm.globalMin, _vm.globalMax],\"ticks\":5,\"fixed\":3,\"height\":_vm.chartHeight,\"strokeColor\":this.$vuetify.dark ? 'white' : '#6d6d6d'}})],1):_vm._e(),_vm._v(\" \"),(_vm.extendedArea.active)?_c('g',{attrs:{\"transform\":(\"translate(\" + (_vm.extendedArea.el.x) + \", \" + (_vm.extendedArea.el.y) + \")\")}},[_c('rect',{attrs:{\"fill\":\"#ffffff17\",\"width\":_vm.extendedArea.el.w,\"height\":_vm.extendedArea.el.h},on:{\"mousemove\":_vm.moveExtendedArea,\"mousedown\":function($event){if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }_vm.extendedArea.el.draggable = true},\"mouseup\":function($event){_vm.extendedArea.el.draggable = false},\"mouseout\":function($event){_vm.extendedArea.el.draggable = false}}}),_vm._v(\" \"),_c('circle',{attrs:{\"cx\":_vm.extendedArea.el.w,\"cy\":_vm.extendedArea.el.h / 2,\"r\":\"15\",\"stroke\":\"black\",\"fill\":\"grey\"},on:{\"mousemove\":function($event){_vm.extendedArea.el.w += $event.movementX}}}),_vm._v(\" \"),_c('circle',{attrs:{\"cx\":_vm.extendedArea.el.w / 2,\"cy\":_vm.extendedArea.el.h,\"r\":\"15\",\"stroke\":\"black\",\"fill\":\"grey\"},on:{\"mousemove\":function($event){_vm.extendedArea.el.h += $event.movementY}}})]):_vm._e()]),_vm._v(\" \"),_c('svg',{class:_vm.background,attrs:{\"viewBox\":((_vm.extendedArea.el.x) + \" \" + (_vm.extendedArea.el.y) + \" \" + (_vm.extendedArea.el.w) + \" \" + (_vm.extendedArea.el.h)),\"width\":\"100%\",\"height\":\"300\",\"preserveAspectRatio\":\"xMidYMid slice\"},domProps:{\"innerHTML\":_vm._s(_vm.extendedArea.value)}})],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-e5522066\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/graph.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-e5522066\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./graph.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./graph.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./graph.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-e5522066\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./graph.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/graph.vue\n// module id = null\n// module chunks = ","\r\n\r\n\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/view/homeView.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',{attrs:{\"fluid\":\"\",\"grid-list-md\":\"\"}},[_c('v-toolbar',{attrs:{\"dense\":\"\",\"app\":\"\"}},[_c('span',{staticClass:\"mt-3\"},[_c('v-switch',{on:{\"change\":function($event){_vm.$emit('toggleTheme', _vm.dark)}},model:{value:(_vm.dark),callback:function ($$v) {_vm.dark=$$v},expression:\"dark\"}})],1),_vm._v(\" \"),(!_vm.dark)?_c('img',{staticClass:\"pa-1\",attrs:{\"src\":\"static/img/logo.svg\",\"height\":\"70%\",\"alt\":\"Time Cop\"}}):_c('img',{staticClass:\"pa-1\",attrs:{\"src\":\"static/img/logo_dark.svg\",\"height\":\"70%\",\"alt\":\"Time Cop\"}}),_vm._v(\" \"),_c('v-spacer'),_vm._v(\" \"),_c('v-btn',{attrs:{\"light\":\"\",\"target\":\"new\",\"href\":\"https://github.com/BBVA/timecop\"}},[_c('img',{staticClass:\"mr-2\",attrs:{\"src\":\"static/github.svg\",\"height\":\"26px\",\"alt\":\"github\"}}),_vm._v(\" \"),_c('span',[_vm._v(\"github\")])]),_vm._v(\" \"),_c('v-btn',{attrs:{\"flat\":\"\",\"color\":\"blue\"},on:{\"click\":function($event){_vm.toggleDataVisibility = !_vm.toggleDataVisibility}}},[_vm._v(\"\\n data\\n \"),(_vm.toggleDataVisibility)?_c('v-icon',{attrs:{\"right\":\"\"}},[_vm._v(\"visibility\")]):_c('v-icon',{attrs:{\"right\":\"\"}},[_vm._v(\"visibility_off\")])],1)],1),_vm._v(\" \"),_c('v-layout',{attrs:{\"wrap\":\"\"}},[_c('v-flex',{class:_vm.toggleDataVisibility ? 'xs8' : 'xs12'},[_c('t-graph-2d',{attrs:{\"dataSet\":_vm.response,\"toggleSize\":_vm.toggleDataVisibility,\"height\":350,\"margin-left\":5,\"background\":_vm.dark ? 'grey darken-3': 'grey lighten-3'}})],1),_vm._v(\" \"),_c('v-flex',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.toggleDataVisibility),expression:\"toggleDataVisibility\"}],attrs:{\"xs4\":\"\"}},[_c('t-form',{staticClass:\"mb-4\",on:{\"response\":_vm.showResponse}}),_vm._v(\" \"),_c('t-json',{attrs:{\"json\":_vm.response.prediction}})],1)],1)],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-ffa54d7e\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/view/homeView.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-ffa54d7e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./homeView.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./homeView.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./homeView.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-ffa54d7e\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./homeView.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/view/homeView.vue\n// module id = null\n// module chunks = ","import Vue from 'vue'\r\nimport Router from 'vue-router'\r\nimport home from '@/view/homeView'\r\n\r\nVue.use(Router)\r\n\r\nexport default new Router({\r\n routes: [\r\n {\r\n path: '/',\r\n name: 'home',\r\n component: home\r\n }\r\n ]\r\n})\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/router/index.js","import Vue from 'vue'\r\nimport App from './App'\r\nimport router from './router'\r\nimport Vuetify from 'vuetify'\r\nimport VueResource from 'vue-resource'\r\n// import chartConstructor from './constructor/2d_graph'\r\nimport chart2dConstructor from 'vue-chart2d-constructor'\r\nimport 'vuetify/dist/vuetify.min.css'\r\n\r\nVue.use(Vuetify)\r\n\r\nVue.config.productionTip = false\r\nVue.use(VueResource)\r\nVue.http.headers.common['content-type'] = 'application/json'\r\nVue.use(chart2dConstructor)\r\n/* eslint-disable no-new */\r\nnew Vue({\r\n el: '#app',\r\n router,\r\n render: h => h(App)\r\n})\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/vue-chart2d-constructor/components/cAxis-y.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('g',{attrs:{\"text-anchor\":\"end\",\"fill\":_vm.strokeColor,\"stroke\":_vm.strokeColor,\"stroke-width\":\"1\"}},[_c('line',{attrs:{\"y1\":_vm.height}}),_vm._v(\" \"),_vm._l((_vm.ticksList),function(tick,i){return _c('g',{key:'tick' + i,attrs:{\"transform\":(\"translate(0, \" + (i * (_vm.height/(_vm.ticksList.length - 1))) + \")\")}},[_c('line',{attrs:{\"x2\":\"-6\"}}),_vm._v(\" \"),_c('text',{attrs:{\"stroke-width\":\"0.1\",\"x\":\"-9\",\"dy\":\"0.32em\"}},[_vm._v(_vm._s(tick))])])}),_vm._v(\" \"),_c('text',{attrs:{\"transform\":\"rotate(-90)\",\"y\":\"6\",\"dy\":\"0.71em\",\"stroke-width\":\"0.1\"}},[_vm._v(_vm._s(_vm.label))])],2)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-35c15ce6\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./node_modules/vue-chart2d-constructor/components/cAxis-y.vue\n// module id = null\n// module chunks = ","var normalizeComponent = require(\"!../../vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cAxis-y.vue\"\nimport __vue_script__ from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cAxis-y.vue\"\n/* template */\nimport __vue_template__ from \"!!../../vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-35c15ce6\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../vue-loader/lib/selector?type=template&index=0!./cAxis-y.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-chart2d-constructor/components/cAxis-y.vue\n// module id = null\n// module chunks = ","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/vue-chart2d-constructor/components/cPath.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('path',{attrs:{\"fill\":\"none\",\"stroke\":_vm.color,\"stroke-linejoin\":\"round\",\"stroke-linecap\":\"round\",\"stroke-width\":_vm.strokeWidth,\"stroke-dasharray\":_vm.dasharray,\"d\":_vm.points}})}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-58b941c4\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./node_modules/vue-chart2d-constructor/components/cPath.vue\n// module id = null\n// module chunks = ","var normalizeComponent = require(\"!../../vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cPath.vue\"\nimport __vue_script__ from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cPath.vue\"\n/* template */\nimport __vue_template__ from \"!!../../vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-58b941c4\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../vue-loader/lib/selector?type=template&index=0!./cPath.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-chart2d-constructor/components/cPath.vue\n// module id = null\n// module chunks = ","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/vue-chart2d-constructor/components/cAxis-x.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('g',{attrs:{\"text-anchor\":\"middle\",\"fill\":_vm.strokeColor,\"stroke\":_vm.strokeColor,\"stroke-width\":\"1\",\"transform\":(\"translate(0, \" + _vm.height + \")\")}},[(_vm.ticksList && _vm.ticksList.length > 0)?_c('line',{attrs:{\"x1\":_vm.ticksList[0].position,\"x2\":_vm.ticksList[_vm.ticksList.length - 1].position}}):_vm._e(),_vm._v(\" \"),_vm._l((_vm.ticksList),function(tick,i){return _c('g',{key:'tick' + i,attrs:{\"transform\":(\"translate(\" + (tick.position) + \", 0)\")}},[_c('line',{attrs:{\"y2\":\"6\"}}),_vm._v(\" \"),_c('text',{attrs:{\"stroke-width\":\"0.1\",\"y\":\"9\",\"dy\":\"0.71em\"}},[_vm._v(_vm._s(tick.value))])])}),_vm._v(\" \"),_c('text',{attrs:{\"x\":_vm.ticksList[0].position,\"y\":\"-25\",\"dx\":\"-0.71em\",\"dy\":\"0.71em\",\"stroke-width\":\"0.1\"}},[_vm._v(_vm._s(_vm.label))])],2)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-69a54ebe\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./node_modules/vue-chart2d-constructor/components/cAxis-x.vue\n// module id = null\n// module chunks = ","var normalizeComponent = require(\"!../../vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cAxis-x.vue\"\nimport __vue_script__ from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cAxis-x.vue\"\n/* template */\nimport __vue_template__ from \"!!../../vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-69a54ebe\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../vue-loader/lib/selector?type=template&index=0!./cAxis-x.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-chart2d-constructor/components/cAxis-x.vue\n// module id = null\n// module chunks = ","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/vue-chart2d-constructor/components/cBars.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('g',_vm._l((_vm.list),function(item,i){return _c('rect',{key:i,attrs:{\"x\":i * (_vm.width / _vm.list.length),\"y\":item.v,\"width\":30,\"height\":_vm.height - item.v,\"fill\":\"green\"}})}))}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-65db09f9\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./node_modules/vue-chart2d-constructor/components/cBars.vue\n// module id = null\n// module chunks = ","var normalizeComponent = require(\"!../../vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cBars.vue\"\nimport __vue_script__ from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cBars.vue\"\n/* template */\nimport __vue_template__ from \"!!../../vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-65db09f9\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../vue-loader/lib/selector?type=template&index=0!./cBars.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-chart2d-constructor/components/cBars.vue\n// module id = null\n// module chunks = ","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/vue-chart2d-constructor/components/cCircle.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('circle',{attrs:{\"cx\":_vm.x,\"cy\":_vm.y,\"r\":_vm.r,\"stroke\":_vm.strokeColor,\"stroke-width\":_vm.strokeWidth,\"fill\":_vm.color}})}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-10fc018e\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./node_modules/vue-chart2d-constructor/components/cCircle.vue\n// module id = null\n// module chunks = ","var normalizeComponent = require(\"!../../vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cCircle.vue\"\nimport __vue_script__ from \"!!babel-loader!../../vue-loader/lib/selector?type=script&index=0!./cCircle.vue\"\n/* template */\nimport __vue_template__ from \"!!../../vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-10fc018e\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../vue-loader/lib/selector?type=template&index=0!./cCircle.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-chart2d-constructor/components/cCircle.vue\n// module id = null\n// module chunks = "],"sourceRoot":""} \ No newline at end of file diff --git a/static/static/js/manifest.3ad1d5771e9b13dbdad2.js.map b/static/static/js/manifest.3ad1d5771e9b13dbdad2.js.map index 4468ba7..f5a4269 100644 --- a/static/static/js/manifest.3ad1d5771e9b13dbdad2.js.map +++ b/static/static/js/manifest.3ad1d5771e9b13dbdad2.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap c35f6bb453dcfce10b29"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c35f6bb453dcfce10b29"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 00948d12892eec254c59"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 00948d12892eec254c59"],"sourceRoot":""} \ No newline at end of file diff --git a/uwsgi.ini b/uwsgi.ini new file mode 100644 index 0000000..33db8ce --- /dev/null +++ b/uwsgi.ini @@ -0,0 +1,3 @@ +[uwsgi] +module = app +callable = app