Skip to content
Snippets Groups Projects
Commit d31980b1 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

min max numerical filter independant

parent 117ae95f
No related branches found
No related tags found
No related merge requests found
Pipeline #127734 waiting for manual action
...@@ -52,6 +52,10 @@ const axisOptions = ref<string[]>(["percent", "size"]) ...@@ -52,6 +52,10 @@ const axisOptions = ref<string[]>(["percent", "size"])
const plotY = ref<string>("percent") const plotY = ref<string>("percent")
const plotFill = ref<string>("size") const plotFill = ref<string>("size")
const plotLabelPercent = ref<string>(`% of genomes encoding ${toValue(page)?.title ?? 'the system'}`)
const plotLabelCount = ref<string>(`Nb of genomes encoding ${toValue(page)?.title ?? 'the system'}`)
// onBeforeMount(() => { // onBeforeMount(() => {
// fetchSystemHits() // fetchSystemHits()
// fetchRefSeqTaxo() // fetchRefSeqTaxo()
...@@ -129,7 +133,7 @@ const distributionOptions = computed(() => { ...@@ -129,7 +133,7 @@ const distributionOptions = computed(() => {
const { marginLeft, marginRight } = toValue(margin) const { marginLeft, marginRight } = toValue(margin)
return { return {
...toValue(margin), ...toValue(margin),
y: { label: `% of genomes encoding ${toValue(page)?.title ?? 'the system'}` }, y: { label: toValue(plotY) === 'percent' ? toValue(plotLabelPercent) : toValue(plotLabelCount) },
x: { label: selectedTaxoRank.value, tickRotate: 45 }, x: { label: selectedTaxoRank.value, tickRotate: 45 },
color: { color: {
scheme: "plasma", scheme: "plasma",
...@@ -137,7 +141,7 @@ const distributionOptions = computed(() => { ...@@ -137,7 +141,7 @@ const distributionOptions = computed(() => {
reverse: true, reverse: true,
// domain: [0, 100], // domain: [0, 100],
marginLeft: 10, marginLeft: 10,
label: `Nb of genomes encoding ${toValue(page)?.title ?? 'the system'}`, label: toValue(plotFill) === 'percent' ? toValue(plotLabelPercent) : toValue(plotLabelCount),
}, },
width: computedWidth.value - marginRight - marginLeft, width: computedWidth.value - marginRight - marginLeft,
marks: [ marks: [
......
...@@ -5,20 +5,24 @@ export function useNumericalFilter( ...@@ -5,20 +5,24 @@ export function useNumericalFilter(
) { ) {
const minRef = toRef(min)
const maxRef = toRef(max)
const range: Ref<[number, number]> = ref([toValue(min), toValue(max)]) const range: Ref<[number, number]> = ref([toValue(min), toValue(max)])
const stringifyFilter: Ref<string | undefined> = ref(undefined) const stringifyFilter: Ref<string | undefined> = ref(undefined)
watchEffect(() => { watchEffect(() => {
if (range.value[0] === toValue(min) && range.value[1] === toValue(max)) { if (range.value[0] === toValue(minRef) && range.value[1] === toValue(maxRef)) {
stringifyFilter.value = undefined stringifyFilter.value = undefined
} else { } else {
stringifyFilter.value = `'${toValue(id)}' ${range.value[0]} TO ${range.value[1]}` stringifyFilter.value = `'${toValue(id)}' ${range.value[0]} TO ${range.value[1]}`
} }
}) })
function reset() { function reset() {
range.value = [toValue(min), toValue(max)] range.value = [toValue(minRef), toValue(maxRef)]
} }
// watch(() => range, () => { // watch(() => range, () => {
// console.log("watch reange") // console.log("watch reange")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment