Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Instancing

This is a DisplayObject. Declares a one or more shapes as a shared instance. Members of the instances array will be rendered as shared instances. (Currently supports only Rectangle)

 //inside map's return object. This example will render an orange rect
 //extending 30px above each bar, centered at the bar. Each render
 //will use instance sharing.
...
 graphics: {
     items: [
         {
             tag: "Instancing",
             key: "shades",
             instances: [
                 {
                     position: {
                         x: op(du(d.index()), '-', min(px(2.5), du(0.25))),
                         y: du(d.value())
                     },
                     size: {
                         width: min(px(5), du(0.5)),
                         height: px(30)
                     },
                     color: { r: 1, g: 0.5, b: 0.25 }
                 }
             ],
         }
     ]
}
...

Hierarchy

  • Instancing

Properties

Properties

instances: readonly Instance[]

An array of Instance objects that describes what shapes will share instances.

key: string

The graphic element's render key, like an HTML id attribute.

primitive: Shape

Optional. A Shape primitive to use. (Currently only supports Rectangle.)

tag: "Instancing"

Generated using TypeDoc