Skip to main content

Disk

WLJS
Execution environment
Supports dynamics

draws a filled Circle

Disk[{x_, y_}, r_]

or

Disk[{x_,y_}, r_, {start_, finish_}]

where start and finish are corresponding angles of a sector (used to make pie diagrams)

for example

Graphics[Table[Disk[RandomReal[{-1,1}, 2], 1], {i,10}]]

Dynamics

Fully support for a radius and coordinates. Use Offload

Parameters

RGBColor

Color of the filling and stroke (if EdgeForm is not specified)

{Blue, Disk[{0,0}, 1]}

EdgeForm

Specifies the color of a stroke

{EdgeForm[Red], Blue, Disk[{0,0}, 1]}

Opacity

Defines opacity for a primitive (see [[frontend/Reference/Graphics/Opacity]])

{Opacity[0.5], Red, Disk[{-0.5,0}, 1], Blue, Disk[{0.5,0}, 1]}

Methods

EventHandler

One can listen to a several events produced by this primitive using EventHandler

EventHandler[t_Disk, {event_ -> handler_, ...}]

where event can be

  • "mousemove" detects and sends coordinates of a mouse, when it is over this element
  • "drag" makes primitive draggable and emits coordinates
  • "zoom" detects zoom / mouse-wheel
  • "click" detects mouse clicks
tip

See more in Mouse and keyboard