question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uploading csv to backend to process and display results

See original GitHub issue

I would like to know how can i upload a csv file through stipple to the backend for processing? Currently, I am working with the example provided by @essenciary which can display a random dataframe to the frontend. However, I want client users to upload their own csv file.

Example Script:

using Genie, Stipple
using StippleUI
using DataFrames

dt = DataFrame(rand(10,2), ["x1", "x2"])
dt_opts = DataTableOptions(columns = [Column("x1"), Column("x2", align = :right)])
# WEB_TRANSPORT = Genie.WebThreads #for AJAX/HTTP

@reactive mutable struct APP <: ReactiveModel
  data::R{DataTable} = DataTable()
  data_pagination::DataTablePagination = DataTablePagination(rows_per_page=50)       
end

function handlers(model)

  on(model.isready) do isready
    isready || return 

    model.data[] = DataTable(dt, dt_opts)
  end

  model
end

function ui(model::APP)
  page(model, 
  [
      heading("Dashboard") 
      
      row([
          cell(class="st-module", [
              h4("Dataset")
              # add your table logic here: 
              table(:data;
              pagination=:data_pagination, 
              style="height: 350px;"
              #dense=true, flat=true, 
              )
          ])
      ])
  ])
end

route("/") do
  APP |> init |> handlers |> ui |> html
end
up(9000)

Thanks would highly appreciate the help! Look forward to the suggestions.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
hhaenselcommented, Jan 17, 2022

In this discussion you can find an example of uploading a file.

2reactions
montyvesselinovcommented, May 15, 2022

It will be great if there is an example demonstrating how you can upload and process a CSV file.

For example, it will be nice to show you can upload a custom CSV file to perform k-means clustering using the example https://github.com/GenieFramework/StippleDemos/tree/master/IrisClustering but uploading . The CSV file should be uploaded using for example https://github.com/GenieFramework/StippleDemos/tree/master/BasicExamples/CsvUpload

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node Express Endpoint to Upload and Process CSV File
In this post, we will upload a CSV file, store it temporarily in the server directory to fetch all rows in JSON form,...
Read more >
Importing and Working with CSV Files in SQL Server
Step 1: Selecting the database · Step 2: Select the file to import · Step 3: Preview the data · Step 4: Modify...
Read more >
How to import CSV data into Backendless and inspect the ...
This video demonstrates how to import CSV data into the Backendless database.The import file can be downloaded ...
Read more >
Node.js: Upload CSV file data to Database
In this tutorial, I will show you how to upload/import CSV file data into MySQL Database using Node. js Express & fast-csv.
Read more >
5 Ways to Convert CSV Files to Databases Quickly
ConvertCSV gives you options to paste the data in, upload a file locally, or input a URL where the CSV data is located....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found