Giter Site home page Giter Site logo

ccnmtl / 3demos Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 12.75 MB

Drew Youngren's 3D Calculus Visualizations

Home Page: https://3demos.ctl.columbia.edu/

License: GNU General Public License v3.0

CSS 0.63% HTML 0.50% JavaScript 26.92% Svelte 66.19% Makefile 0.76% Python 4.99%
hacktoberfest

3demos's People

Contributors

carl-vbn avatar dependabot[bot] avatar drewyoungren avatar evan-ctl avatar ndittren avatar nikolas avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

carl-vbn

3demos's Issues

CSS Refactor

CSS appears to be scattered through the various svelte source files.

Let's re-organize this with some central structure to be more understandable.

  1. Move common CSS styles out into a single file, e.g. media/css/main.css
  2. Reduce the amount of custom CSS needed in the svelte source files

Object data merging on delete

I've noticed odd bugs in the Vector and Space Curve. This happens in production as well, both in and out of a room.

  1. The object itself is deleted, but the parameters of every object in the list above the deleted object are shifted up one to the above list entry, but the original colors of that list remain the same.
  2. Even though the parameters have been modified the object does not change. Even when you modify a parameter only that one parameter is affected.
  3. The delete animation looks like the delete is happening at the top of the list. This might hint at the behavior of the bug. Maybe the first list element is deleted along with their parameter data, and so the rest of the list is preserved? But the colors are unaffected for some reason. In which case the object is properly deleted and it is just the list items that are screwy.

This requires some investigating. Here a third vector was deleted and now these two vectors don't correspond to their objects, but notably the red vector params match the state of the blue vector
Screenshot 2023-03-01 at 4 45 14 PM

Formatting

If possible, could one of you add a .prettierrc or .editorconfig with the CTL house style? I realize (finally) my prettier settings at home are making commits a mess.

Address room ID collision issue

Currently, the "Make Room" procedure can overwrite existing rooms - the room ID is generated at random. Let's make sure the room is empty before using that ID for a new room.

Which begs the question - when and how are rooms made empty? The policy itself is very flexible - e.g. after a day or so of inactivity we can clean up room data. But how exactly will this happen on the technical side: a cron job? A celery task? Obviously, let's keep things as simple as possible.

Speed up rollup build

The rollup build (i.e. npm run dev) takes about 20 seconds to compile on my system, in development mode. This is fine for a production build, but annoying when making small changes and you want quick feedback. I'd like to see if we can speed this up.

Flip Panel tab navigation

There is more to do accessibility wise. I found a glaring issue with the “Flip Panel” functionality:

All elements are rendered in the order of their renderings in the Svelte apps. This does not change when they are hidden and they are not skipped over. Therefore to navigate to the object list you HAVE to tab through whatever chapter is open at the time. Hidden elements should not draw focus unless the element is supplemental to help with accessibility features.

Space Curves publish overwrite not working

If you publish a Space Curve, then delete it, create a new one, modify it (make sure to change the color), and publish the published curve remains the same, except the color changes.

I'm wondering if this happens for the same reason that issue #385 is happening?

Accessibility - buttons

Every clickable element should either be a <button> tag, or at least have role="button" specified on it.

Integration objects persist after deletion of parent object

The boxes that are generated to display the integration of objects (for those objects that have working Integrate switches) are no destroyed when their parent object is deleted. They are orphaned and inaccessible. Even the Clear Objects button does not remove them.

Define data model for scene

We need a data model to allow for import/export of arbitrary scenes, as well as sharing a scene out to students.

Implement Object Select feature

Implement an object select to specify which object should be affected by hotkey manipulation, including shifting selection up and down the object list with the keyboard for accessibility purposes. As it stands using a hotkey will affect all objects in the scene at once.

levelWorker is slow

Drawing level sets takes way too long, on the order of seconds.

The culprit is likely makeTraces in levelWorker.js that it calls marchingSquares for every curve along each dimension, redundantly evaluating the function many times.

Tutorial Documentation

Provide documentation for new users regarding mouse and keyboard controls, the site structure, submitting forms, making/editing polls, etc.

Automate JS build

Right now the process is to commit compiled code into media/mathplayground/build to update the JS build. This is a basic process I put together years ago and haven't changed since. Is it time to finally sort out a way to reliably automate this via jenkins?

FXAA shader reduces FPS when scrolling around view

The FXAA anti-aliasing shader pass I've added makes the edges of the objects a little smoother, but it also noticeably reduces responsiveness when scrolling the camera around the scene.

At this point I actually prefer the jagged lines scene I get when commenting out the shader pass, because the camera interaction is so much smoother. But, it may be possible to tweak things here and get the best of both worlds with some further configuration.

Save/Load scene state in room

These are some general thoughts on the technical architecture of how we're going to handle shared scene state.

I'm realizing there's a new use case I want to handle that's not covered by the current websockets setup:

  1. I enter a room and make an object on the graph
  2. A different user enters the room after the new object is made

In this case, the second user didn't receive the websocket event, because they weren't on the page. Would it be crazy to store this state in a simple key-value store (Redis), somehow? Possibly. I mean, it could be a fine alternative to a database in this scenario as the ephemeral nature of the scene is fine: we are planning import/export functionality via csv.

We are using Redis for two things already in mathplayground:

  • WebSockets channels communication
  • Session storage

From my understanding, session storage is pretty much tied to a single user's client. It's a useful way to store data to a unique, anonymous user's client. I don't think it would really make sense to "share" session state between two different users... though the session mechanism may also prove useful here, somehow.

"Chat socket closed unexpectedly"

Chat socket closed unexpectedly this error keeps popping up on Firefox specifically, but looking at the django logs you can see that CONNECT is firing twice when a user makes or enters a room. Need to investigate. Nik suggests looking into the django-channels discussion boards. Look into async functions, race conditions, and possibly locks.

Make Room button unresponsive

I'm seeing this error that we've seen before on production - it's possible for the Make Room button to be unresponsive. The error is intermittent and not always easy to reproduce.

No JS console error, but there are new WebSockets connection attempts in the Network tab each time Make Room is clicked:
Screenshot_2023-02-23_16-04-18

In the mean time, it looks like the way to work around this is make a new browser session - i.e. close and restart browser, or use private tab.

Let's re-visit the makeRoom procedure here: https://github.com/ccnmtl/mathplayground/blob/main/media/src/modes/Session.svelte#L23

At the very least, let's display when there are errors. Ideally, let's handle this setHost method a different way. As I've discussed with Evan, the way it's currently set up is kind of awkward:

  1. On make room, create a websocket. Use this websocket to set session host data in redis, so the system knows we're the host.
  2. Navigate to new room URL. A new websocket is created in this new window.

There's no real reason we need a WebSocket to tell the system that we're the host. It was just the simplest way I could set a value in redis, as all the infrastructure is already set up. There may be another way we can set this, or otherwise infer that the new user is the host from the back-end.

Weird low-res three.js display when joining a room that happens to be animating

Tested on animating space curve. I've seen this bug a while ago too, so it wasn't a recent change that caused this. Worth looking into.

Screenshot_2023-03-07_16-48-38

To reproduce:

  • As the host of a room, make a space curve, animate it, and publish.
  • Join the room in private tab as student.

The display is fixed on the student side if the host removes the objects and publishes again.

Camera Reset not working

You might be mistaken in thinking that the button does nothing at all, but if you bring the camera close to the grid plan then you'll see that the camera does shift slightly with every click. This is different behavior from the buttons that currently do nothing. You can hold the mouse as still as possible, but clicking on the Camera Reset will still cause the camera to move.

Canvas focus

I'm getting an effect in recent builds where from the object list , when the "shade" is raised or lowered, it takes and extra click for the controls of the scene to respond, like it takes a click to "focus" on the canvas element. In limited testing, it doesn't seem to happen with the Chapters info box visible (raising or lowering takes no extra click), and doesn't seem to happen in older builds (I tried 26426df, at random).

Refresh deletes unpublished changes

The way that a host connects to the room is the same as anyone else, which means that any adjustments made to the room that haven't been published are not preserved on refresh.

I think expected behavior for the local object list of every user would be to preserve on refresh, but overwrite all user lists in the room on publish. Thoughts?

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.