-
Notifications
You must be signed in to change notification settings - Fork 282
Using maker.js without the CodeMirror-Editor #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @DanDaHahn, I just now added the ability for you to render your own model in the playground:
I think the easiest thing might be for you to just hide the editor with CSS. See the original stylesheet. And tweak it until you can't see the editor. Resize your browser to make sure it is invisible in large and small window sizes. Hope this helps! -Dan |
Thank you for your responds Dan! I'am grateful that you try to help and for adding this ability to the playground. |
Hi @DanDaHahn , you probably can just take the JavaScript and remove bits about the editor one by one. I'm sure that it will work without it, if you keep testing your changes along the way. This project has an Apache 2.0 license which permits you to make changes. Just make sure to keep a copy of the license with your changes. 👍 |
Thanks for your suggestion Dan. So only removing JavaScript could do the trick? If I remember it right I got sometimes some issues where I had to remove something in the TypeScript - file. |
You only need to modify the JavaScript file 😃👍 |
Thank you Dan. You were right. I did something wrong at the beginning. I'am glad that you could assure me that only the JavaScript file had to be modified. |
I'm also interested in this use case. I'd like to import an SVG path and display it in the web page with the blueprint, zoom, pan, and fit-to-window capabilities: I've been taking playground's index.html and slowly removing elements/js etc but there's still a lot of boilerplate and codemirror references to remove and wondered if there was a ready-made version with just the GUI available? |
Here's a super-ugly hack that throws a couple console errors, isn't resize-friendly, doesn't trigger a measurements calculation, and doesn't fill the entire viewport height but it might give you a sense of an approximation of my goal:
|
@mrbluecoat thanks for the examples! I recently refactored the repo to be a monorepo so that modular development would be easier. The goal is to make each of these available as separate components:
Currently the Playground is just one big module that needs to be broken apart. |
@danmarshall |
@roduq yes, there are a few ways you can do this:
|
Hello, I also need the beautiful blueprint for an ongoing project. So I made this little module. If it helps :) https://onlfait.github.io/svg-blueprint/docs/ |
Hey, @lautr3k @danmarshall , I really loved both your work ! So I ended up building a react-component with "blueprint, zoom, pan, and fit-to-window" functionality: https://github.com/Bersaelor/react-blueprint-svg I was hoping a library that presents maker.js models nicely in a react web app will allow for a wider audience for makerjs. At looc.io we have a react based CMS, where clients upload 3D objects that we show in AR client apps. Then we modify uploaded CNC shapes and put out a modified shape that goes to the milling machine. |
@lautr3k @Bersaelor great to see you guys modularizing this! The Playground is in dire need of modularization, I originally wrote it as a small proof of concept, then added one thing after another. This was before there was great tooling for components, which we have now in 2020. |
That would be great, although I should admit I'm pretty new to typescript and react, been mostly working with Swift and C-like languages in past years. The component is working in the example I put in the repo, but I do still have to work out some kinks when embedding it as a small component of a larger react app. Hoping to finish this work in the next weeks. |
Hello Dan. I came across makerjs and have a question. Before I ask the question, I want to let you know that I’am still a „Beginner“ at programming. I hope the answer to my question isn’t to obvisouly. My question is: Is it possible to use your makerjs example as it is in your github download just without the CodeMirror-JavaScript-Editor? My goal is it to display a .dxf in the viewer. I'am going to parse a .dxf into a .json and make it readable for makerjs. If I try to cut out the editor nothing works. It seems like it’s hard to imagine without it, or am I wrong? At the beginning I thought that it would be easy to cut the editor. I thought it just reads out of the editor and that’s it – seems like my guess was wrong.
It seems like it is a relatively important component. Maybe I‘am totally wrong. If so, perhaps you can give me a hint how to cut out the editor and hand over the information within a function (for example if I just put an example makerjs-object in the code and read it out and display it in the viewer).
English isn’t my native language. I hope you’ll understand it and maybe give me a hint.
Best regards
The text was updated successfully, but these errors were encountered: