David - You are right about the illogic of the second paragraph - that
is a major criticism of that approach.
But I don't think selecting all and deselecting say "red" works any
differently. I put together a sample database and html to
illustrate: So all five colors start off selected and all cars are
listed as expected. But if I deselect "red" then all five cars are
still listed. Briefly - Rainbow+car = red, green, blue, yellow;
Rainbow+minus+red+car = green, blue, yellow; and so on.
Note that if I had included "not_red" as a Color tag in the Rainbow
+minus+red+car item then pretty much the same behavior would result. I
am reminded that it is basically impossible to implement a NOT using
only AND & OR. Some sort of exclusionary filter is necessary. - Jim
{
"items" : [
{
"label" : "Rainbow+minus+yellow+car",
"type" : "Car",
"Colors" : [
"red",
"blue",
"green"
],
"id" : "Rainbow minus yellow car"
},
{
"label" : "Rainbow+minus+blue+car",
"type" : "Car",
"Colors" : [
"red",
"green",
"yellow"
],
"id" : "Rainbow minus blue car"
},
{
"label" : "Rainbow+minus+green+car",
"type" : "Car",
"Colors" : [
"red",
"blue",
"yellow"
],
"id" : "Rainbow minus green car"
},
{
"label" : "Rainbow+car",
"type" : "Car",
"Colors" : [
"red",
"blue",
"green",
"yellow"
],
"id" : "Rainbow car"
},
{
"label" : "Rainbow+minus+red+car",
"type" : "Car",
"Colors" : [
"blue",
"green",
"yellow"
],
"id" : "Rainbow minus red car"
}
]
}
<html>
<head>
<title>Car Colors Example</title>
<link href="cars2.js" type="application/json" rel="exhibit/data" />
<script src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-
api.js"
type="text/javascript"></script>
<style>
</style>
</head>
<body>
<h1>Car Colors Example</h1>
<table width="100%">
<tr valign="top">
<td ex:role="viewPanel">
<div ex:role="view"></div>
</td>
<td width="25%">
<div ex:role="facet" ex:expression=".Colors" ex:facetLabel="Colors"
ex:selection="red; blue; green; yellow" ></div>
<!--<div ex:role="facet" ex:expression=".Colors"
ex:facetLabel="Colors"></div>-->
</td>
</tr>
</table>
</body>
</html>
So if the Colors facet had "red","blue,"green and "yellow" selected
then all 5 cars would be listed. If "red" were deselected
On Nov 15, 10:19 am, David Karger <[email protected]> wrote:
> I can't really follow your second paragraph as I don't see the logic of
> including something red when not-red is selected. But, in regard to
> your first paragraph, I think you get what you want by just preselecting
> all facet values, and allowing the user to _uncheck_ red if they want to
> exclude that one. In your facet tag, just add
> ex:selection="red;blue;green;yellow" and it'll start off with those
> selected.
>
> (note the following inconsistency-for-good-reason in exhibit: if _no_
> value is selected for a facet, then in fact it is as if _every_ value is
> selected. For facets with selections, only items that match one of the
> selections will be shown. But if we applied this without exception,
> then a facet without selections would make everything vanish---not a
> good default. So, we have an exception for an "empty" facet. However,
> this does force a dramatic change when you take an empty facet and
> select one value; suddenly it switches from "as if all values are
> selected" to just the single selected value. If instead you start with
> all values selected, then unselected one will do what you want)
>
>
>
> lbjvg wrote:
> > Thanks David (H & K) - I haven't worked with collections before -
> > thanks for bringing them to my attention. My big idea was to - on the
> > fly - have the user be able to exclude any color listed - as if "red"
> > in the <div>'s above were replaced with a variable that could change
> > on the user's whim. So, it seems like a hard nut to crack and I can
> > live without that feature.
>
> > I can think of a weaker solution involving a massively enlarged json
> > database. - so instead of being totally exclusionary, "not_red" would
> > be a feature like any other - that is the universe of colors includes
> > red, not_red, green, not_green, blue, not_blue and so on. So the
> > "not_color" choices would be listed right along with the usual color
> > names of red, green, blue and so on. This involves analyzing and
> > addending the json database to include the 'not_color' tags as
> > appropriate.
>
> > So if 'not_red' is selected then of course those items would be
> > included in the view. But this is not exclusionary - things with red
> > in them will still be present in the view list if "green" is selected
> > and "red" also just also happened to be one of the Color tags for that
> > item. (However, If the json database were completely filled out in
> > this way it should not be possible to select "red" and "not_red"
> > together). In general, I suppose then the user could sort the view by
> > "Color" and at least all of the "not_reds" would be grouped
> > together.
>
> > Two problems with this approach - the larger database size and
> > confusing the hell out of the user who (rightly) expects "not_red" to
> > be exclusionary.
>
> > Thanks for helping to clarify the issue. - Jim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---