Giter VIP home page Giter VIP logo

Comments (7)

enkimute avatar enkimute commented on June 3, 2024

Hi Citron,

Using viewof inside a ganja call is not possible (for now - the observableHQ guys have promised to keep this on their desired feature list). In the mean time I have provided a workaround that enables the next best thing. (its only published for SVG, for conformal space I'll try to upload it later tonight).

It boils down to that you can 'viewof' your entire graph, and you will be able to access all elements you have graphed from inside other cells.

e.g.

viewof myElements = PGA.inline(()=>this.graph([1e1^1e2, "test"]))

and then inside another cell you could access

myElements[0]

which would contain a PGA Element (the e12 bivector)

or

myElements[1]

which would contain the string "test"

And ofcourse these items would update inside observable if you drag them in the graph.

It's all the way at the bottom of this notebook.

from ganja.js.

citron avatar citron commented on June 3, 2024

So Great ! Waiting for it in CGA !
Thanks !

from ganja.js.

enkimute avatar enkimute commented on June 3, 2024

Working on it here - working but looks like its a frame behind .. tbc

from ganja.js.

enkimute avatar enkimute commented on June 3, 2024

basic interactivity and viewof response added .. the last demo in this notebook. Demonstrates the use of viewof to render great arcs in CGA, where the user can drag the two points around and get feedback both on the graph and in other observable cells.

I assume this issue can be closed ?

from ganja.js.

citron avatar citron commented on June 3, 2024

Awesome !
now that we can drag the points, it works better than what I requested.
By the way, now the "Segments and Triangles" section poses me two problems :
1/ The figures are not redrawn when you move a point
2/ we are allowed to drag "no" - which is defined as .5e5-.5e4 - but I would suggest to make it immutable ( because if you can alter "no" then why not alter "ni" ? it would lead us to an "Ekke Ekke Ekke Ekke Ptang Zoo Boing!" basis. ). Immutable.js could help.

And yes, this issue can be closed. Thank you very much.

from ganja.js.

enkimute avatar enkimute commented on June 3, 2024

Hehe - excellent !

you can easily make it immutable for the graphs by adding a "()=>" where its graphed .. that way you can pick between both behaviors :) - I'll update the other samples on that page so they respond as expected :)

👍

from ganja.js.

enkimute avatar enkimute commented on June 3, 2024

They should all work as expected now. (only very minor changes .. an extra functional here and there.) - next up are better camera controls for the GL visualizer. (better as in .. any ..)

from ganja.js.

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.