-
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.
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-translation-method - A users jQuery method that translates request parameters and API response into a
data-background-load=[none|???] ?? The algorithm to use for background loading (defaults to "none")
The server should have these values in response.
jMatrixQuery jSon acceptable response. This can be used to generate a matrix
on client side by using the request parameters and an undefined response.
data-layers="0:data,1:age,2:confidence" ?? I think we could allow custom API layers based on key-value configuration.
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?
mjy at present we decided to move away from the layers concept, but rather consider sudo-layering via sets of CSS stylings down the road
user.css -> references to named classes that are "fixed"
Configurable css subclasses based on response as provided for data: {}
| data-css | class | expected response |
| | cell-color | a valid CSS background-color, e.g. #fef |
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 - Proposition: jMatrixBrowse can generate some class names for matrix elements based on different layers and the response values which can then be used by the user to write custom stylesheets to style the matrix.