From: rixed@happyleptic.org
To: 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 21:42:46 +0100 [thread overview]
Message-ID: <20160102204246.GA23759@pim.happyleptic.org> (raw)
In-Reply-To: <CAOOOohS2J2MHsYEnkqOm+3f_We62bz=YRiV84f_9aBpDbQqQpw@mail.gmail.com>
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 20:42 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 [this message]
2016-01-02 20:53 ` Spiros Eliopoulos
2016-01-02 20:56 ` Spiros Eliopoulos
2016-01-02 21:18 ` Drup
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=20160102204246.GA23759@pim.happyleptic.org \
--to=rixed@happyleptic.org \
--cc=caml-list@inria.fr \
--cc=philippe.veber@gmail.com \
/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