Open benlk opened 7 years ago
I am making some attempts towards this direction too. Clearly, this is the most accurate and complete orrery code we can find. But I am not familiar enough with packaging in js to move a lot forward. What I'd love is to build this as a npm package, to be able to load remote scenario data. Indeed, why stopping at our own solar system while there are hundreds of exo ones known today? And counting.
Added the lines I use to run the app in the readme.
I did not build the orrery with extendability in mind, so it is not possible to install it through npm. In fact, I built it merely to have a bit of fun, so unfortunately I did not think of other users when I did. I made it available on github because I thought maybe people would want to see how it works, I did not think that some would want to use it! If you fork the project though, it would be super easy to add scenarios. If I have some time I'll try to find a way to make it extendable.
That's usually the way good projects start. But the result of jsorrery is great, and could be very useful inside other projects. Maybe there are not so many of them, but what I'm building with https://www.arcsecond.io is precisely one of them.
I'd love to be able to dynamically load secnarii for exoplanets built upon my data source https://api.arcsecond.io
I'm about to leave for some vacations. But once back, I'll be happy to help to make it extendable. Thanks anyway for considering the suggestion!
Back from vacations, bit still struggling. :-)
This is what I am using... webpack -d --config ./webpack/dev.config.js
I couldn't get the production config working, some sort of node module conflict as I recall, so that's what I am using for now.
Unless you are just trying to get this running, in which case I have been using npm install, then npm start (which is running node server.js)
I keep investigating. Running local dev server is one thing, and I am able to do so as well. However, I am looking for a way to publish correctly the package to npm for it to be usable both in a browser and as a node module.
Once this is done, we'll have moved a long way. But another one starts: refactoring the thing to accept dynamically a planet scenario.
Ah, yes that would be super useful. Currently the project seems very tied to the UI. Sadly I don't have any experience getting an npm package up. Definitely interested in what you come up with though, Good Luck!
I spent quite a few hours again today. It seems that a lot of things are wired up together, and without the help of @mgvez I won't go very far, I fear. I am considering a rewrite from a boilerplate, then slowly integrating only the JS code...
Terribly sorry guys, I am so busy these days that I have zero time for jsOrrery. You're right, the code was not meant to be used in another context, and is tied to the UX. For another project, I needed to get the output of jsOrrery with different scenarios. With the current version, you could:
import { loadScenario } from 'jsorrery/src/JSOrrery';
onScenarioReady = loadScenario({
//see examples of scenarios in jsorrery
});
onScenarioReady.then(scenario => {
//scenario is an instance of jsorrery/Universe
});
There would still be work to do in order, for example, to completely detach the scenario from any gui (all calls to GUI from Universe could be called explicitly, if needed, from an external object) and from the DOM (Scene is created and added to the body, but Scene could be modified to keep its canvas as a property, which could then be accessible through Universe by an external scope, and then added wherever you'd like in the DOM)
Sorry again not to be of more help :(
Something using
babel
andwebpack
, but I'm not sure what the actual incantation is.