Skip to content

Commit

Permalink
use png handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalc committed Feb 25, 2025
1 parent f54d14b commit 87b7ea0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/js/Pages/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default function Dashboard({ modelname }) {
setOutputFilename(csv_filename);
const file_response = await axios.get('/output-file-json/'+csv_filename);
let shap_filename = csv_filename.replace("inference_output.csv", "shap_chart.png");
const shap_response = await axios.get('/output-file-bytes/'+shap_filename);
const shap_response = await axios.get('/output-file-png/'+shap_filename);
// For the csv data used for histogram, store output as json instead of bytes.
const x = 4;
console.log('file_response', file_response);
Expand Down Expand Up @@ -220,7 +220,7 @@ export default function Dashboard({ modelname }) {
// Store file as json.
setData(JSON.stringify(res.data));
let shap_filename = csv_filename.replace("inference_output.csv", "shap_chart.png");
return axios.get('/output-file-bytes/'+shap_filename).then(res1 => {
return axios.get('/output-file-png/'+shap_filename).then(res1 => {
bytesToBase64(res1.data).then(blob => {
setShapImgBlob(blob);
});
Expand Down
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function () {
// Since the filename may contain forward slashes, we have to explicitly use regex so Laravel can recognize this route.
Route::middleware('auth')->get('/output-file-bytes/{filename}', [ApiController::class, 'fileBytes'])->where('filename','.*');
Route::middleware('auth')->get('/output-file-json/{filename}', [ApiController::class, 'fileJson'])->where('filename','.*');
Route::middleware('auth')->get('/output-file-png/{filename}', [ApiController::class, 'filePng'])->where('filename','.*');

Route::middleware('auth')->get('/model/{model_name}', [ApiController::class, 'modelRuns']);
// Data dictionary does not require logging in to view.
Expand Down

0 comments on commit 87b7ea0

Please sign in to comment.