You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/11/22 09:36:10 UTC

[GitHub] [echarts] theoarmengou opened a new issue, #17953: [Feature] Use html to render symbols

theoarmengou opened a new issue, #17953:
URL: https://github.com/apache/echarts/issues/17953

   ### What problem does this feature solve?
   
   I have a tree that use svg with multiple paths, I'm using the callback to render different svgs depending on which element is shown in the graph.
   Currently I'm using `image://url.svg` which works and renders the SVG but with that method I can't change the SVG color which is required in my project.
   Using `path://...` to render the SVG is not really doable because some SVG have multiple path and other elements like rects, circles, ... and those SVG are used in other parts of my application.
   
   I'm switching from SyncFusion graph to apache tree, because I find the overall possibilities of echarts way better. I just lack this feature to reproduce the same graph that I had in echarts.
   
   ### What does the proposed API look like?
   
   Be able to provide a template by referencing an html div or by writing html in typescript / javascript.
   If the string provided to symbol doesn't match current options (`rect`, `emptyCircle`, ..., `path://`, `image://`, ...), it would try to inject the html directly in the renderer. Or if the string starts with a `<` then it tries to render html directly, maybe with an encapsulation of a "master div" that would apply symbolSize.
   ```
   symbol: '<div class="my-svg-mask svg-mask-color" style="width: 100%; height: 100%"></div>'
   ```


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


[GitHub] [echarts] Ovilia commented on issue #17953: [Feature] Use html to render symbols

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17953:
URL: https://github.com/apache/echarts/issues/17953#issuecomment-1324485914

   This may not be easy because Apache ECharts has multiple rendering engines like Canvas, SVG and they should work for both Web side and server side. If you don't need multiple colors for a single symbol, `path://...` should be enough. Convert multiple elements to be a single one using union operation in tools like figma/sketch first.
   
   If you want multi colors, you can create svg files with different variations of colors. If the colors should be dynamic (e.g., users can change hue from 0 to 360), then you may consider drawing the image to a temperary canvas and convert color and export an image.


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


[GitHub] [echarts] theoarmengou commented on issue #17953: [Feature] Use html to render symbols

Posted by GitBox <gi...@apache.org>.
theoarmengou commented on issue #17953:
URL: https://github.com/apache/echarts/issues/17953#issuecomment-1328715502

   I think I'll have to convert my svgs to `path://...`, and for dynamic color I'm using  SVGRenderer instead of CanvasRenderer with css vars, since I need to be able to switch between light and dark theme at anytime. And the svgs i'm using doesn't have multiple colors.


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