insights: add/remove data series, update series visual metadata
Created by: CristinaBirkel
Partial implementation for https://github.com/sourcegraph/sourcegraph/issues/25979
Description
This is a partial implementation of updating data series on insights:
- Update visual metadata (label and color)
- Add/remove series
- Add a series by including a
dataSeries
with noseriesId
field - Remove a series by excluding it from the
dataSeries
array
- Add a series by including a
To finish this issue, the query
, timeScope
and repositoryScope
will need to be updated. These will require more work because they affect the actual data that needs to be generated for the chart.
I have a few notes for discussion and will leave them as comments in the PR.
Testing Steps
- Query
updateLineChartSearchInsight
for an insight with at least onedataSeries
, and modify thedataSeries.options
and see that they return as expected. - Run the same query, but add another
dataSeries
, this time leaving out theseriesId
field. Verify that a new series is created and attached. - Now exclude one of the
dataSeries
and verify that it gets removed.