code: func MarshalViewPropertiesJSON(v ViewProperties) ([]byte, error) {
  	var s interface{}
  	switch vis := v.(type) {
  	case SingleStatViewProperties:
  		s = struct {
  			Shape string `json:"shape"`
  			SingleStatViewProperties
  		}{
  			Shape:                    "chronograf-v2",
  			SingleStatViewProperties: vis,
  		}
  	case TableViewProperties:
  		s = struct {
  			Shape string `json:"shape"`
  			TableViewProperties
  		}{
  			Shape:               "chronograf-v2",
  			TableViewProperties: vis,
  		}
  	case GaugeViewProperties:
  		s = struct {
  			Shape string `json:"shape"`
  			GaugeViewProperties
  		}{
  			Shape:               "chronograf-v2",
  			GaugeViewProperties: vis,
  		}
  	case XYViewProperties:
  		s = struct {
  			Shape string `json:"shape"`
  			XYViewProperties
  		}{
  			Shape:            "chronograf-v2",
  			XYViewProperties: vis,
  		}
  	case LinePlusSingleStatProperties:
  		s = struct {
  			Shape string `json:"shape"`
  			LinePlusSingleStatProperties
  		}{
  			Shape:                        "chronograf-v2",
  			LinePlusSingleStatProperties: vis,
  		}
  	case MarkdownViewProperties:
  		s = struct {
  			Shape string `json:"shape"`
  			MarkdownViewProperties
  		}{
  			Shape:                  "chronograf-v2",
  			MarkdownViewProperties: vis,
  		}
  	case LogViewProperties:
  		s = struct {
  			Shape string `json:"shape"`
  			LogViewProperties
  		}{
  			Shape:             "chronograf-v2",
  			LogViewProperties: vis,
  		}
  	default:
  		s = struct {
  			Shape string `json:"shape"`
  			EmptyViewProperties
  		}{
  			Shape:               "empty",
  			EmptyViewProperties: EmptyViewProperties{},
  		}
  	}
  	return json.Marshal(s)
  }
docs: // MarshalViewPropertiesJSON encodes a view into JSON bytes.