Skip to content

Conversation

@ChitlangeSahas
Copy link
Contributor

@ChitlangeSahas ChitlangeSahas commented Dec 17, 2021

Closes #3098

Bigger Picture:

Screen Shot 2021-12-17 at 3 34 02 PM

The translate is basically looking at the viewProperties.colorMapping object from the idpe and then looking up the color using the index in the properties.colors array. We then embed the color property into the mappings.[series_index] object in giraffe.

Visualization of how the colorMapping object is translated into color for the giraffe. This translation happens in the UI. (getColorMappingObjects function)

Screen Shot 2021-12-17 at 3 51 12 PM

@ChitlangeSahas ChitlangeSahas requested a review from a team as a code owner December 17, 2021 22:40
@ChitlangeSahas ChitlangeSahas requested a review from a team December 17, 2021 22:41
@ChitlangeSahas ChitlangeSahas changed the title feat: color mapping pass the mapping object to giraffe feat: Color Map pass the colorMapping object to giraffe Dec 17, 2021
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.

Good work! Code looks pretty clean and I like the comments you have. Have a couple of suggestions for more comments and maybe some more tests.

Edit: oh and like we said on Slack - let's hold off merging this until the start of next week

@ui-ci-bot-influx
Copy link

ui-ci-bot-influx commented Dec 17, 2021

Metric Score Level
performance 54 🔴
accessibility 97 🟢
seo 90 🟢
pwa null 💩
best-practices 100 🟢

Compare your scores with master branch

package.json Outdated
"cy:dev": "source ../monitor-ci/.env && CYPRESS_dexUrl=CLOUD CYPRESS_baseUrl=https://$INGRESS_HOST:$PORT_HTTPS cypress open --config testFiles='{cloud,shared}/**/*.*'",
"cy:dev-oss": "source ../monitor-ci/.env && CYPRESS_dexUrl=OSS CYPRESS_baseUrl=https://$INGRESS_HOST:$PORT_HTTPS cypress open --config testFiles='{oss,shared}/**/*.*'",
"generate": "export SHA=2da36d4beb7fc22dd8d037c3398c91c7ca2c346d && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta",
"generate": "export SHA=018d2381f78e52acbe1deaaff4c9512adf5e3703 && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this SHA lives in a branch, maybe we should wait for this PR influxdata/openapi#248

* 'result',
* ],
*
* the seriesID would be : "co-airSensors-TLM0102-mean-"
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

interpolation,
position: properties.position,
colors: colorHexes,
colorMapping,
Copy link
Contributor

Choose a reason for hiding this comment

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

an alternative to passing in colorMapping: null when the flag is off is doing something like:

remove this line in the definition of config, and then below where config is defined, doing this:

if (isFlagEnabled('graphColorMapping')) {
  config.colorMapping = colorMapping
}

to make sure this is truly 'dark' in the sense that it makes no changes to production code if the flag is off.

@@ -0,0 +1,402 @@
// tests will go here
Copy link
Contributor

Choose a reason for hiding this comment

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

✂️

@ChitlangeSahas ChitlangeSahas merged commit 799ced9 into master Dec 20, 2021
@ChitlangeSahas ChitlangeSahas deleted the color-mapping-pass-to-giraffe branch December 20, 2021 21:13
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.

Color Map: Pass the color preferences object to Giraffe

4 participants