
Gravit – Open-source design tool - jarek-foksa
http://hub.gravit.io/browser/
======
jarek-foksa
It's worth noting that Gravit.io is a JavaScript rewrite of Stagestack project
[1] which was an attempt to create commercial clone of Macromedia FreeHand
from scratch [2]. Stagestack project failed due to lack of funding from
FreeHand community.

[1] [http://www.stagestack.com/](http://www.stagestack.com/)

[2]
[http://www.freehandforum.org/news.html](http://www.freehandforum.org/news.html)

~~~
freework
... but Joel Spolsky said you should never rewrite code ever ever ever...

~~~
coldtea
Whereas what Joel said is debatable, this snark comment is wrong on so many
leves it's funny...

1) Joel was talking on the context of a software business -- if you have
working code it can be detrimental to business to do a rewrite from scratch,
it will take you years, you will leave stuff off, piss off your customers,
lose ground to the competition etc. It's not like Gravit.io has that kind of
"business reasons" at this moment (this is their initial version offering), so
his reasons do not apply to it.

2) Gravit.io is a port of a project to another language. This is not a rewrite
-- much less a "rewrite from scratch". Again, Joel's reasons do not apply to
the situation.

~~~
Tosh108
I think he was trying to be funny

~~~
coldtea
Yeah, hence the "snark" moniker, but funny works better if it's also clever
and/or coherent.

------
joelthelion
This may be the first time I try a web app that is as snappy as a desktop one.
Congratulations!

What front-end frameworks/technologies did you use?

~~~
moron4hire
>> "What front-end frameworks/technologies did you use?"

Why is that everyone's first question? I get this constantly when I demo my
stuff at meetups and hackathons. None. The answer is none. And they look at me
like I just admitted to being a person who prefers to breath water. Vanilla JS
is not that hard. It's a sight easier to know one language than to have to
relearn the darling framework of the year all the time.

~~~
Igglyboo
Vanilla js is not that hard when you have thing like document.queryselect or
you're building trivial web apps. Sadly when you're building enterprise grade
software and you have to support things like Internet Explorer 7 it makes a
lot more sense to use a framework like angular than vanilla js.

~~~
moron4hire
Having been involved in lots of different types of projects over the years,
"enterprise" software is not different from other types of software in any
way.

~~~
Igglyboo
Sorry but when I'm writing my hobby projects I don't have to worry about
supporting a 13 year old browser.

~~~
moron4hire
The occurrence of this in enterprise is grossly overstated.

------
diminish
Random thoughts; (1) A classic drawing tool made slick, beautiful. (2) Flash
is not needed for this type of work at all, thanks to HTML5 (3) It's fast
enough (4) View source shows nothing, which means all the UI view generation
functionality has moved inside JS.

~~~
joshribakoff
(2) Maybe it was faster for him to build that way, due to experience, etc..
(3) strawman argument, perhaps he chose his technologies for other reasons
besides premature optimization. You're essentially accusing him of making a
design mistake IMO. (4) The fact that right click is disabled doesn't tell us
anything about the software architecture, your statement reads as if its a
critique.

~~~
diminish
I was indeed praising him. 2) he used html/js, and i'm glad flash isn't needed
to make such a tool 3) i was happy it's fast enough. 4)no u misunderstood; i
pressed ctrl+u and have seen the source code, indeed. it's an empty body with
few JS files. I find it remarkable as HTML's document centric approach with
viewable document structure disappeared from view and moved into the JS files.

------
reinhardt1053
Source code:
[https://github.com/quasado/gravit](https://github.com/quasado/gravit)

------
overgard
You might consider overriding the delete/backspace button. I tried to delete a
spline and ended up back on hacker news :-)

~~~
ch0wn
It's definitely one of those web apps where I'd be totally fine with a
`window.onbeforeunload` popup asking me whether I really want to leave.

------
thewarrior
Has anyone here manage to figure out the secrets behind this apps blazing fast
performance ?

~~~
moron4hire
Load performance is mostly due to the few number of files that are being
included, though minification also helps.

Application performance is typical of modern, hand-coded JS. Or rather, I
should say, the only reason I can see for why people tolerate bloated
frameworks is because they've just come to expect JS to be slow. There is a
reason some of us insist on sticking to vanilla JS. It's not because we're
crotchety, old, greybeards. We wouldn't be touching JS at all if that were the
case.

