Giter Site home page Giter Site logo

Comments (14)

gaocegege avatar gaocegege commented on September 13, 2024 3

All tasks in Evaluation 2 are done 🎉

from processing.r.

jeremydouglass avatar jeremydouglass commented on September 13, 2024 1

For reference, this is how library Processing.py / Jython handles importing native Processing(Java) libraries.

https://github.com/jdf/processing.py/blob/master/runtime/src/jycessing/LibraryImporter.java

It looks quite complex -- I believe because a lot seems to be about auto-discovering non-jar resources.

The renjin documentation starting point for import() seems to be Ch5, p27: Importing Java Classes Into R Code:

https://media.readthedocs.org/pdf/renjin/latest/renjin.pdf#page31

I wonder if some very widely used Processing libraries are already importable and already work out-of-the-box, without changes to the renjin import mechanism.

from processing.r.

jeremydouglass avatar jeremydouglass commented on September 13, 2024 1

Per our discussion: an example of a popular 3rd-party Processing library:

Built-in libraries to consider starting with for testing:

from processing.r.

gaocegege avatar gaocegege commented on September 13, 2024 1

The ad-hoc code has been fixed in #137

from processing.r.

gaocegege avatar gaocegege commented on September 13, 2024 1

We need to test more libraries to test if the feature works well

from processing.r.

gaocegege avatar gaocegege commented on September 13, 2024

Now Processing.R supports libraries in PDE, for example, https://github.com/jdf/peasycam.

But it fails in Runner because of the libraries discovery in standalone sketch.

from processing.r.

jeremydouglass avatar jeremydouglass commented on September 13, 2024

Initial library discovery work done in #133

from processing.r.

jeremydouglass avatar jeremydouglass commented on September 13, 2024

Good idea!

  1. Do we have an example library sketch?
    It could be the bases for a number of library sketches -- a simple example for each library. Easy to ask others to write them if there is a template. I could write a few myself.

  2. Is there a test sketch for the library feature?
    Or would that not work with the testing setup?

from processing.r.

gaocegege avatar gaocegege commented on September 13, 2024
  1. I will write a example tomorrow.
  2. Libraries are different with each other, I am afraid that it is hard to develop a framework to test all libraries just like e2etest does.

from processing.r.

jeremydouglass avatar jeremydouglass commented on September 13, 2024

I agree that Processing.R does not need a library testing framework -- that too complex to be useful, and also out of scope!

Instead, I was wondering if, for example, the peasycam demo on Welcome Issue #142 could be added to test documentation for importLibrary(). Then as long as we had generated the target screenshot the test it would pass as long as peasycam was importing correctly, and fail if it wasn't. Not library specific testing, just an e2etest sanity check on importLibrary(). An issue would pre-installing peasycam into the CI environment to make it work.

settings <- function() {
    importLibrary("peasycam")
    size(200, 200, P3D)
}

setup <- function() {
    cam = PeasyCam$new(processing, 100)
    cam$setMinimumDistance(50)
    cam$setMaximumDistance(500)
}

draw <- function() {
    rotateX(-.5)
    rotateY(-.5)
    background(0)
    fill(255, 0, 0)
    box(30)
    pushMatrix()
    translate(0, 0, 20)
    fill(0, 0, 255)
    box(5)
    popMatrix()
}

from processing.r.

gaocegege avatar gaocegege commented on September 13, 2024

Oh It is a good idea! But there is one thing:

We could not use libraries in Runner now, because of the StandaloneSketch.

from processing.r.

jeremydouglass avatar jeremydouglass commented on September 13, 2024

because of the StandaloneSketch

Can you remind me why StandaloneSketch is a problem for importLibrary()?

from processing.r.

gaocegege avatar gaocegege commented on September 13, 2024

StandaloneSketch doesn't implement the logic about the path to libraries. It could not find the libraries.

from processing.r.

jeremydouglass avatar jeremydouglass commented on September 13, 2024

Wonderful. Let's schedule a meeting to check in and discuss before E2.

from processing.r.

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.