Skip to content

Commit

Permalink
citations partially done, removed dangerous logs
Browse files Browse the repository at this point in the history
  • Loading branch information
J-avery32 committed Sep 16, 2021
1 parent fdcaf6a commit d868751
Show file tree
Hide file tree
Showing 44 changed files with 706 additions and 556 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
},
extends: [
'plugin:vue/essential',
'@vue/airbnb'
'@vue/airbnb',
],
parserOptions: {
parser: 'babel-eslint',
Expand Down
2 changes: 1 addition & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import '@testing-library/jest-dom'
import '@testing-library/jest-dom';
21 changes: 1 addition & 20 deletions src/components/ExperimentLineChart.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<div class="run-data">


<div class="container">
<line-chart v-if="loaded"
:chartdata="chartdata"
Expand Down Expand Up @@ -55,28 +54,10 @@ export default {
}];
this.loaded = true;
} catch (e) {
console.log(e);
console.log('Could not retrieve run');
}
},
},
// mounted(){
// console.log(this.experiment)
// try{
// this.loaded = false
// const response = await this.$api.get(this.$runs_url + "/" + this.experiment.run)
// const chartdata = {}
// this.metadata = response.data.metadata
// this.label = 'time'
// this.chartdata.datasets = [{fill: false, label: this.metadata.start.sample_name, borderColor: 'rgba(0, 0, 0, 1)', data: response.data.data}]
// this.loaded = true
// }
// catch (e){
// console.error(e)
// }
// },
components: {
LineChart,
Expand Down
73 changes: 35 additions & 38 deletions src/components/ImageAdjuster.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div id='info-box'>
<div id='info-box'>

<div>
<label>brightness</label>
<b-form-input type="range" v-model="brightness" min="0" max="200" step="5" @update="changeBrightness" ></b-form-input>

<label>contrast</label>
<b-form-input type="range" v-model="contrast" min="0" max="200" step="5" @update="changeContrast" ></b-form-input>
<!--
<!--
<label>saturation</label>
<b-form-input type="range" v-model="saturation" min="0" max="1000" step="25" @update="changeSaturation" ></b-form-input> -->
</div>
Expand All @@ -16,47 +16,44 @@

<script>
export default {
// https://codepen.io/khr2003/pen/GwdaEG
data(){
return{
image: null,
brightness: 100,
contrast: 50,
// saturation: 50
}
},
mounted(){
// https://codepen.io/khr2003/pen/GwdaEG
data() {
return {
image: null,
brightness: 100,
contrast: 50,
// saturation: 50
};
},
mounted() {
},
created() {
this.image = this.$parent.$refs.image;
},
props: {
// image: null
},
methods: {
handleUpdate(filter, index) {
const filterSpecs = this.filterSpecs[index];
const newValue = filter.amount;
filter.changed = true;
this.filters[index].changed = true;
},
created() {
this.image = this.$parent.$refs.image
changeBrightness(value) {
this.image.style.filter = `brightness(${value}%)`;
},
props: {
// image: null
changeContrast(value) {
this.image.style.filter = `contrast(${value}%)`;
},
methods: {
handleUpdate: function(filter, index) {
const filterSpecs = this.filterSpecs[index]
var newValue = filter.amount;
filter.changed = true;
this.filters[index].changed = true;
},
changeBrightness: function(value){
this.image.style.filter = 'brightness(' + value + '%)';
},
changeContrast: function(value){
this.image.style.filter = 'contrast(' + value + '%)';
}
// changeSaturation: function(value){
// this.image.style.filter = 'saturate(' + value + '%)';
// }
}
// changeSaturation: function(value){
// this.image.style.filter = 'saturate(' + value + '%)';
// }
},
};
</script>
<style scoped>
</style>
</style>
13 changes: 6 additions & 7 deletions src/components/ReadFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<b-list-group>
<b-list-group-item v-for="field in fields" :key="field[value] + field[name]" class="flex-column align-items-start bg-light m-2">
<div class="overflow-hidden ">

<div class="mb-1 text-muted text-break font-weight-light">
<h5 class="mb-1"> {{ convertToTitleCase(field[name])}}</h5>
</div>
<p class="mb-1 text-black sm text-break font-weight-bold">
{{field[value]}}
</p>

</div>
</b-list-group-item>
</b-list-group>
Expand All @@ -30,15 +30,15 @@ export default {
methods: {
convertToTitleCase(str) {
return str
return str
.replace(/([^A-Z])([A-Z])/g, '$1 $2') // split cameCase
.replace(/[_\-]+/g, ' ') // split snake_case and lisp-case
.toLowerCase()
.replace(/(^\w|\b\w)/g, function(m) { return m.toUpperCase(); }) // title case words
.replace(/(^\w|\b\w)/g, (m) => m.toUpperCase()) // title case words
.replace(/\s+/g, ' ') // collapse repeated whitespace
.replace(/^\s+|\s+$/, ''); // remove leading/trailing whitespace
}
}
},
},
};
</script>

Expand All @@ -49,7 +49,6 @@ export default {
font-weight: bold;
}


.list-group-item{
border: none;
}
Expand Down
16 changes: 5 additions & 11 deletions src/components/RunVisualizer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
variant="light"
opacity="0.8"
rounded="sm">
<b-img
<b-img
ref="image"
alt= "image of scan"
id="image"
Expand All @@ -22,7 +22,7 @@
</template>

<script>
import ImageAdjuster from "@/components/ImageAdjuster.vue";
import ImageAdjuster from '@/components/ImageAdjuster.vue';
export default {
props: {
Expand Down Expand Up @@ -52,14 +52,11 @@ export default {
},
}),
mounted() {
this.validateRoute();
this.getJpeg(this.$route);
},
methods: {
validateRoute() {
if (this.$route.query.frame && !this.isPositiveInteger(this.$route.query.frame)) {
Expand Down Expand Up @@ -94,12 +91,11 @@ export default {
return n !== Infinity && String(n) === str && n >= 0;
},
async getJpeg($route) {
this.setLoading();
this.isMetaDataLoading = true;
if ($route.params.catalog && $route.params.uid) {
let requestUrl = this.$runs_url.concat('/', $route.params.catalog, '/', $route.params.uid + "/thumb");
let requestUrl = this.$runs_url.concat('/', $route.params.catalog, '/', `${$route.params.uid}/thumb`);
if (this.$route.query.frame) {
requestUrl = requestUrl.concat('?frame=', this.$route.query.frame);
}
Expand Down Expand Up @@ -136,7 +132,6 @@ export default {
this.constructImage(response.data);
this.isPlotLoaded = true;
} catch (e) {
console.error(e);
}
},
Expand All @@ -145,7 +140,6 @@ export default {
const BYTES_PER_ROW = 2048;
let imageRow;
let rowEnd;
// console.log(buffer.byteLength);
for (let rowBegin = 0; rowBegin < buffer.byteLength; rowBegin += BYTES_PER_ROW) {
rowEnd = rowBegin + BYTES_PER_ROW;
// slices up to but not including row end
Expand All @@ -155,7 +149,7 @@ export default {
}, */
},
components: {
"image-adjuster": ImageAdjuster
}
'image-adjuster': ImageAdjuster,
},
};
</script>
6 changes: 2 additions & 4 deletions src/components/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export default {
const ENDPOINT = this.$elastic_index_url;
queries.AUTOCOMPLETE.suggest.text = this.displayedSearchInput;
this.$search.post(ENDPOINT, queries.AUTOCOMPLETE).then((res) => {
// console.log(res)
this.destroySuggestions();
res.data.suggest.researcherNameSuggestions[0].options.forEach((element) => {
this.suggestions.push(element.text.toLowerCase());
Expand Down Expand Up @@ -113,9 +112,8 @@ export default {
});
this.cutSuggestions();
return Promise.resolve();
}).catch((err) => {
console.log(err);
console.log(err.response);
}).catch(() => {
console.log('error searching');
}); // TODO: make catch statement better
},
cutSuggestions() {
Expand Down
Loading

0 comments on commit d868751

Please sign in to comment.