CJex / regulex

:construction: Regular Expression Excited!
https://jex.im/regulex/
MIT License
5.71k stars 756 forks source link

Add support for overriding font/display settings #27

Closed asbasile closed 5 years ago

asbasile commented 9 years ago

In visualize.js, replaced the individual variables FONT_SIZE, LABEL_FONT_SIZE, FONT_FAMILY, PATH_LEN, and PAPER_MARGIN with a 'Properties' object that sets them as properties. If the new 'properties' parameter to the visualize() method is set, then its properties are copied into the main 'Properties' object. Thus, the calling routine can override these font/display properties by calling visualize() as follows:

/* Override font/display settings in visualize.js */ var properties = {FONT_SIZE:12, LABEL_FONT_SIZE:10, PATH_LEN:12, PAPER_MARGIN:8}; visualize(ret, '', paper, properties);