korbit-ai[bot] commented on code in PR #34794:
URL: https://github.com/apache/superset/pull/34794#discussion_r2291205470


##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -390,8 +393,17 @@ export default function transformProps(
 
   const array = ensureIsArray(chartProps.rawFormData?.time_compare);
   const inverted = invert(verboseMap);
+  let patternIncrement = 0;
 
   rawSeriesA.forEach(entry => {
+    const derivedSeries = isDerivedSeries(entry, chartProps.rawFormData);
+    const lineStyle: LineStyleOption = {};
+    if (derivedSeries) {
+      patternIncrement += 1;
+      // use a combination of dash and dot for the line style
+      lineStyle.type = [(patternIncrement % 5) + 1, (patternIncrement % 3) + 
1];

Review Comment:
   ### Limited Line Pattern Combinations <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The line pattern generation logic could lead to repeated patterns too 
quickly, making it difficult to distinguish between different derived series 
when there are many of them.
   
   
   ###### Why this matters
   With the current modulo operations (5 and 3), the line patterns will start 
repeating after just 15 combinations, which could make it hard for users to 
distinguish between different derived series in charts with many series.
   
   ###### Suggested change ∙ *Feature Preview*
   Increase the pattern variety by using larger numbers in the modulo operation 
and adding more pattern variations:
   ```typescript
   const patterns = [
     [1, 1],  // dot
     [4, 4],  // dash
     [8, 8],  // long dash
     [4, 4, 1, 4],  // dash-dot
     [8, 8, 1, 8],  // long dash-dot
     [4, 4, 1, 4, 1, 4],  // dash-dot-dot
   ];
   lineStyle.type = patterns[patternIncrement % patterns.length];
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1d82f850-ed80-4862-b21e-b2b8d9b49d78/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1d82f850-ed80-4862-b21e-b2b8d9b49d78?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1d82f850-ed80-4862-b21e-b2b8d9b49d78?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1d82f850-ed80-4862-b21e-b2b8d9b49d78?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1d82f850-ed80-4862-b21e-b2b8d9b49d78)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:98b21f84-5857-4642-bb51-f90ae665b7fb -->
   
   
   [](98b21f84-5857-4642-bb51-f90ae665b7fb)



-- 
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