From ae1c61907b6ffd0f9949d0d697bdc941eb28b7e2 Mon Sep 17 00:00:00 2001
From: eperelm2 <emily_perelman@brown.edu>
Date: Mon, 31 Jul 2023 15:41:53 -0400
Subject: filters - working on range

---
 src/client/views/FilterPanel.tsx | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

(limited to 'src/client/views/FilterPanel.tsx')

diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index f85052ff2..d6638df46 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -164,12 +164,16 @@ export class FilterPanel extends React.Component<filterProps> {
             this._chosenFacets.set(facetHeader, 'text');
         } else if (facetHeader !== 'tags' && nonNumbers / facetValues.strings.length < 0.1) {
 
-            // const ranged = Doc.readDocRangeFilter(targetDoc, facetHeader);
-            // const extendedMinVal = minVal - Math.min(1, Math.floor(Math.abs(maxVal - minVal) * 0.1));
-            // const extendedMaxVal = Math.max(minVal + 1, maxVal + Math.min(1, Math.ceil(Math.abs(maxVal - minVal) * 0.05)));
-            // newFacet[newFacetField + '-min'] = ranged === undefined ? extendedMinVal : ranged[0];
-            // newFacet[newFacetField + '-max'] = ranged === undefined ? extendedMaxVal : ranged[1];
-            // const scriptText = `setDocRangeFilter(this?.target, "${facetHeader}", range)`;
+            console.log("in this IF STATEMENE ")
+
+            const ranged = Doc.readDocRangeFilter(this.targetDoc, facetHeader);
+            const extendedMinVal = minVal - Math.min(1, Math.floor(Math.abs(maxVal - minVal) * 0.1));
+            const extendedMaxVal = Math.max(minVal + 1, maxVal + Math.min(1, Math.ceil(Math.abs(maxVal - minVal) * 0.05)));
+          //  newFacet[newFacetField + '-min'] = ranged === undefined ? extendedMinVal : ranged[0];
+          //  newFacet[newFacetField + '-max'] = ranged === undefined ? extendedMaxVal : ranged[1];
+          //  const scriptText = `setDocRangeFilter(this?.target, "${facetHeader}", range)`;
+            Doc.setDocRangeFilter(this.targetDoc, facetHeader)
+
 
             // newFacet = Docs.Create.SliderDocument({
             //     title: facetHeader,
-- 
cgit v1.2.3-70-g09d2

