chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

As a backend I can save y ranges on a cell

Open 121watts opened this issue 9 years ago • 6 comments

For a given cell on a dashboard we need another field on the cell object to persist range selection. Something like:

{
  x: 0,
  y: 0,
  ...
  ranges: {
    y: [0, 1],
    y2: [null,  null],
  },
}

Open to a different shape for ranges. Something like

ranges: [
    {
      axis: 'y',  
      bounds: [0, 1]
    },
    {
      axis: 'y2',  
      bounds: [0, 1]
    },
  ]

121watts avatar Jul 07 '17 16:07 121watts

lol @ title

jaredscheib avatar Jul 07 '17 23:07 jaredscheib

I would like @goller 's input on this before this is taken on. After spending some time reviewing the existing API, I think this would require a data migration as an equivalent API already exists here:

chronograf_api

The current API is inconvenient from the way #1714 is put together. However, the proposed API destroys context provided by having view information like ranges and labels associated with queries, which may be beneficial to some clients.

timraymond avatar Jul 11 '17 21:07 timraymond

We can talk more about this when you're back.

121watts avatar Jul 11 '17 22:07 121watts

@timraymond i don't think I understand. If this is an optional field there is no migration step that would be needed. What makes adding this field inconvenient.

This has nothing do do with the query, it is part of the visual representation. It belongs on the cell object.

nhaugo avatar Jul 11 '17 22:07 nhaugo

@goller i think we settled on something like this added to the cell:

{
  axes: {
     y: {min: 0, max: 1},
     y2: {..., label: "foo"}
  },
}

121watts avatar Jul 14 '17 00:07 121watts

{
    "axes": {
        "y": {
            "bounds": [
                0,
                1
            ]
        },
        "y2": {
            "bounds": [
                0,
                1
            ]
        },
        "x": {
            "bounds": []
        }
    }
}

goller avatar Jul 17 '17 17:07 goller