It appears they might also be using layered canvases to render different parts
of the workspace that update at different rates. So that prevents them from
having to redraw the checkered background every time you move the drawing. And
it prevents them from having to redraw the existing drawing every time you add
a new element and are still adjusting it.

Pretty standard techniques for anyone with experience working with Canvas,
actually.

------
jng
Congrats on the great job. Nobody would raise an eyebrow for this work if it
were not browser-based. Does this say something about the state of web apps?

------
_delirium
For offline usage, has anyone used both Gravit and Inkscape for any
significant period of time, and can comment on pros/cons?

This might be a dumb question if they don't really occupy the same space. But
naively it seems to me like they overlap somewhat, and maybe I should move
some of what I currently do in Inkscape to Gravit? (I'm not all that
proficient in Inkscape, and at first usage Gravit seems simpler.)

------
iamleppert
This is awesome!! Played around with it for awhile. Very snappy, great UI.
Very functional! Well done.

------
baltcode
I couldn't click on the Save item in the File menu.

~~~
zo1
It's a demo...

------
nulldata
I'm impressed with the responsiveness on the iPad, it feels like a native app!

~~~
Pxtl
Same on n7. Developer should phonegap this thing and drum up some revenue on
the app stores, OSS or not.

------
theoutlander
Nice interface. I'm trying to get better at very quickly implementing UI's
from the ground up (also moving past bootstrap/foundation). What was your
approach to making this interface? Did you use a pre-processor? Did you modify
an existing framework or generate css output from a photoshop mockup? Thanks.

------
djtriptych
This is very good. I think it's designed to be an Adobe Fireworks replacement.
Great stuff!

------
aaron987
Nice work! It might be cool to allow people to share designs. So if I was
creating a web page, I could browse through web pages other people have
created and import one, then use that as a foundation for my own design. At
any rate, this is pretty cool.

------
microcolonel
This is kinda cool, and might help out the web crowd which is working with
Chrome OS at the moment.(I'm writing this comment on a Chromebook right now)

Why anyone would use this rather than inkscape on either Linux or Windows,
however, is beyond me.

------
webwanderings
I was looking for something similar frantically the other day when I couldn't
use pixlr (it needs flash and my laptop was very old).

But, how do I insert an image from my computer as the layer?

------
adamjs
Has a nice UI (albeit cloned from Photoshop).

Save/Export doesn't seem to work on my machine (Chrome 37, Mac OSX).

Would be nice to see some kind of SVG export instead of raster formats.

~~~
boomskats
There's an intro to the app on their blog. Sounds like they were going for
Freehand/Fireworks rather than Photoshop :)

All saving also disabled for me, guessing the back end isn't quite there yet.

------
hliyan
That loaded much faster than expected. I'd very much like a peek at the code
(could not find a link to Github or Google Code).

~~~
sputnik27
[https://github.com/quasado/gravit](https://github.com/quasado/gravit)

Found on [http://gravit.io/](http://gravit.io/), upper right corner.

------
wydyl
Fantastic...have a similar initiative though of a little different flavor.
Will share soon.

All the best

------
nottombrown
This is great. I could see it replacing much of my Illustrator work.

------
kudu
Just wondering, why is the title of this submission allowed to remain as
"Gravit - Open-source design tool"? Under HN's dogmatic rules, shouldn't it be
renamed to just "Gravit"?

~~~
nightpool
While this was once a problem, your information is like 6 months out of date.
The mods have been pretty good at balancing "informative" and "close to the
original submission". pg even said that the way the rules were being
interpreted weren't the way they were originally intended.

------
hawleyal
Trash buttons don't work.

------
dfurlong
This is not open source! this is free software

~~~
gokhan
GPL

[https://github.com/quasado/gravit/blob/master/LICENSE](https://github.com/quasado/gravit/blob/master/LICENSE)

~~~
sspiff
I think he means free software as defined by the FSF, which has different
definitions for free-of-cost, open source and free/libre software.

------
clarry
I came expecting a free alternative to something like AutoCAD. Instead I got a
blank page, and after reloading with JS enabled, a core dump from a browser
that ran out of memory.

For a snappy drawing program, native code remains the way to go.

~~~
Igglyboo
I disagree, this is really fast and totally rivals a native app. What are you
computer specs and what browser are you using?

~~~
clarry
Do you disagree with the core dump on my hard drive? Firefox 31 ESR, Atom
N450, 1G of RAM. Gimp for instance runs pretty smooth (although there are much
faster still options if you don't need all the features); I use it a lot.

~~~
coldtea
> _Do you disagree with the core dump on my hard drive?_

No, he and I disagree that your experience is typical for everybody. Most
people in this thread (including me) praised this for its quick loading,
snapiness and speed.

Perhaps "Atom" and "1GB of RAM" doesn't cuts it for this kind of in-browser
app, despite GIMP (a native app) running "pretty smooth). It makes sense if
this has a minimum memory use requirement -- below which you can't run it at
all because you don't have enough space that it needs to load, and after which
you're OK and it's fast.

That said, people have run it on their iPads, and it's extremely snappy there
too.

I'm also not sure the core dump was because of "out of memory". How about some
glitch with your graphics card driver and the canvas renderer (which is not
uncommon)?

~~~
clarry
> I'm also not sure the core dump was because of "out of memory".
    
    
      out of memory: 0x0000000000020000 bytes requested
      Segmentation fault (core dumped) 
      [..]
      #0  0x0000097c6124c82a in kill () at <stdin>:2
      #1  0x0000097c74ed6fd4 in XRE_FreeAppData ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #2  <signal handler called>
      #3  0x0000097cd08b6957 in mozalloc_abort ()
         from /usr/local/lib/firefox-esr-31.0/libmozalloc.so.1.0
      #4  0x0000097cd08b6a07 in mozalloc_handle_oom ()
         from /usr/local/lib/firefox-esr-31.0/libmozalloc.so.1.0
      #5  0x0000097cd08b6707 in moz_xmalloc ()
         from /usr/local/lib/firefox-esr-31.0/libmozalloc.so.1.0
      #6  0x0000097c73667172 in NS_CycleCollectorSuspect3 ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #7  0x0000097c736624d0 in NS_DebugBreak ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #8  0x0000097c73660702 in NS_DebugBreak ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #9  0x0000097c75548bf9 in js::IterateGrayObjects ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #10 0x0000097c7554f8a5 in js::IterateGrayObjects ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #11 0x0000097c7555242c in js::IterateGrayObjects ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #12 0x0000097c7365e71f in NS_DebugBreak ()
      ---Type <return> to continue, or q <return> to quit---
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #13 0x0000097c7365e644 in NS_DebugBreak ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #14 0x0000097c73661e9c in NS_DebugBreak ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #15 0x0000097c736634ed in NS_DebugBreak ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #16 0x0000097c73664d0d in NS_DebugBreak ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #17 0x0000097c73665d7f in NS_CycleCollectorSuspect3 ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #18 0x0000097c74474d6a in DumpCompleteHeap ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #19 0x0000097c74475cdc in DumpCompleteHeap ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #20 0x0000097c736b2fcb in XRE_AddJarManifestLocation ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #21 0x0000097c736b3135 in XRE_AddJarManifestLocation ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #22 0x0000097c736b006d in XRE_AddJarManifestLocation ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #23 0x0000097c73648291 in ?? ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      ---Type <return> to continue, or q <return> to quit---
      #24 0x0000097c738b8006 in std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >::_M_insert_aux ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #25 0x0000097c73888ec9 in std::_Rb_tree<int, std::pair<int const, std::string>, std::_Select1st<std::pair<int const, std::string> >, std::less<int>, std::allocator<std::pair<int const, std::string> > >::_M_erase ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #26 0x0000097c7431f7fe in js::BaseProxyHandler::finalizeInBackground ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #27 0x0000097c74f0bf93 in XRE_StartupTimelineRecord ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #28 0x0000097c74ecd2ea in XRE_InitCommandLine ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #29 0x0000097c74ecd4d1 in XRE_InitCommandLine ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #30 0x0000097c74ecd8b6 in XRE_main ()
         from /usr/local/lib/firefox-esr-31.0/libxul.so.1.0
      #31 0x0000097a4a703f87 in atexit () from /usr/local/bin/firefox-esr
      #32 0x0000097a4a7038b1 in _start () from /usr/local/bin/firefox-esr
      #33 0x0000000000000000 in ?? ()

~~~
coldtea
Fair enough!

