DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Drawskrit  (Read 18,645 times)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • Participated in NANY Challenge Seven Times
    • Plugin Coding Medal
Drawskrit
« on: December 19, 2014, 09:43 PM »
My NANY contribution for this year is a simple description language for drawings and diagrams (which I've named Drawskrit). My main goal is to be able to describe diagrams with text. The description language should be natural and simple (I don't want a diagram programming language).

Its current state is experimental. I have a JavaScript implementation that demonstrates the current specification. I'm afraid it's not very useful yet though. I'm not sure I'll ever get it to a state where it'll be powerful enough to specify real-world non-toy diagrams without becoming a complex monster language.

A few of the current obvious shortcomings:
  • needs more shapes (e.g. arrows)
  • current text alignment sucks (specification bug)
  • dotted/dashed looks horrible with thick lines (implementation bug)
  • needs more documentation (e.g. layers)
  • JS implementation needs to be decoupled from the HTML demo page

If I ever get it to a state where it's actually useful, I'm planning to implement it as a cross-platform tool which can be integrated into an automated build process.

A non-formal specification (i.e. a description) and the JavaScript implementation can be found here:

https://github.com/phitsc/drawskrit

Drawskrit is open source.

If someone wants to play around with it please direct your browser here:

http://rawgit.com/phitsc/drawskrit/master/js/drawskrit.html

As a first example, paste the following text into the big text box on the left of the above web page:

Code
orange background filled shapes
_
small blue circle small green circle
tiny purple square big red triangle tiny purple square
small olive smile

==
fat navy huge empty dashed circle

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Drawskrit
« Reply #1 on: December 19, 2014, 09:45 PM »
that's pretty cool.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,970
    • Gathering Badge
    • Participated in NANY Challenge Once
Re: Drawskrit
« Reply #2 on: December 19, 2014, 10:10 PM »
very nice :up:

Code
yellow background empty shapes

-
small blue circle small green circle
tiny purple square big red triangle tiny purple square
small olive smile

[attachthumb=#]
Tom

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: Drawskrit
« Reply #3 on: December 20, 2014, 01:20 AM »
Love the live update!



Quote
black background filled shapes

small red circle
small blue circle small green circle
tiny purple triangle big yellow smile tiny purple triangle


==
fat orange huge empty dashed circle

Jibz

  • Cold Warrior
  • Developer
  • Joined in 2005
  • ***
  • Posts: 1,187
    • Programming School - Stage 1 Medal
    • Coding Snacks
    • Participated in NANY Challenge Four Times
Re: Drawskrit
« Reply #4 on: December 20, 2014, 07:50 AM »
Almost like handwriting PostScript, except without the reverse polish notation :D.
"A problem, properly stated, is a problem on it's way to being solved" -Buckminster Fuller
"Multithreading is just one damn thing after, before, or simultaneous with another" -Andrei Alexandrescu

Mattes57

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 23
Re: Drawskrit
« Reply #5 on: January 05, 2015, 05:48 PM »
Interesting concept.
Will it be possible to specify exact sizes?

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • Participated in NANY Challenge Seven Times
    • Plugin Coding Medal
Re: Drawskrit
« Reply #6 on: January 05, 2015, 09:28 PM »
Interesting concept.
Will it be possible to specify exact sizes?

The current concept assumes that shapes change their sizes depending on with how many other shapes they have to share the available space.

So with exact size, do you mean the size within one cell, or within the whole drawing?

Mattes57

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 23
Re: Drawskrit
« Reply #7 on: January 06, 2015, 10:16 AM »
With "exact size", I meant specifying for example, a square that is 100x100 pixel

Original address: https://www.donationcoder.com/forum/index.php?topic=39861.0