Synopsis
Moves all items from one depth to a new depth.
Syntax
reindex_depth(olddepth, newdepth) reindex_depth(id, olddepth, newdepth)
Description
The function arguments.
Argument | Description |
---|---|
olddepth | The object depth to change. |
newdepth | The new object depth. |
id | A ChipsId structure identifying the item, or a string containing the name of the object. |
The reindex_depth command changes depth of all objects from the specified depth to a new depth.
By default, objects within a depth are ordered chonologically based on when they were added to that depth. The objects are stacked with the oldest item at the back of the list and the newest item at the front of the list. This order is not changed by the reindex_depth command. If objects already exist in the new depth, the objects being added will appear on top of them.
Use the shuffle family of commands to change the rendering order of the objects within the depth.
Examples
Example 1
chips> set_preferences(['default.depth', '50', 'region.fill.style', 'solid'])) chips> add_region (4, 0.5, 0.5, 0.1, 'fill.color=blue') chips> add_region (5, 0.6, 0.5, 0.1, 'fill.color=red') chips> add_curve (range(5), [0, 1, 0, 1, 0]) chips> add_label (1, 0.5, 'DEPTH 100', 'depth=100 color=skyblue size=36') chips> reindex_depth(50, 110)
Reindex all objects at depth 50 (the two regions and the curve) to be at depth 110.
Example 2
chips> add_curve(range (5), [10, 2, -2, 2, 5], 'depth=50 frame.id=frame1') chips> (xr, yr) = ([0.5,0.5,3.5,3.5], [2,0,0,2]) chips> add_region (xr, yr, 'fill.style=1 fill.color=red depth=100') chips> add_frame () chips> add_histogram([1,2,3],[3,5,-1], 'depth=50') chips> add_hline(2, 'thickness=5 color=red depth=100') chips> tile(2,1) chips> reindex_depth('frame1', 50, 110)
Reindex objects in "frame1" (the curve) from depth 50 to depth 110. Objects in second frame are not affected by the reindexing.
Example 3
chips> set_preferences(['region.fill.style',"solid",'region.opacity',1]) chips> add_region(4, .4, .5, .1, 'fill.color=blue depth=50') chips> add_region(5, .5, .5, .1, 'fill.color=red depth=50') chips> add_region(6, .6, .5, .1, 'fill.color=green depth=50') chips> add_region(4, .4, .6, .1, 'fill.color=skyblue depth=100') chips> add_region(5, .5, .6, .1, 'fill.color=pink depth=100') chips> add_region(6, .6, .6, .1, 'fill.color=seagreen depth=100') chips> add_hline(0.5, 'color=purple depth=25') chips> add_vline(0.5, 'color=purple depth=25') chips> reindex_depth(50, 100) chips> reindex_depth(100, 20)
The objects at depth 50 (the blue, red and green regions) are moved to depth 100, so that they are on top of the regions in depth 100 (the skyblue, pink, and seagreen regions). The objects of depth 100 (all the regions) are then moved to depth 24, under the horizontal and vertical lines.
Bugs
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.
See Also
- concepts
- chipsid, currency, depthcontrol
- depth
- collapse_depths, display_depth, get_default_depth, hide_depth, set_default_depth