Nayanapawar / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 1 forks source link

Exhibit: Support sort items by number of facet selection matches. #329

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.In an Exhibit - suppose more than one selection is made within 
the same facet.  By default the filtered results are sorted 
alphabetically and there is no way to distinguish a result that 
happens to match all selections versus results that match some but 
all.

What is the expected output? What do you see instead?
As an example - from the CSAIL example: 
http://simile-widgets.org/exhibit/examples/CSAIL-PIs/CSAIL-PIs.html 
There are 3 people in the "medical vision group" and 10 in the 
"vision" group.  If you select both groups the total result is 10 (not 
13) because 3 people are in both groups. But it is not immediately 
evident from the alphabetical listing which 3 are in both groups.  I 
want to sort these at the top because they match more criteria 
("vision" and "medical vision") than the other 7 (which match one or 
the other but not both). 

What version of the product are you using? I don't know - how do you find 
that out? On what browser and what operating system? Any

Please provide any additional information below.
See the thread http://groups.google.com/group/simile-
widgets/browse_thread/thread/c065b061afec57f1/669010ee63d16e63?
hl=en#669010ee63d16e63

var facetMatchStyler = function(item, database, tr, tel, collection) { 
            for (var i in collection._facets) { 
                var facetSelection = collection._facets 
[i].exportFacetSelection(); 
                if (facetSelection) { 
                    var expression = collection._facets 
[i]._expression; 
                    var results = expression.evaluate({"value":item}, 
                        {"value":"item"},"value",database); 
                    var itemSet = results.values; 
                    // assume all facets are list-facets! 
                    var nrMatches = Exhibit.Set.createIntersection 
(itemSet, 
                                collection._facets[i]._valueSet).size(); 
                    if (nrMatches > 1) { 
                        tr.style.background = 'red'; 
                    } 
                } 
            } 
        } 

Basically the enchancement is to be able to sort Items by nrMatches.

Original issue reported on code.google.com by jvgallag...@gmail.com on 7 Nov 2009 at 4:03

GoogleCodeExporter commented 9 years ago
It's a valid feature to develop in the near future!
When it can be developed?
I view demo and it change backround if the filter found a record with 2 or plus 
selection match. But it not order the results. :-p
Also, it's desiderable have a function to change background depending of how 
much select match.

    thanks a lot
    .hachreak.

Original comment by hachr...@gmail.com on 7 Oct 2010 at 10:19

GoogleCodeExporter commented 9 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 9:27