Code Monkey home page Code Monkey logo

Comments (5)

eibanez avatar eibanez commented on May 29, 2024

First correction: it looks like there is a package for JSON schema validation: http://ropensci.github.io/jsonvalidate/

from altair.

AliciaSchep avatar AliciaSchep commented on May 29, 2024

@eibanez Thanks for the review of the python approach! I am very intrigued by what they are doing but haven't had a chance to really dive in deeply into the underlying implementation. I think a native R approach auto-generated from the JSON would be really awesome, but quite a large undertaking to do as well as altair.

I also think that such an approach should not be incorporated into this package -- the vegalite package might be a better home for it (or a new package altogether). This package (correct my if I am wrong @ijlyttle) intends to be a faithful port of the altair package itself. Ideally this other effort could leverage the rendering functionality that has been built here and is likely going to be spun off into its own package.

I'll note that as someone that uses both R and Python, I'm really appreciating this package and the fact that it isn't more of a 'native R experience' in that it makes it very easy to switch between plotting in python and R 😄 But I see the advantages of a different approach for those that don't know or use Python...

Re validation, in the vegalite R package I added in a schema validation function:

https://github.com/hrbrmstr/vegalite/blob/master/R/validate.r

using jsonvalidate. I also experimented with zschema, and it was easy to wrap that into R using V8 package. One nice feature with that library is that it allows validation of sub-schemas (which I think jsonvalidate does not). I think that becomes useful if you have functions that generate part of a schema (e.g. alt$X)

from altair.

eibanez avatar eibanez commented on May 29, 2024

I agree that the altair package should remain as-is. It's very valuable and, once the vegalite portion is spun off, it should be easy to maintain (if it's kept as a thin wrapper).

Currently, jsonvalidate is not suited to test v2 of vega-lite schemas, as they appear to use a newer version of JSON-schema (draft-06). Anyway, I played with ajv and it seems to work, providing errors that are similar to the vega online editor.

I will leave this open for a little while and, if I have time and make progress, move the discussion over to the vegalite or propose next steps.

from altair.

ijlyttle avatar ijlyttle commented on May 29, 2024

As @AliciaSchep said, I am presently working on spinning-off the renderer into its own package (https://github.com/vegawidget/vegawidget) - so that it can be used elsewhere.

I would like the altair package to remain dedicated to porting the python package - it gets us "R users" into the Vega-Lite world, and I like that it has a limited mandate.

I agree that a native R implementation would be a separate package (and one that I would look forward to using and helping out with). Such a separate package would be very welcome to be hosted in the vegawidget organization. I don't know how this proposed new functionality would relate to the existing vegalite package - or if it would be a completely new thing - that question is completely out of my hands.

from altair.

eibanez avatar eibanez commented on May 29, 2024

Makes total sense. I might close this issue (as it's not really one) but feel free to add comments with related developments.

from altair.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.