Closed rgbkrk closed 6 years ago
@rufuspollock are the react components in https://github.com/frictionlessdata/dpr-js clean/extractable for standalone use?
@rgbkrk great question 😄
@rgbkrk @pwalsh I'm actually working on that 😄 - the current code is pretty close but would probably need a bit of tweaking. The relevant component is this container:
https://github.com/frictionlessdata/dpr-js/blob/gh-pages/src/containers/DataPackageView.jsx
Basically you pass it a Data Package (not a resource but that is trivial to change) and it then renders tables for each resource in the Data Package plus the views. You can see the kind of output (in progress and not yet launched) here: https://staging.datapackaged.com/core/finance-vix
@rgbkrk what is your exact use case? That would help in providing guidance.
Within the Jupyter ecosystem, we'd like to be able to allow libraries to provide application/vnd.dataresource+json
. Pandas recently merged a PR to provide a default representation of a DataFrame as a data resource json when an optional flag is set: https://github.com/pandas-dev/pandas/pull/14904
The way that the nteract notebook works (same protocol as Jupyter) is that it takes a payload like:
{
"text/html": "...some HTML",
"application/vnd.dataresource+json": { "schema": {}, "data": [] }
}
picks the "richest" of the media types and passes the data into a React component to render it. As an example, here's me working with baseball data in pandas:
That's the text/html
version provided by pandas, which could instead be a rendered version of the data resource, which is now part of the payload for dataframe representation:
@rgbkrk great, much clearer now on the use case. Would it be possible to arrange a short chat or call to talk further with myself or @pwalsh? Easiest way is to ping me us on gitter via the FrictionlessData channel https://gitter.im/frictionlessdata/chat
Sure, I'm happy to have a chat/call. We've also done some preliminary work to explore the space here: https://github.com/nteract/nteract/pull/1534
@rgbkrk great! Can you PM me on gitter -- i'm rufuspollock. Alternatively, let me know how to ping you.
@rgbkrk how did things develop here?
We brought it in and the data resource spec has been part of the nteract release line since August. Feel free to try it out!
The community has also been picking it up as the table schema support that pandas introduced is now used by qgrid to create dynamic tables that rely on table schema.
@rgbkrk that is amazing! I'll close this issue then.
I'll talk to @callmealien and @jobarratt here at OKI about a short write up on this work - is it ok if they reach out to you?
Has anyone made a React Component that accepts dataresource json?