HTML+JavaScript diagram builder

For discussing go computing, software announcements, etc.
User avatar
Charlie
Lives in gote
Posts: 310
Joined: Mon Feb 06, 2012 2:19 am
Rank: EGF 4 kyu
GD Posts: 0
Location: Deutschland
Has thanked: 272 times
Been thanked: 126 times

Re: HTML+JavaScript diagram builder

Post by Charlie »

This is very cool.

Can you add a "Copy to Clipboard" button at the bottom, right of the text output?
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: HTML+JavaScript diagram builder

Post by HermanHiddema »

Charlie wrote:This is very cool.

Can you add a "Copy to Clipboard" button at the bottom, right of the text output?


I looked into this, but it turns out you can't really do this from javascript. I would have to add a Flash component to make it work, which I am reluctant to do. I'll look into other solutions, such as auto-selecting all the diagram code when clicked.
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: HTML+JavaScript diagram builder

Post by Kirby »

I haven't looked into it much, but regarding the ipad issue, http://stackoverflow.com/questions/1079 ... k-for-ipad suggests binding to 'blur' in the javascript. I don't know if this applies to Herman's implementaion (I'm using an ipad now and don't see the source :)).
be immersed
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: HTML+JavaScript diagram builder

Post by Kirby »

Another workaround that's being referenced is to use onclick="".

Again, I don't know if this applies here, but it seems worth mentioning: http://stackoverflow.com/questions/1016 ... rk-on-ipad

Finally, one more idea: http://stackoverflow.com/questions/1361 ... art-events
be immersed
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: HTML+JavaScript diagram builder

Post by HermanHiddema »

@Kirby: Thanks for the links. The main problem right now is that I don't have an iPad to test with, really. I've installed a library that binds the tablet touch events to fire the relevant mouse click events, but apparently it doesn't work (this library is also recommended in one of your links, BTW). I'll try to get hold of a tablet somewhere, but until then I'm working blind. :)
tj86430
Gosei
Posts: 1348
Joined: Wed Apr 28, 2010 12:42 am
Rank: FGA 7k GoR 1297
GD Posts: 0
Location: Finland
Has thanked: 49 times
Been thanked: 129 times

Re: HTML+JavaScript diagram builder

Post by tj86430 »

If I change the color from top-right, all the numbered stones already on board invert their color. Non-numbered stones stay the same. Is this intentional?
Offending ad removed
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: HTML+JavaScript diagram builder

Post by HermanHiddema »

tj86430 wrote:If I change the color from top-right, all the numbered stones already on board invert their color. Non-numbered stones stay the same. Is this intentional?


Yes. The way the diagram format works, the colors have to alternate. You cannot have :b1: and :b2: on the same board. If 1 is black, 2 is white. The top right color choice only changes whether odd move are black, and even moves white, or vice-versa, and therefore all the moves already on the board switch color too.
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: HTML+JavaScript diagram builder

Post by HermanHiddema »

ez4u wrote:
HermanHiddema wrote:
ez4u wrote:Still no action on the iPad. The drop-down lists for labels and moves do drop down when touched. However, nothing else on the page reacts, not even the 'show help' tab.


Just to make sure: Did you do a reload on the page? Otherwise it might use a cached version.

Yes I did. I also tried using Chrome, Opera Mini, Atomic Web Browser, and Mercury (iOS alternatives). None work.


I tried it today on a Samsung Galaxy Tab 7.0, and that works, so it seems to be an iPad/iOS specific problem not immediately related to the touch vs. click difference. I'll try to get my hands on an iPad for testing.
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: HTML+JavaScript diagram builder

Post by HermanHiddema »

tj86430 wrote:One more suggestion: How about adding the "prisoners": line (or did I miss that too)?


Yes, good point, I need to add a field that allows you to set the caption.
User avatar
ez4u
Oza
Posts: 2414
Joined: Wed Feb 23, 2011 10:15 pm
Rank: Jp 6 dan
GD Posts: 0
KGS: ez4u
Location: Tokyo, Japan
Has thanked: 2351 times
Been thanked: 1332 times

Re: HTML+JavaScript diagram builder

Post by ez4u »

This is what the page looks like in Safari on the iPad. As mentioned, only the drop-down boxes 'work' in that they drop down and I can select a number. But nothing else functions. Also note that the handles for adjusting the board size do not appear at all.
image.jpg
image.jpg (155.52 KiB) Viewed 8348 times
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: HTML+JavaScript diagram builder

Post by Kirby »

If you don't want to buy an ipad for testing, maybe you can use the ipad dev kit with xcode to test it out with the emulator.
be immersed
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: HTML+JavaScript diagram builder

Post by Kirby »

HermanHiddema wrote:
daal wrote:This is really very good. Next step is to integrate it into L19...


Yes, this is one of the goals of the project. Because it is completely written in HTML+JS, it can easily be integrated into any site via some sort of overlay or popup. Good option both for L19 and for Sensei's Library. :tmbup:


Is this to say that you would not be opposed to L19 using your diagram builder directly?
be immersed
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: HTML+JavaScript diagram builder

Post by HermanHiddema »

Kirby wrote:Is this to say that you would not be opposed to L19 using your diagram builder directly?

Yes.

You can find the source on github:
https://github.com/HermanHiddema/diagrammer

And I've just put an MIT licence on it, which basically means: Do whatever you want with it, no restrictions.
User avatar
Bonobo
Oza
Posts: 2223
Joined: Fri Dec 23, 2011 6:39 pm
Rank: OGS 9k
GD Posts: 0
OGS: trohde
Universal go server handle: trohde
Location: Germany
Has thanked: 8262 times
Been thanked: 924 times
Contact:

Re: HTML+JavaScript diagram builder

Post by Bonobo »

HermanHiddema wrote:[..] The way the diagram format works, the colors have to alternate. You cannot have :b1: and :b2: on the same board. If 1 is black, 2 is white. The top right color choice only changes whether odd move are black, and even moves white, or vice-versa, and therefore all the moves already on the board switch color too.
Forgive the n00b question (I’ve never created diagrams, only enjoyed them)—how does this handle passing?
“The only difference between me and a madman is that I’m not mad.” — Salvador Dali ★ Play a slooooow correspondence game with me on OGS? :)
User avatar
Bonobo
Oza
Posts: 2223
Joined: Fri Dec 23, 2011 6:39 pm
Rank: OGS 9k
GD Posts: 0
OGS: trohde
Universal go server handle: trohde
Location: Germany
Has thanked: 8262 times
Been thanked: 924 times
Contact:

Re: HTML+JavaScript diagram builder

Post by Bonobo »

HermanHiddema wrote:
Kirby wrote:Is this to say that you would not be opposed to L19 using your diagram builder directly?

Yes.

You can find the source on github:
https://github.com/HermanHiddema/diagrammer

And I've just put an MIT licence on it, which basically means: Do whatever you want with it, no restrictions.
:bow:
“The only difference between me and a madman is that I’m not mad.” — Salvador Dali ★ Play a slooooow correspondence game with me on OGS? :)
Post Reply