My edges' and vertices' user objects' toString methods generate a label for the node / vertex based on the current state of the user object. The changes in the state of the user objects are not reflected in the UI until mxGraph.refresh is called.

This works, but I only actually need to refresh individual mxCells because it is event driven. It's quite a CPU intensive application I have, so I would like to do something along the lines of mxCell.refresh().

How do you refresh specific cells rather than all of them?

asked 28 Jul '11, 01:14

Spycho's gravatar image

accept rate: 0%

edited 08 May '12, 08:27

David's gravatar image


This does the trick (you can clear multiple cells before calling validate):

graph.getView().clear(cell, false, false);

answered 29 Jul '11, 05:15

Gaudenz's gravatar image

accept rate: 39%

edited 08 May '12, 07:09

David's gravatar image


I'm having trouble getting this to work... Can you pass an array of cells to the clear method? It doesn't appear to complain about it, but it isn't in the docs...

(29 Jul '11, 06:06) Spycho

Also, what do the 'force' and 'recurse' parameters do?

(29 Jul '11, 06:11) Spycho

You can pass one cell to the clear method.

(29 Jul '11, 23:07) Gaudenz
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 28 Jul '11, 01:14

Seen: 2,256 times

Last updated: 08 May '12, 08:27