ForeUI is an easy-to-use UI prototyping tool, designed to create mockup / wireframe / prototypes for any application or website you have in mind.

All posts tagged optimization

ForeUI V3.8: Use ClipArt to Make HTML5 Simulation Smaller and Faster

ForeUI V3.80 is released today.  This version introduces a new approach to optimize your HTML5 simulation, which is extremely useful for people who want to create big, complex prototype with ForeUI.

After actively working on a plot for some time, you may find out that your plot becomes bigger and bigger. Loading and saving the plot file is slow, and it may take several minutes to launch the simulation in web browser. When this happens, we would suggest you to optimize your plot before adding more content into it. Actually, the best practice is to understand how to avoid unnecessarily increase your plot size, and keep your plot small and neat at the beginning. We have a document to introduce all currently known tricks for this topic.

Before version 3.8, those tricks focus on avoiding duplicated or useless content in your plot. Since this new version, we have a new approach, which is to reduce the number of DOM objects that need to be loaded by the web browser, hence directly make your HTML5 simulation smaller and faster. Consider such an example: on the page you have a chart created with basic shape elements, such as rectangle, arrow line, text box etc., and you have two buttons to navigate between pages. Actually only these two buttons have their behavior defined, and other elements are just shapes or text, which are completely static. If you use older version of ForeUI to generate HTML5 simulation for it, all those elements will be converted to DOM objects, which have to be loaded by the web browser. If your plot has a lot of shape elements which are actually static during the simulation, loading them as DOM objects is a waste of resource for web browser, and you will see the simulation loading time meaninglessly prolonged.ChartNavI guess you already know what I am going to say, the best way to treat those “static” element is to put them into an image and let them display as a static background, while those buttons that have behavior defined should be kept as they are. So to simulate the page mentioned above, the web browser just need to load 3 DOM objects: the static chart image and two buttons, which will be very fast! Now the question is: how to tell ForeUI to do so?

ClipArt Element

The answer is to use ClipArt element, which is newly included in ForeUI V3.80. This new ClipArt element is not an element that you can directly drag and add into your plot. You will need to select one or more elements and then click the convert_clipart button in the tools panel to wrap it/them as a ClipArt. ClipArt is just like a Group, but it will be output as a static picture in the HTML5 simulation, which means all its members will not be interactive during the simulation. So please make sure not to abuse it, and do not put any element that has (or will have) behavior defined into the ClipArt, otherwise ForeUI will warn you in the behavior editor:


Wrapping some elements into a ClipArt looks like to put a static picture into your page, but there is difference: you can not modify the content of static picture in ForeUI, but you can edit the members of ClipArt as you wish. What’s more, you can always restore those elements from the ClipArt. This is extremely useful when you need to modify the diagram frequently.

You maybe interested in how good this kind of optimization can be, let’s see some comparisons.

The two plots in the comparison have the same content and behavior, the only difference is the second one converts all static elements into ClipArt elements. The plot files and HTML5 simulations are available in the table, so you can do the test by yourself. Your result may vary a little bit, depends on the hardware and software environment, but you will see the similar result, that the plot use ClipArt can be loaded much faster.

If you have a big plot, try using the methods mentioned in this document to optimize its size. If you are just starting a new plot, please also learn those tricks and keep your plot small. If you just want to create a prototype with less than 20 pages, it should be fine to ignore all these optimizations. However, if you are targeting a prototype with 100+ pages and still want it to be small and fast (it is possible, we have saw people did it), those optimizations are almost mandatory.

How to Make Your ForeUI Plot Smaller?

The design/development of ForeUI V3.0 is just started, and I have some time to write something.  I plan to write a series of articles to introduce some advanced tricks of ForeUI usage, which will be very useful for all ForeUI users.

Today’s topic is: how to make your ForeUI plot smaller?  The “plot” here means both the saved .4ui file and the exported DHTML simulation files.  The benefits to make plot smaller is obvious:  smaller plot can be loaded/saved faster for editing, and smaller simulation files can be launched quickly in your (and reviewers’) web browser.  Here are some tricks to minimize your plot size:

Use Master Page to Avoid Duplication

Usually there will be some common parts between pages in your plot.  Although you could duplicate elements or even the entire page to make every page have the common parts, you are encouraged to move the common parts to a master page, which can be shared by other pages.

This trick is frequently used for pages that have the same header, footer or side bar.  For example, all pages in your plot has the same header, footer and side bar.  So you can place them in a page, and all other pages use this page as the master page.  Thus you can just manage the center content on other pages, the figure below shows the details.

What if some pages have different side bars, while they have the same header and footer?  In this case you can use this master hierachy:

There are 3 pages are used as master pages.  Master Page 1 is shared by Master Page 2 and 3, while Master Page 2 is shared by two pages (Page 4 and 5) and Master Page 3 is shared by another two pages (Page 6 and Page 7).  This hierarchy should meet the requirements for most web site/app prototyping.

By using master pages, you can avoid duplicating content in the plot, and significantly reduce your plot size.

Optimise Image Usage

Experiments show that using images is the best way to enlarge your plot.  So if you wish your plot become smaller, make sure your plot only includes the images that are necessary.  It seems superfluous words, who would like to include unnecessary images in the plot?  But sometimes you may do this unconsciously, consider this case:  you add an Image Box element and specify an external image file for it, after a while you delete that Image Box and forget it.  But the image is still stay in the Image Dock, and will be saved to plot file even it is not referenced anymore.  If you did this a lot, your plot will be quite big, although most of the images in Image Dock are not used actually.

Shouldn’t ForeUI just take care of this situation and optimize it automatically?  I can’t agree more, so we will have it in V3.0, but we still have to do the optimization manually before 3.0 is out.  How to know if an image is referenced then?  You can click on the image in Image Dock, then you will see a pop-up menu like this:

You can see how many elements are referencing this image.  If an image is not used by any element (used by 0 elements), you can just click the  button to remove it safely.  Remarks: you will need to update to V2.802+ to have the correct image reference number (fixed Bug_0309).

Besides removing the unused images, you can also merge the duplicated images in Image Dock, which will also reduce your plot size.  Again ForeUI V3 will provide this feature, but we need to do it manually for now.  For example, say you have two images (img0 and img1) in Image Dock, they are duplicated and any of them are used by other elements, how could you merge them?

You can choose one image to keep, and click the button for another image to change all references to the one will be kept.  For example, you like to keep img0 (merge img1 to img0), you can click the button for img1, then you will see this window:

After you click the “Ok” button, all references to img1 will be changed to img0.  So nobody is using img1 now, and you can safely remove img1.

By removing unused images and merging duplicated images, your plot will become much smaller.  You don’t have to do this kind of optimization all the time, but you’d better do it once before exporting the plot to DHTML.

Use Text Box to Replace Big Rectangle

Rectangle is a very frequently used element in prototyping.  However when you want to add a big Rectangle into your plot (e.g. make it as background), you can consider using a Text Box (with border shown, background filled) instead.

Why?  Because the Rectangle element will be converted to an image file when you export the plot to DHTML, bigger Rectangle will generate bigger image file.  While the Text Box will be converted to just a snippet of HTML code, its size will not change when you enlarge the element.  So if you need a big rectangle, consider using a Text Box with border and background first, as long as you don’t need the radius corner feature provided by Rectangle element.

If your plot has many big rectangles and you replace them to Text Box elements, your exported DHTML files will become much smaller.


In this article I introduced three approaches to reduce your plot’s size.  It is not just about saving the space in your hard drive, it can also significantly reduce the DHTML files generated by ForeUI.  If you upload the DHTML files to the Internet for people to review, smaller file size is bandwidth and time saver.  I would suggest all ForeUI users to try using this approaches, and create small and powerful prototypes.