stephenLYZ commented on PR #19038:
URL: https://github.com/apache/superset/pull/19038#issuecomment-1104997733

   @serenajiang Hi, thanks for the feedback. This PR is not only to prevent 
color conflicts caused by "run out" of colors in the color-scheme, but mainly 
to ensure that the same dimensions of all charts in the dashboard have the same 
color. 
   
   The `shared_label_colors` is transparent to the user. It stores the 
colorMap(`{[chartId]: { [label]: color }}`) of all charts in the dashboard, and 
if different charts have the same dimensions, these dimensions will be 
extracted to generate analogous colors of color scheme, which is to prevent 
color conflicts.
   
   The question is why we need to extract these same dimensions and use 
analogous colors. In this case, if we use the remaining color of color-scheme 
for the same dimensions in the one chart,  we can't be sure whether the 
remaining color has been used in another chart, which may lead to color 
conflicts in another chart.
   
   For example, one dashboard has chartA and chartB. The color scheme is 
`['red', 'yellow', 'blue']`. The chartA has two dimensions `['a', 'b']` and 
chartB has three dimensions `['b', 'c', 'e']`. 
   As before the color map is
   **chart A**
   ```
   {
     a: 'red',
     b: 'yellow',
   }
   ```
   **chart B**
   ```
   {
     b: 'red',
     c: 'yellow',
     e: 'blue',
   }
   ```
   But we need to make sure that dimension `b` has the same color in the two 
charts. If we both use `yellow` as the color value for dimension `b`,  it will 
cause a color conflict for chartB. That's the problem I want to solve.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to