Remove unused ids from diagram-data.