diff --git a/app/javascript/controllers/plotly_actos_controller.js b/app/javascript/controllers/plotly_actos_controller.js index 30bbf811..7f9bb584 100644 --- a/app/javascript/controllers/plotly_actos_controller.js +++ b/app/javascript/controllers/plotly_actos_controller.js @@ -254,8 +254,7 @@ export default class extends Controller { plotly_serietiempo_actos() { const self = this; - const ruta_relativa = window.location.pathname.split("/")[1] - Plotly.d3.csv("/" + ruta_relativa + "/" + ruta_relativa + "/csv/actos_individuales.csv", function(err, datos) { + Plotly.d3.csv("../assets/csv/actos_individuales.csv", function(err, datos) { if (err) { console.error("Error al cargar el archivo CSV:", err); } else { diff --git a/test/dummy/app/javascript/application.js b/test/dummy/app/javascript/application.js index e89962e7..e73a3e7a 100644 --- a/test/dummy/app/javascript/application.js +++ b/test/dummy/app/javascript/application.js @@ -27,6 +27,7 @@ Heb412Gen__Motor.iniciar() import Sivel2Gen__Motor from "./controllers/sivel2_gen/motor" window.Sivel2Gen__Motor = Sivel2Gen__Motor Sivel2Gen__Motor.iniciar() +import PlotlyActosController from "./controllers/sivel2_gen/plotly_actos_controller" import TomSelect from 'tom-select'; @@ -89,6 +90,10 @@ promesaRecursosSprocketsYDocumento.then((mensaje) => { p2ult = p[p.length - 2] + "/" + p[p.length - 1] } + if (p2ult == 'graficar/actos_individuales') { + const plotlycontroller = new PlotlyActosController() + plotlycontroller.plotly_serietiempo_actos(); + } })