-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support local file Data Sources #38
Comments
Update: upon further discussion while we would still benefit from a |
2017 UpdateThis is an older issue but it still holds that LocusZoom.js lacks an obvious approach to working with local files. However, it's not impossible: apiBase = window.location.origin + window.location.pathname.substr(0, window.location.pathname.length - "demo.html".length) + "staticdata/";
data_sources = new LocusZoom.DataSources()
.add("assoc", ["AssociationLZ", {url: apiBase + "assoc_10_114550452-115067678.json?", params: {analysis: 3, id_field: "variant"}}])
.add("ld", ["LDLZ", { url: apiBase + "ld_10_114550452-115067678.json?" }])
.add("gene", ["GeneLZ", { url: apiBase + "genes_10_114550452-115067678.json?" }])
.add("recomb", ["RecombLZ", { url: apiBase + "recomb_10_114550452-115067678.json?" }])
.add("constraint", ["GeneConstraintLZ", { url: apiBase + "constraint_10_114550452-115067678.json?" }]); As of v0.5.6 this approach is demonstrated in index.html using local files. While this is demonstrated in the repo currently it's not clear that it's there. This issue is resolved when this is documented in the README in the repo as well as on the wiki. |
Update: README and Wiki updated, repo example tuned up. Good enough for now! |
The Problem
Presently LocusZoom does not support creating a data source that maps to a local file. This is a likely use case for the plugin on a longer time scale.
It's unclear exactly how to approach this problem without having some example files to work with. The HTML5 File API will likely play a part.
Opportunities
In scope for this feature we may want to consider generating a few small "example" data files that live in the repository. These would be very useful for building automated tests against local file data sources logic (see #36, related).
From there we could also strike the current data sources from the demo and define a proper
DefaultDataSources
object (in keeping with the pattern ofDefaultLayout
andDefaultState
). In this way the "hello world" for the LocusZoom plugin could literally be a one-liner (that is, one line of JavaScript logic to callpopulate
and the HTML to include the scripts and create an empty div).The text was updated successfully, but these errors were encountered: