Skip to content

Commit

Permalink
Allow flatmap to be set using api.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-wu committed Apr 27, 2023
1 parent 57f97d5 commit 4d8041d
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 149 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VUE_APP_API_LOCATION=https://your-api-location/
//VUE_APP_API_LOCATION=https://your-api-location/
VUE_APP_FLATMAPAPI_LOCATION=https://mapcore-demo.org/current/flatmap/v3/
VUE_APP_ALGOLIA_INDEX=k-core_dev_published_time_desc
VUE_APP_ALGOLIA_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Expand Down
308 changes: 168 additions & 140 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abi-software/mapintegratedvuer",
"version": "0.3.15",
"version": "0.4.0-beta.0",
"license": "Apache-2.0",
"scripts": {
"serve": "vue-cli-service serve --port 8081",
Expand All @@ -26,10 +26,10 @@
"*.js"
],
"dependencies": {
"@abi-software/flatmapvuer": "^0.4.0",
"@abi-software/flatmapvuer": "^0.4.1-beta.1",
"@abi-software/map-side-bar": "^1.3.38",
"@abi-software/plotvuer": "^0.3.9",
"@abi-software/scaffoldvuer": "^0.1.58",
"@abi-software/scaffoldvuer": "^0.1.59",
"@abi-software/simulationvuer": "^0.6.5",
"@abi-software/svg-sprite": "^0.2.0",
"@soda/get-current-script": "^1.0.2",
Expand Down
10 changes: 10 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<el-button @click="setMultiFlatmap()" size="mini">Set MultiFlatmap</el-button>
<el-button @click="setLegacyMultiFlatmap()" size="mini">Set Legacy MultiFlatmap</el-button>
<el-button @click="setScaffold()" size="mini">Set To Scaffold</el-button>
<el-button @click="setFlatmap()" size="mini">Set Flatmap</el-button>
<el-button @click="setSearch()" size="mini">Set Search</el-button>
</el-row>
</div>
Expand Down Expand Up @@ -103,6 +104,15 @@ export default {
xmlhttp.send(JSON.stringify({"state": state}));
},
setFlatmap: function() {
this.$refs.map.setCurrentEntry(
{
type: "Flatmap",
resource: "FunctionalConnectivity",
label: "Functional"
}
);
},
setLegacyMultiFlatmap: function() {
this.$refs.map.setCurrentEntry(
{
Expand Down
15 changes: 15 additions & 0 deletions src/components/MapContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ export default {
}
}
}
else if (state.type === "Flatmap") {
//State for scaffold containing the following items:
// label - Setting the name of the dialog
// region - Which region/group currently focusing on
// resource - the url to metadata
// state - state to restore (viewport)
// viewUrl - relative path of the view file to metadata
const newView = {
type: state.type,
resource: state.resource,
state: state.state,
label: state.label
};
this.$refs.flow.createNewEntry(newView);
}
}
},
/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/SplitpanesBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default {
let title = entry.label ? entry.label + " ": '';
let type = entry.type;
if (type == "Scaffold")
type = "Scaffold 3D";
type = "3D Scaffold";
title += type;
if (entry.datasetId)
title += " (" + entry.datasetId + ")";
Expand Down
4 changes: 2 additions & 2 deletions src/components/viewers/Flatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
style="height: 100%; width: 100%"
:minZoom="entry.minZoom"
:helpMode="helpMode"
:pathControls="entry.pathControls"
:pathControls="true"
ref="flatmap"
@ready="getAvailableTerms"
:displayMinimap="true"
:displayMinimap="false"
:flatmapAPI="flatmapAPI"
/>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/components/viewers/MultiFlatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:initial="entry.resource"
:helpMode="helpMode"
ref="multiflatmap"
:displayMinimap="true"
:displayMinimap="false"
:flatmapAPI="flatmapAPI"
@pan-zoom-callback="flatmapPanZoomCallback"
/>
Expand Down Expand Up @@ -76,7 +76,7 @@ const getBodyScaffold = async(sparcApi, species) => {
if (species === "rat") {
return "https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json";
} else if (species === "human") {
return "https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/24-11-2022-human/humanBody_metadata.json";
return "https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/27-4-23-human/human_body_metadata.json";
}
}
}
Expand Down

0 comments on commit 4d8041d

Please sign in to comment.