A range of questions/answers

CODAP Forums CODAP Help Forum A range of questions/answers

Tagged: 

  • This topic has 0 replies, 1 voice, and was last updated 7 years ago by Anonymous.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #96 Score: 0
    Anonymous
    Inactive

    I was able to chat on an email thread with some CODAP folks (thanks!) and found a lot of great info about how to structure integration with CODAP tools — specifically how one might embed/insert CODAP tools into another site (like PublicLab.org), and conversely, how to take features/functions from our own system and build them into CODAP. I’ll just excerpt some of our discussion here:

    > So, this is getting into some code-specific details, but I think this could help us frame how we might structure integration… anyhow, I was wondering a bunch of things I couldn’t immediately figure out from a read through the docs:

    1. Is there a way to pass JSON or data file in and get JSON out as callback, upon initializing a CODAP instance? Then we could store the JSON outside CODAP, and just pass it in and get it back out each time — for example to build up a dataset from lots of users’ input.  (This is really helpful for me as someone encountering the project and thinking of how modular the code is and how easy it would be to plug it into a workflow we already have. It’d also be awesome to see that included as an option in the constructor — we’re trying to show those sorts of options in our own work, for example.)

    > [Jonathan] CODAP is a document-oriented web application, the document is persisted as a JSON stream. This sounds in line with what you are thinking about here, but as always, the devil is in the details. Generally, we have saved and restored data to the file system or to a cloud store.

    2. Is there a way to start up CODAP in an embed or a modal interface with starting data pre-loaded?

    > [Jonathan] CODAP is normally configured as a static web application (static on the server, that is). It reads query parameters to determine, among other things, the document to load. I am not quite sure what “an embed or a modal interface” means in this context. Is it a disconnected or self-contained environment you have in mind (e.g. an ebook)? If so, the answer would be: we haven’t done that, but it would not be difficult.

    3. Is there an example “empty” Data Interactive and maybe an example of how to write data to spreadsheet? (We’re trying to show something similar — how to add functionality via new modules — here.)

    > [Jonathan] There are two API’s for CODAP/Data Interactive communication. The old one, the “Game API” has a guide for writing a basic Data Interactive. We do not yet have one for the more modern Data Interactive API. We do not have an example of writing data to a spreadsheet.

    4. Are there any image processing Data Interactives? We have some image => spreadsheet based workflows would would be cool to attempt, so just curious.

    > [Jonathan] None yet. It would, indeed, be cool!

    5. How about (blue-sky here) a way to go through some steps in CODAP one by one — to ‘guide’ someone through some analysis steps, or run a pre-set procedure in CODAP on startup?

    > [Jonathan] We do have the capability to incorporate a guide, that is a static page with instructions. It sounds like you are thinking of a more active scaffolding. Alas, that is not present in CODAP at the moment.

    6. Is there logging of user steps — when things are added to a spreadsheet, or what operations were done, timestamped? We’re thinking through chain of custody questions for environmental sampling, but this could also be useful for “recording” a sequence of analysis steps for playback or “guided analysis.”

    > [Jonathan] Yes, all user initiated actions are timestamped and logged to a log server on an activity by activity basis. Mostly, these log entries are effectively anonymous, but they can be  correlated with users in a controlled environment.

    ###############

    Dan also contributed:

    > When you ask about Data Interactive examples and writing to a spreadsheet, do you mean how one could write a data interactive that would send data into CODAP’s spreadsheet-like tables?

    > The links Jonathan included above should provide the overview of how to write a Data Interactive that communicates with CODAP (and thus create data tables in CODAP). There are examples of working data interactives and their code here: https://github.com/concord-consortium/codap-data-interactives

    > They can be launched in CODAP from here: https://concord-consortium.github.io/codap-data-interactives/index.html

    > Scroll down to see the list of simple/demo data interactives. I think most, if not all, of the data interactives here use the old API. Jonathan, do any of these use the new API? Perhaps the Data Card data interactive?

    ################

    I responded:

    Re: spreadsheets, yes, that’s exactly what I was hoping for — sorry I wasn’t more specific. Thanks for the links!

    Really, my questions follow two overall themes —

    First, how we might integrate Public Lab projects like (for example) microscopic photo analysis, or plugin-less web-based sensor reading, into the CODAP environment (hence how to write a data interactive).

    Second, how we might integrate the CODAP environment into Public Lab activities — by embedding it like on this page, where you see a button (or as I imagined above, a modal) launching CODAP.

    So regarding this:

    > [Jonathan] CODAP is a document-oriented web application, the document is persisted as a JSON stream. This sounds in line with what you are thinking about here, but as always, the devil is in the details. Generally, we have saved and restored data to the file system or to a cloud store.

    …I’m thinking specifically of how on some pages, we might have a JSON data file, the output of some Public Lab activity, boot up at the click of a button into a CODAP environment, potentially by passing it like:

    var codap = new Codap({

    inputJSON: ‘input.json’,

    callback: function(output) {

    // do something with new JSON data

    }

    });

    If this is sort of similar to the idea of a JSON stream, that’s great!

    Sorry to dive all the way into fake code examples, but it’s looking like there are plenty of ways we might integrate at a technology level, which is great — freeing us up a bit to think through the programmatic alignment and how specific projects could be planned out.

    ####################

     

    Finally, Dan added:

     

    I think the links to the API and simple examples of existing data interactives should provide a guide as to how you could have the headphone jack sensor talk with CODAP.

     

    As for data encoded in JSON that you want to feed to CODAP, I think there are many options for how to do this, and which way to achieve this may depend on how you want to do the integration. Here are some existing or near existing options:

    We can open CODAP, and have it load a data interactive automatically via a URL parameter. This data interactive could interpret your JSON and create a CODAP table.

    We can open CODAP and have it point to a pre-made CODAP document. Our document format is JSON, so it might be not too much work to adapt the JSON data format you are already using and wrap it in the other parts necessary to make a CODAPdocument. One of our partners is now offering “CODAP” as an extract format along with CSV, SPSS, etc.

    Soon we may be able to open CSV files as if they are CODAP documents, so if the data were stored as a CSV, we could point to that as the “CODAP” document to launch and it would open that data table in CODAP.

    Not possible now, but embedding CODAP as an iframe on the page which is generating data so that your web-app could send data directly to CODAP from outside the CODAP frame (like having the data interactive live outside the CODAP iframe rather than being encompassed by it.)

    I’m sure there are other options, if we might understand how you would like the integration to work.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.