Recent Changes - Search:

Information

Installation

Documentation

HtmlViewElementsDrawingPanel

Important notice about interaction:

If a panel is not Enabled, none of its drawables will be enabled for interaction. This is due to performance issues.
(:html:)
    <script src="../uploads/Download/EjsS_doc/ejss_doc_simple.js"></script>
    <script language="JavaScript">
      var dummy;
      getInfo("DrawingPanel" ,"EJSS_DRAWING2D.DrawingPanel");
    </script>

(:htmlend:)

Basic container for 2D drawing. A drawing panel is a view element able to display drawable objects within a rectangular region of the plane in which it defines a world coordinate system in user-provided coordinates. Drawables, or drawing elements, are graphical objects which draw themselves (in different forms) in a given position and with a given size within a drawing panel.

Properties

Scales
NameDescriptionValues acceptedDefault
Autoscale XWhether to automatically adjust X scales.A Boolean or variable or one of the constants true or false.True
Autoscale YWhether to automatically adjust Y scales.A Boolean or variable or one of the constants true or false.True
Minimum XMinimum X value that can be displayed.A constant or variable-1
Maximum XMaximum X value that can be displayed.A constant or variable1
Minimum YMinimum Y value that can be displayed.A constant or variable-1
Maximum YMaximum Y value that can be displayed.A constant or variable1
X Margin (%)The percentage of the margin in the autoscaled horizontal direction.A constant or variable0
Y Margin (%)The percentage of the margin in the autoscaled vertical direction.A constant or variable0
SquareAspectWhether to keep a square aspect.A Boolean or variable or one of the constants true or false.True
ScaleXTypeSCALE_NUM, SCALE_LOG.scale can be either in numbers or log.SCALE_NUM
ScaleYTypeSCALE_NUM, SCALE_LOG.scale can be either in numbers or log.SCALE_NUM
Interaction
NameDescriptionValues acceptedDefault
Enabledto enable interaction in this panel.A Boolean or variable or one of the constants true or false.False
CursorTypeForMovecursor type css https://developer.mozilla.org/en-US/docs/Web/CSS/cursor.default, grab, pointer are examples.default
StopEventPropagationstop event propagation in this panel.A Boolean or variable or one of the constants true or false. 
ShowAreaRectangleshow area of a rectangle selection in this panel.A Boolean or variable or one of the constants true or false.True
EnabledZoomingenabled zooming in this panel.A Boolean or variable or one of the constants true or false.False
EnabledDraggingenabled dragging in this panel.A Boolean or variable or one of the constants true or false.False
OnMoveThe action to invoke when the element is pressed.The JavaScript code to invoke for the action. 
OnPressThe action to invoke when the element is pressed.The JavaScript code to invoke for the action. 
OnDragThe action to invoke when the element is dragged.The JavaScript code to invoke for the action. 
OnReleaseThe action to invoke when the element is released.The JavaScript code to invoke for the action. 
OnDoubleClickThe action to invoke when the mouse enters the element.The JavaScript code to invoke for the action. 
OnOrientationChangeThe action to invoke when the mouse enters the element.The JavaScript code to invoke for the action. 
OnZoomThe action to invoke when the mouse enters the element.The JavaScript code to invoke for the action. 
Graphical Aspect
NameDescriptionValues acceptedDefault
GraphicsModeGraphics mode.SVG or CanvasSVG
VisibleThe visibility of the element.A Boolean or variable or one of the constants true or false.True
DisplayThe css display of the element. https://developer.mozilla.org/en-US/docs/Web/CSS/displaycss display block, inline-block, flex, inline-flex etc. example to try booleanVariable?"inline-block":"none" // if booleanVariable is true then display is set to inline-block, else display is set to none. This provides a nice method to show or display none the drawingPanel, superior to Visible as Visible will continue to keep the drawingPanel is the same position, creating a blank space.True
Width values are default in px, accepts % https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units.800px or 100%400px
Height values are default in px, accepts vh https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units.800px pr 90vh300px
BackgroundThe background color for the element.Use the editor provided or read about colors.White
ForegroundThe color to use when drawing or writing in the element.Use the editor provided or read about colors.Black
LineWidthThe font used to display text in the element.Use the editor provided to select name, style and size of the font. 
ShapeRenderingshape-rendering attribute provides hints to the renderer about what tradeoffs to make when rendering shapes like paths, circles, or rectangles. https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering.example to try auto | optimizeSpeed | crispEdges | geometricPrecision.auto
CSScss to apply. none
Transformstring https://developer.mozilla.org/en-US/docs/Web/CSS/transform.example rotate(0.5turn)none
TooltipText displayed when the mouse is over the element.A string constant or variable.none
Decoration
NameDescriptionValues acceptedDefault
GuttersGutters around the drawing area.Type the size of the four gutters or use the editor provided.[LEFT,TOP,RIGHT,BOTTOM][50,50,50,50]
GuttersLineColorGutters line color the drawing area.line color of the gutters or use the editor provided.black
GuttersLineWidthGutters Line Width around the drawing area.size of the four gutters line width1
GuttersColorGutters colorsuch as rgb(239,239,254), rgba(239,239,254,0.1), bluergb(239,239,254)
GuttersRenderingGutters Rendering.string.
ShowCoordinatesWhether to display coordinates when the mouse is pressed.A Boolean or variable or one of the constants true or false. 
CoordinatesFormatThe format to the coordinates.The property refers to the way the panel displays (in a yellow box at its lower left corner) the X and Y coordinate when you click on a point in the panel. The special value null makes the panel not to display this coordinate.(0.00,0.00)
TRMessageThe message to display at the top-right corner.A string constant or variable. 
TLMessageThe message to display at the top-left corner.A string constant or variable. 
BRMessageThe message to display at the bottom-right corner.A string constant or variable. 
BLMessageThe message to display at the bottom-left corner.A string constant or variable. 
Edit - History - Print - Recent Changes - Search
Page last modified on October 10, 2023, at 08:39 AM