Types like Margin or Offset are interfaces in Typescript's NvD3 facade to allow codes like:
chart.margin({
// With optional left or right for example
top: 30,
bottom: 30
})
One thing I have thought to implement is named parameters with default values:
def margin(left: Int = 0, right: Int = 0, up: Int = 0, bottom: Int = 0): this.type
The problem is that this methods are overloaded with a parameter-less method that returns the actual value of that property:
Let's find a way to create an easy way to bind and implement this functionality, and at the end methods like margin receive this objects with optional values.