Skip to content

Commit

Permalink
Merge pull request #444 from broadinstitute/dk-egls-bug-fix
Browse files Browse the repository at this point in the history
DK egls bug fix
  • Loading branch information
dkjang authored Dec 5, 2022
2 parents cd26c57 + 8652fe6 commit 0fd5b97
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/views/EglMethod/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ new Vue({
appendCss(DATASET) {
let file = document.createElement('link');
file.rel = 'stylesheet';
file.href = 'https://kp4cd.org/sites/default/files/vueportal/egl_data/' + DATASET + '/' + DATASET + '.css'
file.href = 'https://hugeampkpncms.org/sites/default/files/users/user1/egl_data/' + DATASET + '/' + DATASET + '.css'
document.head.appendChild(file)
},
tableTop() {
Expand Down
40 changes: 32 additions & 8 deletions src/views/EglMethod/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Vuex from "vuex";
import bioPortal from "@/modules/bioPortal";
import kp4cd from "@/modules/kp4cd";
import effectorGenes from "@/modules/effectorGenes";
import hugeampkpncms from "@/modules/hugeampkpncms";

import { BootstrapVue, IconsPlugin } from "bootstrap-vue";

Expand All @@ -19,7 +20,8 @@ export default new Vuex.Store({
modules: {
bioPortal,
kp4cd,
effectorGenes
effectorGenes,
hugeampkpncms
},
state: {
geneName: "",
Expand Down Expand Up @@ -58,25 +60,47 @@ export default new Vuex.Store({
context.commit("setGene", gene);
},
async fetchConfig(context, config) {
let json = await fetch(
/*
let fetchUrl = (param.domain == "hugeampkpn") ? "https://hugeampkpncms.org/servedata/dataset?dataset=" + param.dataPoint : param.dataPoint;
let csv = await fetch(fetchUrl).then(resp => resp.text(fetchUrl));
*/
/*let json = await fetch(
`https://kp4cd.org/egldata/config?dataset=${config.dataset}`
).then(resp => resp.json());*/

//let configUrl = 'https://hugeampkpncms.org/sites/default/files/users/user1/egl_data/'+config.dataset+

let json = await fetch(
`https://hugeampkpncms.org/servedata/dataset?dataset=https://hugeampkpncms.org/sites/default/files/users/user1/egl_data/${config.dataset}/${config.dataset}_config.json`
).then(resp => resp.json());
context.commit("setConfig", json);



let parsedJson = JSON.parse(json)

context.commit("setConfig", parsedJson);
context.commit("setPageTitle", {
config: json,
config: parsedJson,
dataset: config.dataset
});
context.commit("setPlotsConfig", {
config: json,
config: parsedJson,
dataset: config.dataset
});
},
async fetchData(context, dataset) {
let json = await fetch(

/*let json = await fetch(
`https://kp4cd.org/egldata/dataset?dataset=${dataset.dataset}&trait=${dataset.trait}`
).then(resp => resp.json());*/
let json = await fetch(
`https://hugeampkpncms.org/servedata/dataset?dataset=https://hugeampkpncms.org/sites/default/files/users/user1/egl_data/${dataset.dataset}/${dataset.dataset}_${dataset.trait}.json`
).then(resp => resp.json());
context.commit("setTableData", json.data);
context.commit("setFilteredData", json.data);

let parsedJson = JSON.parse(json)

context.commit("setTableData", parsedJson.data);
context.commit("setFilteredData", parsedJson.data);
},
filteredData(context, filtered) {
context.commit("setFilteredData", filtered);
Expand Down
2 changes: 1 addition & 1 deletion src/views/Papers/PaperData/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ new Vue({
appendCss(DATASET) {
let file = document.createElement('link');
file.rel = 'stylesheet';
file.href = 'https://kp4cd.org/sites/default/files/vueportal/egl_data/' + DATASET + '/' + DATASET + '.css'
file.href = 'https://hugeampkpncms.org/sites/default/files/users/user1/egl_data/' + DATASET + '/' + DATASET + '.css'
document.head.appendChild(file)
}
},
Expand Down
29 changes: 22 additions & 7 deletions src/views/Papers/PaperData/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,40 @@ export default new Vuex.Store({
context.commit("setGene", gene);
},
async fetchConfig(context, config) {
let json = await fetch(
/*let json = await fetch(
`https://kp4cd.org/egldata/config?dataset=${config.dataset}`
).then(resp => resp.json());*/

let json = await fetch(
`https://hugeampkpncms.org/servedata/dataset?dataset=https://hugeampkpncms.org/sites/default/files/users/user1/egl_data/${config.dataset}/${config.dataset}_config.json`
).then(resp => resp.json());
context.commit("setConfig", json);

let parsedJson = JSON.parse(json)

context.commit("setConfig", parsedJson);
context.commit("setPageTitle", {
config: json,
config: parsedJson,
dataset: config.dataset
});
context.commit("setPlotsConfig", {
config: json,
config: parsedJson,
dataset: config.dataset
});
},
async fetchData(context, dataset) {
let json = await fetch(
/*let json = await fetch(
`https://kp4cd.org/egldata/dataset?dataset=${dataset.dataset}&trait=${dataset.trait}`
).then(resp => resp.json());*/
/*context.commit("setTableData", json.data);
context.commit("setFilteredData", json.data);*/
let json = await fetch(
`https://hugeampkpncms.org/servedata/dataset?dataset=https://hugeampkpncms.org/sites/default/files/users/user1/egl_data/${dataset.dataset}/${dataset.dataset}_${dataset.trait}.json`
).then(resp => resp.json());
context.commit("setTableData", json.data);
context.commit("setFilteredData", json.data);

let parsedJson = JSON.parse(json)

context.commit("setTableData", parsedJson.data);
context.commit("setFilteredData", parsedJson.data);
},
filteredData(context, filtered) {
context.commit("setFilteredData", filtered);
Expand Down

0 comments on commit 0fd5b97

Please sign in to comment.