mustcanbedo commented on code in PR #21201:
URL: https://github.com/apache/echarts/pull/21201#discussion_r2384012895


##########
src/model/Global.ts:
##########
@@ -1039,7 +1035,9 @@ function mergeTheme(option: ECUnitOption, theme: 
ThemeOption): void {
             if (typeof themeItem === 'object') {
                 option[name] = !option[name]
                     ? clone(themeItem)
-                    : merge(option[name], themeItem, false);
+                    : preserveUserOptions
+                        ? merge(themeItem, option[name], false) // User 
options have higher priority

Review Comment:
   So it seems that if we need to solve this problem now, there are two 
options: either do it the way I did in my first fix commit: 
8575bb150ab8a99f4e2b29a6e4762dc80082e206, that is, keep the configuration 
first, then apply it after changing the theme, or we would really have to carry 
out a significant amount of refactoring work. Currently, my proposed solutions 
are: 
   1. As you suggested, add a layer of models to handle it (private 
_themeModel: Model; private _userModel: Model; private _defaultModel: Model;). 
   2. Reference the flags from the option source, but in terms of memory usage 
this could potentially cause considerable performance overhead.
   If a short-term fix for this issue is needed, or a refactor for a complete 
solution, could there be an opportunity to participate together if needed?



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