Skip to content

Conversation

@ChitlangeSahas
Copy link
Contributor

@ChitlangeSahas ChitlangeSahas commented Dec 15, 2021

Closes: #243
Depends on: https://github.com/influxdata/idpe/pull/12366

This PR adds the colorMapping property to the swagger definition. I ran make generate to update the other files needed.

Comment on lines +27 to +29
colorMapping:
description: An object that contains information about the color mapping
$ref: "./ColorMapping.yml"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are mine.

Comment on lines 1 to 7
type: object
description: maps series id to the color index that is used to index into the colors array
additionalProperties:
type: int
example:
series_id_1: 0
series_id_2: 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And these. Rest are generated.

Copy link
Contributor

@hoorayimhelping hoorayimhelping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is solid and will work just fine, but i gave a couple suggestions to make the documentation a little bit richer. let me know what you think

- explicit
ColorMapping:
type: object
description: maps series id to the color index that is used to index into the colors array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bit of an obvious comment. I think a better description would explain what a color mapping is so that someone reading this definition who wasn't familiar with color mapping would understand what it's for.

A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads.

type: int
example:
series_id_1: 0
series_id_2: 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a decent example, but it might be more illustrative if the series ids were more like how they'll be in real life using a common example that many people in the company would be familar with:

measurement_birdmigration_europe: 0

that isn't a very good example, but I'm sure you can find a more common example using sample data or something like that?

Copy link
Contributor

@hoorayimhelping hoorayimhelping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for updating those examples! solid work 👍

@ChitlangeSahas ChitlangeSahas merged commit 1e7c6a9 into master Dec 20, 2021
@ChitlangeSahas ChitlangeSahas deleted the sahas-color-mapping branch December 20, 2021 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI Color Mapping: Add a property to XYViewProperties to enable color mapping

3 participants