You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "xiatianshitiancai (via GitHub)" <gi...@apache.org> on 2023/09/26 08:23:14 UTC
[GitHub] [echarts] xiatianshitiancai opened a new issue, #19157: [Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
xiatianshitiancai opened a new issue, #19157:
URL: https://github.com/apache/echarts/issues/19157
### What problem does this feature solve?
[Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
### What does the proposed API look like?
echats.setOtionBefore((option) => {
let newOption = modOption(option)
return newOption
})
--
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] echarts-bot[bot] commented on issue #19157: [Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #19157:
URL: https://github.com/apache/echarts/issues/19157#issuecomment-1735062244
@xiatianshitiancai It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
<details><summary><b>TRANSLATED</b></summary><br>
**TITLE**
[Feature] Can you provide a mechanism that allows me to implement a method similar to webpack hooks to hijack the setOption of echarts, so that I can handle echart style-related business by myself without coupling the business to the style?
**BODY**
### What problem does this feature solve?
[Feature] Can you provide a mechanism that allows me to implement a method similar to webpack hooks to hijack the setOption of echarts, so that I can handle echart style-related business by myself without coupling the business to the style?
### What does the proposed API look like?
echats.setOtionBefore((option) => {
let newOption = modOption(option)
return newOption
})
</details>
--
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] plainheart commented on issue #19157: [Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on issue #19157:
URL: https://github.com/apache/echarts/issues/19157#issuecomment-1735311682
那你直接重写下 setOption 方法不就可以了嘛... 参见 https://codepen.io/plainheart/pen/xxmWoop
--
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] Ovilia commented on issue #19157: [Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on issue #19157:
URL: https://github.com/apache/echarts/issues/19157#issuecomment-1736607185
> 这种如果在import * as echarts from 'echarts' 里面 可以这样写吗
那你封装一下提供一个新的方法呀
--
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] plainheart commented on issue #19157: [Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on issue #19157:
URL: https://github.com/apache/echarts/issues/19157#issuecomment-1738894924
那就用 ECharts 本身提供的 `registerPreprocessor` API 吧,这个没什么侵入性。例如:
```js
echarts.registerPreprocessor(option => {
// 可对 option 进行修改
option.series[0].type = 'bar'
})
```
--
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] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合? [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia closed issue #19157: [Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
URL: https://github.com/apache/echarts/issues/19157
--
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] xiatianshitiancai commented on issue #19157: [Feature] 能不能提供 一种机制, 让我能实现类似webpack 钩子一样的方法 来劫持echarts 的setOption, 这样我可以自行处理echart 样式相关业务,而不用把业务与样式耦合?
Posted by "xiatianshitiancai (via GitHub)" <gi...@apache.org>.
xiatianshitiancai commented on issue #19157:
URL: https://github.com/apache/echarts/issues/19157#issuecomment-1736595459
这种如果在import * as echarts from 'echarts' 里面 可以这样写吗
--
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