Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Polygon

This is a Shape primitive. Defines an instance of a Polygon shape for use in the Shapes or ContourShapes primitives value. Usage:

//within a map function's return object. This will draw a red triangle rect at each rendered
//bar's value and index.
...
 {
     graphics: {
         items: [
             {
                 tag: "Shapes",
                 key: 'tris',
                 //the polygon is a primitve
                 primitives: [
                     {
                         tag: 'Polygon',
                         points: [
                             //top
                             {
                                 x: du(d.index()),
                                 y: op(du(d.value()), '-', px(4))
                             },
                             //right
                             {
                                 x: op(du(d.index()), '+', px(4)),
                                 y: du(d.value())
                             },
                             //left
                             {
                                 x: op(du(d.index()), '-', px(4)),
                                 y: du(d.value())
                             }
                         ]
                     }
                 ],
                 fillStyle: {
                     color: '#f00'
                 }
             }
         ]
     }
 }
...

Hierarchy

  • Polygon

Properties

Properties

points: readonly Point[]

An array of Point objects that describe this Polygon.

tag: "Polygon"

Generated using TypeDoc