From: Drup <drupyog+caml@zoho.com>
To: rixed@happyleptic.org, Philippe Veber <philippe.veber@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] js_of_ocaml and <svg>
Date: Sat, 2 Jan 2016 22:18:09 +0100 [thread overview]
Message-ID: <56883E91.1030704@zoho.com> (raw)
In-Reply-To: <20160102204246.GA23759@pim.happyleptic.org>
Indeed, It seems we are missing a Dom_svg.document function. Could you
please open a bug report ?
However, in this case, you should use Tyxml_js. The code is going to be
exactly the same as the one with normal tyxml, except the module is
Tyxml_js.Html5.
You can see a complete example here:
https://github.com/talex5/js-skeleton/blob/master/main.ml
Le 02/01/2016 21:42, rixed@happyleptic.org a écrit :
> Indeed TyXML can generate XHTML trees with svg elements.
> But how to use that to update the DOM from JS generated by js_of_ocaml?
>
> # echo > toto.ml <<EOF
> let svg = Dom_svg.createSvg Dom_html.window##document
> EOF
> # ocamlfind ocamlc -syntax camlp4o -package "js_of_ocaml js_of_ocaml.syntax" -c toto.ml
> Error: This expression has type Dom_html.document Js.t
> but an expression was expected of type Dom_svg.document Js.t
> Type
> Dom_html.document = (... yanked for sanity ...)
> is not compatible with type
> Dom_svg.document = (... yum yum ...)
> The second object type has no method anchors
>
> Apparently that's a known issue of js_of_ocaml:
> https://github.com/ocsigen/js_of_ocaml/issues/276
>
> that I don't know how to work around nicely, may be because I have no idea how
> js_of_ocaml interacts with tyxml. I guess you are the pveber of that discussion
> so probably you can shed some light on this?
>
next prev parent reply other threads:[~2016-01-02 21:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-02 17:43 rixed
2016-01-02 18:07 ` Philippe Veber
2016-01-02 20:42 ` rixed
2016-01-02 20:53 ` Spiros Eliopoulos
2016-01-02 20:56 ` Spiros Eliopoulos
2016-01-02 21:18 ` Drup [this message]
2016-01-02 21:30 ` Philippe Veber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56883E91.1030704@zoho.com \
--to=drupyog+caml@zoho.com \
--cc=caml-list@inria.fr \
--cc=philippe.veber@gmail.com \
--cc=rixed@happyleptic.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox