Skip to content
Snippets Groups Projects
Verified Commit f9493bcf authored by BARBIER Marc's avatar BARBIER Marc
Browse files

improved slider behavior for bigger dataset

parent b399515b
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,9 @@ import Slider from '@vueform/slider'
import makeTheSliderDragOnLock from './makeTheSliderDragOnLock'
import secureFetch from '@/secureFetch'
//bellow this value the slider has two part wich allow the user to zoom in on the data
const DOUBLE_SLIDER_MAX_VALUE = 100000
export default defineComponent({
name: 'PlotView',
components: {
......@@ -100,16 +103,20 @@ export default defineComponent({
}
this.fileItem = await (await secureFetch(this, `http://localhost:8080/rest/metadata/fileitem?id=${localStorage.getItem('datasetId')}`)).json()
await this.loadDataSet()
this.sliderMax = this.dataset?.totalSize || 1000
if(this.sliderMax < 10000) makeTheSliderDragOnLock(this.sliderMax)
else this.slider = 0
this.sliderMax = this.fileItem?.noRows || 1000
if(this.sliderMax < DOUBLE_SLIDER_MAX_VALUE) {
makeTheSliderDragOnLock(this.sliderMax)
this.slider = [0, 1000]
}
else {
this.slider = 0
}
this.generateChartData()
this.fetchPatternData()
},
updated() {
if(this.sliderMax < 10000)makeTheSliderDragOnLock(this.sliderMax)
if(this.sliderMax < DOUBLE_SLIDER_MAX_VALUE)makeTheSliderDragOnLock(this.sliderMax)
},
methods: {
async loadDataSet(xmin?: number, xmax?: number, cancelPrevious = false) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment