Well, the obvious objection to this kind of support for arbitrary 
expressions is that it means that there is important information in the 
exhibit that is only available to the person looking at the _particular 
presentation_ of the exhibit---either visually, or by carefully parsing 
the html of the exhibit to find those expressions.  This hurts a major 
appeal of exhibit---that I can just grab the data, without worrying 
about the presentation, and use it a different way.   Couldn't we 
achieve the same thing, and do a better job of keeping data separate 
from presentation, by creating "virtual facets" in the schema json file 
instead of in the html file?   eg, to have something like

properties: {
    'age': {
         valueType: "date",
         computedAs: "NOW - .birthdate";
         default: "unknown"
         }
    }

With this approach, someone who wants to grab my data just need to be 
able to take/parse the json---no html ever involved.  Also, this would 
enable the copy-all button to snag the virtual properties as well as the 
real ones.

David Huynh wrote:
> Hi Johan,
>
> I've added support for arbitrary expressions in facets, and it looks 
> like that's working in your hotel exhibit... This is opening up a few 
> other doors, given that certain functions are added, e.g.,
> - a facet of first letters of names, serving as an alphabetic directory 
> index.
> - a facet of area codes of phone numbers.
> - a facet of century names ("15th century) generated from raw dates.
> - a facet that categorizes people into infant/toddler/teenager/adult by 
> mapping their ages, computed with date-range(.birthday, now, "year")
>
> Of course, there has been an argument that such dependent properties 
> should be explicitly expressed in the data rather than computed on the 
> fly. But that variable "now" could be a good counter-argument.
>
> Cheers,
>
> David
>
> Johan Sundström wrote:
>   
>> Since some hour, the 2.0 Exhibit API has a distance() calculation
>> function which calculates the distance (in meters by default, but "km"
>> and "mile" unit parameters are supported too) between two lat/long
>> coordinates. An example, plotting a few hotels and other
>> accommodations in a wide area around an upcoming German dance
>> festival:
>>
>>   http://exhibit.ecmanaut.googlepages.com/boogie.dev.html
>>
>> I intentionally don't mention exact argument layout here, as it
>> sounded like David might improve on that a bit before it's stable. The
>> page documents what works at present, though. (It depends on the
>> Google Maps API too, so I suspect it requires setting up your Exhibit
>> for map view to work.)
>>
>> That page presently bugs out a little (for trying to use the distance
>> function in a facet description, which David tells me isn't supported
>> quite yet), but you can see it working in table and scatter plot view,
>> and with a bit of luck we might soon get to filter the map view for
>> markers in increasing radii circles around the event, once that is
>> supported. Drop ".dev" from the url if you want to play with the other
>> facets, for now.
>>
>> I also noted that ex:selection for NumericRange facets does not work;
>> neither what is shown ("0 - 500") nor what is reported in the title
>> bar on clicking ("0 to 500") works to list in that attribute.
>>
>> (Maybe the lazy initialization of Exhibit's map marker icons shouldn't
>> be quite as lazy, by the way; the default Google Maps icons show quite
>> noticeably while loading large numbers of markers, as here.)
>>
>>   
>>     
>
> _______________________________________________
> General mailing list
> [email protected]
> http://simile.mit.edu/mailman/listinfo/general
>   
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to