-
Notifications
You must be signed in to change notification settings - Fork 2
In development
We'd like the plugin to be unobtrusive, using HTML data- elements. Something like this:
<div id="my_browser"
data-jmatrix_browser=true
data-api="http://foo.org/path/to/api"
</div>
cb - I think it would also be useful to allow for jMatrixBrowse instantiation on elements / pages that already exist : $('#myDiv').jMatrixBrowse( { api: 'http..' } )
pg - I agree that it should allow instantiation on already existing elements.
- = required
data-api=http://foo.org/path/to/api * The API to call
data-jmatrix_browser=true * This element is the wrapper for a jMatrixBrowser
data-initial-window-size="2,3" - Define the width, height of the initial window (defaults to 10,10 ?)
data-initial-window-position="x,y" - Define the x,y position of the window (defaults to 0,0)
data-background-load=[none|???] ?? The algorithm to use for background loading (defaults to "none")
data-layers="0:data,1:age,2:confidence" ?? I think we could allow custom API layers based on key-value configuration
I'll explain at next meeting
data-translation-method - A users jQuery method that translates a API response into a jMatrixQuery jSon
acceptable response
cb - I like this idea with regard to data-layers. One could simply give keys ( or perhaps functions that are given cell data and return a value ), that correspond to different z-index layers of data. This is one reason I'm not 100% sure I like the API response sending back the cell value (literal) in one property, and the cell properties (metadata) about the data in another property. I think the API response for a single cell should be either a literal, or a json object. When the data layers is specified, it can just pick out the property it wants to display as a cell value.
mjy - I had initially envisioned each request returning data for a specific layer, but now I'm wondering if, perhaps, all layers could be updated with their respective mapped properties for any given response?
cb - also, what if the user already has an array of arrays already on the client somewhere - should we allow them to instantiate a jMatrixBrowse object with that data ?
mjy - We do need to isolate the request/response interface code so that we can dummy in client-side JSONified matrices, particularly for unit testing.
We want to provide a simple set of CSS hooks so that the user can style their matrix viewer, we'll need a default stylesheet as well Some considerations (just thinking of the top of my head here)
window_height=px window_width=px
cb - We could break the css into table, and cell properties and allow the user to give us an object similar to what jQuery does. For example,
$('#myDiv').jMatrixBrowse( { api: 'http', table-css: { border: 1 px solid blue, margin: 5px },cell-css { border: 2px dashed red, padding: 2px } ). We could take these objects and insert them directly into a jQuery css function. $ ('div[data-jmatrix-browser="true"]').css( table-css-obj ) and $('div[data-jmatrix-browser="true"] .cell').css( cell-css ). Maybe I should stop writing inline code.. I hope the idea comes across.mjy - I think i get it - but here's where my jQuery (lack of) experience is coming into play. Might have to see it in action.
pg - I think its a very good idea.