RectDrawer (minimap)
@ckeditor/ckeditor5-minimap/src/utils
class
protected
A helper class that makes it possible to visualize rect objects.
TODO: Move this class to shared utils.
Filtering
Properties
Static properties
-
_defaultStyles : Objectprivate static
-
_domElements : Array.<HTMLElement>private static
-
_stylesElement : HTMLElement | nullprivate static
Methods
Static methods
-
clear()static
Clears all previously drawn rects.
-
draw( rect, [ userStyles ], [ name ] )static
Draws a rect object on the screen.
const rect = new Rect( domElement ); // Simple usage. RectDrawer.draw( rect ); // With custom styles. RectDrawer.draw( rect, { outlineWidth: '3px', opacity: '.8' } ); // With custom styles and a name. RectDrawer.draw( rect, { outlineWidth: '3px', opacity: '.8' }, 'Main element' );Note: In most cases, drawing a rect should be preceded by
clear.Parameters
rect : RectThe rect to be drawn.
[ userStyles ] : ObjectAn optional object with custom styles for the rect.
[ name ] : StringThe optional name of the rect.
-
_injectStyles()private static