build-your-own-radar icon indicating copy to clipboard operation
build-your-own-radar copied to clipboard

BYOR had Displaying Radar from local csv. Now its not ?

Open arjunm183 opened this issue 6 years ago • 14 comments

Hello Team,

I had build your own radar with local csv file attached it and it displays data from csv file. Now i dont see the option. Attached is the screenshot having this feature. Kindly let me know how do i enable this feature? image

Reason having this feature is we dont have to upload our data in google sheets and expose it. We would like to have the data in the csv format.

Thanks and Regards, Arjun.M

arjunm183 avatar Jan 15 '18 07:01 arjunm183

Hi @arjunm183,

Currently, we support BYOR with hosted CSV files (Github, S3 etc). We do not allow the usage of a local CSV file as it wouldn't work well with the SaaS version of BYOR (hosted @ radar.thoughtworks.com).

Your screenshot seems to be from this pull request raised by @andy9876. We had received this pull request some time ago and couldn't accept it for the same reason.

Thanks, ThoughtWorks BYOR team.

SARAN-thala avatar Jan 15 '18 09:01 SARAN-thala

@SARAN-thala Can it be from any git solution ( Private git repo ) If so how do we achieve this with BYOR ?.

We have our centralized GIT Repository where we want to upload the csv file and fetch from BYOR.

arjunm183 avatar Jan 15 '18 09:01 arjunm183

@SARAN-thala any tips on how BYOR supports S3 hosted CSV files? Much like @arjunm183 I'd like something private and got the local CSV working a while back and now cannot see it. Thanks.

camcleod avatar Jan 19 '18 18:01 camcleod

@camcleod

Like we said to @arjunm183, the local CSV hosted fork is from this pull request. It was never merged with this repo.

@arjunm183 Have you hosted your own version of the BYOR?

Thanks, ThoughtWorks BYOR team.

mohamednajiullah avatar Jan 24 '18 10:01 mohamednajiullah

Hi @mohamednajiullah ,

Yes we had it. Since it is not merged we were not able to get the same option. Is there a way we can keep this csv files in a git repo and point out them .

Thanks and Regards, Arjun.M

arjunm183 avatar Jan 25 '18 02:01 arjunm183

Hi @arjunm183, I solved the problem using a docker image of apache httpd You can serve local files through a local apache web server but CORS needs to be enabled So I have made a httpd:2.4 with cors docker image : https://hub.docker.com/r/christophec/httpd_cors/ Just run docker run -dit --name local-apache-app -p 8090:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd_cors:latest just put the url to your file in the input field like http://localhost:8090/my_radar.csv

christ-off avatar Jan 25 '18 16:01 christ-off

I'm also struggling with the problem to load a local .csv file from my pc. I tried to implement a function like this:

form.append("input")
          .attr("type", "file")
          .attr("accept", ".csv")
          .style("margin", "4px")
          .on("change", function() {
            var file = d3.event.target.files[0];
            if (file) {
              var reader = new FileReader();
                reader.onloadend = function(evt) {
                  var dataUrl = evt.target.result;
                  var sheet = CSVDocument(dataUrl);
                  sheet.init().build();
              };
             reader.readAsDataURL(file);
            }
         })

The result is an XMLHttpRequest error: Protocol not supported. When I use reader.readAsText(file) it goes a step further but ends with Type Errors. I think this has something to do with d3.csv(url, createBlips); but at the moment I don't find the cause.

I know you guys won't support a local file option but maybe there is someone who can help me to find a working solution with local .csv files.

Gitsaibot avatar Jan 27 '18 18:01 Gitsaibot

@Christ-OFF I did a pull on your codes how does it work? Steps:

  1. docker run --rm -p 8080:80 -e SERVER_NAMES="localhost 127.0.0.1" wwwthoughtworks/build-your-own-radar
  2. docker run -dit --name local-apache-app -p 8090:80 -v ${pwd}:/usr/local/apache2/htdocs/ httpd_cors:latest
  3. http://localhost:8090/sample_radar.csv

It returns "Oops! It seems like there are some problems with loading your data. Document is missing one or more required headers or they are misspelled. Check that your document contains headers for "name", "ring", "quadrant", "isNew", "description". Please check FAQs for possible solutions."

dexteravelasco avatar Apr 30 '18 07:04 dexteravelasco

Dear @dexteravelasco Did you put your file sample_radar.csv in your local home directory ? -v ${pwd}:/usr/local/apache2/htdocs/ means map the working directory to usr/local/apache2/htdocs/ in the container apache (sorry if you're familiar with Docker) Just retested my docker image on a mac and it works Do a ls ${PWD} under MAc/Linux or dir ${PWD} under windows to check if your csv is there

christ-off avatar Apr 30 '18 11:04 christ-off

@SARAN-thala how to generate radar from CSV from github or s3? just use url from there instead of google spreadsheet one?

algra avatar Jul 27 '18 13:07 algra

@algra just use the URL with the filename and extension. For example, the sample GitHub gist URL
https://gist.githubusercontent.com/{username}/{random-number}/raw/{random-number}/data.csv

SARAN-thala avatar Aug 06 '18 16:08 SARAN-thala

BYOR is displaying PUB?OUTPUT=CSV as the title of the radar. But the title is actually "FAMC Technology Radar 08/15/2018" as it the title specified in the google doc. How can I fix this?

The File link is : https://radar.thoughtworks.com/?sheetId=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2Fe%2F2PACX-1vQwCcvTyUgC6quDHhExJqErbtb5URtZ6SGgLkkx6azHPg7zYhKxfnav2oGS_3uphblR1Wep1cOieZfX%2Fpub%3Foutput%3Dcsv

Michael

shawshank37027 avatar Aug 16 '18 15:08 shawshank37027

@SARAN-thala I tried to use the CSV sample data provided in README using GitHub gist URL. https://gist.githubusercontent.com/sgarap/32c02feeec4fc010a332ac7013559e38/raw/d1d0a1575bd47a0502fabe0c94909e99a8039571/test.csv

Also with surrounding quotes https://gist.githubusercontent.com/sgarap/34fc20a71004ecedb7d427c40cd964f5/raw/49faf2a713bb040b2f544472fa687b8bd6062196/test1.csv

No Quotes at all https://gist.githubusercontent.com/sgarap/6e33465958a2384a18cc668d6be4fcea/raw/059a793f9ddfa3390dfe46b9ff3274429e2acee4/testtwo.csv

In all cases, I ended up getting the following error. Can you point out what is wrong here?

Oops! It seems like there are some problems with loading your data. Document is missing one or more required headers or they are misspelled. Check that your document contains headers for "name", "ring", "quadrant", "isNew", "description". Please check FAQs for possible solutions.

Sindhura

sgarap avatar Sep 24 '18 11:09 sgarap

If you look in the console it says:

-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at 
https://gist.githubusercontent.com/sgarap/32c02feeec4fc010a332ac7013559e38
/raw/d1d0a1575bd47a0502fabe0c94909e99a8039571/test.csv. (Reason: CORS preflight channel did 
not succeed).[Learn More]

transducer avatar Oct 24 '18 14:10 transducer

@devansh-sharma-tw this should be able to be closed now

setchy avatar Apr 23 '23 09:04 setchy