You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "pa7-sigma (via GitHub)" <gi...@apache.org> on 2024/12/27 19:17:29 UTC

[I] [Feature] Add blur/unselect state for selections [echarts]

pa7-sigma opened a new issue, #20625:
URL: https://github.com/apache/echarts/issues/20625

   ### What problem does this feature solve?
   
   ### Use case
   I'd like to mute other marks when an individual or multiple marks are selected to visually distinguish selected & unselected marks more prominently.
   While there is a select customization state, there is no way to customize the unselected slices during selection.
   
   ### Example Experience
   
   https://github.com/user-attachments/assets/f7fe70c9-acb7-4a69-9b0b-f00134a301ae
   
   ### Current Workaround
   - dispatch select action to trigger the select state & styles
   - after dispatching customize styles through accessing the graphics elements on the next tick (w/ requestAnimationFrame)
   
   Initially I tried a combination of dispatching highlight & select to show the emphasis state for selected marks however as soon as I hovered over a different mark the selected mark would no longer be emphasized.
   
   ### Open Questions 
   
   Is there a better way to do this without customizing on the renderer level?
   
   If no, is there an API to know when a dispatched action has been applied internally? I have not found any and 
   listening for the last `rendered` or `finished` event after dispatching an action turned out to not be feasible as the render delay was to long. Directly applying style customizations after dispatching the action (without waiting for the next tick) expectedly led to render inconsistencies 
   
   ### What does the proposed API look like?
   
   I can think of 2 ways to surface this:
   
   1. Apply blur styles on marks that are not selected when selection happens
   2. Introduce a new `unselect` state supporting an `itemStyle` configuration that would be applied to items that are not selected during selection
   
   1 would be a breaking change so probably not feasible, 2 would be additive but expand the API surface


-- 
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: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] [Feature] Add blur/unselect state for selections [echarts]

Posted by "vitalets (via GitHub)" <gi...@apache.org>.
vitalets commented on issue #20625:
URL: https://github.com/apache/echarts/issues/20625#issuecomment-3858702855

   I finally made it working with the current API. 
   The idea is to use the `selected` state for other items to blur them, while keeping the clicked item as `unselected`.
   
   1. set the `selectedMode` to `multiple`
   2. set the `select` style opacity to 0.3
   3. in the click handler mark all items as selected and then mark the current item as unselected
   
   [Demo code.](https://echarts.apache.org/examples/en/editor.html?c=pie-simple&code=nVNta9swEP6eX3ErDDsQ3JQkLKR0kLUp7MMorOyFjTIU-eyIyJaR5K6h5L9PlizZWRPoFoJl3z1399w9J1FpJkq4gucBgGaa48K-mg980guIPmOGEiWIDAh8w7ViGqORRah63YJuyRbhhmjSejhmjZliqVFGxrRv7FoIrlkVCkiW5ygNzqQsAopjjmXqQUIyk8RgHlFqRgk_rNAcIVKhAasF_LQIFw9QksL0FC0pRaXgVoqiTWEY7KrGVTHfEYAkKatNjmg2fhuMCjlSjeknkTb4om7a4F2Q999lmUJDa-wdqRmJ52M5wSPhtclxMZ7OR57aPRJJN7Aqc1Zi5Hr5C_9uMgvwGyZNteO42XwccKuCMH4cNp1PA-xL2SzAMlXHoZNxl_ErS1G00Bb54EOwqDZEMTM6P3iARtd7vet2qh3XhqTi9wdeG-0vwqw6jxvj994cO9-14KJZGZmvSWyYtf9kNmzWwP08t9CO0-cVzERFKNM7UzmZdLVDPns2z4fB_nJgzmJ3vSFSJ6KMI8oZ3UYjiJ_bRfxYpvg0sjtgX2E_hKv3bb3zcyiI3ALh3JJRQBSc-UU6sxifPUd9Z69pPExc6iQTckXoJo7VqF-tV6ALT5mqiKabJbU5un7b9XdFwzL7e-ToB2NoYwEqaT6SglRx_GsEzFZlQ4_dDy_doNrzoF9aS2kutO22Lo_3e4JwS9dH9W7fC7qBrDM4Ju5p_obLegdrQre5FHWZgpXumB6HDHt6_JBGiwPVsTd7lkH8BhNNpIEOXwjyn3q-QtHTQzqp678o22naU9lN9g8&enc=deflate)
   
   https://github.com/user-attachments/assets/0a8ab021-506c-47fc-be28-21f0e6923b16
   
   


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] [Feature] Add blur/unselect state for selections [echarts]

Posted by "lwangsf (via GitHub)" <gi...@apache.org>.
lwangsf commented on issue #20625:
URL: https://github.com/apache/echarts/issues/20625#issuecomment-2608469062

   Any update on this? Thanks.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] [Feature] Add blur/unselect state for selections [echarts]

Posted by "aliuwho (via GitHub)" <gi...@apache.org>.
aliuwho commented on issue #20625:
URL: https://github.com/apache/echarts/issues/20625#issuecomment-2852356529

   Would also love to see this implemented. We have use cases where we want to gray out unselected bars in our charts


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] [Feature] Add blur/unselect state for selections [echarts]

Posted by "vitalets (via GitHub)" <gi...@apache.org>.
vitalets commented on issue #20625:
URL: https://github.com/apache/echarts/issues/20625#issuecomment-3853036709

   I would also like this to be implemented. Did not find any better workarounds for now.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org