Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON and XML views rendering #46

Open
4 tasks
EvgeniiaVak opened this issue Jul 29, 2020 · 6 comments
Open
4 tasks

Add JSON and XML views rendering #46

EvgeniiaVak opened this issue Jul 29, 2020 · 6 comments

Comments

@EvgeniiaVak
Copy link
Contributor

EvgeniiaVak commented Jul 29, 2020

Job story

When having JSON / XML data resource, I want to be able to use datapackage-views-js to render data view, so that I can see it before / instead of downloading.

Acceptance criteria

  • JSON and XML text are rendered with highlighted syntax

Tasks

  • analysis
  • add rendering functionality
  • add test fixtures for cosmos

Analysis

  • We can try to find lightweight libraries (can be limited to only JSON/XML)
  • We shouldn’t do anything time-consuming (like downloading and preping 4MB JSON files to render) in node-js - it'll hinder ux
  • Probably will have to put a limit on files and not render them at all if they are too large even in browser
  • Need to think about consistency with CKAN representation https://github.com/ckan/ckan/tree/master/ckanext/textview

Text spec

datapackage-views-js already has 'document' spec for rendering PDF views, JSON / XML could also have a similar dedicated spec type - text that would:

  • read the content of a file in specified encoding
  • render the text with syntax highlighted according to the file's extention

Rendering libraries

@rufuspollock
Copy link
Member

@EvgeniiaVak surely we just do this in pure frontend app - doing this datapackage-views-js seems a bit crazy. datapacakge-views-js is focused on proper rendering and visualizing.

@gavram
Copy link
Member

gavram commented Jul 29, 2020

@rufuspollock @EvgeniiaVak

When I spoke with Anu about this we were talking about datapackage-views-js. But I would agree with Rufus that all can be done in frontend app.

The only thing that goes in favor of datapackage-views-js is to keep all the visualizations in one place

@EvgeniiaVak
Copy link
Contributor Author

I agree with @rufuspollock actually. If we try to fit all visualizations in one place, this place would grow to be too large and we would end up loading to much unnecessary code to places where it is not used
cc @gavram @anuveyatsu

@EvgeniiaVak
Copy link
Contributor Author

notes on this issue from the meeting with @anuveyatsu and @gavram

  • We can try to find lightweight libraries (can be limited to only JSON/XML)
  • We shouldn’t do anything time-consuming (like downloading and preping 4MB JSON files to render) in node-js - it'll hinder ux
  • Probably will have to put a limit on files and not render them at all if they are too large even in browser
  • Need to think about consistency with CKAN representation https://github.com/ckan/ckan/tree/master/ckanext/textview

@anuveyatsu
Copy link
Member

@rufuspollock depends on what do you mean by frontend app. Main point for me is to do it on client as JSON/XML files can be large. Doing this in datapackage-views-js sounds correct to me because:

  • it is a view
  • we can render based on view type

cc @EvgeniiaVak @gavram

Another way would be to do it in frontend templates so it is still client-side.

@rufuspollock
Copy link
Member

rufuspollock commented Aug 5, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants