ebi-gene-expression-group / atlas-heatmap

Heatmap visualizing bulk Expression Atlas data
8 stars 2 forks source link

Issue in loading resources in production #25

Open sankhlepawan opened 4 years ago

sankhlepawan commented 4 years ago

when I am running in my local system resources are being served but when running in production it is trying to load resources from https://www.ebi.ac.uk/static/media/homo_sapiens.male.4626c730.svg this path. this is returning 404 as resources are available on https://wwwdev.ebi.ac.uk/gxa/resources/js-bundles/4626c730027e5ff70254d23451537f9a.svg this path.

don't know how to change this resource path.

alfonsomunozpomer commented 4 years ago

From the path static/media I’m assuming that you’re setting output.publicPath in webpack.config.js for your target environment, right? The anatomogram component has an undocumented prop, atlasUrl, which is used to resolve static assets such as PNGs and SVGs.

I think the best option currently is to hard code a value for atlasUrl that matches your environment in https://github.com/ebi-gene-expression-group/atlas-heatmap/blob/master/src/manipulate/HeatmapWithControls.js#L257. Unfortunately the code quality of this heatmap is far from ideal, and we want to reimplement it at some point, but for the time being this should do.

Depending on your use case, you might want to have a look at a precompiled heatmap that it’s easier to integrate in any environment. Please have a look at the showcase page.

As an aside, and if you don’t mind my asking, what are you using the heatmap component for?

mirandaio commented 3 years ago

Looks like this issue is very similar to this one https://github.com/ebi-gene-expression-group/atlas-heatmap/issues/19

LucaFumis commented 3 years ago

Hi @alfonsomunozpomer I also had a quick play with the anatomogram and ran into the same problem (missing SVG) and your suggestion seem to work, in part.

Setting atlasUrl="" for the <Anatomogram> component did the trick, fetching the SVG correctly locally from http://localhost:3000/static/media/homo_sapiens.male.4626c730.svg (also works when deployed).

Trying the same approach for the ExpressionAtlasHeatmap component (expression-atlas-heatmap-highcharts) doesn't help as it fails to fetch /json/baseline_experiments.

It would also be great to have atlasUrl as a documented option - unfortunately I saw your suggestion only once I had gone through the code and picked up on it.

alfonsomunozpomer commented 3 years ago

Yes, we’re aware of all the limitations about the resource loading. Indeed the whole component needs some major maintenance but we’ve got limited capacity to do so, but we’re doing our best. I’ll try to address this issue during next week.