If you look at the function _makeTable in
http://static.simile.mit.edu/exhibit/extensions-2.0/chart/scripts/pivot-table-view.js
you should see a pair of nested for loops. It shouldn't be too hard to
get the total for each row. Something like this would do:
for (var r = 0; r < rowCount; r++) {
...
var rowItems = this._rowPath.evaluateBackward(rowValue,
rowResults.valueType, items, database).getSet();
var rowTotal = 0;
for (var c = 0; c < columnCount; c++) {
...
if (cellResults.valueType == "number" &&
cellResults.values.size() == 1) {
cellResults.values.visit(function(v) {
rowTotal += (typeof v == "number") ? v : parseFloat(v);
...
});
} else {
...
}
}
td = tr.insertCell(cellToInsert++);
td.appendChild(document.createTextNode(rowTotal));
}
By the way, note that each cell might not contain a number. It depends
on what you set in ex:cell.
David
David
It's unfortunate that I'm the only full-time developer on Exhibit,
Babel, Timeline, Seek, Potluck, Backstage. Sometimes I also provide
technical support for Solvent, Piggy Bank, Longwell, and chimed in on
Crowbar. I also have other duties and interests. And documentation isn't
a very appealing task compared to research and coding ... The hope is
that our enthusiastic users might spare a minute to help editing our
wiki and add tips for other users.
And this hope has worked out in a number of cases. Tom Woodward and
Brian Croxall have made excellent tutorials on Exhibit and Timeline;
we're very grateful! And since our code move to Google Code we have
gotten a number of code contributions, too. That's very exciting.
Another hope is to find funding for a real full-time developer, one who
doesn't get distracted with wild research tangents like I do. :-)
Hope that helps,
David
One way to ensure that this will survive is to boost interest on it. If
enough people use it, maybe there are enough resources (financial,
expertise) to keep it going. My recent message on "The Exhibition"
hinted at a plan to tell search engines that there is a gold mine of
structured data in exhibits to index. 2,800 public exhibits are not a
bad start, but more will make the message stronger. I understand your
use of Exhibit is all private, but if there's any chance for you to make
public exhibits, I think that'd help us all.
Thanks,
David
(I'm moving soon so I might not be able to respond quickly. But I'm sure
other people on the list can chime in for your questions.)
David