mediacloud / web-tools

The shared repository for Media Cloud web apps (Explorer, Source Manager, Topic Mapper)
https://tools.mediacloud.org
Apache License 2.0
64 stars 30 forks source link

switch JS link maps to pull directly from S3 #1774

Closed rahulbot closed 4 years ago

rahulbot commented 4 years ago

Right now we serve the topic link maps via a proxy in server/topic/maps.py. This is unnecessary. We should have the JS code source the maps for the user directly from the url that the list results now include. This will require changing DownloadMapFiles to link directly the url for download.

rahulbot commented 4 years ago

Split off from Python solution in #1771 because I think we can do this later.

dsjen commented 4 years ago

@cindyloo / @rahulbot -- I'm looking into this. I don't see anything when I click through on the view link for any of the gexf format visualizations. It takes me to a page called "Link Map" and there appears to be a large canvas with nothing rendered. What should I expect to see? If this is indeed a problem, I'm happy to carve this off into an issue.

dsjen commented 4 years ago

Also, how important is it to be able to download the SVG? I'm not finding ways of forcing the svg to be downloaded. If we removed the download link, users would have to save the svg by either:

rahulbot commented 4 years ago

This code is only on localhost/.master, or the topics-dev server.

The revenant code is now in server/views/topics/files.py.

A good topic to check this on is the big coronavirus one: http://localhost:5000/#/topics/3837/summary?focusId&snapshotId=5131&timespanId=984117 Click the Export tab, then click "view" next to the first media link map. You'll see an SVG rendered in the browser from a localhost address. That is the proxy hitting S3 behind that we want to remove. We want that link to just be directly to the file on S3. The S3 URL is already in JS. This is written this way for now because it used to make sense with an older version of the API. Now it makes sense to just direct them to the S3.

I decided to display it in-browser rather than downloading via this proxy because honestly browsers are the best SVG renderers I found - rendering is fast, pan/zoom work great.

dsjen commented 4 years ago

Yes, I had actually found that code already and was intending to remove the method entirely. Sound good?

My two questions are:

Thanks!

rahulbot commented 4 years ago

Ah, ok, sorry.

hroberts commented 4 years ago

I agree with removing gexf rendering. the point is just to allow folks to fiddle with the map in gephi.

-hal

On Thu, May 21, 2020 at 6:11 PM rahulbot notifications@github.com wrote:

Ah, ok, sorry.

  • Yes, removing that sounds right.
  • Gexf viewing used to work, but honestly if the SVG is viewable quickly then why offer views f the Gexf, which is the same network map. The point fo that is to allow for downloading to edit in Gephi. I say just remove the Gexf display code and libraries. Originally we didn't have SVG support so that Gexf view made more sense.Thoughts?
  • Removing SVG download link seems right.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mitmedialab_MediaCloud-2DWeb-2DTools_issues_1774-23issuecomment-2D632391188&d=DwMCaQ&c=WO-RGvefibhHBZq3fL85hQ&r=0c5FW2CrwCh84ocLICzUHjcwKK-QMUDy4RRw_n18mMo&m=haUUx8VOXLBfr1c2HR4I2EmOWNvf_fHbvtLIksqGkuk&s=qJTZtXIT0eTjvBJcOL1vHSsBWDo2kZkojlGWr6Q37vU&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAN66TZNJJFBPGJ5DN4KTC3RSWYINANCNFSM4LUKNOUQ&d=DwMCaQ&c=WO-RGvefibhHBZq3fL85hQ&r=0c5FW2CrwCh84ocLICzUHjcwKK-QMUDy4RRw_n18mMo&m=haUUx8VOXLBfr1c2HR4I2EmOWNvf_fHbvtLIksqGkuk&s=1khLyhAScZC4VSauaU2MeIitXtRfHK0dBnmkGgXtY5g&e= .

dsjen commented 4 years ago

Ah, I see! Is there a way to see how often the Gexf views have been viewed/downloaded? That might give us a sense of whether we can remove too.

dsjen commented 4 years ago

Also, I'm excited for an amazing deletion PR.

rahulbot commented 4 years ago

Nah - we have poor Google Analytics integration that we don't check often at all. It isn't getting the hashed URLs at all and we haven't got around to fixing that :-( Probably worth queuing up an issue to track and fix that.

Relatedly, I think we should move off of Google (#1142).

hroberts commented 4 years ago

we definitely need the gexf map downloads available. we actively use them for the election project.

-hal

On Thu, May 21, 2020 at 6:18 PM Dennis Jen notifications@github.com wrote:

Ah, I see! Is there a way to see how often the Gexf views have been viewed/downloaded? That might give us a sense of whether we can remove too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mitmedialab_MediaCloud-2DWeb-2DTools_issues_1774-23issuecomment-2D632393259&d=DwMCaQ&c=WO-RGvefibhHBZq3fL85hQ&r=0c5FW2CrwCh84ocLICzUHjcwKK-QMUDy4RRw_n18mMo&m=WGHq-5AiMRH6L2tb1RuCHSuUusnle_r4nTgtyb9xz8o&s=98UCuxpE2E67geJW_COKU6LhswjnTG-1z5mTmDZZ66o&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAN66T6HDLMEAVQ6NEMJKXDRSWZDPANCNFSM4LUKNOUQ&d=DwMCaQ&c=WO-RGvefibhHBZq3fL85hQ&r=0c5FW2CrwCh84ocLICzUHjcwKK-QMUDy4RRw_n18mMo&m=WGHq-5AiMRH6L2tb1RuCHSuUusnle_r4nTgtyb9xz8o&s=OCc8nguikGXtNOBAkFIEqGpcAKKR2MI4dOSfq6hSpgI&e= .

dsjen commented 4 years ago

@rahulbot -- I see, thanks!

@hroberts -- gotcha on keeping the downloads.

Here's my plan of attack then: