Hi James,

1) One thing you can do is modify the text through Exhibit without changing
your data source.  For example, you can register a mapping function with
Exhibit, and then call that function where you need to.  Take a look at this
exhibit.  The top right facet "Category" actually has data coming in as
"geology", "hydrogeology" and "reference", however, the facets displays
these items as "Geologic Data", "Hydrologic Data", and "Reference Data."
In this way, you can create several mapping functions, all that operate on
the same field, but each used in a different place, such as a facet, lens,
table column.

http://www.dgs.udel.edu/data


2) You can sort on the date field itself.  Just make sure that field is
defined as "date" type.  You can control how the date is displayed using
formats.  In the example, above, take a look at "List By Date".   This is a
Tabular View with the following parameters.

   ex:columns=".title, .field_date_value, .tid_2"
   ex:columnLabels="Title, Date Published, Format"
   ex:columnFormats="list, date { template: 'MMM yyyy' }, list"
   ex:sortColumn="1"

For more info about formats, take a look at
http://www.simile-widgets.org/wiki/Exhibit/Formats


Hope this helps.

- John

**************************************************
John Callahan, Geographic Information Scientist
Delaware Geological Survey, University of Delaware
URL: http://www.dgs.udel.edu
**************************************************


On Wed, Sep 15, 2010 at 7:57 AM, James Cummings <[email protected]>wrote:

> Hiya,
>
> I have some json I'm feeding into a simile exhibit where the items in
> the list currently look like:
>
>  {
> label:    "8  January  1790",
> type:   "Meal",
> id: "m1790-01-08_dMeal_D",
> URI: "/diary/1790-01-08.html",
> subtype: "Dines",
> date: "1790-01-08",
> participants: [
> "HOL04",
> "UnCoded",
> "KIP01",
> "UnCoded",
> "HOL02",
> "HOL03"],
> numParticipants: "6",
>  },
>
> What I'd like to do in the script producing this json is for each of
> the participants  list items e.g. "HOL04", provide a label.  What
> should the json look like for exhibit to use the code HOL04 for
> counting but use a pretty version like "John Hollins" for display in
> the facet that is displaying the participants?
>
> A second question is about the label and dates:  This is a pretty
> version of the date item.  When I click on the label column in table
> view it sorts this as a basic alphanumeric string.  Is there a way I
> can say sort the label column by using the date column?   The
> viewPanel definition looks something like:
>
> ====
>  <td ex:role="viewPanel">
>                     <div ex:role="view" ex:viewClass="Tabular"
> ex:label="Tabular View" ex:columns=".label, .type, .subtype,
> .numParticipants, .date, .participants" ex:columnLabels="Meeting,
> Type, Subtype, Number of Participants, Date, Participants"
> ex:columnFormats="list, list, list, list, url, list" ex:sortColumn="4"
> ex:sortAscending="true" ex:paginate="true" ex:pageSize="10">
>                        <table>
>                           <tr>
>                              <td><b><a ex:href-content=".URI"
> class="link"><span ex:content=".label"></span></a></b></td>
>                              <td><span ex:content=".type"
> class="type"></span></td>
>                              <td><span ex:content=".subtype"
> class="subtype"></span></td>
>                              <td><span
> ex:content=".numParticipants"></span></td>
>
>                              <td><span ex:content=".date"></span></td>
>                              <td><span
> ex:content=".participants"></span></td>
>                           </tr>
>                        </table>
>                     </div>
>                  </td>
> ====
>
> Any suggestions on either of these (though the first question is more
> important), appreciated.
>
> -James
>
> --
> 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]<simile-widgets%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/simile-widgets?hl=en.
>
>

-- 
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.

Reply via email to