# Class: Context

## Konva. Context

#### <virtual> new Context()

  Canvas Context constructor

  Source:
    - konva-v5.2.0.js, line 1589

### Methods

#### clear(bounds)

  clear canvas

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `bounds` | Object | <optional> | ###### Properties
  Name | Type | Argument | Description
  --- | --- | --- | ---
  `x` | Number | <optional> |
  `y` | Number | <optional> |
  `width` | Number | <optional> |
  `height` | Number | <optional> |

  Source:
    - konva-v5.2.0.js, line 1735

#### clearTrace()

  clear trace if trace is enabled

  Source:
    - konva-v5.2.0.js, line 1693

#### fillShape(shape)

  fill shape

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `shape` | Konva.Shape |

  Source:
    - konva-v5.2.0.js, line 1609

#### fillStrokeShape(shape)

  fill then stroke

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `shape` | Konva.Shape |

  Source:
    - konva-v5.2.0.js, line 1631

#### getCanvas() → {Konva.Canvas}

  get canvas

  Source:
    - konva-v5.2.0.js, line 1722

  ##### Returns:

  Type
    Konva.Canvas

#### getTrace(relaxed) → {String}

  get context trace if trace is enabled

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `relaxed` | Boolean | if false, return strict context trace, which includes method names, method parameters properties, and property values. If true, return relaxed context trace, which only returns method names and properites.

  Source:
    - konva-v5.2.0.js, line 1649

  ##### Returns:

  Type
    String

#### reset()

  reset canvas context transform

  Source:
    - konva-v5.2.0.js, line 1712

#### strokeShape(shape)

  stroke shape

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `shape` | Konva.Shape |

  Source:
    - konva-v5.2.0.js, line 1620