Customization of lodash templateSettings

56 views
Skip to first unread message

Jonathan de Flaugergues

unread,
Jul 18, 2016, 8:46:07 AM7/18/16
to JointJS
Hi,

By default, lodash use the ERB-style delimiters for templateSettings.

I would like to customize this template like logic-less templates, but when I customize it, it's fail since joint.js use ERB-style in its joint.dia.Cell element.

e.g : 
  _.templateSettings = {
    interpolate: /\{\{=(.+?)\}\}/g,
    escape: /\{\{-(.+?)\}\}/g,
    evaluate: /\{\{(.+?)\}\}/g
  };

Is there a way to customize it ?

Thanks.

Jonathan.

Roman Bruckner

unread,
Jul 18, 2016, 9:15:19 AM7/18/16
to joi...@googlegroups.com
Hi Jonathan,

0.9.6+ JointJS doesn't use lodash `_.template` for templating. It uses a custom function `joint.util.template` instead. What version do you use?

Best,
Roman

--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Jonathan de Flaugergues

unread,
Jul 20, 2016, 8:39:14 AM7/20/16
to JointJS
Hi,

I'm using RappidJS version 1.7.1

Regards,

Roman Bruckner

unread,
Jul 20, 2016, 9:09:16 AM7/20/16
to joi...@googlegroups.com
Hi Jonathan,

unfortunately these changes are not part of the Rappid v1.7.x.
They will be included in Rappid v2.0+ though.

There is no way how to customize it I'm afraid (except rewriting all `markups` in JointJS to match your setting e.g joint.dia.Link.prototype.markup and avoid using utilities like filters and gradients).

I have a look if this change could be back-ported to v1.7.3 (i.e. for the next 1.7 release as we going to keep maintaining the Rappid v1.7).

Best,
Roman


Reply all
Reply to author
Forward
0 new messages